Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nearest_node = self.robot.node_manager.nodes_dict.nearest_neighbors(self.robot_location.tolist(), 1)[0] IndexError: list index out of range #1

Open
tqlblzj opened this issue Dec 19, 2024 · 3 comments

Comments

@tqlblzj
Copy link

tqlblzj commented Dec 19, 2024

Hi, thanks for your open source code, here i have a question, when i launch the code, the error is

Exception in thread Thread-8:
Traceback (most recent call last):
File "/home/dzt/anaconda3/envs/drl/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/timer.py", line 237, in run
self._callback(TimerEvent(last_expected, last_real, current_expected, current_real, last_duration))
File "/home/dzt/catkin_ws/ARiADNE-ROS-Planner/src/scripts/rl_planner.py", line 208, in run
nearest_node = self.robot.node_manager.nodes_dict.nearest_neighbors(self.robot_location.tolist(), 1)[0]
IndexError: list index out of range

This shows that at first there is no any way_point, can you help me solve it, thanks!!!

@caoyuhong001
Copy link
Contributor

This is because I assume the robot starts at (0,0) wrt to the map frame, where I initialize the quad tree. Could you check the start location of your robot? I guess you are using a customized environment.

@cbcbHH
Copy link

cbcbHH commented Jan 5, 2025

This is because I assume the robot starts at (0,0) wrt to the map frame, where I initialize the quad tree. Could you check the start location of your robot? I guess you are using a customized environment.

Hello, I have met the same problems; However, I used the same environment developed by CMU, where I changed the robot position from a random start. I have found that the problems were from the quad tree in quad.py, and I tried to initialize the tree from the start location of the robot, but it still showed the error "AttributeError: 'NoneType' object has no attribute 'data' ". Could you please help me to address this problem, thanks a lot !!! Appreciate your greatness.

@caoyuhong001
Copy link
Contributor

caoyuhong001 commented Jan 5, 2025

I have updated the code to support random starting locations as requst by @cbcbHH. You can try wheter it solves your issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants