This project is part of the TIPE 2023-2024 preparatory course. It implements a Conflict-Based Search (CBS) algorithm combined with A* for autonomous vehicle path planning in an urban environment. The project integrates OpenStreetMap (OSM) data to load city maps, displays the map using SFML 2, uses Reed-Sheep curves to generate smooth trajectories, and constructs a city graph with one edge per road.
- Overview
- Features
- Dependencies
- Building and Running the Project
- Project Structure
- CMake Configuration
- Documentation
- License
- Acknowledgements
The goal of this project is to simulate autonomous vehicles navigating through a city environment using a CBS-based path planning approach. The city is loaded from OSM data, and the map is rendered in real time using SFML 2. The project uses Reed-Sheep curves to compute smooth paths and builds a graph representing the city with one edge per road segment.
- Autonomous Vehicle Simulation: Implements path planning for self-driving cars.
- OSM Integration: Loads city maps directly from OpenStreetMap data.
- Graph Construction: Creates a graph where each edge represents a road.
- Smooth Trajectories: Utilizes Reed-Sheep curves for smooth path generation.
- Visualization: Renders the city map using SFML 2.
- Robust Logging: Uses spdlog for logging purposes.
- XML Parsing: Uses tinyxml2 for handling XML data.
- Flexible Build System: Managed using CMake with debug and release configurations.
Before building the project, ensure you have the following dependencies installed:
- C++ 17 Compiler
- Boost: Required for various functionalities.
- OMPL (Open Motion Planning Library).
- SFML 2: For graphics and window management.
- spdlog: For logging (fetched via FetchContent).
- tinyxml2: For XML parsing (fetched via FetchContent).
- Doxygen (Optional): For generating documentation.
The project fetches SFML, spdlog, and tinyxml2 automatically using CMake's FetchContent module.
The project uses CMake as its build system and includes a convenient shell script (build.sh) to streamline the build and run process.
Run the shell script with the following options:
./build.sh debug
: Builds the project in debug mode../build.sh release
: Builds the project in release mode../build.sh run data [num_agents_min] [num_agents_max] [num_data]
: Creates data files for the given number of agents (see below for more details)../build.sh run run [num_agents]
: Runs the project with the given number of agents../build.sh help
: For more information on the available options.
Alternatively, you can build the project manually using CMake:
cmake -DCMAKE_BUILD_TYPE=Release -B build
cmake --build build -j
To run the project, execute the following command (same as the build.sh
script):
./bin/city-cbs-astar data [num_agents_min] [num_agents_max] [num_data]
# or
./bin/city-cbs-astar run [num_agents]
- src/: Contains source files including modules for A*, car dynamics, city graph and map management, constraint control, and more.
- include/: Contains header files.
- build.sh: Shell script to build, run, and manage the project.
- CMakeLists.txt: CMake configuration file.
- doc/: Contains documentation files generated by Doxygen (if applicable).
The CMake configuration ensures the following:
- The project uses C++17.
- The target architecture is set to arm64.
- Both debug and release configurations are supported, including memory sanitizers in debug mode.
- External dependencies (SFML, spdlog, tinyxml2) are fetched automatically.
- Boost and OMPL are required and must be found on the system.
The project includes Doxygen support for generating documentation. It's available here for the html version, and the pdf version is also available.
This project is licensed under the MIT License. See the LICENSE file for more information.
- OpenStreetMap: For providing city map data.
- SFML: For graphics and window management.
- Boost: For various functionalities.
- OMPL: For motion planning.
- spdlog: For logging purposes.
- tinyxml2: For XML parsing.