Skip to content

Files

Latest commit

41a32ad · Feb 21, 2025

History

History
This branch is 4 commits ahead of, 6 commits behind SleipnirGroup/Choreo:main.

trajoptlib

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Oct 24, 2024
Dec 4, 2024
Jan 23, 2025
Jan 23, 2025
Jan 4, 2025
Jul 8, 2024
Dec 15, 2024
Jul 8, 2024
Jul 8, 2024
Feb 21, 2025
Jan 9, 2025
Jul 8, 2024
Nov 20, 2024
Jul 8, 2024
Jan 6, 2025

TrajoptLib

Build

This library is used to generate time-optimal trajectories for FRC robots.

Trajectory optimization works by mathematically formulating the problem of travelling along a given path with the minimum possible time. The physical constraints of motor power capacity are applied along with waypoint constraints, which force the robot to begin and end a segment of the trajectory with a certain state. A mathematical solver must vary the position of the robot at each discrete timestamp to minimize total time.

Features

  • Currently only supports swerve drives with arbitrary module configurations
  • Position and velocity constraints at each waypoint
  • Keep-out circle and polygons
  • Custom physical constraints of robot
  • Custom bumper shape

Build

Dependencies

  • C++20 compiler
    • On Windows 10 or greater, install Visual Studio Community 2022 and select the C++ programming language during installation
    • On Ubuntu 22.04 or greater, install GCC 11 via sudo apt install g++-11
    • On macOS 13.3 or greater, install the Xcode 14 command-line build tools via xcode-select --install
  • CMake 3.21 or greater
    • On Windows, install from the link above
    • On Linux, install via sudo apt install cmake
    • On macOS, install via brew install cmake
  • Rust compiler
  • Sleipnir
  • Catch2 (tests only)

Library dependencies which aren't installed locally will be automatically downloaded and built by CMake.

C++ library

On Windows, open a Developer PowerShell. On Linux or macOS, open a Bash shell.

# Clone the repository
git clone git@github.com:SleipnirGroup/TrajoptLib
cd TrajoptLib

# Configure
cmake -B build -S .

# Build
cmake --build build

# Test
ctest --test-dir build --output-on-failure

# Install
cmake --install build --prefix pkgdir

The following build types can be specified via -DCMAKE_BUILD_TYPE during CMake configure:

  • Debug
    • Optimizations off
    • Debug symbols on
  • Release
    • Optimizations on
    • Debug symbols off
  • RelWithDebInfo (default)
    • Release build type, but with debug info
  • MinSizeRel
    • Minimum size release build

Rust library

On Windows, open a Developer PowerShell. On Linux or macOS, open a Bash shell.

# Clone the repository
git clone git@github.com:SleipnirGroup/TrajoptLib
cd TrajoptLib

cargo build