diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f8dea3fce..dee090a085 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/envision/data_formatter.py b/envision/data_formatter.py index 4c08eb1a67..7a37b624ee 100644 --- a/envision/data_formatter.py +++ b/envision/data_formatter.py @@ -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 diff --git a/smarts/core/sumo_road_network.py b/smarts/core/sumo_road_network.py index da3420e089..20262706c2 100644 --- a/smarts/core/sumo_road_network.py +++ b/smarts/core/sumo_road_network.py @@ -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)