Simulating GPS in Gazebo

In this section, we will see how to simulate a GPS sensor in Gazebo. As you know, GPS is one of the essential sensors in a self-driving car. You can start a GPS simulation using the following command:

$ roslaunch sensor_sim_gazebo gps.launch

Now, you can list out the topic and find the GPS topics published from the Gazebo plugin. Here is a list of topics from the GPS plugin:

Simulating GPS in Gazebo

Figure 20: List of topics from the Gazebo GPS plugin

You can echo the /gps/fix topic to confirm that the plugin is publishing the values correctly.

You can use the following command to echo this topic:

$ rostopic echo /gps/fix

Figure 21: Values published ...

Get ROS Robotics Projects 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.