Robotics StackExchange | Archived questions

How to move the robot both in gazebo and rviz?

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?

Asked by stefanvan on 2018-03-29 23:07:55 UTC

Comments

Is this not a duplicate of #q286866?

Asked by gvdhoorn on 2018-03-30 01:38:08 UTC

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

Asked by stefanvan on 2018-03-30 03:42:18 UTC

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

Asked by jayess on 2018-03-30 11:51:32 UTC

@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.

Asked by stefanvan on 2018-03-31 05:03:00 UTC

Answers

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

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

Asked by ARB on 2018-03-30 10:00:08 UTC

Comments

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

Asked by stefanvan on 2018-04-06 22:05:26 UTC