Browse Source

Validation handled by ui

QGC4.4
Don Gagne 8 years ago
parent
commit
120781ae2e
  1. 10
      src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc

10
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc

@ -435,16 +435,8 @@ void PX4FirmwarePlugin::guidedModeChangeAltitude(Vehicle* vehicle, double altitu
return; return;
} }
// Don't allow altitude to fall below 3 meters above home
double currentAltRel = vehicle->altitudeRelative()->rawValue().toDouble(); double currentAltRel = vehicle->altitudeRelative()->rawValue().toDouble();
double newAltRel = currentAltRel; double newAltRel = currentAltRel + altitudeChange;
if (altitudeChange <= 0 && currentAltRel <= 3) {
return;
}
if (currentAltRel + altitudeChange < 3) {
altitudeChange = 3 - currentAltRel;
}
newAltRel = currentAltRel + altitudeChange;
vehicle->sendMavCommand(vehicle->defaultComponentId(), vehicle->sendMavCommand(vehicle->defaultComponentId(),
MAV_CMD_DO_REPOSITION, MAV_CMD_DO_REPOSITION,

Loading…
Cancel
Save