0
$\begingroup$

Rosanswers logo

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?


Originally posted by Karan Thakkar on ROS Answers with karma: 1 on 2012-09-14

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by dougbot01 with karma: 342 on 2012-09-16

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Lorenz on 2012-09-16:
Just a note: you can fill in the header from the command line. See here.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.