zhm-real / MotionPlanning

Motion planning algorithms commonly used on autonomous vehicles. (path planning + path tracking)
https://github.com/zhm-real/MotionPlanning
2.04k stars 558 forks source link

Issue when loading custom reference path on lattice_planner.py #4

Closed namKolorfuL closed 2 years ago

namKolorfuL commented 2 years ago

Hi , I am studying autonomous driving and used your MotionPlanning repo as a reference. I encounter some issue with lattice_planner as I tried to load a route generated from OpenStreetMap as reference line. I have converted the route’s lat and long to a range from 0 to 100 so I can load to the planner. The path that I loaded to the planner looks like this: image and then I got this error

Traceback (most recent call last):
  File "c:/Users/nam/Desktop/MotionPlanning-master/LatticePlanner/lattice_planner.py", line 433, in <module>
    main_Crusing()
  File "c:/Users/nam/Desktop/MotionPlanning-master/LatticePlanner/lattice_planner.py", line 335, in main_Crusing
    path = lattice_planner_for_Cruising(l0, l0_v, l0_a, s0, s0_v, s0_a, ref_path)
  File "c:/Users/nam/Desktop/MotionPlanning-master/LatticePlanner/lattice_planner.py", line 265, in lattice_planner_for_Cruising
    path = extract_optimal_path(paths)
  File "c:/Users/nam/Desktop/MotionPlanning-master/LatticePlanner/lattice_planner.py", line 260, in extract_optimal_path
    return paths[-1]
KeyError: -1

I havent managed to fix this, please help me out! Thanks