Hello Team.
I tried to run the 2_tutorial_commonroad_search.ipynb
But I met this AttributeError when running code block 3.1
I got the same error. Did not get this error when using the Docker installation, but since I wanted to use Pycharm I used the local installation instructions. Then I got this error:
The whole error message I got
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-14-83826f179552> in <module>
3 planning_problem=planning_problem,
4 automaton=automaton,
----> 5 motion_planner_type=type_motion_planner)
~/Documents/cr2/commonroad-search/tutorials/2_commonroad_search/../../SMP/motion_planner/motion_planner.py in create(cls, scenario, planning_problem, automaton, plot_config, motion_planner_type)
76 try:
77 return cls.dict_motion_planners[motion_planner_type](scenario, planning_problem, automaton,
---> 78 plot_config=plot_config)
79 except KeyError:
80 raise cls.NoSuchMotionPlanner(f"MotionPlanner with type <{motion_planner_type}> does not exist.")
~/Documents/cr2/commonroad-search/tutorials/2_commonroad_search/../../SMP/motion_planner/search_algorithms/best_first_search.py in __init__(self, scenario, planningProblem, automaton, plot_config)
212 def __init__(self, scenario, planningProblem, automaton, plot_config=DefaultPlotConfig):
213 super().__init__(scenario=scenario, planningProblem=planningProblem, automaton=automaton,
--> 214 plot_config=plot_config)
215
216 if plot_config.SAVE_FIG:
~/Documents/cr2/commonroad-search/tutorials/2_commonroad_search/../../SMP/motion_planner/search_algorithms/best_first_search.py in __init__(self, scenario, planningProblem, automaton, plot_config)
22 def __init__(self, scenario, planningProblem, automaton, plot_config=DefaultPlotConfig):
23 super().__init__(scenario=scenario, planningProblem=planningProblem, automaton=automaton,
---> 24 plot_config=plot_config)
25 self.frontier = PriorityQueue()
26
~/Documents/cr2/commonroad-search/tutorials/2_commonroad_search/../../SMP/motion_planner/search_algorithms/base_class.py in __init__(self, scenario, planningProblem, automaton, plot_config)
91
92 # parse planning problem
---> 93 self.parse_planning_problem()
94 self.initialize_lanelets_costs()
95
~/Documents/cr2/commonroad-search/tutorials/2_commonroad_search/../../SMP/motion_planner/search_algorithms/base_class.py in parse_planning_problem(self)
114 # get lanelet id of the initial state
115 self.list_ids_lanelets_initial = self.scenario.lanelet_network.find_lanelet_by_position(
--> 116 [self.planningProblem.initial_state.position])[0]
117
118 # get lanelet id of the goal region, which can be of different types
~/anaconda3/envs/commonroad-py37/lib/python3.7/site-packages/commonroad/scenario/lanelet.py in find_lanelet_by_position(self, point_list)
1550 self._strtee.query(point) if
1551 lanelet_shapely_polygon.intersects(point) or lanelet_shapely_polygon.buffer(1e-15).intersects(point)]
-> 1552 for point in [ShapelyPoint(point) for point in point_list]]
1553
1554 def find_lanelet_by_shape(self, shape: Shape) -> List[int]:
~/anaconda3/envs/commonroad-py37/lib/python3.7/site-packages/commonroad/scenario/lanelet.py in <listcomp>(.0)
1550 self._strtee.query(point) if
1551 lanelet_shapely_polygon.intersects(point) or lanelet_shapely_polygon.buffer(1e-15).intersects(point)]
-> 1552 for point in [ShapelyPoint(point) for point in point_list]]
1553
1554 def find_lanelet_by_shape(self, shape: Shape) -> List[int]:
~/anaconda3/envs/commonroad-py37/lib/python3.7/site-packages/commonroad/scenario/lanelet.py in <listcomp>(.0)
1549 return [[self._get_lanelet_id_by_shapely_polygon(lanelet_shapely_polygon) for lanelet_shapely_polygon in
1550 self._strtee.query(point) if
-> 1551 lanelet_shapely_polygon.intersects(point) or lanelet_shapely_polygon.buffer(1e-15).intersects(point)]
1552 for point in [ShapelyPoint(point) for point in point_list]]
1553
AttributeError: 'numpy.int64' object has no attribute 'intersects'
If you or someone knows how to resolve it I would be very thankful!
EDIT: Solution: here
2 Likes