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

[Bugfix] Envision 0 length lane crash #1876

Merged
merged 3 commits into from
Feb 19, 2023
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Copy and pasting the git commit messages is __NOT__ enough.
- Made the heading input relative to the current heading in `RelativeTargetPose` action space.
### Deprecated
### Fixed
- Issue where a 0 length lane caused `envision` to crash.
- Fixed an issue where `Feature.type_specific_info` was calling a non-existant method.
### Removed
### Security

Expand Down
2 changes: 2 additions & 0 deletions envision/data_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ def _format_traffic_actor(obj, data_formatter: EnvisionDataFormatter):
for l_point in data_formatter.layer(obj.point_cloud):
data_formatter.add(l_point, op=Operation.FLATTEN)
for geo in data_formatter.layer(obj.mission_route_geometry):
if len(geo) == 0:
continue
for route_point in data_formatter.layer(geo):
data_formatter.add(route_point, op=Operation.FLATTEN)
assert type(obj.actor_type) is TrafficActorType
Expand Down
2 changes: 1 addition & 1 deletion smarts/core/sumo_road_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ def type_specific_info(self) -> Optional[Any]:
# the only type we currently handle is FIXED_LOC_SIGNAL
in_lane, to_lane, _ = self._feat_data
via_id = in_lane.getConnection(to_lane).getViaLaneID()
return self.lane_by_id(via_id)
return self._map.lane_by_id(via_id)

def min_dist_from(self, point: Point) -> float:
return np.linalg.norm(self.geometry[0].as_np_array - point.as_np_array)
Expand Down