https://github.com/96syh/multi-vehicle-formation-system

https://github.com/96syh/multi-vehicle-formation-system

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.6%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: 96syh
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 56.6 KB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

Multi-Vehicle Formation Control System 🚁

[![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://www.python.org/downloads/) [![ROS2](https://img.shields.io/badge/ROS2-Humble-green.svg)](https://docs.ros.org/en/humble/) [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) *A comprehensive multi-vehicle formation control and simulation system with both standalone Python simulation and ROS2/Gazebo integration* [🚀 Quick Start](#quick-start) • [📖 Documentation](#documentation) • [🎮 Demo](#demo) • [🛠️ Development](#development)

✨ Features

🎯 Core Capabilities

  • Multiple Formation Types: Line, V-shape, Diamond, Circle formations
  • Intelligent Algorithms: Artificial potential field, consensus-based control
  • Obstacle Avoidance: Dynamic window approach (DWA) integration
  • Real-time Visualization: Interactive matplotlib interface with live parameter adjustment
  • Multi-platform Support: Standalone Python, ROS2, and embedded systems

🔧 Technical Highlights

  • Physics-based Simulation: Gazebo-compatible vehicle dynamics
  • Distributed Control: Decentralized formation algorithms
  • Interactive UI: Real-time parameter tuning and visualization
  • Hardware Ready: STM32 embedded system integration
  • Scalable Architecture: Support for 2-20+ vehicles

🚀 Quick Start

Prerequisites

```bash

Python dependencies

pip install numpy matplotlib

For ROS2 integration (optional)

sudo apt install ros-humble-desktop sudo apt install ros-humble-ros-gz ```

Standalone Simulation

```bash

Clone the repository

git clone https://github.com/yourusername/multi-vehicle-formation-system.git cd multi-vehicle-formation-system

Run interactive demo

python runformationdemo.py

Or run directly with parameters

python formationsimulationstandalone.py -n 6 -f v_shape --auto-start ```

ROS2 + Gazebo Simulation

```bash

Build and run with Ignition Gazebo

./scripts/buildandrun_ignition.sh -n 8 -f diamond ```

🎮 Demo

Interactive Simulation Interface

Formation Demo

Controls: - 🖱️ Double-click: Set new target position - 🎛️ Right Panel: Adjust formation type and parameters - ⏯️ Buttons: Start/pause/reset simulation - 📊 Real-time Info: Live formation error and status display

Formation Types

| Formation | Description | Best Use Case | |-----------|-------------|---------------| | 🔹 Line | Vehicles in straight line | Highway convoy | | 🔸 V-Shape | V formation with leader | Aerial formations | | 💎 Diamond | Diamond/rhombus pattern | Defensive positions | | ⭕ Circle | Circular formation | Area patrol |

📁 Project Structure

multi-vehicle-formation-system/ ├── 🎯 formation_simulation_standalone.py # Main standalone simulation ├── 🎮 run_formation_demo.py # Interactive demo launcher ├── 📚 docs/ # Documentation │ ├── algorithm_design.md # Algorithm details │ ├── parameter_tuning.md # Parameter guide │ └── ignition_gazebo_guide.md # ROS2/Gazebo setup ├── 🤖 ros2_workspace/ # ROS2 integration │ └── src/multi_vehicle_formation/ # ROS2 package ├── 🔧 scripts/ # Build and run scripts ├── 💻 embedded_system/ # STM32 embedded code └── 🧪 tests/ # Test framework

📖 Documentation

Algorithm Design

The system implements multiple formation control algorithms:

  • 🧲 Artificial Potential Field: Attractive and repulsive forces for formation keeping
  • 🤝 Consensus-based Control: Distributed coordination between vehicles
  • 🚧 Obstacle Avoidance: Dynamic window approach for collision-free navigation
  • ⚖️ Formation Transitions: Smooth transitions between different formations

Key Parameters

```python

Formation control gains

katt = 1.0 # Attraction to target krep = 2.0 # Repulsion from neighbors
kform = 1.5 # Formation constraint force kobstacle = 3.0 # Obstacle avoidance force

Physical constraints

maxspeed = 2.0 # m/s maxacceleration = 1.0 # m/s² influence_radius = 3.0 # meters ```

🛠️ Development

Architecture Overview

mermaid graph TD A[Vehicle Sensors] --> B[Formation Controller] B --> C[Path Planner] C --> D[Vehicle Actuators] B --> E[Visualization] F[User Interface] --> B G[Parameter Tuning] --> B

Adding New Formations

  1. Define Formation Pattern: Add new formation type in FormationController.generate_formation_positions()
  2. Update UI: Add to formation selection in control panel
  3. Test: Run with new formation type

```python

Example: Adding triangular formation

elif self.formationtype == "triangle": # Define triangle vertices positions[0] = [0, formationscale] # Top positions[1] = [-formationscale, -formationscale] # Bottom left positions[2] = [formationscale, -formationscale] # Bottom right ```

Performance Optimization

  • Real-time Factor: Adjustable simulation speed (0.1x - 3.0x)
  • Update Frequency: 50Hz physics, 30Hz visualization
  • Scalability: Tested with up to 20 vehicles
  • Memory Usage: ~50MB for 10-vehicle simulation

🧪 Testing

```bash

Run unit tests

python -m pytest tests/

Formation convergence test

python tests/testformationconvergence.py

Performance benchmark

python tests/benchmark_performance.py ```

🚀 Deployment

Embedded Systems (STM32)

```bash

Compile for STM32F4

cd embeddedsystem ./compilestm32.sh ./flash_firmware.sh ```

ROS2 Integration

```bash

Build ROS2 workspace

cd ros2_workspace colcon build source install/setup.bash

Launch full simulation

ros2 launch multivehicleformation simulation.launch.py ```

📊 Performance Metrics

| Metric | Value | Unit | |--------|-------|------| | Formation Error | < 0.1 | meters | | Convergence Time | 5-15 | seconds | | Update Rate | 50 | Hz | | Max Vehicles | 20+ | count | | CPU Usage | < 30% | single core |

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

```bash

Clone with submodules

git clone --recursive https://github.com/yourusername/multi-vehicle-formation-system.git

Install development dependencies

pip install -r requirements-dev.txt

Run pre-commit hooks

pre-commit install ```

📄 License

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

🙏 Acknowledgments

  • ROS2 Community for excellent robotics framework
  • Gazebo Team for physics simulation engine
  • NumPy/Matplotlib for scientific computing and visualization
  • Formation Control Research community for algorithmic foundations

📞 Support


**⭐ Star this repo if you find it helpful! ⭐** *Made with ❤️ for the robotics community*

Owner

  • Login: 96syh
  • Kind: user

GitHub Events

Total
  • Push event: 1
  • Create event: 1
Last Year
  • Push event: 1
  • Create event: 1

Dependencies

requirements.txt pypi
  • argparse *
  • dataclasses *
  • matplotlib >=3.5.0
  • numpy >=1.20.0