Connect with me:
📧 email
🔗 LinkedIn
| Technology | Usage | Proficiency |
|---|---|---|
| ROS2 Humble | Core robotics framework | |
| Python | Node scripting and logic | |
| Gazebo | Simulation and testing | |
| RViz2 | Visualization | |
| SLAM Toolbox | Mapping and localization |
A ROS2 Humble simulation project featuring autonomous room exploration with LIDAR-based SLAM and obstacle avoidance in Gazebo.
- ✅ Autonomous navigation and exploration
- ✅ Real-time LIDAR-based mapping using SLAM Toolbox
- ✅ Intelligent obstacle avoidance
- ✅ Live visualization in RViz2
- ✅ Gazebo simulation environment
- Ubuntu 22.04
- ROS2 Humble
- Gazebo
- Python 3
sudo apt update
sudo apt install -y ros-humble-gazebo-ros-pkgs ros-humble-cartographer \
ros-humble-cartographer-ros ros-humble-navigation2 ros-humble-nav2-bringup \
ros-humble-slam-toolbox ros-humble-turtlebot3-gazebo ros-humble-turtlebot3-msgs \
ros-humble-turtlebot3 python3-colcon-common-extensionsecho "export TURTLEBOT3_MODEL=burger" >> ~/.bashrc
source ~/.bashrcmkdir -p ~/robot_mapping_ws/src
cd ~/robot_mapping_ws/src
git clone <your-repo-url> autonomous_mapper
cd ~/robot_mapping_ws
colcon build
source install/setup.bashsource ~/robot_mapping_ws/install/setup.bash
ros2 launch autonomous_mapper mapping_launch.pyThis single command starts:
- Gazebo simulation with TurtleBot3
- SLAM Toolbox for mapping
- RViz2 for visualization
- Autonomous explorer node
- Gazebo Window: 3D simulation of the robot in the environment
- RViz2 Window: Real-time map building and robot pose
Once satisfied with the mapping, save it:
ros2 run nav2_map_server map_saver_cli -f my_room_mapThis creates:
my_room_map.pgm- Map imagemy_room_map.yaml- Map metadata
- Continuously reads LIDAR scan data
- Moves forward while safe
- Detects obstacles within 0.5m
- Intelligently rotates toward open space
- Adds random exploration variations
- Processes LIDAR data
- Builds occupancy grid map
- Localizes robot position
- Updates map in real-time
- Monitor LIDAR 360° scan
- Calculate minimum distance to obstacles
- If distance < 0.5m: Avoid
- Stop forward motion
- Compare left vs right open space
- Rotate toward larger opening
- If distance > 0.5m: Explore
- Move forward
- Add random small turns for coverage
Edit autonomous_mapper/autonomous_explorer.py:
self.linear_speed = 0.2 # m/s (increase for faster exploration)
self.angular_speed = 0.5 # rad/s (rotation speed)self.safe_distance = 0.5 # meters (obstacle detection threshold)Edit mapping_launch.py to use different worlds:
# Options: turtlebot3_world, turtlebot3_house, empty_world
'turtlebot3_world.launch.py'killall gzserver gzclient
source ~/.bashrcCheck if explorer node is running:
ros2 node list
# Should show: /autonomous_explorer- Click "Add" button
- Select "Map" display type
- Set topic to
/map
source ~/robot_mapping_ws/install/setup.bashautonomous_mapper/
├── autonomous_mapper/
│ ├── __init__.py
│ └── autonomous_explorer.py # Main exploration logic
├── launch/
│ └── mapping_launch.py # Launch file
├── resource/
│ └── autonomous_mapper # Package marker
├── package.xml # Package dependencies
├── setup.py # Python package setup
└── README.md # This file
| Feature | Progress |
|---|---|
| Autonomous Exploration | |
| Obstacle Avoidance | |
| SLAM Toolbox Integration | |
| Frontier-based Exploration | |
| Multi-Robot Coordination |
- Frontier-based exploration
- Path planning integration
- Multi-robot coordination
- 3D mapping support
- Return to start position
Connect with me:
📧 email
🔗 LinkedIn
AryanGanesh Kavuri


