Apollo 11.0
自动驾驶开放平台
apollo::planning::Trajectory1dGenerator类 参考

#include <trajectory1d_generator.h>

apollo::planning::Trajectory1dGenerator 的协作图:

Public 成员函数

 Trajectory1dGenerator (const std::array< double, 3 > &lon_init_state, const std::array< double, 3 > &lat_init_state, std::shared_ptr< PathTimeGraph > ptr_path_time_graph, std::shared_ptr< PredictionQuerier > ptr_prediction_querier)
 
virtual ~Trajectory1dGenerator ()=default
 
void GenerateTrajectoryBundles (const PlanningTarget &planning_target, std::vector< std::shared_ptr< Curve1d > > *ptr_lon_trajectory_bundle, std::vector< std::shared_ptr< Curve1d > > *ptr_lat_trajectory_bundle)
 
void GenerateLateralTrajectoryBundle (std::vector< std::shared_ptr< Curve1d > > *ptr_lat_trajectory_bundle) const
 

详细描述

在文件 trajectory1d_generator.h 第 40 行定义.

构造及析构函数说明

◆ Trajectory1dGenerator()

apollo::planning::Trajectory1dGenerator::Trajectory1dGenerator ( const std::array< double, 3 > &  lon_init_state,
const std::array< double, 3 > &  lat_init_state,
std::shared_ptr< PathTimeGraph >  ptr_path_time_graph,
std::shared_ptr< PredictionQuerier >  ptr_prediction_querier 
)

在文件 trajectory1d_generator.cc 第 40 行定义.

44 : init_lon_state_(lon_init_state),
45 init_lat_state_(lat_init_state),
46 end_condition_sampler_(lon_init_state, lat_init_state,
47 ptr_path_time_graph, ptr_prediction_querier),
48 ptr_path_time_graph_(ptr_path_time_graph) {}

◆ ~Trajectory1dGenerator()

virtual apollo::planning::Trajectory1dGenerator::~Trajectory1dGenerator ( )
virtualdefault

成员函数说明

◆ GenerateLateralTrajectoryBundle()

void apollo::planning::Trajectory1dGenerator::GenerateLateralTrajectoryBundle ( std::vector< std::shared_ptr< Curve1d > > *  ptr_lat_trajectory_bundle) const

在文件 trajectory1d_generator.cc 第 120 行定义.

121 {
122 if (!FLAGS_lateral_optimization) {
123 auto end_conditions = end_condition_sampler_.SampleLatEndConditions();
124
125 // Use the common function to generate trajectory bundles.
126 GenerateTrajectory1DBundle<5>(init_lat_state_, end_conditions,
127 ptr_lat_trajectory_bundle);
128 } else {
129 double s_min = init_lon_state_[0];
130 double s_max = s_min + FLAGS_max_s_lateral_optimization;
131
132 double delta_s = FLAGS_default_delta_s_lateral_optimization;
133
134 auto lateral_bounds =
135 ptr_path_time_graph_->GetLateralBounds(s_min, s_max, delta_s);
136
137 // LateralTrajectoryOptimizer lateral_optimizer;
138 std::unique_ptr<LateralQPOptimizer> lateral_optimizer(
139 new LateralOSQPOptimizer);
140
141 lateral_optimizer->optimize(init_lat_state_, delta_s, lateral_bounds);
142
143 auto lateral_trajectory = lateral_optimizer->GetOptimalTrajectory();
144
145 ptr_lat_trajectory_bundle->push_back(
146 std::make_shared<PiecewiseJerkTrajectory1d>(lateral_trajectory));
147 }
148}
std::vector< std::pair< std::array< double, 3 >, double > > SampleLatEndConditions() const

◆ GenerateTrajectoryBundles()

void apollo::planning::Trajectory1dGenerator::GenerateTrajectoryBundles ( const PlanningTarget &  planning_target,
std::vector< std::shared_ptr< Curve1d > > *  ptr_lon_trajectory_bundle,
std::vector< std::shared_ptr< Curve1d > > *  ptr_lat_trajectory_bundle 
)

在文件 trajectory1d_generator.cc 第 50 行定义.

53 {
54 GenerateLongitudinalTrajectoryBundle(planning_target,
55 ptr_lon_trajectory_bundle);
56
57 GenerateLateralTrajectoryBundle(ptr_lat_trajectory_bundle);
58}
void GenerateLateralTrajectoryBundle(std::vector< std::shared_ptr< Curve1d > > *ptr_lat_trajectory_bundle) const

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