Can somebody help me with IndexError problem?

asked 2019-02-26 05:23:12 -0500

Richard Christo gravatar image

updated 2019-02-26 05:51:25 -0500

gvdhoorn gravatar image

Hello, right now i am doing my project which is a 3 d printed arm robot and connected to my laptop using USB2dynamixel. I want to control this robot using MoveIt, but everytime I want to launch the robot_state.launch, this error always comes up

[ERROR] [1551179662.216765]: bad callback: <function process at 0x7f2f64be3488>
Traceback (most recent call last):

File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
File "/home/richard/robot_ws/src/dxl_tutorial/scripts/state_publisher.py", line 37, in process
    joint_states.position.append((x.position-offset[x.id-1])*(300.0/1023)*(pi/180))
IndexError: list index out of range

I have already checked the state_publisher.py, but it seems like there is nothing wrong there. Can somebody please give some advice? I am also new to ROS.

edit retag flag offensive close merge delete