ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

How to move the robot both in gazebo and rviz?

asked 2018-03-29 23:07:55 -0500

stefanvan gravatar image

Hi everyone, I can make my robot move on gazebo by posting a twist message on cmd_vel. What should I do if I want the robot to move simultaneously in rviz?

edit retag flag offensive close merge delete


Is this not a duplicate of #q286866?

gvdhoorn gravatar image gvdhoorn  ( 2018-03-30 01:38:08 -0500 )edit

Yes, it is, sir. I just simplify the question and post it again.

stefanvan gravatar image stefanvan  ( 2018-03-30 03:42:18 -0500 )edit

@jn-chen instead of posting a duplicate question, next time just edit your question.

jayess gravatar image jayess  ( 2018-03-30 11:51:32 -0500 )edit

@jayess I am not that familiar with the using of this Q&A forum, just forgot the edit thing when I post this question. After receiving your suggestion, I'll just do so next time.

stefanvan gravatar image stefanvan  ( 2018-03-31 05:03:00 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-30 10:00:08 -0500

ARB gravatar image

Add this to your launch file

<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
        <param name="/use_gui" value="false"/>
        <rosparam param="/source_list">[/your_robot_name/joint_states]</rosparam>

gazebo publishes the joint states to /robotname/joint_states topic and rviz listens to /joint_states topic.

source list param takes the values from /robotname/joint_states and publishes to /joint_states

edit flag offensive delete link more


I just imitate this repo and then robot can move both in rviz and gazebo simultaneously. Thank you!

stefanvan gravatar image stefanvan  ( 2018-04-06 22:05:26 -0500 )edit

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: 2018-03-29 23:07:55 -0500

Seen: 1,360 times

Last updated: Mar 30 '18