Omni Att-Ctrl: Added a new parameter for controlling the maximum horizontal thrust

- OMNI_MAX_HOR_THR parameter specifies the maximum horizontal thrust compared to the maximum possible thrust generated by the vehicle for an omnidirectional multirotor
This commit is contained in:
Azarakhsh Keipour
2019-12-28 20:41:42 -05:00
parent 3c2087a69d
commit 494595111b
3 changed files with 19 additions and 3 deletions
@@ -159,7 +159,9 @@ private:
(ParamInt<px4::params::MC_AIRMODE>) _param_mc_airmode,
(ParamInt<px4::params::OMNI_ATT_MODE>) _param_omni_att_mode
/* Omnidirectional vehicle params */
(ParamInt<px4::params::OMNI_ATT_MODE>) _param_omni_att_mode,
(ParamFloat<px4::params::OMNI_MAX_HOR_THR>) _param_omni_max_hor_thr
)
bool _is_tailsitter{false};
@@ -241,8 +241,7 @@ MulticopterAttitudeControl::generate_attitude_setpoint(float dt, bool reset_yaw_
h_thrust /= h_thrust_norm;
}
const float max_xy_thrust_ratio = 0.3;
h_thrust *= max_xy_thrust_ratio;
h_thrust *= _param_omni_max_hor_thr.get();
// Check if the total thrust has exceeded the maximum
Vector3f total_thrust = Vector3f(h_thrust(0), h_thrust(1), z_thrust);
@@ -144,3 +144,18 @@ PARAM_DEFINE_FLOAT(MC_YAWRATE_MAX, 200.0f);
* @group Multicopter Attitude Control
*/
PARAM_DEFINE_FLOAT(MC_RATT_TH, 0.8f);
/**
* Maximum horizontal thrust ratio for omnidirectional vehicles
*
* Specifies the maximum horizontal thrust compared to the maximum possible
* thrust generated by the vehicle for an omnidirectional multirotor. The
* value of this parameter does not affect the behavior if the attitude mode
* is not set to one of omni-directional modes.
*
* @min 0
* @max 1
* @decimal 2
* @group Multicopter Attitude Control
*/
PARAM_DEFINE_FLOAT(OMNI_MAX_HOR_THR, 0.3f);