mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 11:06:04 +08:00
MPC_POS_MODE remove old metadata and explicitly handle invalid configuration
This commit is contained in:
committed by
Mathieu Bresciani
parent
d01806a0c6
commit
0ba1bc0ce1
@@ -314,6 +314,12 @@ void FlightModeManager::start_flight_task()
|
|||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
default:
|
default:
|
||||||
|
if (_param_mpc_pos_mode.get() != 4) {
|
||||||
|
PX4_ERR("MPC_POS_MODE %d invalid, resetting", _param_mpc_pos_mode.get());
|
||||||
|
_param_mpc_pos_mode.set(4);
|
||||||
|
_param_mpc_pos_mode.commit();
|
||||||
|
}
|
||||||
|
|
||||||
error = switchTask(FlightTaskIndex::ManualAcceleration);
|
error = switchTask(FlightTaskIndex::ManualAcceleration);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -708,13 +708,11 @@ PARAM_DEFINE_FLOAT(MPC_TKO_RAMP_T, 3.0f);
|
|||||||
* The supported sub-modes are:
|
* The supported sub-modes are:
|
||||||
* 0 Simple position control where sticks map directly to velocity setpoints
|
* 0 Simple position control where sticks map directly to velocity setpoints
|
||||||
* without smoothing. Useful for velocity control tuning.
|
* without smoothing. Useful for velocity control tuning.
|
||||||
* 1 Smooth position control with maximum acceleration and jerk limits based on slew-rates.
|
|
||||||
* 3 Smooth position control with maximum acceleration and jerk limits based on
|
* 3 Smooth position control with maximum acceleration and jerk limits based on
|
||||||
* jerk optimized trajectory generator (different algorithm than 1).
|
* jerk optimized trajectory generator (different algorithm than 1).
|
||||||
* 4 Smooth position control where sticks map to acceleration and there's a virtual brake drag
|
* 4 Smooth position control where sticks map to acceleration and there's a virtual brake drag
|
||||||
*
|
*
|
||||||
* @value 0 Simple position control
|
* @value 0 Simple position control
|
||||||
* @value 1 Smooth position control
|
|
||||||
* @value 3 Smooth position control (Jerk optimized)
|
* @value 3 Smooth position control (Jerk optimized)
|
||||||
* @value 4 Acceleration based input
|
* @value 4 Acceleration based input
|
||||||
* @group Multicopter Position Control
|
* @group Multicopter Position Control
|
||||||
|
|||||||
Reference in New Issue
Block a user