Commit 02fe0274 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

Prevent altitude override without coordinates

Altitude should not be overriden with default value as it is defined without
knowing the field or the flight conditions. Therefore the user has to provide
coordinates with the desired altitude so altitude override can happen.
parent 0c190fd4
...@@ -193,6 +193,11 @@ static int doOverride(float altitude, float speed, const char* failure_msg) { ...@@ -193,6 +193,11 @@ static int doOverride(float altitude, float speed, const char* failure_msg) {
if (!mavsdk_started) if (!mavsdk_started)
return -1; return -1;
if (!first_coordinate_entered) {
log_error("Not overriding altitude before user sets coordinates");
return -1;
}
MavlinkPassthrough::CommandLong command; MavlinkPassthrough::CommandLong command;
command.command = MAV_CMD_DO_OVERRIDE; command.command = MAV_CMD_DO_OVERRIDE;
command.param1 = 1 | 2 | 4 | 8; command.param1 = 1 | 2 | 4 | 8;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment