Skip to content

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.

Notifications You must be signed in to change notification settings

MarineRock10/frontier_exploration_sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontier Exploration Simulation

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.

Features

  • 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

Installation

Prerequisites

  • ROS2 (Humble or newer)
  • Gazebo
  • TurtleBot3 packages
  • C++17 compatible compiler

Building the Package

# 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

Usage

Setting up the Environment

# 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.py

Available World Files

The package includes several world configurations:

  • corrider.world: Simple corridor environment
  • garage.world: Garage-like environment
  • hard.world: Challenging environment with obstacles
  • house.world: House layout
  • MTR.world: Subway/metro station environment
  • number.world: Number-based maze
  • shopping_mall.world: Shopping mall layout
  • super_mall.world: Large mall environment
  • unknown.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 world

Manual Control

For manual testing, use the teleop keyboard controller:

ros2 run teleop_twist_keyboard teleop_twist_keyboard

Nodes

scan_to_pointcloud

Converts 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 Hz
  • odom_buffer_size (int, default: 20): Size of odometry buffer for interpolation
  • time_sync_threshold (double, default: 0.05): Time synchronization threshold in seconds
  • max_tf_age (double, default: 0.1): Maximum age for TF lookups in seconds
  • world_frame (string, default: "odom"): World coordinate frame
  • base_frame (string, default: "base_link"): Robot base frame

Package Structure

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

Dependencies

  • rclcpp: ROS2 C++ client library
  • sensor_msgs: ROS2 sensor message definitions
  • nav_msgs: ROS2 navigation message definitions
  • tf2_geometry_msgs: TF2 geometry message utilities
  • gazebo_ros_pkgs: Gazebo ROS2 integration
  • turtlebot3_gazebo: TurtleBot3 Gazebo simulation package

Troubleshooting

  1. Gazebo not launching: Ensure Gazebo is properly installed and sourced:

    source /usr/share/gazebo/setup.sh
  2. TF errors: The system requires proper TF tree. Ensure TurtleBot3 packages are correctly installed.

  3. World not loading: Check that the world file exists in the worlds directory and path is correct.

  4. Compilation errors: Ensure you have C++17 support and all dependencies installed.

License

MIT License

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published