sanchithaseshadri / PathPlanningAstar

An implementation of a mobile robot path planner in Python and ROS
74 stars 23 forks source link

IndexError: list assignment index out of range #3

Open Algabri opened 4 years ago

Algabri commented 4 years ago

/usr/bin/python2.7 /home/redhwan/1/PathPlanningAstar-master/astar.py building map.... Traceback (most recent call last): File "/home/redhwan/1/PathPlanningAstar-master/astar.py", line 133, in planner.plan() File "/home/redhwan/1/PathPlanningAstar-master/astar.py", line 32, in plan final = a_star(self.start, self.goal, self.map) File "/home/redhwan/1/PathPlanningAstar-master/astar.py", line 86, in a_star if not end.is_valid(grid_map): File "/home/redhwan/1/PathPlanningAstar-master/node.py", line 65, in is_valid goal_pixel = world_to_pixel((self.x, self.y), (608, 1280)) File "/home/redhwan/1/PathPlanningAstar-master/transformations.py", line 12, in world_to_pixel pixel_points[0] = int(max((world_x / MAP_WIDTH) * img_w, 0)) IndexError: list assignment index out of range map built. planner initialized

Process finished with exit code 1

ErenKaymakci commented 3 years ago

I got the same error. Did you fix that ? @Algabri

Algabri commented 3 years ago

@ErenKaymakci Sorry, I do not remember, but I did not use it in my work.

Zachary19980701 commented 3 years ago

before "/home/redhwan/1/PathPlanningAstar-master/transformations.py", line 12, in world_to_pixel pixel_points[0] = int(max((world_x / MAP_WIDTH) * img_w, 0))

the assignment pixel_point = [] is wrong . I use "pixel_point = np.zeros(2)"