TypeError: 'NoneType' object has no attribute '__getitem__'

asked 2016-06-02 20:00:32 -0600

Zero gravatar image

updated 2016-06-02 20:22:58 -0600

Hi everyone,

I'm trying to test my Baxter robot arms by using IK in gazebo simulate, but when I run my code it will shows me :

TypeError: 'NoneType' object has no attribute '__getitem__'

The following is my code:

def main():
    rospy.init_node("test")
    kin_left=baxter_kinematics("left")
    kin_right=baxter_kinematics("right")
    limb_left=Limb("left")
    limb_right=Limb("right")
    angles= kin_right.inverse_kinematics((0.5,-0.3,0.1),(0.0,0.0,0.0,0.0))
    names=limb_right.joint_names()
    s1=list(angles[()])
    dic=dict(zip(names,s1))
    limb_right.move_to_joint_positions(dic)

if __name__ == '__main__':
    main()

the error msg shows that I was wrong with s1=list(angles[()])

anyone know how to fix it? Thank you so much! image description

edit retag flag offensive close merge delete