Skip to content

Commit

Permalink
fix: obstacle speed > 0 -> Abort Overtake
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliusMiller committed Jan 29, 2024
1 parent fbb42c4 commit fafa196
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/planning/src/behavior_agent/behaviours/overtake.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ def update(self):
else:
distance_lidar = None

obstacle_msg = self.blackboard.get("/paf/hero/collision")
if obstacle_msg is None:
return py_trees.common.Status.FAILURE

if distance_lidar is not None:
collision_distance = distance_lidar.data
if collision_distance > clear_distance:
Expand All @@ -230,6 +234,8 @@ def update(self):
rospy.loginfo("Overtake still blocked")
self.curr_behavior_pub.publish(bs.ot_wait_stopped.name)
return py_trees.commom.Status.RUNNING
elif obstacle_msg[1] > convert_to_ms(2):
return py_trees.common.Status.FAILURE
else:
rospy.loginfo("No Lidar Distance")
return py_trees.common.Success
Expand Down

0 comments on commit fafa196

Please sign in to comment.