New LANDING_TARGET Mavlink Message

477 views
Skip to first unread message

Daniel Nugent

unread,
May 20, 2015, 11:07:45 PM5/20/15
to tri...@tridgell.net, l...@qgroundcontrol.org, drones-...@googlegroups.com
Hey Tridge and Lorenz,

I am working on precision land for copter with Randy and proposing adding a new mavlink message to be sent from the camera/companion computer to the autopilot. 

The first approach is barebones. Provides us with all the information we currently need.

LANDING_TARGET
uint8_t target_num;  <-- for future support of multiple landing targets visible at the same time.
uint8_t frame;     <-- enum specifying whether following fields are earth-frame, body-frame etc
float angle_x      <----The angular offset of the object from the center of the image: x axis
float angle_y       <----The angular offset of the object from the center of the image: y axis
float distance      <----Distance to the object from the camera in cm(meters?)

Randy and I also discussed widening the scope of the message and provide more detailed info to allow for additional features in the future. The idea is to treat the landing pad like a vehicle and report information about it's position, velocity, and acceleration. This would look very similar to(may be even use) the LOCAL_POSITION_NED_COV message. This may also be useful for smart landing pads which would report the position of the vehicle in reference to the landing pad(i.e. camera is on the landing pad).

The scope can be widened even more to just classify any object detected by a camera(not just landing pads). Maybe a person, or geomarker, or balloon, or IR beacon. The message would then have to have an additional parameter for the type of object being tracked/detected. Then you have to account for the camera being mounted at different angles(i.e. forward facing or downward facing) and whether the camera is mounted to the frame or a gimbal. This would require a CAM_NAV_STATE or CAM_NAV_CONFIG message or something like that. I can't even start to think how this would be properly implemented.

As I said this vastly exceeds the scope of what is required for precision land but I thought I would mention the alternatives and start the discussion. 

Thanks,
Daniel Nugent

Lorenz Meier

unread,
May 22, 2015, 6:41:20 AM5/22/15
to Daniel Nugent, tri...@tridgell.net, l...@qgroundcontrol.org, drones-...@googlegroups.com
This sounds good. I think we can close the discussion in a PR against the MAVLink repo.

I think we need to have a pass at the camera and gimbal interfaces and document them in the MAVLink wiki the same way as the param protocol and the waypoint protocol are documented.

-Lorenz


Daniel Nugent

unread,
May 22, 2015, 7:00:34 PM5/22/15
to drones-...@googlegroups.com, tri...@tridgell.net, dannu...@gmail.com
Alright I'll move forward with the first approach. I'll add it to ardupilot first and then look into a PR(pull request?) into the mavlink repo after. Or are linked/synced in someway?

Daniel

Randy Mackay

unread,
May 22, 2015, 10:23:07 PM5/22/15
to drones-...@googlegroups.com, tri...@tridgell.net

Daniel,

 

     Normally I do it in the ardupilot repo first and then merge it “up”… so it’s a bit manual.

 

-Randy

--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Nugent

unread,
May 24, 2015, 1:10:49 AM5/24/15
to drones-...@googlegroups.com
Alright. I currently have the message implemented on the ardupilot side of things. I can't figure out where to place the auto-generated mavlink python file for use with DroneKit or MAVProxy or pymavlink.

Daniel

Daniel Nugent

unread,
May 25, 2015, 2:14:15 AM5/25/15
to drones-...@googlegroups.com
So I think I found out a way. I forked the mavlink repo, added the LANDING_TARGET message, and reinstalled pymavlink. I hopefully that will do the trick. 

Daniel

On Wednesday, May 20, 2015 at 10:07:45 PM UTC-5, Daniel Nugent wrote:

Daniel Nugent

unread,
May 26, 2015, 5:49:21 PM5/26/15
to drones-...@googlegroups.com, l...@qgroundcontrol.org, tri...@tridgell.net
So I am having a lot of trouble getting the message to send from the python side. Here is what I did:

1.Forked mavlink and added a new message here
2.Uninstalled pymavlink and then ran "sudo python setup.py install" from my pymavlink repo
3.I then call landing_target_encode(args....)
4.Then send it using droneAPI vehicle.send_mavlink(msg)
5. On the ardupilot side I print to console the msgid of all mavlink messages that come in.
~6. I have also implemented the new message on ardupilot side but the message isn't even getting that far

My custom message(msgid 230) never comes in. I have replaced the messsage I am sending with a set_position_target_local_ned message and it get's processed by the autopilot no problem. My message appears in /usr/local/lib/python2.7/dist-package/pymavlink/dialects/ 1.0 and 0.9 .xml and .py. It is accessible from my python script(everything runs without error even when the message is "sent").

I have read through mavproxy, droneAPI, and pymavlink source for hours trying to figure out why this specific message wont send/be received. I am puzzled because I am not even trying to process the message on arducopter yet. I am just trying to flag  its arrival and it only fails with this message. 

What am I missing? 

Side Note: There is very little documentation on adding new messages to non-ardupilot platforms. Also the documentation for SITL needs to be updated please. The location of code placement(i.e. ardupilot, px4firmware, PX4nuttx,pymavlink) are very unclear and it was difficult to find the correct location to place my modified code. 

Thanks,
Daniel

On Wednesday, May 20, 2015 at 10:07:45 PM UTC-5, Daniel Nugent wrote:

Randy Mackay

unread,
May 27, 2015, 2:21:07 AM5/27/15
to drones-...@googlegroups.com, l...@qgroundcontrol.org, tri...@tridgell.net

Daniel,

 

     I don’t exactly see the issue but some random bits of advice:

·         No need to add the description to MAVLink 0.9 (version 1.0 is all we use these days)

·         You ran generate.sh?  I imagine that needs to be done for dronekit just like it does for ardupilot. http://dev.ardupilot.com/wiki/apmcopter-code-overview/code-overview-adding-a-new-mavlink-message/

·         Maybe the messages aren’t making it through the MAVLink router for some reason which could happen if you’re sending the messages with an indentical system-id to the vehicle itself (which is probably “1”).  This normally doesn’t happen but it’s possible.  If you try turning on MAVLink routing debugging (see link below) and if you have a debug cable connected to the Pixhawk’s Serial4/5 port, you should see on the nsh console debug related to new messages and routing info (i.e. whether it thinks it needs to forward these messages to components).

o   https://github.com/diydrones/ardupilot/blob/master/libraries/GCS_MAVLink/MAVLink_routing.cpp#L29

 

-Randy

--

Daniel Nugent

unread,
May 27, 2015, 3:04:13 AM5/27/15
to drones-...@googlegroups.com
Randy,

Thanks for the reply. DroneAPI and mavproxy both feed from pymavlink and everything is generated there properly.

One interesting thing about droneAPI's send_mavlink() method is that it calls a "fix target and source id", or something like that, before it sends the message. Im wondering if my lack of target system id in the message body is causing this method to assign the message a source system id of 1. I'll test this theory tomorrow and report back.

Thanks
Daniel

Daniel Nugent

unread,
May 28, 2015, 2:06:10 AM5/28/15
to drones-...@googlegroups.com
Messing with system and component IDs did not work. I'm stumped. I'll look into the mavlink routing debug, but that doesn't help with SITL.

Daniel

Randy Mackay

unread,
May 28, 2015, 9:49:30 AM5/28/15
to drones-...@googlegroups.com
Daniel,

I'll give you a hand with this tomorrow. My guess is that one of the components on your machine has not picked up the new mavlink message.

I think it might be good to create a pull-request for the mavlink message changes as a first step.

-Randy

-----Original Message-----
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of Daniel Nugent

Nuno Marques

unread,
Jun 17, 2015, 1:54:13 PM6/17/15
to drones-...@googlegroups.com
@Daniel Nugent,

Does https://github.com/mavlink/mavlink/pull/400 goes against any of your current msg applications? Please leave some feedback on comments for this PR.

Thanks! Best,
N.
Reply all
Reply to author
Forward
0 new messages