Hi. I would like to know if it is possible to use a rangefinder to help improve altitude hold of a drone without it jumping up and down when it flies over an obstacle as it happens when we active surface tracking.
In other words, can the range finder behave like the vision system of dji where the drones fly at constant level even over obstacles?
The biggest issue here is that the flight controller doesn’t know what the terrain is doing. With default settings the terrain model has about 100m resolution. Imagine flying over a flat but sloped field, this can work reasonably well. Now there is a shed on your way, let’s say 3m high, lidar detects change in altitude. Flight controller doesn’t know if the change was caused by the drone being shifted or small terrain feature got in the way. If it was given ATL target it will assume its desired position is relative to the terrain and adjust accordingly.
If you want something like that you will need companion computer running either high resolution (probably 1m or better) DEM and RTK or terrain profile matching or full simultaneous localization and mapping stack. Either one is significantly harder and more expensive than lidar.
why dont you use a lua script to disable surface tracking when speed is above a set limit. that way its only going to care abound terrain when stationary to help with hovering, it wont try and terrain follow when moving.
or better yet, rather than disable surface tracking just reduce the the maximum range of the rangefinder by changing the rangefinder max parameter when its moving so it will only avoid terrain if it gets really close.
That really seems a good idea. However, how can I know the drone speed in the situations when I don´t have gps signal? Instead, would it be a good idea to disable surface tracking when there is stick input and enable when sticks are inside the deadzone (for loiter mode)?
The part of reducing the maximum range of the rangefinder while its moving does not seem to be a good idea for my case because if the drone is moving in loiter mode without gps signal, only trusting in optical flow (which happens a lot in the placs I usually fly), the optical flow will lose the ability to send good velocity data because of the lack of rangefinder data, and so I will not be able to have good loiter performance while moving.
I didn’t realise you were using optical flow. Disabling it with RC input sounds like a good idea, you could still re-enable it if it gets too close to the ground so it will still avoid the ground if you get too low.