LidarLite3 doesn't work on pixhawk?


I experienced an odd issue. I install a LidarLite3 rangefinder on pixhawk on my copter, when I fly it in manual mode, the LidarLite can work, I put something below the copter, it can go up auto, but when I fly it in automonous mode, the LidarLite cann’t work, and the copter use the barometer for rangefind.

who can I help me, and give me some hints. thanks a lot!!!



Have you read


Thanks for you reply.

 open the link, it write below:

Lidar’s are used in flight modes which have height control, such
as Altitude Hold, Loiter and PosHold Mode. The data from the sensor
will be used until you exceed RNGFND_MAX_CM, after that it switches to
the barometer. Copter-3.4 includes support for Terrain Following in Auto mode.

it mesns that if I want to use Lidar to measue altitude, I must use AUTO mode in my application?

Best Regards

What do you mean with measure altitude? Your question in the first post was about Lidar not working in Auto mode, now you are asking if you need to use Auto, so I’m having trouble understanding what you want to know.

I am so sorry for giving you misunderstand.

now I will describe the issue again.

I use a 6-axis mutil-copter whit pixhawk, and it have a Lidar-Lite v3 for rangefinder.

when I use romote-control to control the copter, the LIdar-Lite can work, I put something below the copter,

the copter can go up automaticly. but when I use my software to control the copter automonously in guided mode
vehicle.mode = VehicleMode(“GUIDED”)

the Lidar-Lite cann’t work.

my question is if I should use ATUO mode in my software.
vehicle.mode = VehicleMode(“AUTO”)


I had a look at the code and this may be a code issue in ardupilot actually.

Within Guided mode we have a method to accept a Location which can have the altitude specified as an alt-above-terrain but I see that within the processing of the SET_POSITION_TARGET_LOCAL_NED and SET_POSITION_TARGET_GLOBAL_INT we don’t make use of that method.

Before I go off and attempt to fix this, could you confirm you’re trying to send the position target using one of the above two mavlink messages?


In my app, I use command below:

self.targetLocation = LocationGlobalRelative(lan, lon, alt)

and I find that the copter use barometer instead of LidarLite,so the altitude isn’t accurate.
how I can fix this issue, this is very urgency, would you please give me some suggetions.

Thanks a lot

Best Regards

Am I missing something?

Yes, the problem is that guided_set_destination is providing a Vector3f. We need it to provide the Location. Only the Location structure has the extra info to allow defining the altitude as an alt-above-terrain.

I’m afraid that call isn’t setting the target Location as an alt-above-terrain but instead it’s setting it as an alt-above-home. I think there should be a way to change the altitude type to be terrain but I’m not sure. The terrain following was added to ardupilot relatively recently and I think DroneKit hasn’t been updated since.

Hi, rmackay9

thanks for your reply.
I am still confused, you mean that the latest Dronekit doesn't support the Lidar-LiteV3 terrain-follow function?


@rmackay9 function overloading is great! Except when you don’t remember about it and only look at one of the methods :smile: We should definitely fix that - unfortunately looks like with SET_POSITION_TARGET_LOCAL_NED we can’t support terrain altitudes (that could be obtained with a rangefinder).

Hello Tom,

I am having difficulties getting the Pixhawk to read accurately read the pulsewidth of the Lidarlite3. Can you tell me how you connected it to the Pixhawk? I2C or PWM? Also, can you send a parameter is list dump?


Hi Jim,
Could you try setting the RNGFND_TYPE parameter to “15” for the LidarLite-v3? That should get it working. Sorry for the lag in getting the wiki updated. It’s climbing higher on my to-do list.


I used PWM to connect Lidarlite3,you can follow the link to configure it:

Hi,thanks for your response

But I am sorry I cannot understand your meaning,would you please describe it clearly?thanks again



There are two issues here:

  • you are using basic Dronekit commands, and, as far as we know, it doesn’t have the possibility of using terrain altitudes. For example, the LocationGlobalRelative object you are using clearly says in the documentation that it is relative to home, not to terrain:
  • at this point, ArduPilot doesn’t support altitude relative to terrain in Guided mode. It should be fairly simple to do it though.

thanks for you response,.
you said that "at this point, ArduPilot doesn’t support altitude relative to terrain in Guided mode. It should be fairly simple to do it though."
but I can’t understand your last words, you said It should be very simple to use LidarLite for terrain follow? how can I do it?



your mean that the latest dronekit version hasn’t support the terrain follow of LidarLite?
if so, when will support it?

thanks a lot


I meant that it should be simple to code it in ArduPilot.

Dronekit is independent from ArduPilot, you’ll have to ask in their forum.