Ask Your Question

Publishing to topic /joint_angles

asked 2012-09-14 20:42:57 -0500

Karan Thakkar gravatar image

updated 2012-09-14 22:03:55 -0500

I was unsure about how to publish a message to joint_angles topic. These are the commands which I have run till now, all in different terminals:


~/naoqi/naoqi-sdk-1.12.5-linux32/naoqi --verbose --broker-ip

roslaunch nao_description nao_state_publisher.launch

roslaunch nao_driver nao_driver_sim.launch

rosrun rviz rviz

rostopic pub -1 /cmd_vel geometry_msgs/Twist '{linear: {x: 1.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}}'

After I run all these I can see the Nao model walking in the RViz window. What I wanted was to see different joint movements and I figured I'll have to publish a message to /joint_angles. So I tried this:

rostopic pub -1 /joint_angles nao_msgs/JointAnglesWithSpeed -- '' 'HeadYaw' 2.0 0.5 1

But I got an invalid msg_args error. So obviously I dont know how to publish a message. Any help on how to do that?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-09-16 20:29:02 -0500

updated 2012-09-16 20:30:09 -0500

I see that what you're trying to publish is a rather complex message type

I am not sure if you can publish a topic like this on the command line, since it has a header. However, ignoring the header, the next two arguments are arrays, so if this works:

rostopic pub -1 /joint_angles nao_msgs/JointAnglesWithSpeed -- '' ['HeadYaw'] [2.0] 0.5 1

If that doesn't work, take a look at this link and see if it helps :

If those both do not work, then you might want to try writing a ROS node that publishes these messages instead.

edit flag offensive delete link more


Just a note: you can fill in the header from the command line. See here.

Lorenz gravatar image Lorenz  ( 2012-09-16 21:50:17 -0500 )edit

answered 2012-09-17 00:18:09 -0500

Karan Thakkar gravatar image

@doughbot01 this works for me:

rostopic pub -1 /joint_angles nao_msgs/JointAnglesWithSpeed '{header: {frame_id: "test", seq: 200}, joint_names: ["LAnklePitch", "RAnklePitch"], joint_angles: [0, 0], speed: 1}'

But its pretty clumsy.

Also, this does, like from the link @Lorenz pointed out:

rostopic pub -1 /joint_angles nao_msgs/JointAnglesWithSpeed '{header: auto, joint_names: ["LAnklePitch", "RAnklePitch"], joint_angles: [0, 0], speed: 1}'

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2012-09-14 20:42:57 -0500

Seen: 2,009 times

Last updated: Sep 17 '12