mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
ObstacleAvoidance: do not check for loiter nav state twice
This commit is contained in:
committed by
bresch
parent
0dab5d3a11
commit
6f5c97f184
@@ -97,9 +97,8 @@ void ObstacleAvoidance::injectAvoidanceSetpoints(Vector3f &pos_sp, Vector3f &vel
|
||||
> TRAJECTORY_STREAM_TIMEOUT_US;
|
||||
const bool avoidance_point_valid =
|
||||
_sub_vehicle_trajectory_waypoint->get().waypoints[vehicle_trajectory_waypoint_s::POINT_0].point_valid == true;
|
||||
const bool is_loitering = _sub_vehicle_status->get().nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_LOITER;
|
||||
|
||||
if ((avoidance_data_timeout || !avoidance_point_valid) && !is_loitering) {
|
||||
if (avoidance_data_timeout || !avoidance_point_valid) {
|
||||
PX4_WARN("Obstacle Avoidance system failed, loitering");
|
||||
_publishVehicleCmdDoLoiter();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user