mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-16 13:27:35 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user