Planar Laser Scanner MAVLink message

I recently got hold of some inexpensive (~ $100) laser scanners from the Neato-XV11 vacuum cleaner. I put it on one of my copters for testing some basic obstacle avoidance stuff.

I got my custom firmware onto the lidar controller which will allow it to speak MAVLink, which we can then access from the flight controller for basic sense-and-avoid.

I’m currently stuck at defining the MAVLink message for the laser scan. Currently the message looks like this :


uint64_t         time_usec
float            max_range  # Maximum range of scanner
float            min_range  # Minimum range of scanner
uint32_t         time_interval # Interval between measurements
float            start_angle # Start angle of scan
floar            end_angle   # End angle of scan
float[SOME_SIZE] measurements # Array of measurements
float[SOME_SIZE] covariances  # Array of covariance for the measurements

I just realised that MAVLink requires a fixed array size to be declared. What should we do for this? Also, anything else you want in the message? Hope I;m not missing anything important.

Can you send a link to the repository with the code? How many points does it output per scan?

It outputs 360 points per scan, but I was thinking of a more generic case, where a Lidar with sub-degree accuracy could use the same interface. Exciting stuff is happening when it comes to cheap scanning lasers (e.g, and I want to make sure we have good protocol support.

I will try to get the code online soon, just trying to iron out some licensing issues. A small interface board sits between the Lidar and the Pixhawk, which runs the code, translating the Lidar proprietary protocol to MAVLink, and doing the low-level motor PID control, etc.

Meanwhile, you can check these two packages. I got the protocol decoding, etc. from there :


We can do that with MAVLink 2, but not with MAVLink 1. I propose to first finish your prototype so its in a consumable shape and then go for MAVLink 2.

Hi, is planar laser scanner MAVLink message available now ?

Are you thinking along these lines?