mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 02:03:33 +08:00
msg: re-use manual_control_input in setpoint
This way we avoid duplication between manual_control_input and manual_control_setpoint.
This commit is contained in:
committed by
Matthias Grob
parent
baf81abbab
commit
6a6b8d49fc
@@ -2420,8 +2420,8 @@ Commander::run()
|
||||
}
|
||||
|
||||
_status.rc_signal_lost = false;
|
||||
_is_throttle_above_center = manual_control_setpoint.z > 0.6f;
|
||||
_is_throttle_low = manual_control_setpoint.z < 0.1f;
|
||||
_is_throttle_above_center = manual_control_setpoint.chosen_input.z > 0.6f;
|
||||
_is_throttle_low = manual_control_setpoint.chosen_input.z < 0.1f;
|
||||
_last_valid_manual_control_setpoint = manual_control_setpoint.timestamp;
|
||||
|
||||
} else {
|
||||
|
||||
@@ -85,15 +85,15 @@ int do_trim_calibration(orb_advert_t *mavlink_log_pub)
|
||||
/* set parameters: the new trim values are the combination of active trim values
|
||||
and the values coming from the remote control of the user
|
||||
*/
|
||||
float p = manual_control_setpoint.y * roll_scale + roll_trim_active;
|
||||
float p = manual_control_setpoint.chosen_input.y * roll_scale + roll_trim_active;
|
||||
int p1r = param_set(param_find("TRIM_ROLL"), &p);
|
||||
/*
|
||||
we explicitly swap sign here because the trim is added to the actuator controls
|
||||
which are moving in an inverse sense to manual pitch inputs
|
||||
*/
|
||||
p = -manual_control_setpoint.x * pitch_scale + pitch_trim_active;
|
||||
p = -manual_control_setpoint.chosen_input.x * pitch_scale + pitch_trim_active;
|
||||
int p2r = param_set(param_find("TRIM_PITCH"), &p);
|
||||
p = manual_control_setpoint.r * yaw_scale + yaw_trim_active;
|
||||
p = manual_control_setpoint.chosen_input.r * yaw_scale + yaw_trim_active;
|
||||
int p3r = param_set(param_find("TRIM_YAW"), &p);
|
||||
|
||||
if (p1r != 0 || p2r != 0 || p3r != 0) {
|
||||
|
||||
Reference in New Issue
Block a user