mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-08 19:31:36 +08:00
FlightModeManager: handle MAV_CMD_DO_CHANGE_SPEED
- support setting the cruise speed of the auto flight task via command Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -441,6 +441,12 @@ void FlightModeManager::handleCommand()
|
||||
command_ack.target_component = command.source_component;
|
||||
command_ack.timestamp = hrt_absolute_time();
|
||||
_vehicle_command_ack_pub.publish(command_ack);
|
||||
} else if (_current_task.task) {
|
||||
// check for other commands not related to task switching
|
||||
if (command.command == vehicle_command_s::VEHICLE_CMD_DO_CHANGE_SPEED && command.param2 >= 0
|
||||
&& (uint8_t)command.param1 == vehicle_command_s::SPEED_TYPE_GROUNDSPEED) {
|
||||
_current_task.task->setCruisingSpeed(command.param2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user