mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 07:33:33 +08:00
autotune: enable autotune in mission mode
When operating fully autonomously (i.e., without manual control or a guaranteed link to the ground station), tuning a vehicle can be difficult since the current autotune process requires either RC input or a GCS command. For these scenarios, it it useful to be able to start autotune inside a mission.
This commit is contained in:
@@ -759,6 +759,21 @@ void Navigator::run()
|
||||
reset_cruising_speed();
|
||||
set_cruising_throttle();
|
||||
}
|
||||
|
||||
else if (cmd.command == vehicle_command_s::VEHICLE_CMD_DO_AUTOTUNE_ENABLE) {
|
||||
|
||||
|
||||
if (fabsf(cmd.param1 - 1.f) > FLT_EPSILON) {
|
||||
// only support enabling autotune (consistent with autotune module)
|
||||
events::send(events::ID("navigator_autotune_unsupported_input"), {events::Log::Warning, events::LogInternal::Warning},
|
||||
"Provided autotune command is not supported. To enable autotune in mission, set param1 to 1");
|
||||
|
||||
} else if (fabsf(cmd.param2) > FLT_EPSILON) {
|
||||
// warn user about axis selection
|
||||
events::send(events::ID("navigator_autotune_unsupported_ax"), {events::Log::Warning, events::LogInternal::Info},
|
||||
"Autotune axis selection not supported through Mission. Use FW_AT_AXES to set axes for fixed-wing vehicles");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_NAVIGATOR_ADSB
|
||||
|
||||
Reference in New Issue
Block a user