Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
d616cad1
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d616cad1
编写于
3月 31, 2019
作者:
K
kechxu
提交者:
Kecheng Xu
3月 31, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: move some constants to gflags
上级
a5531edc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
31 addition
and
15 deletion
+31
-15
modules/prediction/common/prediction_gflags.cc
modules/prediction/common/prediction_gflags.cc
+13
-2
modules/prediction/common/prediction_gflags.h
modules/prediction/common/prediction_gflags.h
+7
-1
modules/prediction/predictor/interaction/interaction_predictor.cc
...prediction/predictor/interaction/interaction_predictor.cc
+11
-12
未找到文件。
modules/prediction/common/prediction_gflags.cc
浏览文件 @
d616cad1
...
...
@@ -51,6 +51,8 @@ DEFINE_double(lane_search_radius_in_junction, 15.0,
DEFINE_double
(
junction_search_radius
,
1.0
,
"Search radius for a junction"
);
DEFINE_double
(
pedestrian_nearby_lane_search_radius
,
5.0
,
"Radius to determine if pedestrian-like obstacle is near lane."
);
DEFINE_int32
(
road_graph_max_search_horizon
,
20
,
"Maximal search depth for building road graph"
);
// Scenario
DEFINE_double
(
junction_distance_threshold
,
10.0
,
...
...
@@ -251,8 +253,17 @@ DEFINE_double(cost_function_sigma, 5.0,
DEFINE_bool
(
use_bell_curve_for_cost_function
,
false
,
"Whether to use bell curve for the cost function or not."
);
DEFINE_int32
(
road_graph_max_search_horizon
,
20
,
"Maximal search depth for building road graph"
);
// interaction predictor
DEFINE_double
(
collision_cost_time_resolution
,
1.0
,
"The time resolution used to compute the collision cost"
);
DEFINE_double
(
centripedal_acceleration_cost_weight
,
1.0
,
"The weight of the cost related to centripedal acceleration"
);
DEFINE_double
(
collision_cost_weight
,
1.0
,
"The weight of the cost related to collision"
);
DEFINE_double
(
collision_cost_exp_coefficient
,
1.0
,
"The coefficient in the collision exponential cost function"
);
DEFINE_double
(
likelihood_exp_coefficient
,
1.0
,
"The coefficient in the likelihood exponential function"
);
DEFINE_double
(
lane_distance_threshold
,
3.0
,
"The threshold for distance to ego/neighbor lane "
...
...
modules/prediction/common/prediction_gflags.h
浏览文件 @
d616cad1
...
...
@@ -40,6 +40,7 @@ DECLARE_double(lane_search_radius);
DECLARE_double
(
lane_search_radius_in_junction
);
DECLARE_double
(
junction_search_radius
);
DECLARE_double
(
pedestrian_nearby_lane_search_radius
);
DECLARE_int32
(
road_graph_max_search_horizon
);
// Scenario
DECLARE_double
(
junction_distance_threshold
);
...
...
@@ -147,7 +148,12 @@ DECLARE_double(cost_function_alpha);
DECLARE_double
(
cost_function_sigma
);
DECLARE_bool
(
use_bell_curve_for_cost_function
);
DECLARE_int32
(
road_graph_max_search_horizon
);
// interaction predictor
DECLARE_double
(
collision_cost_time_resolution
);
DECLARE_double
(
centripedal_acceleration_cost_weight
);
DECLARE_double
(
collision_cost_weight
);
DECLARE_double
(
collision_cost_exp_coefficient
);
DECLARE_double
(
likelihood_exp_coefficient
);
// scenario feature extraction
DECLARE_double
(
lane_distance_threshold
);
...
...
modules/prediction/predictor/interaction/interaction_predictor.cc
浏览文件 @
d616cad1
...
...
@@ -39,8 +39,7 @@ using apollo::prediction::math_util::EvaluateQuarticPolynomial;
using
apollo
::
prediction
::
math_util
::
EvaluateQuinticPolynomial
;
InteractionPredictor
::
InteractionPredictor
()
{
// TODO(kechxu) move constants to gflags
BuildADCTrajectory
(
1.0
);
BuildADCTrajectory
(
FLAGS_collision_cost_time_resolution
);
}
void
InteractionPredictor
::
Predict
(
Obstacle
*
obstacle
)
{
...
...
@@ -99,6 +98,10 @@ void InteractionPredictor::BuildADCTrajectory(const double time_resolution) {
auto
adc_trajectory_container
=
ContainerManager
::
Instance
()
->
GetContainer
<
ADCTrajectoryContainer
>
(
AdapterConfig
::
PLANNING_TRAJECTORY
);
if
(
adc_trajectory_container
==
nullptr
)
{
AERROR
<<
"Null adc trajectory container"
;
return
;
}
const
auto
&
adc_trajectory
=
adc_trajectory_container
->
adc_trajectory
();
double
curr_timestamp
=
0.0
;
for
(
const
TrajectoryPoint
&
point
:
adc_trajectory
.
trajectory_point
())
{
...
...
@@ -243,9 +246,8 @@ double InteractionPredictor::ComputeTrajectoryCost(
const
Obstacle
&
obstacle
,
const
LaneSequence
&
lane_sequence
,
const
LatLonPolynomialBundle
&
lat_lon_polynomial_bundle
)
{
// TODO(kechxu) adjust and move to gflags
double
centri_acc_weight
=
1.0
;
double
collision_weight
=
1.0
;
double
centri_acc_weight
=
FLAGS_centripedal_acceleration_cost_weight
;
double
collision_weight
=
FLAGS_collision_cost_weight
;
double
total_cost
=
0.0
;
double
centri_acc_cost
=
CentripetalAccelerationCost
(
lane_sequence
,
lat_lon_polynomial_bundle
);
...
...
@@ -267,8 +269,6 @@ double InteractionPredictor::CentripetalAccelerationCost(
double
cost_abs_sum
=
0.0
;
double
cost_sqr_sum
=
0.0
;
// TODO(kechxu) use flags
double
time_resolution
=
1.0
;
double
curr_time
=
0.0
;
while
(
curr_time
<
FLAGS_prediction_trajectory_time_length
)
{
double
s
=
EvaluateQuarticPolynomial
(
lon_coeffs
,
curr_time
,
0
,
...
...
@@ -279,7 +279,7 @@ double InteractionPredictor::CentripetalAccelerationCost(
double
centri_acc
=
v
*
v
*
kappa
;
cost_abs_sum
+=
std
::
abs
(
centri_acc
);
cost_sqr_sum
+=
centri_acc
*
centri_acc
;
curr_time
+=
time_resolution
;
curr_time
+=
FLAGS_collision_cost_
time_resolution
;
}
return
cost_sqr_sum
/
(
cost_abs_sum
+
FLAGS_double_precision
);
}
...
...
@@ -303,8 +303,8 @@ double InteractionPredictor::CollisionWithEgoVehicleCost(
double
adc_x
=
adc_trajectory_point
.
path_point
().
x
();
double
adc_y
=
adc_trajectory_point
.
path_point
().
y
();
double
distance
=
std
::
hypot
(
adc_x
-
pos_x
,
adc_y
-
pos_y
);
// TODO(kechxu) adjust parameter
double
cost
=
std
::
exp
(
-
1.0
*
distance
*
distance
);
double
cost
=
std
::
exp
(
-
FLAGS_collision_cost_exp_coefficient
*
distance
*
distance
);
cost_abs_sum
+=
std
::
abs
(
cost
);
cost_sqr_sum
+=
cost
*
cost
;
}
...
...
@@ -317,8 +317,7 @@ bool InteractionPredictor::LowerRightOfWayThanEgo(
}
double
InteractionPredictor
::
ComputeLikelihood
(
const
double
cost
)
{
// TODO(kechxu) adjust alpha
double
alpha
=
1.0
;
double
alpha
=
FLAGS_likelihood_exp_coefficient
;
return
std
::
exp
(
-
alpha
*
cost
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录