mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-05 18:10:34 +08:00
FlightModeManager/FixedwingPositionControl: robustify vehicle command parameter casting
This commit is contained in:
committed by
Roman Bapst
parent
6ce3e88f9d
commit
f892a624b7
@@ -258,8 +258,9 @@ FixedwingPositionControl::vehicle_command_poll()
|
||||
abort_landing(true);
|
||||
}
|
||||
|
||||
} else if (vehicle_command.command == vehicle_command_s::VEHICLE_CMD_DO_CHANGE_SPEED
|
||||
&& (uint8_t)vehicle_command.param1 == vehicle_command_s::SPEED_TYPE_AIRSPEED && vehicle_command.param2 > 0) {
|
||||
} else if ((vehicle_command.command == vehicle_command_s::VEHICLE_CMD_DO_CHANGE_SPEED)
|
||||
&& (static_cast<uint8_t>(vehicle_command.param1 + .5f) == vehicle_command_s::SPEED_TYPE_AIRSPEED)
|
||||
&& (vehicle_command.param2 > 0.f)) {
|
||||
|
||||
if (_control_mode_current == FW_POSCTRL_MODE_AUTO) {
|
||||
_pos_sp_triplet.current.cruising_speed = vehicle_command.param2;
|
||||
|
||||
Reference in New Issue
Block a user