Rplidar C1 has different results in firmware Copter 4.5 and Copter 4.4

Hello everyone,

I’ve recently conducted tests with two different versions of Pixhawk: 2.4.8 and 6X. It turns out you were right! The Pixhawk 6X performs well.

I’ve just completed a few tests, and in the photo, you can see the box positioned 0.50 meters from the lidar with the Pixhawk 6X:

And here’s the radar view:

Here are the results with Pixhawk 2.4.8:

And the radar view for this setup:

So, for some reason, it appears that the RPLIDAR C1 is compatible with the Pixhawk 6X but not with the Pixhawk 2.4.8.

Hope this information is helpful!

I seen something similar to this when using my lidars, some serial ports on some f4 controller just can’t handle high speed lidars.

1 Like

My apologies for the confusion earlier. I had some reservations, so I decided to test the Pixhawk 2.4.8 on a rover using the copter firmware, and surprisingly, it worked!

Encouraged by this, I then tested the Pixhawk 6X with the rover firmware, only to encounter the same issue:

image

Therefore, it appears that the issue does not stem from the Pixhawk hardware version but rather from the differences in the software between the rover and copter firmware.

Firstly, I will investigate whether there is a difference between the Telem2 ports in the rover and copter firmware. Secondly, I will examine the software architecture to understand how the “rover task” and “copter task” access lidar data within the AP_Proximity_RPLidarA2 files.

Does anybody have an idea?

Thanks!

Hi @potcha,

One of the largest differences between Copter and Rover is that the Rover firmware only runs at 50hz by default while Copter runs at 400hz. It may help to set SCHED_LOOP_RATE to 400 on the Rover.

This may not be enough though because that will increase the main estimation and control loops but it might not increase the speed of everything.

We should be able to get it working though.

Hi rmackay9,

You were right!!
I changed the SCHED_LOOP_RATE value from 50Hz to 400Hz, but that wasn’t enough. So, I also modified the rover.cpp file by changing:
#if HAL_PROXIMITY_ENABLED SCHED_TASK_CLASS(AP_Proximity, &rover.g2.proximity, update, 50, 200, 27),
to
#if HAL_PROXIMITY_ENABLED SCHED_TASK_CLASS(AP_Proximity, &rover.g2.proximity, update, 200, 50, 36),.
These two changes made the RPLIDARC1 work with the rover firmware.
image

Now, there surely is a reason why the scheduling values are not the same between the Rover and Copter firmware. And i’m not sure modify scheduling values will resolve the problem because changing scheduling values like this must impact the soft and should create bug elsewhere. Anyway, thanks for your help :slight_smile:

2 Likes