Global planner does not work for latest dataset

Hi, I used the global planner to plan the route for the scenarios from NuPlan Graph Dataset: Boston, but an error occurred as

  File "/home/jidan/irl_planner/src/commonroad_interface/global_planner.py", line 50, in plan_global_route
    route = candidate_holder.retrieve_best_route_by_orientation()
  File "/home/jidan/anaconda3/envs/cr/lib/python3.10/site-packages/commonroad_route_planner/route.py", line 394, in retrieve_best_route_by_orientation
    list_ids_lanelets_goal_sorted = sort_lanelet_ids_by_goal(self.lanelet_network, self.goal_region)
  File "/home/jidan/anaconda3/envs/cr/lib/python3.10/site-packages/commonroad_route_planner/utility/route.py", line 193, in sort_lanelet_ids_by_goal
    return sort_lanelet_ids_by_orientation(lanelet_network.find_lanelet_by_shape(goal_shape), goal_orientation,
  File "/home/jidan/anaconda3/envs/cr/lib/python3.10/site-packages/commonroad/scenario/lanelet.py", line 1566, in find_lanelet_by_shape
    return [self._get_lanelet_id_by_shapely_polygon(lanelet_shapely_polygon) for lanelet_shapely_polygon in
  File "/home/jidan/anaconda3/envs/cr/lib/python3.10/site-packages/commonroad/scenario/lanelet.py", line 1567, in <listcomp>
    self._strtee.query(shape.shapely_object) if lanelet_shapely_polygon.intersects(shape.shapely_object)]
AttributeError: 'numpy.int64' object has no attribute 'intersects'

But this planner worked well with scenarios like those begin with ‘DEU’. Can someone help with this? Thank you!

Hi @J1dan ,

could you check the numpy version and (if necessary) upgrade to numpy>=1.21.6 ? We found that this issue could occur sometime with older versions of numpy. In the requirements file of CommonRoad-Search we therefore added this (requirements.txt · master · tum-cps / commonroad-search · GitLab). Hope this helps!

Best,
Gerald

1 Like

I was trying to set up the toolbox and wasn’t able to run the sample code in Tutorial: Reachable Set Computation due to the same error. Traced it down to shapely.strtree.STRtree.query returning np.array([0]) in commonroad/scenario/lanelet.py::1567. Downgrading shapely from 2.0.1 to 1.7.0 resolved the issue for me. I am using numpy 1.24.2.

P.S.: Perhaps requirements.txt should be adjusted? @gerald_w

1 Like