Ask Your Question
2

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.

Hello,

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?

Thanks,

Mike

edit retag flag offensive close merge delete

Comments

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 imageE1000ii ( 2013-09-20 00:17:03 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
4

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>
</node>

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

Comments

1

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 imageVictorLamoine ( 2016-12-19 03:52:41 -0500 )edit

from where you get joint state for a real robot?

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

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
0

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

Your Answer

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

Add Answer

Question Tools

Stats

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

Seen: 2,724 times

Last updated: Jul 22 '15