mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 19:33:35 +08:00
Auto traj - Add dedicated parameter to enable trajectory smoothing in auto mode only
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user