CommonRoad / commonroad-reactive-planner

A sampling-based motion planner for autonomous vehicles using quintic polynomials in a Frenet frame
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

AttributeError: 'Scenario' object has no attribute 'find_lanelet_by_position' #2

Closed ZhaiMen-Hub closed 4 months ago

ZhaiMen-Hub commented 4 months ago

An AttributeError occurs when launching python run_planner.py

The error message is as follows


  (commonroadPyPi) ➜  commonroad-reactive-planner git:(master) python run_planner.py
  Traceback (most recent call last):
    File "run_planner.py", line 43, in <module>
      route_planner = RoutePlanner(config.scenario, config.planning_problem)
    File "/home/robotics/miniconda3/envs/commonroadPyPi/lib/python3.8/site-packages/commonroad_route_planner/route_planner.py", line 92, in __init__
      self._init_lanelet_ids_for_start_and_overtake()
    File "/home/robotics/miniconda3/envs/commonroadPyPi/lib/python3.8/site-packages/commonroad_route_planner/route_planner.py", line 260, in _init_lanelet_ids_for_start_and_overtake
      self._lanelet_network.find_lanelet_by_position([initial_state.position])[0]
  AttributeError: 'Scenario' object has no attribute 'find_lanelet_by_position'
ZhaiMen-Hub commented 4 months ago

It seems that the reason is the version of commonroad-route-planner is too high.

The requirement.txt only required >=2024.1.1, hence pip will install the 2024.2.0 version (i.e. the newest version). Running pip install commonroad-route-planner==2024.1.1 can solve this problem.

lihu2022 commented 2 months ago

hey,bro.Thank you for providing this debug method, but i am little interesting that how do you know this bug you mentioned is version mistake.I try lot of method but not success to solve this bug.