Skip to content

Commit

Permalink
fix ego vehicle overlap check
Browse files Browse the repository at this point in the history
  • Loading branch information
cjy1992 committed May 5, 2020
1 parent d73145b commit a642fbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gym_carla/envs/carla_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def _try_spawn_ego_vehicle_at(self, transform):
vehicle = None
# Check if ego position overlaps with surrounding vehicles
overlap = False
for idx, poly in self.vehicle_polygons[0].items():
for idx, poly in self.vehicle_polygons[-1].items():
poly_center = np.mean(poly, axis=0)
ego_center = np.array([transform.location.x, transform.location.y])
dis = np.linalg.norm(poly_center - ego_center)
Expand Down

0 comments on commit a642fbf

Please sign in to comment.