ChoreoLib
Choreo support library.
Loading...
Searching...
No Matches
choreo::Choreo::TrajectoryCache< SampleType > Class Template Reference

#include <choreo/Choreo.h>

Static Public Member Functions

static std::optional< Trajectory< SampleType > > LoadTrajectory (std::string_view trajectoryName)
 
static std::optional< Trajectory< SampleType > > LoadTrajectory (std::string_view trajectoryName, int splitIndex)
 
static void Clear ()
 

Detailed Description

template<TrajectorySample SampleType>
class choreo::Choreo::TrajectoryCache< SampleType >

A utility for caching loaded trajectories. This allows for loading trajectories only once, and then reusing them.

Member Function Documentation

◆ Clear()

template<TrajectorySample SampleType>
static void choreo::Choreo::TrajectoryCache< SampleType >::Clear ( )
inlinestatic

Clears the trajectory cache.

◆ LoadTrajectory() [1/2]

template<TrajectorySample SampleType>
static std::optional< Trajectory< SampleType > > choreo::Choreo::TrajectoryCache< SampleType >::LoadTrajectory ( std::string_view  trajectoryName)
inlinestatic

Load a trajectory from the deploy directory. Choreolib expects .traj files to be placed in src/main/deploy/choreo/[trajectoryName].traj.

This method will cache the loaded trajectory and reused it if it is requested again.

Parameters
trajectoryNamethe path name in Choreo, which matches the file name in the deploy directory, file extension is optional.
Returns
the loaded trajectory, or empty std::optional if the trajectory could not be loaded.
See also
Choreo::LoadTrajectory(std::string_view)

◆ LoadTrajectory() [2/2]

template<TrajectorySample SampleType>
static std::optional< Trajectory< SampleType > > choreo::Choreo::TrajectoryCache< SampleType >::LoadTrajectory ( std::string_view  trajectoryName,
int  splitIndex 
)
inlinestatic

Load a section of a split trajectory from the deploy directory. Choreolib expects .traj files to be placed in src/main/deploy/choreo/[trajectoryName].traj.

This method will cache the loaded trajectory and reused it if it is requested again. The trajectory that is split off of will also be cached.

Parameters
trajectoryNamethe path name in Choreo, which matches the file name in the deploy directory, file extension is optional.
splitIndexthe index of the split trajectory to load
Returns
the loaded trajectory, or empty std::optional if the trajectory could not be loaded.
See also
Choreo::LoadTrajectory(std::string_view)

The documentation for this class was generated from the following file: