mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 11:33:34 +08:00
manual_control_setpoint: change stick axes naming
In review it was requested to have a different name for manual_control_setpoint.z because of the adjusted range. I started to investigate what naming is most intuitive and found that most people recognize the stick axes as roll, pitch, yaw, throttle. It comes at no surprise because other autopilots and APIs seem to share this convention. While changing the code I realized that even within the code base the axes are usually assigned to a variable with that name or have comments next to the assignment clarifying the axes using these names.
This commit is contained in:
@@ -173,12 +173,12 @@ MulticopterRateControl::Run()
|
||||
if (_manual_control_setpoint_sub.update(&manual_control_setpoint)) {
|
||||
// manual rates control - ACRO mode
|
||||
const Vector3f man_rate_sp{
|
||||
math::superexpo(manual_control_setpoint.y, _param_mc_acro_expo.get(), _param_mc_acro_supexpo.get()),
|
||||
math::superexpo(-manual_control_setpoint.x, _param_mc_acro_expo.get(), _param_mc_acro_supexpo.get()),
|
||||
math::superexpo(manual_control_setpoint.r, _param_mc_acro_expo_y.get(), _param_mc_acro_supexpoy.get())};
|
||||
math::superexpo(manual_control_setpoint.roll, _param_mc_acro_expo.get(), _param_mc_acro_supexpo.get()),
|
||||
math::superexpo(-manual_control_setpoint.pitch, _param_mc_acro_expo.get(), _param_mc_acro_supexpo.get()),
|
||||
math::superexpo(manual_control_setpoint.yaw, _param_mc_acro_expo_y.get(), _param_mc_acro_supexpoy.get())};
|
||||
|
||||
_rates_setpoint = man_rate_sp.emult(_acro_rate_max);
|
||||
_thrust_setpoint(2) = -(manual_control_setpoint.z + 1.f) * .5f;
|
||||
_thrust_setpoint(2) = -(manual_control_setpoint.throttle + 1.f) * .5f;
|
||||
_thrust_setpoint(0) = _thrust_setpoint(1) = 0.f;
|
||||
|
||||
// publish rate setpoint
|
||||
|
||||
Reference in New Issue
Block a user