Brick
Loading...
Searching...
No Matches
TrajectorySampler Class Reference

#include <trajectory.h>

Description

High-efficiency streaming sampler for real-time control loops.

Caches the search index during sequential calls to sample(units::Time t), achieving O(1) step lookup in 100Hz loop cycles.

Public Member Functions

 TrajectorySampler (const Trajectory &trajectory)
 Constructs a TrajectorySampler bound to a target Trajectory.
void reset ()
 Resets cached index back to start.
Trajectory::State sample (units::Time t)
 Samples state at timestamp t using cached sequential lookup (O(1)).

Constructor & Destructor Documentation

◆ TrajectorySampler()

TrajectorySampler::TrajectorySampler ( const Trajectory & trajectory)
inlineexplicit

Constructs a TrajectorySampler bound to a target Trajectory.

Warning
The TrajectorySampler holds a non-owning pointer to the trajectory. The provided Trajectory object MUST outlive the sampler. Do not pass temporary objects.
Parameters
trajectoryReference to trajectory to sample.

Member Function Documentation

◆ sample()

Trajectory::State TrajectorySampler::sample ( units::Time t)
inline

Samples state at timestamp t using cached sequential lookup (O(1)).

Parameters
tTarget timestamp.
Returns
Interpolated State.

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