From dec5e7e9c842bf631d3778c96417e7bf603bf294 Mon Sep 17 00:00:00 2001 From: Jaeyoung-Lim Date: Wed, 19 Jan 2022 11:57:55 +0100 Subject: [PATCH] Publish orbit status whenever the vehicle is in loiter This commit moves the publish orbit status to be published whenever the vehicle is considering a loiter setpoint --- src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp index 6b79350f98..235f6ab159 100644 --- a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp +++ b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp @@ -843,10 +843,6 @@ FixedwingPositionControl::control_auto(const hrt_abstime &now, const Vector2d &c _att_sp.pitch_reset_integral = false; _att_sp.yaw_reset_integral = false; - if (pos_sp_curr.valid && pos_sp_curr.type == position_setpoint_s::SETPOINT_TYPE_LOITER) { - publishOrbitStatus(pos_sp_curr); - } - position_setpoint_s current_sp = pos_sp_curr; if (_vehicle_status.in_transition_to_fw) { @@ -893,6 +889,8 @@ FixedwingPositionControl::control_auto(const hrt_abstime &now, const Vector2d &c case position_setpoint_s::SETPOINT_TYPE_LOITER: control_auto_loiter(now, dt, curr_pos, ground_speed, pos_sp_prev, current_sp, pos_sp_next); + publishOrbitStatus(pos_sp_curr); + break; case position_setpoint_s::SETPOINT_TYPE_LAND: