mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 11:11:38 +08:00
FW Position Controller: mini fw_control_yaw_wheel refactoring
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -273,13 +273,9 @@ void FixedwingAttitudeControl::Run()
|
|||||||
|
|
||||||
vehicle_land_detected_poll();
|
vehicle_land_detected_poll();
|
||||||
|
|
||||||
// the position controller will not emit attitude setpoints in some modes
|
|
||||||
// we need to make sure that this flag is reset
|
|
||||||
_att_sp.fw_control_yaw_wheel = _att_sp.fw_control_yaw_wheel && _vcontrol_mode.flag_control_auto_enabled;
|
|
||||||
|
|
||||||
bool wheel_control = false;
|
bool wheel_control = false;
|
||||||
|
|
||||||
if (_param_fw_w_en.get() && _att_sp.fw_control_yaw_wheel) {
|
if (_param_fw_w_en.get() && _att_sp.fw_control_yaw_wheel && _vcontrol_mode.flag_control_auto_enabled) {
|
||||||
wheel_control = true;
|
wheel_control = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,6 +415,12 @@ void FixedwingAttitudeControl::Run()
|
|||||||
} else {
|
} else {
|
||||||
// full manual
|
// full manual
|
||||||
_wheel_ctrl.reset_integrator();
|
_wheel_ctrl.reset_integrator();
|
||||||
|
|
||||||
|
_landing_gear_wheel.normalized_wheel_setpoint = PX4_ISFINITE(_manual_control_setpoint.yaw) ?
|
||||||
|
_manual_control_setpoint.yaw : 0.f;
|
||||||
|
_landing_gear_wheel.timestamp = hrt_absolute_time();
|
||||||
|
_landing_gear_wheel_pub.publish(_landing_gear_wheel);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1338,8 +1338,9 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// tune up the lateral position control guidance when on the ground
|
// tune up the lateral position control guidance when on the ground
|
||||||
if (_att_sp.fw_control_yaw_wheel) {
|
if (_runway_takeoff.controlYaw()) {
|
||||||
_npfg.setPeriod(_param_rwto_npfg_period.get());
|
_npfg.setPeriod(_param_rwto_npfg_period.get());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Vector2f start_pos_local = _global_local_proj_ref.project(_runway_takeoff.getStartPosition()(0),
|
const Vector2f start_pos_local = _global_local_proj_ref.project(_runway_takeoff.getStartPosition()(0),
|
||||||
|
|||||||
Reference in New Issue
Block a user