Adding the laser scanner to Gazebo

We add the laser scanner on the top of Gazebo to perform high-end operations, such as autonomous navigation or map creation using this robot. Here, we should add the following extra code section to diff_wheeled_robot.xacro to add the laser scanner to the robot:

 <link name="hokuyo_link"> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <box size="${hokuyo_size} ${hokuyo_size} ${hokuyo_size}"/> </geometry> <material name="Blue" /> </visual> </link> <joint name="hokuyo_joint" type="fixed"> <origin xyz="${base_radius - hokuyo_size/2} 0 ${base_height+hokuyo_size/4}" rpy="0 0 0" /> <parent link="base_link"/> <child link="hokuyo_link" /> </joint> <gazebo reference="hokuyo_link"> <material>Gazebo/Blue</material> ...

Get Mastering ROS for Robotics Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.