forked from Archive/PX4-Autopilot
FlightTaskOrbit: don't start Orbit if radius is not in range
This commit is contained in:
parent
0595efbd9b
commit
d0794c1189
|
@ -69,10 +69,16 @@ bool FlightTaskOrbit::applyCommandParameters(const vehicle_command_s &command)
|
|||
}
|
||||
|
||||
float new_velocity = signFromBool(new_is_clockwise) * new_absolute_velocity;
|
||||
_started_clockwise = new_is_clockwise;
|
||||
_sanitizeParams(new_radius, new_velocity);
|
||||
_orbit_radius = new_radius;
|
||||
_orbit_velocity = new_velocity;
|
||||
|
||||
if (math::isInRange(new_radius, _radius_min, _radius_max)) {
|
||||
_started_clockwise = new_is_clockwise;
|
||||
_sanitizeParams(new_radius, new_velocity);
|
||||
_orbit_radius = new_radius;
|
||||
_orbit_velocity = new_velocity;
|
||||
|
||||
} else {
|
||||
ret = false;
|
||||
}
|
||||
|
||||
// commanded heading behaviour
|
||||
if (PX4_ISFINITE(command.param3)) {
|
||||
|
|
Loading…
Reference in New Issue