Mastering ROS for Robotics Programming(Second Edition)
上QQ阅读APP看书,第一时间看更新

Adding joint state publishers in the launch file

After adding the differential drive plugin, we need to join state publishers to the existing launch file, or we can build a new one. You can see the new final launch file, diff_wheeled_gazebo_full.launc , in diff_wheeled_robot_gazebo/launch.

The launch file contains joint state publishers, which help to visualize in RViz. Here are the extra lines added in this launch file for the joint state publishing:

  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" ></node>  
  <!-- start robot state publisher --> 
  <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen" > 
    <param name="publish_frequency" type="double" value="50.0" /> 
  </node>