Apollo  6.0
Open source self driving car software
Public Member Functions | List of all members
apollo::control::TrajectoryAnalyzer Class Reference

process point query and conversion related to trajectory More...

#include <trajectory_analyzer.h>

Collaboration diagram for apollo::control::TrajectoryAnalyzer:
Collaboration graph

Public Member Functions

 TrajectoryAnalyzer ()=default
 constructor More...
 
 TrajectoryAnalyzer (const planning::ADCTrajectory *planning_published_trajectory)
 constructor More...
 
 ~TrajectoryAnalyzer ()=default
 destructor More...
 
unsigned int seq_num ()
 get sequence number of the trajectory More...
 
common::TrajectoryPoint QueryNearestPointByAbsoluteTime (const double t) const
 query a point of trajectory that its absolute time is closest to the give time. More...
 
common::TrajectoryPoint QueryNearestPointByRelativeTime (const double t) const
 query a point of trajectory that its relative time is closest to the give time. The time is relative to the first pointof trajectory More...
 
common::TrajectoryPoint QueryNearestPointByPosition (const double x, const double y) const
 query a point of trajectory that its position is closest to the given position. More...
 
common::PathPoint QueryMatchedPathPoint (const double x, const double y) const
 query a point on trajectory that its position is closest to the given position. More...
 
void ToTrajectoryFrame (const double x, const double y, const double theta, const double v, const common::PathPoint &matched_point, double *ptr_s, double *ptr_s_dot, double *ptr_d, double *ptr_d_dot) const
 convert a position with theta and speed to trajectory frame, More...
 
void TrajectoryTransformToCOM (const double rear_to_com_distance)
 Transform the current trajectory points to the center of mass(COM) of the vehicle, given the distance from rear wheels to the center of mass. More...
 
common::math::Vec2d ComputeCOMPosition (const double rear_to_com_distance, const common::PathPoint &path_point) const
 Compute the position of center of mass(COM) of the vehicle, given the distance from rear wheels to the center of mass. More...
 
const std::vector< common::TrajectoryPoint > & trajectory_points () const
 get all points of the trajectory More...
 

Detailed Description

process point query and conversion related to trajectory

Constructor & Destructor Documentation

◆ TrajectoryAnalyzer() [1/2]

apollo::control::TrajectoryAnalyzer::TrajectoryAnalyzer ( )
default

constructor

◆ TrajectoryAnalyzer() [2/2]

apollo::control::TrajectoryAnalyzer::TrajectoryAnalyzer ( const planning::ADCTrajectory *  planning_published_trajectory)

constructor

Parameters
planning_published_trajectorytrajectory data generated by planning module

◆ ~TrajectoryAnalyzer()

apollo::control::TrajectoryAnalyzer::~TrajectoryAnalyzer ( )
default

destructor

Member Function Documentation

◆ ComputeCOMPosition()

common::math::Vec2d apollo::control::TrajectoryAnalyzer::ComputeCOMPosition ( const double  rear_to_com_distance,
const common::PathPoint &  path_point 
) const

Compute the position of center of mass(COM) of the vehicle, given the distance from rear wheels to the center of mass.

Parameters
rear_to_com_distanceDistance from rear wheels to the vehicle's center of mass.
path_pointPathPoint along the published planning trajectory.
Returns
The position of the vehicle's center of mass.

◆ QueryMatchedPathPoint()

common::PathPoint apollo::control::TrajectoryAnalyzer::QueryMatchedPathPoint ( const double  x,
const double  y 
) const

query a point on trajectory that its position is closest to the given position.

Parameters
xvalue of x-coordination in the given position
yvalue of y-coordination in the given position
Returns
a point on trajectory, the point may be a point of trajectory or interpolated by two adjacent points of trajectory

◆ QueryNearestPointByAbsoluteTime()

common::TrajectoryPoint apollo::control::TrajectoryAnalyzer::QueryNearestPointByAbsoluteTime ( const double  t) const

query a point of trajectory that its absolute time is closest to the give time.

Parameters
tabsolute time for query
Returns
a point of trajectory

◆ QueryNearestPointByPosition()

common::TrajectoryPoint apollo::control::TrajectoryAnalyzer::QueryNearestPointByPosition ( const double  x,
const double  y 
) const

query a point of trajectory that its position is closest to the given position.

Parameters
xvalue of x-coordination in the given position
yvalue of y-coordination in the given position
Returns
a point of trajectory

◆ QueryNearestPointByRelativeTime()

common::TrajectoryPoint apollo::control::TrajectoryAnalyzer::QueryNearestPointByRelativeTime ( const double  t) const

query a point of trajectory that its relative time is closest to the give time. The time is relative to the first pointof trajectory

Parameters
trelative time for query
Returns
a point of trajectory

◆ seq_num()

unsigned int apollo::control::TrajectoryAnalyzer::seq_num ( )
inline

get sequence number of the trajectory

Returns
sequence number.

◆ ToTrajectoryFrame()

void apollo::control::TrajectoryAnalyzer::ToTrajectoryFrame ( const double  x,
const double  y,
const double  theta,
const double  v,
const common::PathPoint &  matched_point,
double *  ptr_s,
double *  ptr_s_dot,
double *  ptr_d,
double *  ptr_d_dot 
) const

convert a position with theta and speed to trajectory frame,

  • longitudinal and lateral direction to the trajectory
    Parameters
    xx-value of the position
    yy-value of the position
    thetaheading angle on the position
    vspeed on the position
    matched_pointmatched point on trajectory for the given position
    ptr_slongitudinal distance
    ptr_s_dotlongitudinal speed
    ptr_dlateral distance
    ptr_d_dotlateral speed

◆ trajectory_points()

const std::vector<common::TrajectoryPoint>& apollo::control::TrajectoryAnalyzer::trajectory_points ( ) const

get all points of the trajectory

Returns
a vector of trajectory points

◆ TrajectoryTransformToCOM()

void apollo::control::TrajectoryAnalyzer::TrajectoryTransformToCOM ( const double  rear_to_com_distance)

Transform the current trajectory points to the center of mass(COM) of the vehicle, given the distance from rear wheels to the center of mass.

Parameters
rear_to_com_distanceDistance from rear wheels to the vehicle's center of mass.

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