Commander: Only change flight mode immediately if GCS requested it

This commit is contained in:
Lorenz Meier
2016-04-24 12:10:23 +02:00
parent 2244ff167f
commit 588133e85d
2 changed files with 15 additions and 9 deletions
+4 -4
View File
@@ -419,25 +419,25 @@ Navigator::task_main()
rep->previous.alt = get_global_position()->alt;
// Go on and check which changes had been requested
if (isfinite(cmd.param4)) {
if (PX4_ISFINITE(cmd.param4)) {
rep->current.yaw = cmd.param4;
} else {
rep->current.yaw = NAN;
}
if (isfinite(cmd.param5)) {
if (PX4_ISFINITE(cmd.param5)) {
rep->current.lat = cmd.param5 / (double)1e7;
} else {
rep->current.lat = get_global_position()->lat;
}
if (isfinite(cmd.param6)) {
if (PX4_ISFINITE(cmd.param6)) {
rep->current.lon = cmd.param6 / (double)1e7;
} else {
rep->current.lon = get_global_position()->lon;
}
if (isfinite(cmd.param7)) {
if (PX4_ISFINITE(cmd.param7)) {
rep->current.alt = cmd.param7;
} else {
rep->current.alt = get_global_position()->alt;