MPC_POS_MODE remove old metadata and explicitly handle invalid configuration

This commit is contained in:
Daniel Agar
2021-02-28 22:07:08 -05:00
committed by Mathieu Bresciani
parent d01806a0c6
commit 0ba1bc0ce1
2 changed files with 6 additions and 2 deletions
@@ -314,6 +314,12 @@ void FlightModeManager::start_flight_task()
case 4:
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);
break;
}
@@ -708,13 +708,11 @@ PARAM_DEFINE_FLOAT(MPC_TKO_RAMP_T, 3.0f);
* The supported sub-modes are:
* 0 Simple position control where sticks map directly to velocity setpoints
* 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
* jerk optimized trajectory generator (different algorithm than 1).
* 4 Smooth position control where sticks map to acceleration and there's a virtual brake drag
*
* @value 0 Simple position control
* @value 1 Smooth position control
* @value 3 Smooth position control (Jerk optimized)
* @value 4 Acceleration based input
* @group Multicopter Position Control