# A Free Simulation Environment Based on ROS for Teaching Autonomous Vehicle Navigation Algorithms
## 2 Materials and Methods  
### Using ROS to Teach Robotics  
There are multiple platforms currently used to teach robotics at different educational levels. Such platforms are used for teaching mobile robotics [8; 17], STEAM concepts [18], control engineering robotics [19], manipulators [20; 21], programming skills [22; 23], smart sensors [24], robot vision [25], and survival and behavior analysis [26], among others. There is a wide range of hardware platforms that support robotics courses and laboratory practices. As for the different programming environments, Matlab(tm) [7] and C [27] are the prevailing options in classrooms. In recent years, free open-source packages have emerged, which allow for the implementation of virtual scenarios for the simulation of mobile robots. Such is the case of Robot Operating System (ROS) [28]. Figure 1 shows the basic operation of ROS. The Robot Operating System (ROS) is an open-source working environment initially developed to be installed on a Linux operating  
system. It is used for programming and robot simulations. ROS is organized by execution units (called nodes), which communicate by publishing/subscribing messages, offering services, and/or executing actions. ROS includes connectivity with physical and real hardware (for example sensors or actuators) and algorithm implementation of various control types, navigation, map creations, etc. [29]. Its Gazebo module (simulation) and RVIZ (ROS-VIsualiZer) complete a flexible framework that allows teaching with simulated elements and minimal effort to transfer and test developments on real hardware. Gazebo is a 3D environment for running robot simulations in combination with ROS. In this way, users can test algorithms, design and test mobile robots, and train an AI (Artificial Intelligence) system using virtual representations of realistic scenarios. This offers the ability to simulate robot movements accurately and efficiently in complex indoor and outdoor environments [30]. The Gazebo graphical user interface (GUI) can be observed in Figure 2.  
ROS Visualization (RVIZ) is a 3D visualization tool for ROS applications; its main screen is shown in Figure 3. RVIZ displays the mobile robot model, captures robot sensor data, and reproduces the captured data. It can display data from cameras, lasers, and 3D and 2D devices as images and point clouds [28]. It is more beneficial to use ROS to teach robotics because it has functions for hardware abstraction, different device drivers, communication among multiple machine processes, and testing and visualization tools. However, the primary feature of ROS lies in how the software runs and communicates, allowing for the design and implementation of the algorithms without knowing how the hardware operates in detail [31]. This section reviews some of the systems in which the ROS platform has been used in robotics teaching. Figure 1: ROS is an open-source working environment, which includes connectivity with physical and real hardware (actuators and sensors). Gazebo (run 3D robot simulations) and RVIZ (allows a 3D visualization) modules complete a flexible framework that allows simulations and visualization in combination with ROS. Figure 2: Gazebo main screen. Gazebo can run 3D robot simulations. [PERSON] et al. [32] developed a toolkit for teaching mobile robotics through the Matlab(tm) and Simulink(tm) package add-on using ROS and the Gazebo simulator to improve learning efficiency in physical robotic simulation environments. Access to virtual sensors and actuators has been included in this toolkit, and communication details are hidden to allow students to focus on programming and debugging their autonomous driving algorithms. The basic architecture of the platform consists of three main software blocks: Matlab(tm) and Simulink(tm), Robot Operating System (ROS), and Gazebo. The algorithms developed in Matlab(tm) and Simulink(tm) interact with ROS, which connects Matlab(tm) and the Gazebo simulator. An activity was assigned to a group of robotics students to evaluate the platform.