I’m new to this community even if I have already spent many hours reading
I’m trying to feed my copter with 4 distance messages mesured from 4 TFMini plus sensors configured to work with I2C.
I didn’t find any way to configure multiple I2C lidar sensors (each one in a different direction) neither a driver compliant with arducopter, so I imagined the workaround: An arduino (or teensy) connected to a pixhawk telemetry port.
=> The arduino collects the TFmini plus values on the I2C bus ( DONE ! I can plot the 4 distances on the I2C bus. I can give the code if someone is interested)
=>The arduino sends msg_distance_sensor to the FC
( http://ardupilot.org/dev/docs/code-overview-object-avoidance.html, “any sensor capable of providing distances using the MAVLink [DISTANCE_SENSOR] message”)
=> MissionPlanner should display the distances in the RADAR type window
I have integrated the mavlink 2 library to the arduino project:
- “https://mavlink.io/en/messages/common.html#DISTANCE_SENSOR” provides the data structure to be filled
- the “mavlink_msg_distance_sensor_pack” function and “mavlink_msg_to_send_buffer” should allow to send what I need to send.
I have validated I can receive telemetry from the FC to the arduino, but is there a way to log if my messages are correctly received by the FC? (RADAR window don’t display anything )
Thanks for your help!