controls  3.0.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TrajectoryBase Class Referenceabstract

Abstract base class for all trajectory representations. More...

#include <TrajectoryBase.h>

Inheritance diagram for TrajectoryBase:
EncircleTrajectory PolyTrajectory

Public Member Functions

virtual ~TrajectoryBase ()=default
 
void start (double t)
 Records the start time of the trajectory. More...
 
State get_model (double t, const State &curr_state)
 Returns the desired body-frame state at time t. More...
 
virtual bool is_finished (double t) const =0
 Returns true if the trajectory has completed at time t. More...
 
virtual double get_progress (double t) const =0
 Returns fractional trajectory progress at time t. More...
 
virtual double get_expected_total_time () const =0
 Returns the total expected duration of the trajectory. More...
 
geometry_msgs::msg::PoseArray get_visualization_msg (double t, double sample_hz=20.0) const
 Builds a PoseArray message sampling the trajectory for RViz visualisation. More...
 

Protected Member Functions

double get_elapsed_time (double t) const
 Returns elapsed time since start(), or 0 if not yet started. More...
 
virtual State get_model_world (double t) const =0
 Evaluates the desired world-frame state at the given ROS time. More...
 

Protected Attributes

std::shared_ptr< Trajectory6DOFLimitsvehicle_limits_
 Velocity and acceleration limits for trajectory planning. More...
 
std::string world_frame_id_
 TF frame ID embedded in visualisation message headers. More...
 
bool started_ = false
 True after start() has been called. More...
 
double start_time_ = 0.0
 ROS time at which start() was called. More...
 

Detailed Description

Abstract base class for all trajectory representations.

A trajectory is a time-parameterised sequence of States expressed in the world frame. Subclasses implement get_model_world() to evaluate the desired position, velocity, and acceleration at a given time. TrajectoryBase converts that world-frame result to the body frame via the Jacobian transform before returning it to the caller.

Constructor & Destructor Documentation

◆ ~TrajectoryBase()

virtual TrajectoryBase::~TrajectoryBase ( )
virtualdefault

Member Function Documentation

◆ get_elapsed_time()

double TrajectoryBase::get_elapsed_time ( double  t) const
protected

Returns elapsed time since start(), or 0 if not yet started.

Parameters
t[in] Current ROS time in seconds
Returns
Elapsed time in seconds

◆ get_expected_total_time()

virtual double TrajectoryBase::get_expected_total_time ( ) const
pure virtual

Returns the total expected duration of the trajectory.

Returns
Expected duration in seconds

Implemented in PolyTrajectory, and EncircleTrajectory.

◆ get_model()

State TrajectoryBase::get_model ( double  t,
const State curr_state 
)

Returns the desired body-frame state at time t.

Internally calls get_model_world() and transforms the result to the body frame using the current vehicle orientation.

Parameters
t[in] Current ROS time in seconds
curr_state[in] Current vehicle state (orientation used for frame conversion)
Returns
Desired State in the body frame

◆ get_model_world()

virtual State TrajectoryBase::get_model_world ( double  t) const
protectedpure virtual

Evaluates the desired world-frame state at the given ROS time.

Parameters
t[in] Current ROS time in seconds; elapsed time is computed internally
Returns
Desired State expressed in the world frame

Implemented in PolyTrajectory, and EncircleTrajectory.

◆ get_progress()

virtual double TrajectoryBase::get_progress ( double  t) const
pure virtual

Returns fractional trajectory progress at time t.

Parameters
t[in] Current ROS time in seconds
Returns
Progress value; semantics are implementation-defined but typically increases from 0 to the number of segments

Implemented in PolyTrajectory, and EncircleTrajectory.

◆ get_visualization_msg()

geometry_msgs::msg::PoseArray TrajectoryBase::get_visualization_msg ( double  t,
double  sample_hz = 20.0 
) const

Builds a PoseArray message sampling the trajectory for RViz visualisation.

Parameters
t[in] Current ROS time used for the message stamp
sample_hz[in] Sampling rate in Hz (default: 20 Hz)
Returns
PoseArray containing sampled world-frame poses along the trajectory

◆ is_finished()

virtual bool TrajectoryBase::is_finished ( double  t) const
pure virtual

Returns true if the trajectory has completed at time t.

Parameters
t[in] Current ROS time in seconds
Returns
True once elapsed time exceeds the trajectory duration

Implemented in PolyTrajectory, and EncircleTrajectory.

◆ start()

void TrajectoryBase::start ( double  t)

Records the start time of the trajectory.

Parameters
t[in] ROS time at which execution begins, in seconds

Member Data Documentation

◆ start_time_

double TrajectoryBase::start_time_ = 0.0
protected

ROS time at which start() was called.

◆ started_

bool TrajectoryBase::started_ = false
protected

True after start() has been called.

◆ vehicle_limits_

std::shared_ptr<Trajectory6DOFLimits> TrajectoryBase::vehicle_limits_
protected

Velocity and acceleration limits for trajectory planning.

◆ world_frame_id_

std::string TrajectoryBase::world_frame_id_
protected

TF frame ID embedded in visualisation message headers.


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