Skip to content

Commit

Permalink
Fixed agent crashes due to API changes in is_within_distance_ahead
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianoboril committed Jan 22, 2020
1 parent 7bd95e4 commit 5e84608
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* New python clients:
- `weather.py`: allows weather changes using the new weather parameters
* Fixed typos
* Fixed agent failures due to API changes in is_within_distance_ahead()

## CARLA 0.9.7
* Upgraded parameters of Unreal/CarlaUE4/Config/DefaultInput.ini to prevent mouse freeze
Expand Down
9 changes: 4 additions & 5 deletions PythonAPI/carla/agents/navigation/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def _is_light_red_europe_style(self, lights_list):
continue

loc = traffic_light.get_location()
if is_within_distance_ahead(loc, ego_vehicle_location,
self._vehicle.get_transform().rotation.yaw,
if is_within_distance_ahead(traffic_light.get_transform(),
self._vehicle.get_transform(),
self._proximity_threshold):
if traffic_light.state == carla.TrafficLightState.Red:
return (True, traffic_light)
Expand Down Expand Up @@ -184,9 +184,8 @@ def _is_vehicle_hazard(self, vehicle_list):
target_vehicle_waypoint.lane_id != ego_vehicle_waypoint.lane_id:
continue

loc = target_vehicle.get_location()
if is_within_distance_ahead(loc, ego_vehicle_location,
self._vehicle.get_transform().rotation.yaw,
if is_within_distance_ahead(target_vehicle.get_transform(),
self._vehicle.get_transform(),
self._proximity_threshold):
return (True, target_vehicle)

Expand Down

0 comments on commit 5e84608

Please sign in to comment.