This project is a differential drive mobile robot simulation built using ROS 2 Humble on Ubuntu 22.04.5.
It includes simulation, teleoperation, SLAM-based mapping, and autonomous navigation using Nav2.
- Gazebo-based robot simulation
- Keyboard teleoperation
- SLAM (online asynchronous mapping)
- Autonomous navigation (Nav2)
- RViz visualization support
- Map saving capability
After cloning the repository, run the following commands once:
colcon build
source ~/.bashrcRebuild is only required if you modify the source code.
For every new terminal, run:
source install/setup.bashros2 launch mysimrobot launch_sim.launch.pyTo launch in an empty world:
ros2 launch mysimrobot launch_sim.launch.py world:=src/mysimrobot/worlds/empty.worldOpen a new terminal:
ros2 run teleop_twist_keyboard teleop_twist_keyboardros2 launch mysimrobot online_async_launch.py use_sim_time:=trueros2 launch mysimrobot navigation_launch.py use_sim_time:=truerviz2- Set Fixed Frame →
map - Add RobotModel for proper visualization
ros2 run nav2_map_server map_saver_cli -f ~/maps- Ensure all nodes use
use_sim_time:=trueduring simulation - Run each component in a separate terminal
- RViz must be properly configured for correct visualization


