LidarLite3 doesn't work on pixhawk?

Hi, OXINARF

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?

Tom
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”)

Zhitao,

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?

HI,rmackay9

In my app, I use command below:

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

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

Tom
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.

Tom,
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?

Tom

@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?

Jim

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.

Hi,

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

http://ardupilot.org/copter/docs/terrain-following.html#setting-up-a-mission-to-use-terrain-data

Hi,thanks for your response

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

Tom

Tom,

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: http://python.dronekit.io/automodule.html#dronekit.LocationGlobalRelative
  • at this point, ArduPilot doesn’t support altitude relative to terrain in Guided mode. It should be fairly simple to do it though.

hi, OXINARF
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?

Tom

hi,rmackay9

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

thanks a lot

Tom

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.

ok. thanks a lot

Tom

Hi,OXINARF and rmackay9

I have post a topic in drone-kit forum to ask them whether support the terrain follow of LidarLite for a few days.but onbody reply it . I am stuck by it and so urgent. could you please give me some other suggestions.

Thank you very much for your help

Tom
Best Regards