Vehicle model with (3D lidar, IMU and Camera sensors) can be simulated in 2 different maps.  Vehicle

How to run

1- Install ROS

  • melodic for UBUNTU 18
  • noetic for UBUNTU 20

NOTE: Choose Desktop-Full Install in section 1.4 to install gazebo with ROS

2- Create catkin workspace

3- Clone the repo

cd ~/catkin_ws/src
git clone

4- Install dependencies

cd ~/catkin_ws/src/SLAMEnvironment/vehicle_sim
rosdep install --from-paths . -y

5- Build

source ~/catkin_ws/devel/setup.bash

6- upgrade gazebo version and download gazebo models

sudo sh -c 'echo "deb $(lsb_release -sc) main" > /etc/apt/sources.list.d/gazebo-stable.list'
sudo apt-key adv --keyserver --recv-keys D2486D2DD83DB69272AFE98867170598AF249743
sudo apt update
sudo apt upgrade
rosrun vehicle_sim_launcher

7- Make python code executable

cd ~/catkin_ws/src/SLAMEnvironment/slam_code/scripts
chmod 777

8- Run Simple walls environment

roslaunch vehicle_sim_launcher walls.launch


9- Run complex city environment

roslaunch vehicle_sim_launcher city.launch


NOTE: add gpu:=true to roslaunch command to use gpu.

  • Window to control vehicle velocity and steering.

  •  Vehicle

  • Sample code

    sample code exists in: ~/catkin_ws/src/slam_code/scripts

    • It subscribes to /points_raw topic which lidar publishes on.
    • Creates dumy PointCloud2 message to simulate the map which will be the output of the SLAM algorithm, then publishes it on /map topic.
    • Your SLAM code needs to be added to a script like this.

    NOTE: This code is included in launch files, so runs once you do step 7 or 8.


    this is a modified version of this repo


    View Github