mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
PositionControl: degrees to radians
This commit is contained in:
parent
4a9e5941b6
commit
caa773008a
@ -61,6 +61,7 @@ PositionControl::PositionControl()
|
||||
MPC_THR_MIN_h = param_find("MPC_THR_MIN");
|
||||
MPC_THR_MIN_h = param_find("MPC_MANTHR_MIN");
|
||||
MPC_TILTMAX_AIR_h = param_find("MPC_TILTMAX_AIR");
|
||||
MPC_MAN_TILT_MAX_h = param_find("MPC_MAN_TILT_MAX");
|
||||
_parameter_sub = orb_subscribe(ORB_ID(parameter_update));
|
||||
|
||||
// set parameter the very first time
|
||||
@ -334,5 +335,8 @@ void PositionControl::_setParams()
|
||||
param_get(MPC_THR_MIN_h, &MPC_THR_MIN);
|
||||
param_get(MPC_MANTHR_MIN_h, &MPC_MANTHR_MIN);
|
||||
param_get(MPC_TILTMAX_AIR_h, &MPC_TILTMAX_AIR);
|
||||
MPC_TILTMAX_AIR = math::radians(MPC_TILTMAX_AIR);
|
||||
param_get(MPC_MAN_TILT_MAX_h, &MPC_MAN_TILT_MAX);
|
||||
MPC_MAN_TILT_MAX = math::radians(MPC_MAN_TILT_MAX);
|
||||
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ namespace Controller
|
||||
{
|
||||
/** Constraints that depends on mode and are lower
|
||||
* than the global limits.
|
||||
* tilt_max: Cannot exceed PI/2
|
||||
* tilt_max: Cannot exceed PI/2 radians
|
||||
* vel_max_z_up: Cannot exceed maximum global velocity upwards
|
||||
* @see MPC_TILTMAX_AIR
|
||||
* @see MPC_Z_VEL_MAX_DN
|
||||
@ -198,8 +198,8 @@ private:
|
||||
float MPC_XY_VEL_MAX{1.0f}; /**< maximum speed in the horizontal direction */
|
||||
float MPC_Z_VEL_MAX_DN{1.0f}; /**< maximum speed in downwards direction */
|
||||
float MPC_Z_VEL_MAX_UP{1.0f}; /**< maximum speed in upwards direction */
|
||||
float MPC_TILTMAX_AIR{1.5}; /**< maximum tilt for any position/velocity controlled mode */
|
||||
float MPC_MAN_TILT_MAX{3.1}; /**< maximum tilt for manual/altitude mode */
|
||||
float MPC_TILTMAX_AIR{1.5}; /**< maximum tilt for any position/velocity controlled mode in radians */
|
||||
float MPC_MAN_TILT_MAX{3.1}; /**< maximum tilt for manual/altitude mode in radians */
|
||||
|
||||
// Parameter handles
|
||||
int _parameter_sub { -1 };
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user