diff --git a/src/modules/mc_pos_control/mc_pos_control_main.cpp b/src/modules/mc_pos_control/mc_pos_control_main.cpp index 3118f2b9dfbdac8a5700ecdf9b305b896baf9764..948562d82f40d0cf694b4da4041fedc0d401ff7f 100644 --- a/src/modules/mc_pos_control/mc_pos_control_main.cpp +++ b/src/modules/mc_pos_control/mc_pos_control_main.cpp @@ -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: diff --git a/src/modules/mc_pos_control/mc_pos_control_params.c b/src/modules/mc_pos_control/mc_pos_control_params.c index 599895ab46ea5413ce682dbcca9f798caa4d5bb5..7fdd1b55b29b0251324c5cd769fa05b76d3cfefb 100644 --- a/src/modules/mc_pos_control/mc_pos_control_params.c +++ b/src/modules/mc_pos_control/mc_pos_control_params.c @@ -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. *