Skip to content
Snippets Groups Projects
Commit 066d1f50 authored by bresch's avatar bresch Committed by Roman Bapst
Browse files

Auto traj - Add dedicated parameter to enable trajectory smoothing in auto mode only

parent 7205e8f3
No related branches found
No related tags found
No related merge requests found
......@@ -139,6 +139,7 @@ private:
(ParamFloat<px4::params::MPC_TKO_SPEED>) _tko_speed,
(ParamFloat<px4::params::MPC_LAND_ALT2>) MPC_LAND_ALT2, // altitude at which speed limit downwards reached minimum speed
(ParamInt<px4::params::MPC_POS_MODE>) MPC_POS_MODE,
(ParamInt<px4::params::MPC_AUTO_MODE>) MPC_AUTO_MODE,
(ParamInt<px4::params::MPC_ALT_MODE>) MPC_ALT_MODE,
(ParamFloat<px4::params::MPC_IDLE_TKO>) MPC_IDLE_TKO, /**< time constant for smooth takeoff ramp */
(ParamInt<px4::params::MPC_OBS_AVOID>) MPC_OBS_AVOID, /**< enable obstacle avoidance */
......@@ -895,7 +896,7 @@ MulticopterPositionControl::start_flight_task()
} else if (_control_mode.flag_control_auto_enabled) {
// Auto relate maneuvers
int error = 0;
switch (MPC_POS_MODE.get()) {
switch (MPC_AUTO_MODE.get()) {
case 0:
case 1:
case 2:
......
......@@ -678,6 +678,26 @@ PARAM_DEFINE_FLOAT(MPC_TKO_RAMP_T, 0.4f);
*/
PARAM_DEFINE_INT32(MPC_POS_MODE, 1);
/**
* Auto sub-mode.
*
* The supported sub-modes are:
* 0 Direct line tracking, no smoothing
*
* 1 Not used
*
* 2 Not used
*
* 3 Jerk-limited trajectory
*
* @value 0 Default line tracking
* @value 1 N/A
* @value 2 N/A
* @value 3 Jerk-limited trajectory
* @group Multicopter Position Control
*/
PARAM_DEFINE_INT32(MPC_AUTO_MODE, 3);
/**
* Delay from idle state to arming state.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment