mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 10:23:33 +08:00
PositionControl: degrees to radians
This commit is contained in:
committed by
Lorenz Meier
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_THR_MIN");
|
||||||
MPC_THR_MIN_h = param_find("MPC_MANTHR_MIN");
|
MPC_THR_MIN_h = param_find("MPC_MANTHR_MIN");
|
||||||
MPC_TILTMAX_AIR_h = param_find("MPC_TILTMAX_AIR");
|
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));
|
_parameter_sub = orb_subscribe(ORB_ID(parameter_update));
|
||||||
|
|
||||||
// set parameter the very first time
|
// 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_THR_MIN_h, &MPC_THR_MIN);
|
||||||
param_get(MPC_MANTHR_MIN_h, &MPC_MANTHR_MIN);
|
param_get(MPC_MANTHR_MIN_h, &MPC_MANTHR_MIN);
|
||||||
param_get(MPC_TILTMAX_AIR_h, &MPC_TILTMAX_AIR);
|
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);
|
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
|
/** Constraints that depends on mode and are lower
|
||||||
* than the global limits.
|
* 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
|
* vel_max_z_up: Cannot exceed maximum global velocity upwards
|
||||||
* @see MPC_TILTMAX_AIR
|
* @see MPC_TILTMAX_AIR
|
||||||
* @see MPC_Z_VEL_MAX_DN
|
* @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_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_DN{1.0f}; /**< maximum speed in downwards direction */
|
||||||
float MPC_Z_VEL_MAX_UP{1.0f}; /**< maximum speed in upwards 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_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 */
|
float MPC_MAN_TILT_MAX{3.1}; /**< maximum tilt for manual/altitude mode in radians */
|
||||||
|
|
||||||
// Parameter handles
|
// Parameter handles
|
||||||
int _parameter_sub { -1 };
|
int _parameter_sub { -1 };
|
||||||
|
|||||||
Reference in New Issue
Block a user