BGR Autonomous Racing Team's GitHub repository for controllers, path planners, and simulation environments.
A collection of path planning and control modules for Formula Student Autonomous (FSAE) vehicles, built on top of the fsd-path-planning library by FaSTTUBe. This repository provides additional scripts, simulation tools, and control algorithms to optimize your vehicle’s racing performance in missions like Trackdrive and Skidpad.
- Overview
- Features & Missions
- Repository Structure
- Prerequisites
- Installation
- Basic Usage
- Integration with fsd-path-planning
- Example Workflow
- Contributing
- License
- Trackdrive: Advanced logic for robust path generation—even with partial cone visibility.
- Skidpad: Improved handling of color-agnostic cones and integrated relocalization.
- Caching & Performance: Experiment with
fsd-path-planningcaching features for speed gains in real-time. - Flexible Controller Integration: Utilize paths from
fsd-path-planningin various tracking controllers to compare performance or switch strategies quickly.
BGR_PathPlanning_Control/
├── src/
│ ├── planners/ # Custom wrappers or enhancements for fsd-path-planning
│ ├── controllers/ # Control algorithms (e.g., Pure Pursuit, LQR, MPC)
│ ├── utils/ # Common vehicle models, coordinate transforms, etc.
│ └── main.py # Example script demonstrating usage
├── scripts/ # Additional scripts for simulation and data processing
├── examples/ # Example notebooks and demos
├── tests/ # Unit and integration tests
├── requirements.txt # Python dependencies
└── README.md # This file
- Python: 3.x (Recommended: 3.8+)
- Environment Management:
pip,virtualenv, orconda(optional but recommended) - fsd-path-planning: Ensure this library is installed (follow its official instructions).
- Clone this repository:
git clone --branch yuval https://github.com/grimgrimberg/BGR_PathPlanning_Control.git cd BGR_PathPlanning_Control - Install dependencies:
pip install -r requirements.txt
- (Optional) Create a virtual environment:
python -m venv venv source venv/bin/activate # Linux/Mac # or .\venv\Scripts\activate # Windows pip install -r requirements.txt
- Detect cone positions (optionally with colors).
- Acquire the vehicle’s pose in the SLAM map (e.g., x, y coordinates and heading).
from fsd_path_planning import PathPlanner, MissionTypes
# Example usage for Trackdrive:
path_planner = PathPlanner(MissionTypes.trackdrive)
# Suppose you have global_cones, car_position, and car_direction from your pipeline:
path = path_planner.calculate_path_in_global_frame(
global_cones, # Array of shape (N, 2)
car_position, # e.g., np.array([x, y])
car_direction # e.g., float in radians, or a 2D direction vector
)from src.controllers import pure_pursuit
steering_angle, acceleration = pure_pursuit.compute_control_commands(
path,
current_vehicle_state
)
# Send these commands to your simulator or real-time control stack.python scripts/run_bgr_demo.py --mission trackdriveKey features of fsd-path-planning:
- Color Modes: Switch between color-dependent and color-agnostic modes.
- Caching: A new caching mechanism for sorting cones (use with caution if untested).
- Relocalization Info: For Skidpad, extract translation/rotation data for better alignment.
Our repository enhances these features by:
- Incorporating advanced parameters (e.g.,
experimental_performance_improvements). - Demonstrating when to initialize new
PathPlannerinstances for stateful missions. - Providing additional performance metrics to tune controller parameters.
For Skidpad missions, avoid reinitializing the PathPlanner object on every iteration, as some internal state is maintained to ensure consistent path generation.
- Cone Detection: Identify cone positions (and optionally colors) in real-time.
- Path Planning: Use cone data and vehicle pose to calculate a path.
- Control: Feed the path into a control algorithm (e.g., Pure Pursuit, LQR).
- Execution: Send steering and throttle commands to the simulator or vehicle.
- Loop: Update vehicle state from sensors or simulation and repeat from Step 2.
Contributions are welcome! To propose changes:
- Fork the repository and create a feature branch.
- Make your changes (add tests and update docs if needed).
- Open a pull request describing your modifications.
Formula Student teams using this repository are encouraged to share their improvements and experiences.
This repository is provided under the MIT License. See the fsd-path-planning license for additional details.
Happy racing, and best of luck on your Formula Student Driverless journey! If you have any questions, feel free to open an issue or contact the maintainers.