I have a bunch of scenarios where obstacles only appear half way into the scenario, i.e. whose initial_state
timestamp is > 0. In these cases, I’m getting the following error when trying to evaluate criticality:
File ~/dev/atks/deeptest/venv3.9/lib/python3.9/site-packages/commonroad_crime/utility/general.py:101, in check_in_same_lanelet(lanelet_network, vehicle_1, vehicle_2, time_step)
91 def check_in_same_lanelet(
92 lanelet_network: LaneletNetwork,
93 vehicle_1: DynamicObstacle,
94 vehicle_2: Union[DynamicObstacle, StaticObstacle],
95 time_step: int,
96 ):
97 lanelets_1 = lanelet_network.find_lanelet_by_shape(
98 vehicle_1.occupancy_at_time(time_step).shape
99 )
100 lanelets_2 = lanelet_network.find_lanelet_by_shape(
--> 101 vehicle_2.occupancy_at_time(time_step).shape
102 )
103 return len(set(lanelets_1).intersection(lanelets_2)) > 0
AttributeError: 'NoneType' object has no attribute 'shape'
Could somebody please help me with this?