Skip to content

Commit

Permalink
feat: Collision detection pedestrians, bikes and more (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelkuehnel authored Mar 22, 2024
1 parent bfbce49 commit 12baf10
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 0 additions & 3 deletions code/planning/src/behavior_agent/behaviours/intersection.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@ def update(self):
self.virtual_stopline_distance = self.stop_distance
else:
self.virtual_stopline_distance = 0.0

rospy.loginfo(f"Stopline distance: {self.virtual_stopline_distance}")
rospy.loginfo(f"y-distance: {self.traffic_light_distance}")
target_distance = 5.0
# stop when there is no or red/yellow traffic light or a stop sign is
# detected
Expand Down
3 changes: 1 addition & 2 deletions code/planning/src/local_planner/motion_planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,6 @@ def __calc_speed_to_stop_intersection(self) -> float:
target_distance = 5.0
stopline = self.__calc_virtual_stopline()
# calculate speed needed for stopping
self.logerr(f"MP: {stopline}")
v_stop = max(convert_to_ms(10.),
convert_to_ms(stopline / 0.8))
if v_stop > bs.int_app_init.speed:
Expand Down Expand Up @@ -587,7 +586,7 @@ def __calc_speed_to_stop_overtake(self) -> float:
if stopline < 6.0:
v_stop = 0.0

self.logerr(f"Speed ovt: {v_stop}")
# self.logerr(f"Speed ovt: {v_stop}")
return v_stop

def __calc_virtual_change_point(self) -> float:
Expand Down
7 changes: 5 additions & 2 deletions code/planning/src/local_planner/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,11 @@ def filter_vision_objects(float_array, oncoming):
float_array = float_array[~np.any(np.isinf(float_array), axis=1), :]
if float_array.size == 0:
return None
# Filter out all objects that are not cars
all_cars = float_array[np.where(float_array[:, 0] == 2)]
# Filter out all objects that are not cars, Persons, Bycicles,
# Motorbikes, Busses or Trucks
all_cars = float_array[np.where(float_array[:, 0] <= 7)]
all_cars = all_cars[np.where(all_cars[:, 0] != 6)]
all_cars = all_cars[np.where(all_cars[:, 0] != 4)]

# Get cars that are on our lane
if oncoming:
Expand Down

0 comments on commit 12baf10

Please sign in to comment.