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

Subscribe to new JointState messages

asked 2013-04-17 12:10:31 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.


I'm new in ROS and have a problem making the joint_state_publisher publish JointState messages on a topic different from /joint_states. I wanted to publish arbitrary joint states from the terminal window and therefore I intended to use the source list parameter in my launch file as proposed here in the joint_state_publisher Package Summary.

But I cannot make it work by adding the parameter to my .launch file. I tried something like

\param name="source_list" value="joint_states_test" type="str"/>

What do I have to do in order to make it work?



edit retag flag offensive close merge delete


I have the same problem. But i think quest must be edited to change the beggining of the question in order to make clear. what is intended is to use the imput option for joint_state_publiser to take messages from an arbitrari topic and republish them in /joint_states. Title is not veri descriptive

E1000ii gravatar image E1000ii  ( 2013-09-20 00:17:03 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2013-09-20 04:53:10 -0500

E1000ii gravatar image

Now is an old thread. But i answer anyway for the next noob like that could end up here.

To pass list parameters to a nodes you should use the tag 'rosparam' instead of 'param'. You could see how to use it here.

On my launch file the joint_state_publisher looks like that:

<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
    <rosparam param="source_list">["my_controller/robot/joint_states"]</rosparam>

It worked and I'm now visualizing on rviz my real robol state. Note that you could put whatever you want instead of my_controller/robot/joint_states.

edit flag offensive delete link more



And if you want to test this, try something like:

rostopic pub my_controller/robot/joint_states sensor_msgs/JointState '{header: {seq: 0, stamp: {secs: 0, nsecs: 0}, frame_id: ""}, name: ["the_urdf_joint_name"], position: [1.0], velocity: [0.0], effort: [0.0]}' --once
VictorLamoine gravatar image VictorLamoine  ( 2016-12-19 03:52:41 -0500 )edit

from where you get joint state for a real robot?

marawy_alsakaf gravatar image marawy_alsakaf  ( 2017-11-13 04:21:25 -0500 )edit

answered 2013-04-17 22:42:08 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I tried to use remap, but it only changes the topic the joint_state_publisher publishes on. I still cannot publish anything via terminal as the topic is blocked. I think I should make the robot_state_publisher subscribe to another topic - how??

edit flag offensive delete link more

answered 2013-04-17 12:24:56 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

You should use a remap argument.

edit flag offensive delete link more

Question Tools


Asked: 2013-04-17 12:10:31 -0500

Seen: 4,015 times

Last updated: Jul 22 '15