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
How to overcome this delay, Please help
- Its 115200
- What are all the things should i take care of that affects the link
- 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?
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).
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…