These are chat archives for dronekit/dronekit-android

12th
Jul 2016
Jack-2025
@Jack-2025
Jul 12 2016 01:54

@ne0fhyk sounds great, I'll get that setup today, thanks!

one question I have is how to best debug the Mavlink messages from the Px4Native class? right now I'm not sure whether the messages are reaching PX4, or what payload is being sent. And I'm using Mavproxy to connect to the pixhawk, and Mavproxy has it's own problems. Is there a better alternative to Mavproxy?

Jack-2025
@Jack-2025
Jul 12 2016 03:27

@ne0fhyk @pablomar13
dronekit-android fork (version_3.0 branch): https://github.com/Jack-2025/dronekit-android
Tower fork (standalone branch): https://github.com/Jack-2025/Tower

Let me organize the info an questions, to move forward because I'm stuck right now:
-First I'd like to get camera triggering and waypoint transfers working with PX4. I guess this is the bare minimum needed to enable aerial surveying. I'm editing Px4Native.java based on ArduPilot.java
-The setup I have is Tablet <-> Mavproxy <-> PX4/Pixhawk. Is it possible to eliminate Mavproxy, i.e. would it be better to use telemetry directly or is there a better option to make debugging easier?
-How to best debug the communication? I was looking for a Wireshark Mavlink plugin but didn't find anything usable. pablomar13 suggested using addMavlinkObserver() from DroneApi to write to Log.d. How could this be done in Px4Native.java, or should it be done somewhere else like in the DroneManager? Any other suggestions to debug the communication?

Fredia Huya-Kouadio
@ne0fhyk
Jul 12 2016 05:06
@Jack-2025 have you tried sitl instead of mavproxy: http://dev.px4.io/simulation-sitl.html
@Jack-2025 I have yet to try it myself, but it seems it might fit the bill
@Jack-2025 nothing special needs to be done to receive the mavlink packet through the MavlinkObserver.
@Jack-2025 after the drone is connected, add a MavlinkObserver instance through Drone#addMavlinkObserver(...) and regardless of the underlying autopilot, it will mirror the received raw mavlink packet.
Fredia Huya-Kouadio
@ne0fhyk
Jul 12 2016 05:12
@Jack-2025 you can also override onMavLinkMessageReceived(MAVLinkMessage message) in Px4Native and add a print statement to print out the received mavlink messages.
@TShapinsky are you able to take a look at the bug causing the surveys to crash, or do you need me to weigh in?
Fredia Huya-Kouadio
@ne0fhyk
Jul 12 2016 05:40
@TShapinsky can you test with branch version_3.0 for dronekit-android and see if you can reproduce the surveys crashing bug
Jack-2025
@Jack-2025
Jul 12 2016 08:04

@ne0fhyk hm you're right, using the SITL instead should be better than mavlink, I'll give it a shot soon. I overrode onMavLinkMessageReceived(...) and will try it out once I can get Tower to compile.

Thinking about how to add the necessary code to interface with PX4 for aerial surveying, maybe I'm being naive but isn't it a matter of adding a few switch cases under executeAsyncAction(...), mostly copy/pasting from ArduPilot.java?

Martin Page
@wookoouk
Jul 12 2016 11:16
Are there any docs for creating a mission and uploading it?
@wookoouk that example makes use of the MissionApi#setMission(...)) method
Martin Page
@wookoouk
Jul 12 2016 14:18
@ne0fhyk thank you, I have used this as my example but I get No waypoint load started"when I run it
Fredia Huya-Kouadio
@ne0fhyk
Jul 12 2016 14:22
@wookoouk is that a toast or a logcat message? Are you able to trace where it's coming from, I'm not seeing that error message while searching through the code base
Martin Page
@wookoouk
Jul 12 2016 14:22
@ne0fhyk that is coming from dronekit-sitl via mavproxy
Fredia Huya-Kouadio
@ne0fhyk
Jul 12 2016 14:24
@wookoouk is dronekit-sitl simulating ArduCopter? What mission items (waypoints) are you adding to the mission before pushing it to the drone
Martin Page
@wookoouk
Jul 12 2016 14:26
@ne0fhyk its running APM
@ne0fhyk and I am creating waypoints, takeoff, RTL and Land mission items
Fredia Huya-Kouadio
@ne0fhyk
Jul 12 2016 14:29
@wookoouk do you connect the Drone object and is it receiving telemetry before you push the mission?
Martin Page
@wookoouk
Jul 12 2016 14:29
yup
I just tested with the dronekit-sitl 'solo' module too
I have tried removing the start flight code, so it just uploads

I added a case AttributeEvent.MISSION_UPDATED:
and case AttributeEvent.MISSION_SENT:

catch to it, but it is not acknowlaging that the mission was received...

Fredia Huya-Kouadio
@ne0fhyk
Jul 12 2016 14:35
@wookoouk can you test if Tower is able to upload a similar mission to your sitl instance as well
Martin Page
@wookoouk
Jul 12 2016 14:35
will do, 1 minute
Fredia Huya-Kouadio
@ne0fhyk
Jul 12 2016 14:36
@wookoouk if Tower is not able, then the issue is with sitl, otherwise, I might need to take a look at your code to see how it differs from the Tower implementation.
Martin Page
@wookoouk
Jul 12 2016 14:37

how strange:

APM: APM:Copter builder-solo-2.0.20 (609645b5) APM: Frame: QUAD not loading waypoints not loading waypoints not loading waypoints not loading waypoints not loading waypoints not loading waypoints not loading waypoints Got MAVLink msg: MISSION_ACK {target_system : 255, target_component : 190, type : 0} APM: Flight plan received

it said not loading waypoint for each waypoint, but then lists 7 waypoints when I run wp list
so they were received
so i will revisit the code and see if there are any differences
thanks
Fredia Huya-Kouadio
@ne0fhyk
Jul 12 2016 14:39
@wookoouk no problem :)
TShapinsky
@TShapinsky
Jul 12 2016 16:07
@ne0fhyk I rolled back my code to PR #402 and it worked. I'll try version_3.0 in a bit.
TShapinsky
@TShapinsky
Jul 12 2016 16:15
@ne0fhyk version_3.0 doesn't have a service app, should I just compile the client lib and add that to the project?
Martin Page
@wookoouk
Jul 12 2016 16:17
Fixed my issue
as soon as I removed the Land mission item it started working...
no idea why
TShapinsky
@TShapinsky
Jul 12 2016 16:30
@ne0fhyk version_3.0 appears to work
Fredia Huya-Kouadio
@ne0fhyk
Jul 12 2016 16:53
@TShapinsky good to know!
@wookoouk are you able to test sitl with the latest version of arducopter? It would be good to know if that issue has already been fixed upstream
pablomar13
@pablomar13
Jul 12 2016 18:58
@Jack-2025 sorry, I've been busy this couple last days. I'll try tomorrow to be available. Keep me updated if you make work the MavlinkObserver ;)
TShapinsky
@TShapinsky
Jul 12 2016 22:13
@ne0fhyk any idea what the TTL for version_3.0 is?
Fredia Huya-Kouadio
@ne0fhyk
Jul 12 2016 22:52
@TShapinsky planning a beta for the end of the month, why?
TShapinsky
@TShapinsky
Jul 12 2016 22:55
People here have been trying to figure out how to manage the 3dr services app in terms of getting features moved out to production. So it's nice to have the 3dr services app killed making compatibility and moving out features that require dronekit-android updates much easier