Controlling NAO's joints using actionlib with nao_controller
Hello, I am new to both the NAO ROS package and actionlib, and I am trying to test if I can control the NAO's joints using the action goals in nao_controller. I would like an example of how to form the goal object that is sent to the robot, i.e.:
client = actionlib.SimpleActionClient('joint_trajectory', JointTrajectoryAction)
client.wait_for_server()
goal = ???
client.send_goal(goal)
client.wait_for_result()
Here is what I have been doing:
jt = JointAngleTrajectory()
jt.joint_names = ["HeadYaw", "HeadPitch"]
jt.joint_angles = [0, 0]
jt.times = [0.5, 0.5]
jtg = JointTrajectoryGoal()
jtg.trajectory = jt
jtag = JointTrajectoryActionGoal()
jtag.goal = jtg
client.send_goal(jtag)
But this gets me the error:
AttributeError: 'JointTrajectoryActionGoal' object has no attribute 'trajectory'
Could someone who has used nao_controller and/or actionlib before please clue me in on how to form this goal object? It would be nice to have an example to generalize to other goals in nao_controller like JointAnglesWithSpeedActionGoal.