Apollo 11.0
自动驾驶开放平台
apollo::control::TrajectoryAnalyzerExtend类 参考

process point query and conversion related to trajectory 更多...

#include <trajectory_analyzer_extend.h>

类 apollo::control::TrajectoryAnalyzerExtend 继承关系图:
apollo::control::TrajectoryAnalyzerExtend 的协作图:

Public 成员函数

 TrajectoryAnalyzerExtend ()=default
 constructor
 
 TrajectoryAnalyzerExtend (const planning::ADCTrajectory *planning_published_trajectory)
 
 ~TrajectoryAnalyzerExtend ()=default
 destructor
 
common::TrajectoryPoint QueryNearestPointByRelativeStation (const common::TrajectoryPoint &ref_point, const double &relative_station) const
 query a point of trajectory that its s distance for reference trajectory point is closest to the give reference trajectory point and relative s distance.
 
- Public 成员函数 继承自 apollo::control::TrajectoryAnalyzer
 TrajectoryAnalyzer ()=default
 constructor
 
 TrajectoryAnalyzer (const planning::ADCTrajectory *planning_published_trajectory)
 constructor
 
 ~TrajectoryAnalyzer ()=default
 destructor
 
unsigned int seq_num ()
 get sequence number of the trajectory
 
common::TrajectoryPoint QueryNearestPointByAbsoluteTime (const double t) const
 query a point of trajectory that its absolute time is closest to the give time.
 
common::TrajectoryPoint QueryNearestPointByRelativeTime (const double t) const
 query a point of trajectory that its relative time is closest to the give time.
 
common::TrajectoryPoint QueryNearestPointByPosition (const double x, const double y) const
 query a point of trajectory that its position is closest to the given position.
 
common::PathPoint QueryMatchedPathPoint (const double x, const double y) const
 query a point on trajectory that its position is closest to the given position.
 
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,
 
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.
 
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.
 
const std::vector< common::TrajectoryPoint > & trajectory_points () const
 get all points of the trajectory
 

额外继承的成员函数

- Protected 属性 继承自 apollo::control::TrajectoryAnalyzer
std::vector< common::TrajectoryPoint > trajectory_points_
 
double header_time_ = 0.0
 
unsigned int seq_num_ = 0
 

详细描述

process point query and conversion related to trajectory

在文件 trajectory_analyzer_extend.h 第 48 行定义.

构造及析构函数说明

◆ TrajectoryAnalyzerExtend() [1/2]

apollo::control::TrajectoryAnalyzerExtend::TrajectoryAnalyzerExtend ( )
default

constructor

◆ TrajectoryAnalyzerExtend() [2/2]

apollo::control::TrajectoryAnalyzerExtend::TrajectoryAnalyzerExtend ( const planning::ADCTrajectory *  planning_published_trajectory)
inline

在文件 trajectory_analyzer_extend.h 第 55 行定义.

55 :
56 TrajectoryAnalyzer(planning_published_trajectory) {}
TrajectoryAnalyzer()=default
constructor

◆ ~TrajectoryAnalyzerExtend()

apollo::control::TrajectoryAnalyzerExtend::~TrajectoryAnalyzerExtend ( )
default

destructor

成员函数说明

◆ QueryNearestPointByRelativeStation()

TrajectoryPoint apollo::control::TrajectoryAnalyzerExtend::QueryNearestPointByRelativeStation ( const common::TrajectoryPoint &  ref_point,
const double &  relative_station 
) const

query a point of trajectory that its s distance for reference trajectory point is closest to the give reference trajectory point and relative s distance.

The relative s distance is relative to the reference trajectory point

参数
trelative s distance for query
返回
a point of trajectory

在文件 trajectory_analyzer_extend.cc 第 37 行定义.

39 {
40 std::vector<std::pair<const common::TrajectoryPoint, double>> relative_trajectory_point;
41 relative_trajectory_point.push_back(std::make_pair(ref_point, relative_station));
42 auto func_comp
43 = [](const TrajectoryPoint &point,
44 const std::vector<std::pair<const common::TrajectoryPoint, double>> &relative_trajectory_point) {
45 return point.path_point().s()
46 < relative_trajectory_point[0].first.path_point().s() + relative_trajectory_point[0].second;
47 };
48
49 auto it_low = std::lower_bound(
50 trajectory_points_.begin(), trajectory_points_.end(), relative_trajectory_point, func_comp);
51
52 if (it_low == trajectory_points_.begin()) {
53 return trajectory_points_.front();
54 }
55
56 if (it_low == trajectory_points_.end()) {
57 return trajectory_points_.back();
58 }
59
60 if (FLAGS_query_forward_station_point_only) {
61 return *it_low;
62 } else {
63 auto it_lower = it_low - 1;
64 if (it_low->path_point().s() - ref_point.path_point().s()
65 < ref_point.path_point().s() - it_lower->path_point().s()) {
66 return *it_low;
67 }
68 return *it_lower;
69 }
70}
std::vector< common::TrajectoryPoint > trajectory_points_

该类的文档由以下文件生成: