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

#include <st_driving_limits.h>

apollo::planning::STDrivingLimits 的协作图:

Public 成员函数

 STDrivingLimits ()
 
void Init (const double max_acc, const double max_dec, const double max_v, double curr_v)
 
virtual ~STDrivingLimits ()=default
 
std::pair< double, double > GetVehicleDynamicsLimits (const double t) const
 Given time t, calculate the driving limits in s due to vehicle's dynamics.
 
void UpdateBlockingInfo (const double t, const double lower_s, const double lower_v, const double upper_s, const double upper_v)
 Update the anchoring of the vehicle dynamics limits.
 

详细描述

在文件 st_driving_limits.h 第 39 行定义.

构造及析构函数说明

◆ STDrivingLimits()

apollo::planning::STDrivingLimits::STDrivingLimits ( )
inline

在文件 st_driving_limits.h 第 41 行定义.

41{}

◆ ~STDrivingLimits()

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

成员函数说明

◆ GetVehicleDynamicsLimits()

std::pair< double, double > apollo::planning::STDrivingLimits::GetVehicleDynamicsLimits ( const double  t) const

Given time t, calculate the driving limits in s due to vehicle's dynamics.

参数
Timestampt.
返回
The lower and upper bounds.

在文件 st_driving_limits.cc 第 39 行定义.

40 {
41 std::pair<double, double> dynamic_limits;
42 // Process lower bound: (constant deceleration)
43 double dec_time = lower_v0_ / max_dec_;
44 if (t - lower_t0_ < dec_time) {
45 dynamic_limits.first =
46 lower_s0_ + (lower_v0_ - max_dec_ * (t - lower_t0_) + lower_v0_) *
47 (t - lower_t0_) * 0.5;
48 } else {
49 dynamic_limits.first = lower_s0_ + (lower_v0_ * dec_time) * 0.5;
50 }
51
52 // Process upper bound: (constant acceleration)
53 double acc_time = (max_v_ - upper_v0_) / max_acc_;
54 if (t - upper_t0_ < acc_time) {
55 dynamic_limits.second =
56 upper_s0_ + (upper_v0_ + max_acc_ * (t - upper_t0_) + upper_v0_) *
57 (t - upper_t0_) * 0.5;
58 } else {
59 dynamic_limits.second = upper_s0_ + (upper_v0_ + max_v_) * acc_time * 0.5 +
60 (t - upper_t0_ - acc_time) * max_v_;
61 }
62
63 return dynamic_limits;
64}

◆ Init()

void apollo::planning::STDrivingLimits::Init ( const double  max_acc,
const double  max_dec,
const double  max_v,
double  curr_v 
)

在文件 st_driving_limits.cc 第 26 行定义.

27 {
28 max_acc_ = max_acc;
29 max_dec_ = max_dec;
30 max_v_ = max_v;
31 upper_t0_ = 0.0;
32 upper_v0_ = curr_v;
33 upper_s0_ = 0.0;
34 lower_t0_ = 0.0;
35 lower_v0_ = curr_v;
36 lower_s0_ = 0.0;
37}

◆ UpdateBlockingInfo()

void apollo::planning::STDrivingLimits::UpdateBlockingInfo ( const double  t,
const double  lower_s,
const double  lower_v,
const double  upper_s,
const double  upper_v 
)

Update the anchoring of the vehicle dynamics limits.

For example, when ADC is blocked by some obstacle, its max. drivable area, max. speed, etc. are also limited subsequently.

参数
Timet
lowerbound in s
lowerbound's corresponding speed.
upperbound in s
upperbound's corresponding speed.

在文件 st_driving_limits.cc 第 66 行定义.

69 {
70 auto curr_bounds = GetVehicleDynamicsLimits(t);
71 if (curr_bounds.first < lower_s) {
72 // lower_v0_ = std::fmax(lower_v, 0.0);
73 lower_v0_ = std::fmax(0.0, lower_v0_ - max_dec_ * (t - lower_t0_));
74 lower_t0_ = t;
75 lower_s0_ = lower_s;
76 }
77 if (curr_bounds.second > upper_s) {
78 // upper_v0_ = std::fmax(upper_v, 0.0);
79 upper_v0_ = std::fmin(max_v_, upper_v0_ + max_acc_ * (t - upper_t0_));
80 upper_t0_ = t;
81 upper_s0_ = upper_s;
82 }
83}
std::pair< double, double > GetVehicleDynamicsLimits(const double t) const
Given time t, calculate the driving limits in s due to vehicle's dynamics.

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