Hi.
I try to using lidar and it working perfectly if dron is horizontal ( not moving or slow moving ).
but if change angle ( fly ) then lidar see other point ( away ) and move down and after stop move go up.
If it can be corrected by actual angle ?
The code already assumes that the lidar is pointing down, fixed to the frame and automatically corrects for the pitch and roll angles.
So the feature you want is already there. I am assuming that your parameters are correctly set.
Of course if you did not read the wiki and your parameters are incorrect, it will not work!
https://ardupilot.org/copter/docs/common-benewake-tfmini-lidar.html
Im using this description and shows height goodâŚ
And change flight level when changing angle of frame.
Newest Firmware
So if you hold the copter with your hand and keep it 1m above the ground and tilt it slowly the height changes? if it does you found a bug
At this moment i disable it because it was too big and dangerous problem, will check again for some time.
The reported value in sonarrange
will change with angle - but thatâs not what gets used in AltHold, Loiter, etc. Itâs just the raw distance measured by the LiDAR.
If youâre curious, hereâs the actual line of code where the correction is applied, and the correction function itself.
Thanks. Looks good. I will check again. If i can found in logs data from lidar ? I want to compare it with alt and angle.
I dont know why not good AltHold with lidar and good without lidar. Maybe its problem with switching lidar/baro near lidar range.
Compare the following log items from a dataflash log (tlogs may have some as well, but I donât know those):
- CTUN.DSAlt (desired LiDAR altitude, i.e. what the pilot asked for)
- CTUN.SAlt (actual achieved LiDAR altitude, with the angle correction factored in)
- RFND.0.Dist (measured rangefinder distance, without the angle correction factored in)
- ATT.Roll
- ATT.Pitch
Unfortunately, I havenât experienced a bad althold with lidar so I canât give a whole lot of advice there.
same problem for meâŚ
I see the tilt correction but what about the roll correction
It corrects both tilt and roll