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:
RomanBapst
2022-04-13 12:23:27 +03:00
committed by Roman Bapst
parent ca657f36ef
commit d41de33a85
4 changed files with 26 additions and 3 deletions
@@ -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);
}
}
}
}