mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 03:33:33 +08:00
multicopter manual attitude control: Leave some margin for yaw control
This commit is contained in:
@@ -97,6 +97,7 @@ extern "C" __EXPORT int mc_att_control_main(int argc, char *argv[]);
|
|||||||
#define YAW_DEADZONE 0.05f
|
#define YAW_DEADZONE 0.05f
|
||||||
#define MIN_TAKEOFF_THRUST 0.2f
|
#define MIN_TAKEOFF_THRUST 0.2f
|
||||||
#define RATES_I_LIMIT 0.3f
|
#define RATES_I_LIMIT 0.3f
|
||||||
|
#define MANUAL_THROTTLE_MAX_MULTICOPTER 0.9f
|
||||||
|
|
||||||
class MulticopterAttitudeControl
|
class MulticopterAttitudeControl
|
||||||
{
|
{
|
||||||
@@ -831,7 +832,7 @@ MulticopterAttitudeControl::task_main()
|
|||||||
if (_v_control_mode.flag_control_manual_enabled) {
|
if (_v_control_mode.flag_control_manual_enabled) {
|
||||||
/* manual rates control - ACRO mode */
|
/* manual rates control - ACRO mode */
|
||||||
_rates_sp = math::Vector<3>(_manual_control_sp.y, -_manual_control_sp.x, _manual_control_sp.r).emult(_params.acro_rate_max);
|
_rates_sp = math::Vector<3>(_manual_control_sp.y, -_manual_control_sp.x, _manual_control_sp.r).emult(_params.acro_rate_max);
|
||||||
_thrust_sp = _manual_control_sp.z;
|
_thrust_sp = math::min(_manual_control_sp.z, MANUAL_THROTTLE_MAX_MULTICOPTER);
|
||||||
|
|
||||||
/* publish attitude rates setpoint */
|
/* publish attitude rates setpoint */
|
||||||
_v_rates_sp.roll = _rates_sp(0);
|
_v_rates_sp.roll = _rates_sp(0);
|
||||||
|
|||||||
@@ -83,6 +83,7 @@
|
|||||||
#define TILT_COS_MAX 0.7f
|
#define TILT_COS_MAX 0.7f
|
||||||
#define SIGMA 0.000001f
|
#define SIGMA 0.000001f
|
||||||
#define MIN_DIST 0.01f
|
#define MIN_DIST 0.01f
|
||||||
|
#define MANUAL_THROTTLE_MAX_MULTICOPTER 0.9f
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Multicopter position control app start / stop handling function
|
* Multicopter position control app start / stop handling function
|
||||||
@@ -1387,7 +1388,7 @@ MulticopterPositionControl::task_main()
|
|||||||
|
|
||||||
//Control climb rate directly if no aiding altitude controller is active
|
//Control climb rate directly if no aiding altitude controller is active
|
||||||
if(!_control_mode.flag_control_climb_rate_enabled) {
|
if(!_control_mode.flag_control_climb_rate_enabled) {
|
||||||
_att_sp.thrust = _manual.z;
|
_att_sp.thrust = math::min(_manual.z, MANUAL_THROTTLE_MAX_MULTICOPTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Construct attitude setpoint rotation matrix
|
//Construct attitude setpoint rotation matrix
|
||||||
|
|||||||
Reference in New Issue
Block a user