These are chat archives for dronekit/dronekit-android

Apr 2016
Apr 11 2016 02:00
Hi everyone...first post here. I am working with the hello-drone tutorial app on the website and combining it with the functionality of Google's project tango tablet. The app is up and running, connecting to my sitl (px4 and arducopter) and I have been able to integrate the position/orientation data from the tablet's sensors into the app. However, I have been unable to find any examples of how to send the data out of the app to the drone itself. I would like to use the mavlink command att_pos_mocap (number 138) as I have the necessary info ready to put in. Can anyone give me any direction on how to implement this? I have looked extensively, but the only similar examples I can find are for python applications. I found the experimental SendMavlinkMessage() option, but have no idea how to create the needed messageWrapper it calls for. This is by far the most programming I've done so any help would be much appreciated and help me finish this term project for school! Thanks!
Richard Pablo
Apr 11 2016 15:41
Hey @jwerner37 check if you can send commands directly with the APIs instead of Mavlink messages, there's a bunch of calls available to send to the drone from a high level point: here are the APIs supported,, under known subclases you will see the availables APIs, each one of them having their own purposes
Apr 11 2016 17:12
@r1ckr Thanks for the reply! I looked through the api list again and still am unable to find the commands I need. The Px4 setup directly supports the mavlink message I mentioned; the arducopter version of this would be something along the lines of SET_POSITION_TARGET_LOCAL_NED which is used for guided mode. This is mentioned in the python tutorials but I can't find it anywhere within the android API's. The only support I can find is for long/lat coordinates which won't work for this application. If I could send the mavlink message directly, then I would be able to work with the px4 autopilot which is a bit more ideal for the motion capture type of system I am using. Thanks again for your help! I really appreciate it!
Apr 11 2016 17:34
@jwerner37 The MavlinkMessageWrapper constructor takes in a MAVLinkMessage object. In your case, the mavlink message you want is msg_att_pos_mocap which extends the MAVLinkMessage object. Basically, you can do new MavlinkMessageWrapper(new msg_att_pos_mocap()). This can now be used for the experimental ACTION_SEND_MAVLINK_MESSAGE