ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

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:

roscore

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

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
2

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 http://ros.org/doc/api/nao_msgs/html/msg/JointAnglesWithSpeed.html

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 : http://answers.ros.org/question/10244/publish-arrays-to-a-topic-on-the-command-line/

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

Comments

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
0

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

Question Tools

2 followers

Stats

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

Seen: 2,310 times

Last updated: Sep 17 '12