Skip to content

corticalstack/vrep-search-rescue

Repository files navigation

🤖 V-REP Search and Rescue Simulation

A robotics simulation framework for autonomous search and rescue operations using the V-REP (CoppeliaSim) simulator.

Description

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.

Features

  • 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

Prerequisites

  • Python 3.x
  • V-REP/CoppeliaSim simulator
  • Required Python packages:
    • NumPy
    • SciPy
    • Matplotlib
    • Pickle (included in standard library)

Setup Guide

  1. Install V-REP/CoppeliaSim simulator from Coppelia Robotics
  2. Install required Python packages:
    pip install numpy scipy matplotlib
  3. Clone this repository
  4. Ensure the V-REP remote API is properly configured (the vrep.py module should be accessible)

Usage

  1. Start the V-REP/CoppeliaSim simulator
  2. Load one of the provided scene files:
    • cwMap_VREP_test_mapping.ttt - Basic mapping scenario
    • cwMap_VREP_test_random_wandering.ttt - Random wandering scenario
    • cwMap_VREP_test_return_home.ttt - Complete search and return scenario
  3. Run the main script:
    python scenario.py

Architecture

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

Data Flow

  1. The controller initializes the robot and simulation environment
  2. 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
  3. Mapping data is continuously updated and can be visualized
  4. Path planning is performed when needed for return-to-home functionality
  5. Simulation statistics are recorded for analysis

Example Scenarios

The repository includes several pre-configured scenarios:

  1. Basic Mapping: The robot centers itself in a room and performs a mapping operation
  2. Random Wandering: The robot explores the environment using a random wandering algorithm while mapping
  3. Search and Return: The robot searches for a beacon, then plans and executes a path back to its starting position

Output

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)

Resources

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages