mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-05 07:21:36 +08:00
Add jerk parameter for auto mode MPC_JERK_AUTO. Specify when a parameter is only used in a certain manual or auto mode
This commit is contained in:
@@ -201,9 +201,9 @@ void FlightTaskAutoLineSmoothVel::_updateTrajConstraints()
|
|||||||
_trajectory[1].setMaxAccel(_param_mpc_acc_hor_max.get());
|
_trajectory[1].setMaxAccel(_param_mpc_acc_hor_max.get());
|
||||||
_trajectory[0].setMaxVel(_param_mpc_xy_vel_max.get());
|
_trajectory[0].setMaxVel(_param_mpc_xy_vel_max.get());
|
||||||
_trajectory[1].setMaxVel(_param_mpc_xy_vel_max.get());
|
_trajectory[1].setMaxVel(_param_mpc_xy_vel_max.get());
|
||||||
_trajectory[0].setMaxJerk(_param_mpc_jerk_min.get()); // TODO : Should be computed using heading
|
_trajectory[0].setMaxJerk(_param_mpc_jerk_auto.get()); // TODO : Should be computed using heading
|
||||||
_trajectory[1].setMaxJerk(_param_mpc_jerk_min.get());
|
_trajectory[1].setMaxJerk(_param_mpc_jerk_auto.get());
|
||||||
_trajectory[2].setMaxJerk(_param_mpc_jerk_min.get());
|
_trajectory[2].setMaxJerk(_param_mpc_jerk_auto.get());
|
||||||
|
|
||||||
if (_velocity_setpoint(2) < 0.f) { // up
|
if (_velocity_setpoint(2) < 0.f) { // up
|
||||||
_trajectory[2].setMaxAccel(_param_mpc_acc_up_max.get());
|
_trajectory[2].setMaxAccel(_param_mpc_acc_up_max.get());
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ protected:
|
|||||||
(ParamFloat<px4::params::MPC_ACC_UP_MAX>) _param_mpc_acc_up_max,
|
(ParamFloat<px4::params::MPC_ACC_UP_MAX>) _param_mpc_acc_up_max,
|
||||||
(ParamFloat<px4::params::MPC_ACC_DOWN_MAX>) _param_mpc_acc_down_max,
|
(ParamFloat<px4::params::MPC_ACC_DOWN_MAX>) _param_mpc_acc_down_max,
|
||||||
(ParamFloat<px4::params::MPC_ACC_HOR_MAX>) _param_mpc_acc_hor_max,
|
(ParamFloat<px4::params::MPC_ACC_HOR_MAX>) _param_mpc_acc_hor_max,
|
||||||
(ParamFloat<px4::params::MPC_JERK_MIN>) _param_mpc_jerk_min,
|
(ParamFloat<px4::params::MPC_JERK_AUTO>) _param_mpc_jerk_auto,
|
||||||
(ParamFloat<px4::params::MPC_XY_TRAJ_P>) _param_mpc_xy_traj_p,
|
(ParamFloat<px4::params::MPC_XY_TRAJ_P>) _param_mpc_xy_traj_p,
|
||||||
(ParamFloat<px4::params::MPC_Z_TRAJ_P>) _param_mpc_z_traj_p
|
(ParamFloat<px4::params::MPC_Z_TRAJ_P>) _param_mpc_z_traj_p
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ PARAM_DEFINE_FLOAT(MPC_THR_HOVER, 0.5f);
|
|||||||
* (e.g. if hover thrust is set to 20%, 80% of the upper thrust range is squeezed into the
|
* (e.g. if hover thrust is set to 20%, 80% of the upper thrust range is squeezed into the
|
||||||
* upper half of the stick range).
|
* upper half of the stick range).
|
||||||
*
|
*
|
||||||
* Note: in case MPC_THR_HOVER is set to 50%, the modes 0 and 1 are the same.
|
* Note: In case MPC_THR_HOVER is set to 50%, the modes 0 and 1 are the same.
|
||||||
*
|
*
|
||||||
* @value 0 Rescale to hover thrust
|
* @value 0 Rescale to hover thrust
|
||||||
* @value 1 No Rescale
|
* @value 1 No Rescale
|
||||||
@@ -427,7 +427,10 @@ PARAM_DEFINE_FLOAT(MPC_HOLD_MAX_Z, 0.6f);
|
|||||||
PARAM_DEFINE_FLOAT(MPC_VELD_LP, 5.0f);
|
PARAM_DEFINE_FLOAT(MPC_VELD_LP, 5.0f);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum horizontal acceleration for auto mode and maximum deceleration for manual mode
|
* Maximum horizontal acceleration for auto mode and for manual mode
|
||||||
|
*
|
||||||
|
* Manual mode: Maximum deceleration for MPC_POS_MODE 1 and 2. Maximum acceleration and deceleration for MPC_POS_MODE 3.
|
||||||
|
* Auto mode: Used with MPC_AUTO_MODE 0 only. For MPC_AUTO_MODE 1, MPC_ACC_HOR is always used.
|
||||||
*
|
*
|
||||||
* @unit m/s/s
|
* @unit m/s/s
|
||||||
* @min 2.0
|
* @min 2.0
|
||||||
@@ -441,6 +444,8 @@ PARAM_DEFINE_FLOAT(MPC_ACC_HOR_MAX, 10.0f);
|
|||||||
/**
|
/**
|
||||||
* Acceleration for auto and for manual
|
* Acceleration for auto and for manual
|
||||||
*
|
*
|
||||||
|
* Note: In manual, this parameter is only used in MPC_POS_MODE 1 and 2
|
||||||
|
*
|
||||||
* @unit m/s/s
|
* @unit m/s/s
|
||||||
* @min 2.0
|
* @min 2.0
|
||||||
* @max 15.0
|
* @max 15.0
|
||||||
@@ -454,6 +459,8 @@ PARAM_DEFINE_FLOAT(MPC_ACC_HOR, 5.0f);
|
|||||||
/**
|
/**
|
||||||
* Slow horizontal manual deceleration for manual mode
|
* Slow horizontal manual deceleration for manual mode
|
||||||
*
|
*
|
||||||
|
* Note: This is only used when MPC_POS_MODE is set to 1 or 2.
|
||||||
|
*
|
||||||
* @unit m/s/s
|
* @unit m/s/s
|
||||||
* @min 0.5
|
* @min 0.5
|
||||||
* @max 10.0
|
* @max 10.0
|
||||||
@@ -511,7 +518,7 @@ PARAM_DEFINE_FLOAT(MPC_ACC_DOWN_MAX, 10.0f);
|
|||||||
*
|
*
|
||||||
* Setting this to the maximum value essentially disables the limit.
|
* Setting this to the maximum value essentially disables the limit.
|
||||||
*
|
*
|
||||||
* Note: this is only used when MPC_POS_MODE is set to a smoothing mode.
|
* Note: This is only used when MPC_POS_MODE is set to a smoothing mode.
|
||||||
*
|
*
|
||||||
* @unit m/s/s/s
|
* @unit m/s/s/s
|
||||||
* @min 0.5
|
* @min 0.5
|
||||||
@@ -534,7 +541,7 @@ PARAM_DEFINE_FLOAT(MPC_JERK_MAX, 20.0f);
|
|||||||
*
|
*
|
||||||
* Set this to zero to use a fixed maximum jerk limit (MPC_JERK_MAX).
|
* Set this to zero to use a fixed maximum jerk limit (MPC_JERK_MAX).
|
||||||
*
|
*
|
||||||
* Note: this is only used when MPC_POS_MODE is set to a smoothing mode.
|
* Note: This is only used when MPC_POS_MODE is set to 1 or 2.
|
||||||
*
|
*
|
||||||
* @unit m/s/s/s
|
* @unit m/s/s/s
|
||||||
* @min 0
|
* @min 0
|
||||||
@@ -545,6 +552,24 @@ PARAM_DEFINE_FLOAT(MPC_JERK_MAX, 20.0f);
|
|||||||
*/
|
*/
|
||||||
PARAM_DEFINE_FLOAT(MPC_JERK_MIN, 8.0f);
|
PARAM_DEFINE_FLOAT(MPC_JERK_MIN, 8.0f);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jerk limit in auto mode
|
||||||
|
*
|
||||||
|
* Limit the maximum jerk of the vehicle (how fast the acceleration can change).
|
||||||
|
* A lower value leads to smoother vehicle motions, but it also limits its
|
||||||
|
* agility.
|
||||||
|
*
|
||||||
|
* Note: This is only used in jerk-limited trajectory mode (MPC_AUTO_MODE 1)
|
||||||
|
*
|
||||||
|
* @unit m/s/s/s
|
||||||
|
* @min 5.0
|
||||||
|
* @max 80.0
|
||||||
|
* @increment 1
|
||||||
|
* @decimal 1
|
||||||
|
* @group Multicopter Position Control
|
||||||
|
*/
|
||||||
|
PARAM_DEFINE_FLOAT(MPC_JERK_AUTO, 8.0f);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Altitude control mode.
|
* Altitude control mode.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user