{'fraction_non_alphanumeric': 0.024100196090834334, 'fraction_numerical': 0.007717123157694984, 'mean_word_length': 4.877323420074349, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Simulation Framework for Mobile Robots in Planetary-Like Environments

In this paper we present a simulation framework for the evaluation of the navigation and localization metrological performances of a robotic platform. The simulator, based on ROS (Robot Operating System) Gazebo, is targeted to a planetary-like research vehicle which allows to test various perception and navigation approaches for specific environment conditions. The possibility of simulating arbitrary sensor setups comprising cameras, LiDARs (Light Detection and Ranging) and IMUs makes Gazebo an excellent resource for rapid prototyping. In this work we evaluate a variety of open-source visual and LiDAR SLAM (Simultaneous Localization and Mapping) algorithms in a simulated Martian environment. Datasets are captured by driving the rover and recording sensors outputs as well as the ground truth for a precise performance evaluation.


I. INTRODUCTION
Designing a mobile robot is a costly task, often carried out in an inevitable trial-and-error process. For this reason, simulation toolkits are precious assets to optimize both time and expenses. Aside from mechanical or physical analysis software, which allow to evaluate in detail very specific design choices, many solutions are available to assist the high-level design of the whole robot such as Gazebo 1 , V-REP 2 or Microsoft AirSim 3 [1]. This family of software offers simple physical simulation capabilities in order to allow the robot to interact with a simulated environment and more importantly, provides solutions to simulate the output of various types of perception sensors, such as cameras, range sensors, or Inertial Measurement Units (IMU).
Among them, the Gazebo simulator offers a tight integration within the Robot Operating System (ROS) where the generated sensors outputs can be processed by Simultaneous Localization and Mapping (SLAM) algorithms for pose estimation and mapping [2]- [5]. Then, motion planning algorithms can output motor controls which move the robot in a virtual environment. This is beneficial not only to assist the design process of the robot but also to test thoroughly and in different operating conditions all the algorithms involved. Furthermore, the tight integration with ROS allows to share the source code for all operations between the real robot and the virtual counterpart. This ensures that, when deployed on the field, 1 gazebosim.org 2 coppeliarobotics.com/coppeliaSim 3 github.com/microsoft/AirSim the real robot will behave almost exactly as foreseen and tested in simulation. In addition, the evaluation of positioning algorithms on simulated environments is beneficial from the metrological perspective: the ground truth is exact, while during field testing it is indeed affected by errors. Lastly, it is possible to evaluate the impact of sensor characteristics, such as FOV and resolution, on the reconstructed trajectory.
In this paper, we present a simulation framework dedicated to the validation of SLAM algorithms given the mobility capabilities of a rover and the Martian topography. The framework is based on ROS and Gazebo, and is targeted to the MORPHEUS rover [5], a research test-bed for autonomous space operations developed at the University of Padova (see Fig. 1a). A replica of the rover (Fig. 1b) [6]. Although to this day no LiDAR sensor have been used on planetary rovers, they have been employed for relative navigation in on-Earth-orbit space missions [7], opening the possibility of future implementation in planetary environments. This paper is structured as follows: Section II introduces recent related works, Section III presents the simulation framework, Section IV introduces the tested localization algorithms, Section V reports an in-depth analysis of the results and Section VI contains some final remarks.

II. RELATED WORKS
In literature exist a variety of research works which make use of the Gazebo simulation environment. Many of them are related to indoor mapping and navigation [16]- [18]. In [19] a minimal simulated environment is used to test the operations of a planetary research platform, and finally building a 3D representation of the observed environment in form of OctoMap [20].
Recently, Gazebo has been used to test and develop navigation strategies for Astrobee [21], [22], a flying robot for the International Space Station. The robot tracks its motion using Visual-Inertial sensing and uses a depth camera to build maps for path planning. All sensors are simulated in a virtual environment replicating the interiors of the ISS, allowing to test the full navigation pipeline in the proper operative conditions. The authors of [23] used Gazebo to build a simulator for rover operations in a lunar environment. The Gazebo rendering engine has been modified to some extent in order to enable loading of several kilometers wide DTMs while keeping the computational cost at minimum. Photorealism is obtained through visual shaders replicating sun glare, improvements on the shadow generation and by adding custom bump maps to draw wheel marks on the ground.
The authors of [24], in order to validate the vision-based algorithm for the ExoMars rover navigation, developed a simulation capable of generating realistic Mars-like images. Their simulation was based on the University of Dundee's computer graphics utility PANGU [25].

III. SIMULATED ROVER AND TEST ENVIRONMENT
The MORPHEUS rover is a mobile platform targeted at unstructured terrains. 6 wheels, individually powered by MAXON ® motors, are mounted on three rockers passively connected to the rover body by revoluting joints at their barycenter. Turning is performed by skid-steering such that both spot turns and pivot turns are possible. The motor drivers are controlled by Arduino microcontrollers which receive inputs and communicate the motors status to a nVidia Jetson TX2 running Ubuntu 14.04, where all the local processing is done. The Jetson shares a Wi-Fi ROS network with a laptop intented as a base station, where the status of the robot can be monitored and user inputs can be forwarded. The rover is equipped with a Stereolabs ZED camera, which captures synchronized image pairs at variable framerates and resolutions. The stereo processing (distortion correction and stereo rectification) is performed on the embedded Tegra GPU. The rover carries also a plane scanning LiDAR to perform obstacle avoidance.

A. The Rover Model
An URDF model of the rover is exported from CAD drawings using the ROS add-on for SolidWorks sw_urdf_exporter 4 . As the complexity of the model induces a significant computational load to the rendering  [11] Stereo / Mono X -A-LOAM [12] 3D LiDAR X -HDL-SLAM [13] 3D LiDAR scan registration with NDT [14] LeGO-LOAM [15] 3D LiDAR - and physics engine, we provide also a simplified version retaining complete functionality. The skid-steer locomotion is implemented using the diff_drive_controller 5 . The stereo camera is implemented using the multicamera plugin which allows to simulate lens distortion and noise in the image. We combine this plugin with the recently released lens_flare_sensor [23] to simulate the lens flare effect on the image when the sun lies close to the line of sight. The LiDAR sensor is simulated replicating a Velodyne VLP-16 using the gazebo_ros_velodyne_laser 6 plugin.

B. The Environment
The virtual environment is modeled after a Digital Terrain Model (DTM) of the Gale crater on Mars, cropped to a planar landscape. A schematic overview of the map generation process is given in Fig. 3. The DTM is imported in Gazebo to create a base featureless surface as a basis for the virtual environment. To populate the surface with rocks, we import the DTM in the 3D modeler Blender applying a displacement map to a plane segmented in a coarse grid. Two population of rocks are scattered over this surface using a manually weighted random distribution roughly matching the frequencies observed on the Martian surface [26]: a small population of large boulders and a large population of smaller rocks with diameters ranging from 0.1 to 0.5 meters. We released the environments in form of a ROS package 7 .
To precisely evaluate the performances of SLAM algorithms on this environment, we use Blender to generate two fixed paths along which the robot will move using the actor functionalities of ROS Gazebo. To simulate the motion caused by the roughness of the terrain we added noise to the camera orientations. The resulting sequences of poses are exported to SDF files to instruct the Gazebo actor objects.

IV. LOCALIZATION ALGORITHMS
In this paper we compare a variety of odometry or SLAM algorithms using either the virtual stereo camera or 3D Li-DAR to provide localization (i.e. compute the transformation between the robot and world reference frames T w robot ) showing how our virtual environment can be used to aid the design choices for the perception system of a robot depending on the target environment. An overview is provided in Table I along with relevant implementation remarks about parameter values that differ from the default ones.

A. Visual SLAM
Among all available Visual SLAM algorithms for stereo cameras, we selected ORB-SLAM2 [8], RTAB-MAP [9] and LibVISO2 [11]. LiBVISO2 is a widely used Visual Odometry algorithm without Loop Closure capabilities. RTAB-MAP is instead a RGB-D Graph SLAM with a bayesian Loop Closure detector that addresses multi-session mapping and is highly configurable through an easy Graphical User Interface (GUI) (e.g. types of feature detectors and descriptors, optimizers and respective parameters). ORB-SLAM2 is a Visual SLAM algorithm for monocular, stereo and RGB-D vision systems based on ORB features [27] which leverages a Bag of Words approach [28] for localization and Loop Closure detection.

B. LiDAR SLAM
In addition, we compare the performances of a variety of recently published LiDAR SLAM algorithms which are released open source and are compatible with the Robot Operating System. A-LOAM 8 is an implementation of LOAM [29] where odometry and mapping are decoupled to be performed at a faster and slower rate respectively and the poses are computed by matching edge and planar features across scans. LeGO-LOAM [15] improves the performances of LOAM by  [30]. It provides interfaces for easy integration of IMU and GPS measurements and performs Loop Closure detection to correct a pose graph.

V. EXPERIMENTS AND DISCUSSION
We performed a variety of experiments in two sequences generated as explained in Sec. III-B. The first sequence, denominated Long, takes places in the environment visible in Fig.1c which comprises a denser distribution of small pebbles and a sparser distribution or larger rocks with dimensions comparable to the ones of the rover. A closed trajectory, about 300 meters long, allows to evaluate the tracking performances of all algorithms in the presence of 90 • turns as well as the Loop Closure capabilities, as the rovers returns in the initial location with the same viewpoint. A second and shorter sequence, denominated here Short, is about 60 meters long and takes place around high boulders, generally bigger than the rover. An approximately triangular trajectory ends in proximity of the beginning, however on an opposite camera viewpoint, not allowing detection of Loop Closures from the visual pipelines but, in principle, allowing it for LiDAR pipelines which benefit from 360 • range coverage.
The virtual rover is equipped with a stereo camera whose specifications make it equivalent to a Stereolabs ZED stereo camera, which is mounted on our Morpheus rover (see Fig. 1a). The 3D LiDAR is modeled roughly after the Ouster OS-1 with 64 scan planes. The full characteristics of both sensors are reported for brevity in Table IV.
We test the performances of the algorithms introduces in Sec. IV in terms of how accurately they reconstruct the trajectories from the Long and Short sessions. We first align the trajectory to the ground truth using Horn's method [31] 9 github.com/koide3/hdl graph slam  In order to not underestimate the pose errors resulting from angular drift, only the first third of the whole trajectory is use for alignment. For each correspondence, we compute the Absolute Trajectory Error (ATE), or the L2 distance between the aligned poses: where x * i and x i are positions of corresponding poses from ground truth and estimated from SLAM respectively after alignment. We also compute the translation drift as the relative difference between the lengths of local segments of the estimated trajectory and ground truth. Let be x * i and x * j two ground truth poses such that the length of the trajectory that connects them l(x * i , x * j ) is 10 meters. Let then be x i and x j the estimated poses from SLAM that correspond via timestamps to x * i and x * j . Thus, we define the local translation drift as: Finally, we report a summary of the results in a might be employed for the detection of geological features. Figure 4 presents the qualitative difference between a visual map, comprised of sparse 3D landmarks, and a LiDAR map, built by concatenating LiDAR scans. A quantitative evaluation of performances is instead presented in Figure 5, which reports the results of all algorithms on the Long and Short sequences. In addition, Tables II and III contain the RMS errors highlighting the best scoring algorithms. Figures 5c and  5d show the resulting trajectories and ground truth overlaid on a top-view of the environment to highlight the context in terms of geometry. In the Long sequence both ORB-SLAM2 and RTAB-MAP were able to successfully close the loop, therefore their ATE is close to zero at both the beginning and end of the trajectory. However, ORB-SLAM2 accumulates some translation drift which manifest itself as higher ATEs in the middle of the trajectory (see Fig. 5e). Contrarily, LibVISO2 exhibits the lowest translational drift but accumulates angular drift which can not be recovered as it is a pure visual odometry. RTAB-MAP instead shows consistent performances in both sequences achieving the lowest ATE errors thanks to an accurate odometry and Loop Closure capabilities. The LiDAR odometry A-LOAM outperform the visual odometry LibVISO2 in the Long sequence although obtaining the highest errors in the Short sequence. LeGO-LOAM instead even outperforms ORB-SLAM in the Long sequence. This result is surprising given the little geometric structures present in this sequence but can be explained given that both ALOAM and LeGO-LOAM extract and match edge features belonging to the LiDAR scans, of which the environment has plenty and uniformly distributed, contrarily to the Short sequence which is characterized by bigger and sparsely distributed boulders that obstruct the view. HDL-SLAM instead relies on the mechanism of scan matching, which degenerates in the presence on planar scenes. This explains the extreme translation drift in the Long sequence.

VI. CONCLUSIONS
In this work we presented a simulation framework for mobile robots based on ROS Gazebo. We demonstrated how it can be used to aid the selection of perception sensors based on the expected geometry and appearance of the environment. Furthermore, we compared the performances of a variety of open source Visual and LiDAR SLAM algorithms in different environments characterized by different rock distributions and size. Although visual SLAM proves to be accurate in presence of textured ground, LiDAR SLAM has the advantage of building detailed maps in form of point clouds. As for future developments of this work, we plan to enhance the photorealism of the simulation and join the advantages of both SLAM approaches, fusing 3D LiDARs with stereo cameras using the simulated environment to validate the approach.