mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-20 11:19:05 +08:00
mc_pos_control: enable obstacle avoidance only in mission and rtl
This commit is contained in:
parent
f42095af8f
commit
492e40a139
@ -3495,9 +3495,11 @@ MulticopterPositionControl::use_obstacle_avoidance()
|
||||
{
|
||||
|
||||
/* check that external obstacle avoidance is sending data and that the first point is valid */
|
||||
return (_test_obstacle_avoidance.get() && (hrt_elapsed_time((hrt_abstime *)&_traj_wp_avoidance.timestamp) <
|
||||
TRAJECTORY_STREAM_TIMEOUT_US)
|
||||
&& (_traj_wp_avoidance.waypoints[vehicle_trajectory_waypoint_s::POINT_0].point_valid == true));
|
||||
return (_test_obstacle_avoidance.get()
|
||||
&& (hrt_elapsed_time((hrt_abstime *)&_traj_wp_avoidance.timestamp) < TRAJECTORY_STREAM_TIMEOUT_US)
|
||||
&& (_traj_wp_avoidance.waypoints[vehicle_trajectory_waypoint_s::POINT_0].point_valid == true)
|
||||
&& ((_vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_MISSION) ||
|
||||
(_vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_RTL)));
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user