Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed agent crashes due to API changes in is_within_distance_ahead #2386

Merged
merged 1 commit into from
Jan 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
10 changes: 4 additions & 6 deletions PythonAPI/carla/agents/navigation/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ def _is_light_red_europe_style(self, lights_list):
object_waypoint.lane_id != ego_vehicle_waypoint.lane_id:
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 +183,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