Explaining the simulation code
The sensor_sim_gazebo
package has the following list of files for simulating all self-driving car sensors. Here is the directory structure of this package:
Figure 17: List of files in sensor_sim_gazebo
To simulate a laser, launch the laser.launch
file; similarly, to start simulating the IMU, GPS, and camera, launch the corresponding launch files. Inside URDF, you can see the Gazebo plugin definition for each sensor. The sensor.xacro
file is the orange box definition that you saw in the preceding simulation. It is just a box for visualizing a sensor model. We are using this model for representing all the sensors inside this package. You can use your own model instead of this, too.
The laser.xacro
file has the Gazebo plugin definition of the laser, as shownhere:
<gazebo reference="sensor"> <sensor type="ray" name="head_hokuyo_sensor"> <pose>0 0 0 0 0 0</pose> <visualize...