mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-07-24 15:27:41 +08:00
revert(fw_mode_manager): drop GUIDED_COURSE guard on course setpoints
Reverts the hotfix from #27487. The navigator now guarantees the course field is NaN unless Course mode explicitly commands it, so PX4_ISFINITE(course) is again a sufficient trigger for course guidance. Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
@@ -574,8 +574,7 @@ FixedWingModeManager::control_auto(const float control_interval, const Vector2d
|
||||
move_position_setpoint_for_vtol_transition(current_sp);
|
||||
|
||||
// Course setpoints are handled directly to avoid entering hold mode
|
||||
if (PX4_ISFINITE(current_sp.course)
|
||||
&& _vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_GUIDED_COURSE) {
|
||||
if (PX4_ISFINITE(current_sp.course)) {
|
||||
control_auto_position(control_interval, curr_pos, ground_speed, pos_sp_prev, current_sp);
|
||||
return;
|
||||
}
|
||||
@@ -779,8 +778,7 @@ FixedWingModeManager::control_auto_position(const float control_interval, const
|
||||
const Vector2f &ground_speed, const position_setpoint_s &pos_sp_prev, const position_setpoint_s &pos_sp_curr)
|
||||
{
|
||||
// Course Hold: if a course is explicitly set, navigate along that bearing (ground track)
|
||||
if (PX4_ISFINITE(pos_sp_curr.course)
|
||||
&& _vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_GUIDED_COURSE) {
|
||||
if (PX4_ISFINITE(pos_sp_curr.course)) {
|
||||
const float target_airspeed = pos_sp_curr.cruising_speed > FLT_EPSILON ? pos_sp_curr.cruising_speed : NAN;
|
||||
|
||||
const Vector2f curr_pos_local{_local_pos.x, _local_pos.y};
|
||||
|
||||
Reference in New Issue
Block a user