This Python package provides an interface to run the Time-Optimal Gate-Traversing (TOGT) Planner, originally a C++ project.
With this package, you can generate random racetracks and plan paths using the TOGT Planner. It supports looping to generate a large number of high-quality trajectories that prioritize dynamic feasibility.
git clone https://github.com/FSC-Lab/TOGT-Planner.git
cd TOGT-Planner/
git checkout f69f3fc9143b02b58bd6a66dc12a531395bf5317
Note: Please check out to the commit from May 15, 2024 (commit f69f3fc9143b02b58bd6a66dc12a531395bf5317
, Correct plotting bugs) for a stable version.
cd ${YOUR_TOGT_PLANNER_PATH}
git clone https://github.com/KafuuChikai/Run-TOGT-Planner.git
cd Run-TOGT-Planner/
It is recommended to use Conda to create a virtual environment. If you do not use Conda, ensure Poetry is installed.
conda create -n togt_env python=3.8
conda activate togt_env
Install the package
pip install --upgrade pip
pip install -e .
Add the following code after line 247:
add_executable(planners Run-TOGT-Planner/traj_planner/traj_planner_togt.cpp)
target_compile_options(planners PRIVATE
-fno-finite-math-only
-Wall # Show all warnings
-Wextra # Show extra error information
-Wpedantic # Issue all the warnings demanded by strict ISO C and ISO C++
-Werror # Raise all warnings to errors
-Wunused # Warn whatever is assigned to, but unused
-Wno-unused-parameter
-Wundef # Warn if an undefined identifier is evaluated in an #if directive.
-Wcast-align # Warn whenever a pointer is cast such that the required alignment of the target is increased
-Wmissing-declarations # Warn if a global function is defined without a previous declaration
-Wmissing-include-dirs # Warn if a user-supplied include directory does not exist.
-Wnon-virtual-dtor
-Wredundant-decls # Warn if anything is declared more than once in the same scope
-Wodr
-Wunreachable-code
-Wno-unknown-pragmas
)
target_link_libraries(planners
${LIBRARY_NAME}
$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:stdc++fs>
)
Navigate to the TOGT-Planner directory, configure the project, and compile:
cd ${YOUR_TOGT_PLANNER_PATH}/
mkdir build
cd build
cmake ..
make
- Show predefined trajectory
python ${YOUR_TOGT_PLANNER_PATH}/Run-TOGT-Planner/examples/plan_race_example.py
- Show random trajectory
python ${YOUR_TOGT_PLANNER_PATH}/Run-TOGT-Planner/examples/random_race_example.py
If you want to learn more, refer to Tools.
You can get a predefined trajectory below:
The random trajectory examples:
Update: Plot 3D trajectories and visulize with Tube.
- RaceGenerator
- RaceVisualizer