Thunderbots Project
Loading...
Searching...
No Matches
BangBangTrajectory1D Class Reference
Inheritance diagram for BangBangTrajectory1D:
Collaboration diagram for BangBangTrajectory1D:

Classes

struct  TrajectoryPart
 

Public Member Functions

 BangBangTrajectory1D ()
 
void generate (double initial_pos, double final_pos, double initial_vel, double max_vel, double max_accel, double max_decel)
 
double getPosition (double t_sec) const override
 
double getVelocity (double t_sec) const override
 
double getAcceleration (double t_sec) const override
 
double getTotalTime () const override
 
std::pair< double, double > getMinMaxPositions () const
 
const TrajectoryPartgetTrajectoryPart (size_t index) const
 
size_t getNumTrajectoryParts () const
 
- Public Member Functions inherited from Trajectory< double, double, double >
double getDestination () const
 

Constructor & Destructor Documentation

◆ BangBangTrajectory1D()

Constructor

Member Function Documentation

◆ generate()

void generate ( double  initial_pos,
double  final_pos,
double  initial_vel,
double  max_vel,
double  max_accel,
double  max_decel 
)

Generate a 1D trajectory from the initial position to the final position with the given initial velocity and kinematic constraints.

Note
This method will overwrite the existing trajectory.
The generated trajectory will always have a final velocity of 0
Parameters
initial_posStarting position of the trajectory
final_posDestination. Where the trajectory should end at
initial_velThe velocity at the start of the trajectory
max_velThe maximum velocity (magnitude) the trajectory could have. Must be non-zero.
max_accelThe maximum acceleration the trajectory could have. Must be non-zero.
max_decelThe maximum deceleration the trajectory could have. Must be non-zero.

◆ getAcceleration()

double getAcceleration ( double  t_sec) const
overridevirtual

Get acceleration at time t

Parameters
t_secDuration elapsed since start of trajectory in seconds
Returns
The acceleration at time t

Implements Trajectory< double, double, double >.

◆ getMinMaxPositions()

std::pair< double, double > getMinMaxPositions ( ) const

Get the minimum and maximum positions that the trajectory will reach

Returns
A pair where the first value is the minimum and the second value is the maximum positions

◆ getNumTrajectoryParts()

size_t getNumTrajectoryParts ( ) const

Get the number of trajectory parts that make up the generated trajectory.

Returns
The number of trajectory parts

◆ getPosition()

double getPosition ( double  t_sec) const
overridevirtual

Get position at time t

Parameters
t_secDuration elapsed since start of trajectory in seconds
Returns
The position at time t

Implements Trajectory< double, double, double >.

◆ getTotalTime()

double getTotalTime ( ) const
inlineoverridevirtual

Get total runtime of trajectory

Returns
total time for trajectory

Implements Trajectory< double, double, double >.

◆ getTrajectoryPart()

const BangBangTrajectory1D::TrajectoryPart & getTrajectoryPart ( size_t  index) const

Get the trajectory part at index that makes up the generated trajectory

Note
Crashes if index is out of bound
Returns
Trajectory parts

◆ getVelocity()

double getVelocity ( double  t_sec) const
overridevirtual

Get velocity at time t

Parameters
t_secDuration elapsed since start of trajectory in seconds
Returns
The velocity at time t

Implements Trajectory< double, double, double >.


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