diff options
Diffstat (limited to 'src/modules')
10 files changed, 47 insertions, 50 deletions
diff --git a/src/modules/mc_att_control_multiplatform/mc_att_control.cpp b/src/modules/mc_att_control_multiplatform/mc_att_control.cpp index 9ec6f1864..b5a551109 100644 --- a/src/modules/mc_att_control_multiplatform/mc_att_control.cpp +++ b/src/modules/mc_att_control_multiplatform/mc_att_control.cpp @@ -89,9 +89,6 @@ MulticopterAttitudeControl::MulticopterAttitudeControl() : .yaw_rate_d = px4::ParameterFloat("MC_YAWRATE_D", PARAM_MC_YAWRATE_D_DEFAULT), .yaw_ff = px4::ParameterFloat("MC_YAW_FF", PARAM_MC_YAW_FF_DEFAULT), .yaw_rate_max = px4::ParameterFloat("MC_YAWRATE_MAX", PARAM_MC_YAWRATE_MAX_DEFAULT), - .man_roll_max = px4::ParameterFloat("MC_MAN_R_MAX", PARAM_MC_MAN_R_MAX_DEFAULT), - .man_pitch_max = px4::ParameterFloat("MC_MAN_P_MAX", PARAM_MC_MAN_P_MAX_DEFAULT), - .man_yaw_max = px4::ParameterFloat("MC_MAN_Y_MAX", PARAM_MC_MAN_Y_MAX_DEFAULT), .acro_roll_max = px4::ParameterFloat("MC_ACRO_R_MAX", PARAM_MC_ACRO_R_MAX_DEFAULT), .acro_pitch_max = px4::ParameterFloat("MC_ACRO_P_MAX", PARAM_MC_ACRO_P_MAX_DEFAULT), .acro_yaw_max = px4::ParameterFloat("MC_ACRO_Y_MAX", PARAM_MC_ACRO_Y_MAX_DEFAULT) @@ -146,11 +143,6 @@ MulticopterAttitudeControl::parameters_update() _params.yaw_ff = _params_handles.yaw_ff.update(); _params.yaw_rate_max = math::radians(_params_handles.yaw_rate_max.update()); - /* manual control scale */ - _params.man_roll_max = math::radians(_params_handles.man_roll_max.update()); - _params.man_pitch_max = math::radians(_params_handles.man_pitch_max.update()); - _params.man_yaw_max = math::radians(_params_handles.man_yaw_max.update()); - /* acro control scale */ _params.acro_rate_max(0) = math::radians(_params_handles.acro_roll_max.update()); _params.acro_rate_max(1) = math::radians(_params_handles.acro_pitch_max.update()); diff --git a/src/modules/mc_att_control_multiplatform/mc_att_control.h b/src/modules/mc_att_control_multiplatform/mc_att_control.h index e44317316..52ba369c1 100644 --- a/src/modules/mc_att_control_multiplatform/mc_att_control.h +++ b/src/modules/mc_att_control_multiplatform/mc_att_control.h @@ -110,9 +110,6 @@ private: px4::ParameterFloat yaw_ff; px4::ParameterFloat yaw_rate_max; - px4::ParameterFloat man_roll_max; - px4::ParameterFloat man_pitch_max; - px4::ParameterFloat man_yaw_max; px4::ParameterFloat acro_roll_max; px4::ParameterFloat acro_pitch_max; px4::ParameterFloat acro_yaw_max; diff --git a/src/modules/mc_att_control_multiplatform/mc_att_control_base.cpp b/src/modules/mc_att_control_multiplatform/mc_att_control_base.cpp index 16f1b79bf..18e598636 100644 --- a/src/modules/mc_att_control_multiplatform/mc_att_control_base.cpp +++ b/src/modules/mc_att_control_multiplatform/mc_att_control_base.cpp @@ -66,9 +66,6 @@ MulticopterAttitudeControlBase::MulticopterAttitudeControlBase() : _params.rate_d.zero(); _params.yaw_ff = 0.0f; _params.yaw_rate_max = 0.0f; - _params.man_roll_max = 0.0f; - _params.man_pitch_max = 0.0f; - _params.man_yaw_max = 0.0f; _params.acro_rate_max.zero(); _rates_prev.zero(); diff --git a/src/modules/mc_att_control_multiplatform/mc_att_control_base.h b/src/modules/mc_att_control_multiplatform/mc_att_control_base.h index 5e26b47e2..4e33018b4 100644 --- a/src/modules/mc_att_control_multiplatform/mc_att_control_base.h +++ b/src/modules/mc_att_control_multiplatform/mc_att_control_base.h @@ -119,9 +119,6 @@ protected: float yaw_ff; /**< yaw control feed-forward */ float yaw_rate_max; /**< max yaw rate */ - float man_roll_max; - float man_pitch_max; - float man_yaw_max; math::Vector<3> acro_rate_max; /**< max attitude rates in acro mode */ int32_t autostart_id; diff --git a/src/modules/mc_att_control_multiplatform/mc_att_control_params.c b/src/modules/mc_att_control_multiplatform/mc_att_control_params.c index a0b1706f2..395ae83b0 100644 --- a/src/modules/mc_att_control_multiplatform/mc_att_control_params.c +++ b/src/modules/mc_att_control_multiplatform/mc_att_control_params.c @@ -190,35 +190,6 @@ PX4_PARAM_DEFINE_FLOAT(MC_YAW_FF); PX4_PARAM_DEFINE_FLOAT(MC_YAWRATE_MAX); /** - * Max manual roll - * - * @unit deg - * @min 0.0 - * @max 90.0 - * @group Multicopter Attitude Control - */ -PX4_PARAM_DEFINE_FLOAT(MC_MAN_R_MAX); - -/** - * Max manual pitch - * - * @unit deg - * @min 0.0 - * @max 90.0 - * @group Multicopter Attitude Control - */ -PX4_PARAM_DEFINE_FLOAT(MC_MAN_P_MAX); - -/** - * Max manual yaw rate - * - * @unit deg/s - * @min 0.0 - * @group Multicopter Attitude Control - */ -PX4_PARAM_DEFINE_FLOAT(MC_MAN_Y_MAX); - -/** * Max acro roll rate * * @unit deg/s diff --git a/src/modules/mc_att_control_multiplatform/mc_att_control_params.h b/src/modules/mc_att_control_multiplatform/mc_att_control_params.h index 59dd5240f..ff962dbf1 100644 --- a/src/modules/mc_att_control_multiplatform/mc_att_control_params.h +++ b/src/modules/mc_att_control_multiplatform/mc_att_control_params.h @@ -57,9 +57,6 @@ #define PARAM_MC_YAWRATE_D_DEFAULT 0.0f #define PARAM_MC_YAW_FF_DEFAULT 0.5f #define PARAM_MC_YAWRATE_MAX_DEFAULT 120.0f -#define PARAM_MC_MAN_R_MAX_DEFAULT 35.0f -#define PARAM_MC_MAN_P_MAX_DEFAULT 35.0f -#define PARAM_MC_MAN_Y_MAX_DEFAULT 120.0f #define PARAM_MC_ACRO_R_MAX_DEFAULT 35.0f #define PARAM_MC_ACRO_P_MAX_DEFAULT 35.0f #define PARAM_MC_ACRO_Y_MAX_DEFAULT 120.0f diff --git a/src/modules/mc_pos_control_multiplatform/mc_pos_control.cpp b/src/modules/mc_pos_control_multiplatform/mc_pos_control.cpp index 1fe75b90c..1c0298a07 100644 --- a/src/modules/mc_pos_control_multiplatform/mc_pos_control.cpp +++ b/src/modules/mc_pos_control_multiplatform/mc_pos_control.cpp @@ -82,7 +82,10 @@ MulticopterPositionControl::MulticopterPositionControl() : .xy_ff = px4::ParameterFloat("MPC_XY_FF", PARAM_MPC_XY_FF_DEFAULT), .tilt_max_air = px4::ParameterFloat("MPC_TILTMAX_AIR", PARAM_MPC_TILTMAX_AIR_DEFAULT), .land_speed = px4::ParameterFloat("MPC_LAND_SPEED", PARAM_MPC_LAND_SPEED_DEFAULT), - .tilt_max_land = px4::ParameterFloat("MPC_TILTMAX_LND", PARAM_MPC_TILTMAX_LND_DEFAULT) + .tilt_max_land = px4::ParameterFloat("MPC_TILTMAX_LND", PARAM_MPC_TILTMAX_LND_DEFAULT), + .man_roll_max = px4::ParameterFloat("MC_MAN_R_MAX", PARAM_MPC_MAN_R_MAX_DEFAULT), + .man_pitch_max = px4::ParameterFloat("MC_MAN_P_MAX", PARAM_MPC_MAN_P_MAX_DEFAULT), + .man_yaw_max = px4::ParameterFloat("MC_MAN_Y_MAX", PARAM_MPC_MAN_Y_MAX_DEFAULT) }), _ref_alt(0.0f), _ref_timestamp(0), @@ -146,6 +149,11 @@ MulticopterPositionControl::parameters_update() _params.land_speed = _params_handles.land_speed.update(); _params.tilt_max_land = math::radians(_params_handles.tilt_max_land.update()); + /* manual control scale */ + _params.man_roll_max = math::radians(_params_handles.man_roll_max.update()); + _params.man_pitch_max = math::radians(_params_handles.man_pitch_max.update()); + _params.man_yaw_max = math::radians(_params_handles.man_yaw_max.update()); + _params.pos_p(0) = _params.pos_p(1) = _params_handles.xy_p.update(); _params.pos_p(2) = _params_handles.z_p.update(); _params.vel_p(0) = _params.vel_p(1) = _params_handles.xy_vel_p.update(); diff --git a/src/modules/mc_pos_control_multiplatform/mc_pos_control.h b/src/modules/mc_pos_control_multiplatform/mc_pos_control.h index b754ccf01..59b663b9f 100644 --- a/src/modules/mc_pos_control_multiplatform/mc_pos_control.h +++ b/src/modules/mc_pos_control_multiplatform/mc_pos_control.h @@ -126,6 +126,9 @@ protected: px4::ParameterFloat tilt_max_air; px4::ParameterFloat land_speed; px4::ParameterFloat tilt_max_land; + px4::ParameterFloat man_roll_max; + px4::ParameterFloat man_pitch_max; + px4::ParameterFloat man_yaw_max; } _params_handles; /**< handles for interesting parameters */ struct { @@ -134,6 +137,9 @@ protected: float tilt_max_air; float land_speed; float tilt_max_land; + float man_roll_max; + float man_pitch_max; + float man_yaw_max; math::Vector<3> pos_p; math::Vector<3> vel_p; diff --git a/src/modules/mc_pos_control_multiplatform/mc_pos_control_params.c b/src/modules/mc_pos_control_multiplatform/mc_pos_control_params.c index c741a7f0a..709085662 100644 --- a/src/modules/mc_pos_control_multiplatform/mc_pos_control_params.c +++ b/src/modules/mc_pos_control_multiplatform/mc_pos_control_params.c @@ -210,3 +210,32 @@ PX4_PARAM_DEFINE_FLOAT(MPC_TILTMAX_LND); */ PX4_PARAM_DEFINE_FLOAT(MPC_LAND_SPEED); +/** + * Max manual roll + * + * @unit deg + * @min 0.0 + * @max 90.0 + * @group Multicopter Attitude Control + */ +PX4_PARAM_DEFINE_FLOAT(MPC_MAN_R_MAX); + +/** + * Max manual pitch + * + * @unit deg + * @min 0.0 + * @max 90.0 + * @group Multicopter Attitude Control + */ +PX4_PARAM_DEFINE_FLOAT(MPC_MAN_P_MAX); + +/** + * Max manual yaw rate + * + * @unit deg/s + * @min 0.0 + * @group Multicopter Attitude Control + */ +PX4_PARAM_DEFINE_FLOAT(MPC_MAN_Y_MAX); + diff --git a/src/modules/mc_pos_control_multiplatform/mc_pos_control_params.h b/src/modules/mc_pos_control_multiplatform/mc_pos_control_params.h index fec3bcb7c..8c8b707ae 100644 --- a/src/modules/mc_pos_control_multiplatform/mc_pos_control_params.h +++ b/src/modules/mc_pos_control_multiplatform/mc_pos_control_params.h @@ -58,4 +58,7 @@ #define PARAM_MPC_TILTMAX_AIR_DEFAULT 45.0f #define PARAM_MPC_TILTMAX_LND_DEFAULT 15.0f #define PARAM_MPC_LAND_SPEED_DEFAULT 1.0f +#define PARAM_MPC_MAN_R_MAX_DEFAULT 35.0f +#define PARAM_MPC_MAN_P_MAX_DEFAULT 35.0f +#define PARAM_MPC_MAN_Y_MAX_DEFAULT 120.0f |