Distance_sensor message is having more delay

Arducopter 4.0.7
Cube Orange
LW20C lidar

Hi @ppoirier
I have set RNGFND1_TYPE to 10 (mavlink)
I am reading the LW20C Lidar data to raspberry pi using FTDI cable … and also tried sending distance_sensor mavlink message at a rate of 10 hz (tested up to 50 hz) with mavros-python

With the same Rpi, I tried reading the RANGEFINDER mavlink message using pymavlink
I confirmed that the response between write and read was good and less than 0.5 seconds delay

But in the mission planner, the rangefinder data is very slow.

However, the copter had hard landing and further investigating i found that the delay between Baro Alt and Range finder ALT is 7 seconds which i suspect to be the cause


2022-03-22 10-21-16.bin (958 KB)

How to overcome this delay, Please help

  1. What datarates are you using in the datalink between arducopter and mission planner?
  2. Are you sure you are not saturating that link?
  3. As always: please update to ArduCopter 4.1.5.
1 Like

Thank You

  1. Its 115200
  2. What are all the things should i take care of that affects the link
  3. Will try again with the updated ArduCopter version

I am able to read the Rangefinder data that was sent to Pixhawk as DISTANCE_SENSOR mavlink message without delay using pymavlink

Mission planner just streams the data of Pixhawk…
Why am i able to read the data from pixhawk without any delay from the companion computer but the delay is visible in both BIN logs and also the mission planner?

Hello,

The simplest method is using Mavlink inspector (Ctrl-F) in Mission Planner and compare the 2 signals “live”. Make sure the signal quality is good as the rangefinder graphs shows some issue with scaling and signal drop. Double check on the rangefinder parameters to make sure they fit with the sensor (like max distance).

1 Like
  1. read this blog post: Lowering Telemetry Datarates in ArduPilot especially the end of the first post
2 Likes

@ppoirier @amilcarlucas

Thank you…

The issue was completely with the LW20C lightware lidar reading part

The serial buffer gets full after sending distance_sensor mavlink message…

Clearing the serial buffer using serial.flushInput() after every cycle of range finder update has resolved the issue…

1 Like