MAVLink DISTANCE_SENSOR message: Example...?

Hi, I would like to build my own 360 degrees object avoidance sensor (just for fun). Is there some (Python…?) example for how the MAVLink Distance Sensor message should look like…? Some other DIY project maybe… If anyone knows where I can search, that would be great. Thanks!

Edit: For me, it look like Uart is the only possible way to send the MAVLink message. But maybe the 360 degrees distance information could also be supplied via i2c…?

Ardupilot alredy supports multiple 360° Lidars, either rotating ones, or multiple static ones pointing in different directions.

What exactly are you trying to achieve here? We (IAV GmbH) have been using cameras attached to a companion computer and fancy vision algorithms that generate Mavlink DISTANCE_SENSOR messages that we then feed to the Ardupilot via UART. So yes, it can be done.

Hi,

What exactly are you trying to achieve here?

Well… I am mainly trying to achieve fun. I have some sensors laying around, some microcontrollers, and I would like to build something useful from it. I am thinking about using a low cost lidar (e.g. TF Luna), rotating it (or rotating a mirror), and measuring if an object is closer than 2 meters. Maybe, I’ll mount it to our drone one day (https://www.youtube.com/watch?v=wWPY3eVxUkU).
I found some information on the message here:
TFMINI-POC/TFMINI_I2C_MAVLINK at master · patrickpoirier51/TFMINI-POC · GitHub

Hello

The code on GitHub was referring to this blog

Thank you, I found it. Now if I only had a free UART… :rofl:

For this you can use UAVCAN