gazebo & rviz synchronization

asked 2022-10-03 05:29:20 -0500

KRN.S gravatar image

updated 2022-10-30 09:26:06 -0500

lucasw gravatar image

I'm trying to synchronize robot movements in gazebo and rviz. My robot is 2 wheels differential mobile robot, and it can be moved (controlled) in gazebo via /cmd_vel. However, even when the robot moves in gazebo, not in rviz!

To solve this, I heard tf data should be published and tried to set gazebo publish joint state data of fixed joints (because joint state data of joints with actuator is published automatically). However, i got error saying Joint [joint name] doesn't exist!!. When i run gazebo with launch file even though the joints EXIST.

To set gazebo publish joint state data of fixed joints, I add lines below to the robot xacro file.

<plugin name="joint_state_publisher" filename="libgazebo_ros_joint_state_publisher.so">
  <jointName>chassis_joint, caster_joint</jointName>
</plugin>

In the launch file, this code is there:

<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>

How can I fix it?

edit retag flag offensive close merge delete