-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plane: allow QRTL to terrain follow with approach disabled #27856
base: master
Are you sure you want to change the base?
Conversation
when Q_OPTIONS has approach disabled this allows QRTL to track terrain, allowing for safer approach over hilly terrain
float terrain_altitude_offset; | ||
if (plane.terrain_enabled_in_current_mode() && plane.terrain.height_terrain_difference_home(terrain_altitude_offset, true)) { | ||
// Climb if current terrain is above home, target_altitude_cm is reltive to home | ||
target_z += MAX(terrain_altitude_offset*100,0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only climb? Terrain following is also important for keeping within AGL regulations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because we could dive down into a canyon, and not be able to make it back up again. Same reason we don't descend in the code a few lines up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is not our standard terrain following behavior. It also does not prevent the case you describe. It allows any climb and descending so long as you remain above home. So as long as the bottom of the proposed canyon is above home it will dive right in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not likely to be used for long distances if I understand it right. I'm working with a partner who has asked for something similar in plane RTL mode - ascend to a safe altitude and not go down into dips and valleys on the way back, but still go up over terrain that intervenes. Balancing AGL regulation limits is a challenge.
It does sound safer than what happens now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tridge @timtuxworth @IamPete1 in such cased regulations are the least of our concerns. This is for safety and we not be ever used in normal cases. This is for flight failures. I am against dipping into valleys or canyons as it will be an almost guaranteed loss for radio/telemetry, which I think is more important than temporarily clipping any AGL regulations. Also much less risky staying up, as you cannot know how steep the next "wall" will be and if the aircraft can manage the accent rate while flying forward with 12-15m/s. Remember these are not going to stop then go vertical. And @timtuxworth long distance is relative, we want to be able to do this from up to 20km. That is up to the aircraft capability. I see no real down side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tridge @IamPete1 Hi, I actually wanted to get some clarity on this aspect. What if the drone (for whatever reason) goes into QRTL at 900m AGL. Will it first descend to the altitude above terrain that is in the parameters? Say relative to the highest point in its path. Or will it not decent at all, only climb?
The later is not desirable and would be very dangerous. It should come down to at least the defined height over the highest terrain in its intended flight path home. If that is not possible then I would go with Peter and then request full terrain following, up and down.
The problem with staying high is say we are 10km out at 500m high and have 30% battery remaining when the QRTL kicks in, so it starts to fly home at 500m, half way home, the critical battery FS would kick in, which is Qland, and that would usually not be a problem from 50-100m AGL, however from 500m it will not have enough power to complete the decent. It would end up falling out of the sky half way down or so. Just as example.
@@ -2793,6 +2793,13 @@ void QuadPlane::vtol_position_controller(void) | |||
loc2.change_alt_frame(Location::AltFrame::ABOVE_ORIGIN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could change to above home, apply the offset and then change to above origin.
@@ -2793,6 +2793,13 @@ void QuadPlane::vtol_position_controller(void) | |||
loc2.change_alt_frame(Location::AltFrame::ABOVE_ORIGIN); | |||
float target_z = loc2.alt; | |||
float zero = 0; | |||
#if AP_TERRAIN_AVAILABLE | |||
float terrain_altitude_offset; | |||
if (plane.terrain_enabled_in_current_mode() && plane.terrain.height_terrain_difference_home(terrain_altitude_offset, true)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can could check the original alt frame of the destination location. Although I guess doing it this way allows terrain enable/disable during QRTL. Although that might be quite exciting.
when Q_OPTIONS has approach disabled this allows QRTL to track terrain, allowing for safer approach over hilly terrain