A ROS2 package for frontier exploration simulation using TurtleBot3 in Gazebo environments. This package provides tools to convert laser scan data to point clouds and simulate robot exploration in various world configurations.
- Gazebo Simulation: Multiple world environments for testing exploration algorithms
- Laser Scan to Point Cloud Conversion: Real-time conversion of laser scan data to world-frame point clouds
- Smooth TF Integration: Proper coordinate transformation with interpolation support
- Multiple World Configurations: Various environments including malls, houses, garages, and more
- Odometry Publishing: Integrated odometry data for navigation systems
- ROS2 (Humble or newer)
- Gazebo
- TurtleBot3 packages
- C++17 compatible compiler
# Clone the repository (adjust path as needed)
cd ~/ros2_ws/src
git clone <repository-url>
# Build the package
cd ~/ros2_ws
colcon build --packages-select frontier_exploration_sim
source install/setup.bash# Source Gazebo setup
source /usr/share/gazebo/setup.sh
# Set TurtleBot3 model
export TURTLEBOT3_MODEL=burger
# Launch the simulation
ros2 launch frontier_exploration_sim sim.launch.pyThe package includes several world configurations:
corrider.world: Simple corridor environmentgarage.world: Garage-like environmenthard.world: Challenging environment with obstacleshouse.world: House layoutMTR.world: Subway/metro station environmentnumber.world: Number-based mazeshopping_mall.world: Shopping mall layoutsuper_mall.world: Large mall environmentunknown.world: Unknown exploration environment
To specify a particular world, modify the map_name parameter in launch/sim.launch.py:
map_name = "super_mall.world" # Change to desired worldFor manual testing, use the teleop keyboard controller:
ros2 run teleop_twist_keyboard teleop_twist_keyboardConverts laser scan data to point clouds in the world coordinate frame.
Subscribed Topics:
/scan(sensor_msgs/msg/LaserScan): Laser scan data from TurtleBot3
Published Topics:
/car_pc2(sensor_msgs/msg/PointCloud2): Converted point cloud data in world frame/car_odom(nav_msgs/msg/Odometry): Robot odometry information
Parameters:
publish_rate(double, default: 10.0): Point cloud publishing rate in Hzodom_buffer_size(int, default: 20): Size of odometry buffer for interpolationtime_sync_threshold(double, default: 0.05): Time synchronization threshold in secondsmax_tf_age(double, default: 0.1): Maximum age for TF lookups in secondsworld_frame(string, default: "odom"): World coordinate framebase_frame(string, default: "base_link"): Robot base frame
frontier_exploration_sim/
├── CMakeLists.txt # Build configuration
├── package.xml # Package metadata and dependencies
├── launch/
│ └── sim.launch.py # Main simulation launch file
├── src/
│ └── scan_to_pointcloud.cpp # Laser scan to point cloud converter
└── worlds/ # Gazebo world files
├── corrider.world
├── garage.world
├── hard.world
├── house.world
├── MTR.world
├── number.world
├── shopping_mall.world
├── super_mall.world
└── unknown.world
rclcpp: ROS2 C++ client librarysensor_msgs: ROS2 sensor message definitionsnav_msgs: ROS2 navigation message definitionstf2_geometry_msgs: TF2 geometry message utilitiesgazebo_ros_pkgs: Gazebo ROS2 integrationturtlebot3_gazebo: TurtleBot3 Gazebo simulation package
-
Gazebo not launching: Ensure Gazebo is properly installed and sourced:
source /usr/share/gazebo/setup.sh -
TF errors: The system requires proper TF tree. Ensure TurtleBot3 packages are correctly installed.
-
World not loading: Check that the world file exists in the
worldsdirectory and path is correct. -
Compilation errors: Ensure you have C++17 support and all dependencies installed.
MIT License