A robotics simulation framework for autonomous search and rescue operations using the V-REP (CoppeliaSim) simulator.
This repository contains a Python-based framework for simulating autonomous robot navigation, mapping, and search operations in unknown environments. The system uses a Pioneer P3DX robot model in the V-REP (now called CoppeliaSim) simulator to perform tasks such as:
- Environment mapping using occupancy grid techniques
- Random wandering with obstacle avoidance
- Beacon localization
- Path planning and navigation
- Return-to-home functionality
The simulation demonstrates robotics concepts including sensor fusion, simultaneous localization and mapping (SLAM), path planning algorithms, and autonomous navigation strategies.
- Autonomous Navigation: Random wandering with obstacle avoidance using proximity sensors
- Environment Mapping: Occupancy grid mapping to create a representation of the environment
- Path Planning: A* algorithm implementation for optimal path finding
- Beacon Detection: Simulated beacon for search and rescue target identification
- Return-to-Home: Autonomous navigation back to starting position after target discovery
- Data Visualization: Plotting of maps, paths, and navigation data
- Extensible Framework: Modular design allowing for easy addition of new robot behaviors and sensors
- Python 3.x
- V-REP/CoppeliaSim simulator
- Required Python packages:
- NumPy
- SciPy
- Matplotlib
- Pickle (included in standard library)
- Install V-REP/CoppeliaSim simulator from Coppelia Robotics
- Install required Python packages:
pip install numpy scipy matplotlib
- Clone this repository
- Ensure the V-REP remote API is properly configured (the
vrep.pymodule should be accessible)
- Start the V-REP/CoppeliaSim simulator
- Load one of the provided scene files:
cwMap_VREP_test_mapping.ttt- Basic mapping scenariocwMap_VREP_test_random_wandering.ttt- Random wandering scenariocwMap_VREP_test_return_home.ttt- Complete search and return scenario
- Run the main script:
python scenario.py
The codebase is organized into several key components:
- Controller (
controller.py): Manages the simulation loop and coordinates the robot's sense-think-act cycle - Robot (
robots.py): Implements the Pioneer P3DX robot with movement and sensing capabilities - Sensors (
sensors.py): Defines proximity sensors, compass, and beacon detection - Mapper (
mapper.py): Implements occupancy grid mapping and path planning algorithms - Helper (
helper.py): Provides utility functions for V-REP communication and mathematical operations - Logger (
logger.py): Handles logging of simulation events and data - Scenario (
scenario.py): Defines the sequence of tasks for the robot to perform
- The controller initializes the robot and simulation environment
- In each cycle, the robot:
- Senses the environment using proximity sensors
- Updates its internal state (position, orientation, map)
- Executes the current task based on the scenario definition
- Mapping data is continuously updated and can be visualized
- Path planning is performed when needed for return-to-home functionality
- Simulation statistics are recorded for analysis
The repository includes several pre-configured scenarios:
- Basic Mapping: The robot centers itself in a room and performs a mapping operation
- Random Wandering: The robot explores the environment using a random wandering algorithm while mapping
- Search and Return: The robot searches for a beacon, then plans and executes a path back to its starting position
The simulation produces several outputs:
- Occupancy grid maps (stored in the
data/directory) - Visualizations of maps and paths (stored in the
plots/directory) - CSV files with position and motor data (stored in the
output/directory) - Detailed logs of the simulation (stored in the
logs/directory)
This project is licensed under the MIT License - see the LICENSE file for details.