Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
0c668a12
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,发现更多精彩内容 >>
提交
0c668a12
编写于
4月 05, 2018
作者:
K
kechxu
提交者:
Kecheng Xu
4月 09, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: refactor the framework of move sequence predictor
上级
259ab124
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
35 addition
and
21 deletion
+35
-21
modules/prediction/common/prediction_gflags.cc
modules/prediction/common/prediction_gflags.cc
+1
-1
modules/prediction/common/prediction_gflags.h
modules/prediction/common/prediction_gflags.h
+1
-1
modules/prediction/predictor/move_sequence/move_sequence_predictor.cc
...iction/predictor/move_sequence/move_sequence_predictor.cc
+25
-14
modules/prediction/predictor/move_sequence/move_sequence_predictor.h
...diction/predictor/move_sequence/move_sequence_predictor.h
+8
-5
未找到文件。
modules/prediction/common/prediction_gflags.cc
浏览文件 @
0c668a12
...
...
@@ -147,5 +147,5 @@ DEFINE_double(sample_time_gap, 0.2,
"Gap of time to sample time to get to the lane center"
);
DEFINE_double
(
cost_alpha
,
100.0
,
"The coefficient of lateral acceleration in cost function"
);
DEFINE_double
(
default_time_to_end_state
,
5.0
,
DEFINE_double
(
default_time_to_
lat_
end_state
,
5.0
,
"The default time to lane center"
);
modules/prediction/common/prediction_gflags.h
浏览文件 @
0c668a12
...
...
@@ -102,6 +102,6 @@ DECLARE_double(time_upper_bound_to_lane_center);
DECLARE_double
(
time_lower_bound_to_lane_center
);
DECLARE_double
(
sample_time_gap
);
DECLARE_double
(
cost_alpha
);
DECLARE_double
(
default_time_to_end_state
);
DECLARE_double
(
default_time_to_
lat_
end_state
);
#endif // MODULES_PREDICTION_COMMON_PREDICTION_GFLAGS_H_
modules/prediction/predictor/move_sequence/move_sequence_predictor.cc
浏览文件 @
0c668a12
...
...
@@ -115,16 +115,16 @@ void MoveSequencePredictor::DrawMoveSequenceTrajectoryPoints(
}
Eigen
::
Vector2d
position
(
feature
.
position
().
x
(),
feature
.
position
().
y
());
double
time_to_end_state
=
std
::
max
(
FLAGS_default_time_to_end_state
,
ComputeTimeToLaneCenterByVelocity
(
obstacle
,
lane_sequence
));
double
time_to_lat_end_state
=
std
::
max
(
FLAGS_default_time_to_lat_end_state
,
ComputeTimeToLatEndConditionByVelocity
(
obstacle
,
lane_sequence
));
// double time_to_lon_end_state =
// ComputeTimeToLonEndCondition(obstacle, lane_sequence);
std
::
array
<
double
,
6
>
lateral_coeffs
;
std
::
array
<
double
,
5
>
longitudinal_coeffs
;
GetLateralPolynomial
(
obstacle
,
lane_sequence
,
time_to_end_state
,
GetLateralPolynomial
(
obstacle
,
lane_sequence
,
time_to_
lat_
end_state
,
&
lateral_coeffs
);
GetLongitudinalPolynomial
(
obstacle
,
lane_sequence
,
time_to_end_state
,
&
longitudinal_coeffs
);
GetLongitudinalPolynomial
(
obstacle
,
lane_sequence
,
&
longitudinal_coeffs
);
int
lane_segment_index
=
0
;
std
::
string
lane_id
=
...
...
@@ -140,12 +140,12 @@ void MoveSequencePredictor::DrawMoveSequenceTrajectoryPoints(
double
prev_lane_l
=
lane_l
;
size_t
total_num
=
static_cast
<
size_t
>
(
total_time
/
period
);
size_t
num_to_
center
=
static_cast
<
size_t
>
(
time_to
_end_state
/
period
);
size_t
num_to_
lat_end
=
static_cast
<
size_t
>
(
time_to_lat
_end_state
/
period
);
for
(
size_t
i
=
0
;
i
<
total_num
;
++
i
)
{
double
relative_time
=
static_cast
<
double
>
(
i
)
*
period
;
Eigen
::
Vector2d
point
;
double
theta
=
M_PI
;
if
(
i
<
num_to_
center
)
{
if
(
i
<
num_to_
lat_end
)
{
lane_l
=
EvaluateQuinticPolynomial
(
lateral_coeffs
,
relative_time
,
0
);
}
else
{
lane_l
=
0.0
;
...
...
@@ -197,10 +197,13 @@ void MoveSequencePredictor::DrawMoveSequenceTrajectoryPoints(
void
MoveSequencePredictor
::
GetLongitudinalPolynomial
(
const
Obstacle
&
obstacle
,
const
LaneSequence
&
lane_sequence
,
const
double
time_to_end_state
,
std
::
array
<
double
,
5
>*
coefficients
)
{
std
::
array
<
double
,
5
>*
coefficients
)
{
CHECK_GT
(
obstacle
.
history_size
(),
0
);
CHECK_GT
(
lane_sequence
.
lane_segment_size
(),
0
);
CHECK_GT
(
lane_sequence
.
lane_segment
(
0
).
lane_point_size
(),
0
);
std
::
pair
<
double
,
double
>
lon_end_state
=
ComputeLonEndState
(
obstacle
,
lane_sequence
);
double
time_to_end_state
=
lon_end_state
.
second
;
const
Feature
&
feature
=
obstacle
.
latest_feature
();
double
theta
=
feature
.
velocity_heading
();
double
v
=
feature
.
speed
();
...
...
@@ -215,7 +218,8 @@ void MoveSequencePredictor::GetLongitudinalPolynomial(
double
ds0
=
v
*
std
::
cos
(
theta
-
lane_heading
);
double
dds0
=
a
*
std
::
cos
(
theta
-
lane_heading
);
double
min_end_speed
=
std
::
min
(
FLAGS_still_obstacle_speed_threshold
,
ds0
);
double
ds1
=
std
::
max
(
min_end_speed
,
ds0
+
dds0
*
time_to_end_state
);
// double ds1 = std::max(min_end_speed, ds0 + dds0 * time_to_end_state);
double
ds1
=
lon_end_state
.
first
;
double
dds1
=
0.0
;
double
p
=
time_to_end_state
;
...
...
@@ -274,13 +278,13 @@ void MoveSequencePredictor::GetLateralPolynomial(
coefficients
->
operator
[](
5
)
=
(
6.0
*
c0
-
3.0
*
c1
+
0.5
*
c2
)
/
p2
;
}
double
MoveSequencePredictor
::
ComputeTimeToLa
neCenter
BySampling
(
double
MoveSequencePredictor
::
ComputeTimeToLa
tEndCondition
BySampling
(
const
Obstacle
&
obstacle
,
const
LaneSequence
&
lane_sequence
)
{
std
::
vector
<
double
>
candidate_times
;
GenerateCandidateTimes
(
&
candidate_times
);
if
(
candidate_times
.
empty
())
{
AWARN
<<
"No candidate times found, use default value."
;
return
FLAGS_default_time_to_end_state
;
return
FLAGS_default_time_to_
lat_
end_state
;
}
double
t_best
=
candidate_times
[
0
];
double
cost_min
=
std
::
numeric_limits
<
double
>::
max
();
...
...
@@ -288,7 +292,7 @@ double MoveSequencePredictor::ComputeTimeToLaneCenterBySampling(
std
::
array
<
double
,
6
>
lateral_coeffs
;
std
::
array
<
double
,
5
>
longitudinal_coeffs
;
GetLateralPolynomial
(
obstacle
,
lane_sequence
,
t
,
&
lateral_coeffs
);
GetLongitudinalPolynomial
(
obstacle
,
lane_sequence
,
t
,
&
longitudinal_coeffs
);
GetLongitudinalPolynomial
(
obstacle
,
lane_sequence
,
&
longitudinal_coeffs
);
double
cost
=
Cost
(
t
,
lateral_coeffs
,
longitudinal_coeffs
);
if
(
cost
<
cost_min
)
{
t_best
=
t
;
...
...
@@ -298,7 +302,7 @@ double MoveSequencePredictor::ComputeTimeToLaneCenterBySampling(
return
t_best
;
}
double
MoveSequencePredictor
::
ComputeTimeToLa
neCenter
ByVelocity
(
double
MoveSequencePredictor
::
ComputeTimeToLa
tEndCondition
ByVelocity
(
const
Obstacle
&
obstacle
,
const
LaneSequence
&
lane_sequence
)
{
CHECK_GT
(
obstacle
.
history_size
(),
0
);
CHECK_GT
(
lane_sequence
.
lane_segment_size
(),
0
);
...
...
@@ -319,6 +323,13 @@ double MoveSequencePredictor::ComputeTimeToLaneCenterByVelocity(
return
std
::
fabs
(
lane_l
/
v_l
);
}
std
::
pair
<
double
,
double
>
MoveSequencePredictor
::
ComputeLonEndState
(
const
Obstacle
&
obstacle
,
const
LaneSequence
&
lane_sequence
)
{
// TODO(kechxu) implement
double
t
=
5.0
;
return
{
0.0
,
t
};
}
double
MoveSequencePredictor
::
Cost
(
const
double
t
,
const
std
::
array
<
double
,
6
>&
lateral_coeffs
,
const
std
::
array
<
double
,
5
>&
longitudinal_coeffs
)
{
...
...
modules/prediction/predictor/move_sequence/move_sequence_predictor.h
浏览文件 @
0c668a12
...
...
@@ -25,6 +25,7 @@
#include <array>
#include <string>
#include <vector>
#include <utility>
#include "Eigen/Dense"
#include "modules/common/math/kalman_filter.h"
...
...
@@ -61,7 +62,6 @@ class MoveSequencePredictor : public SequencePredictor {
void
GetLongitudinalPolynomial
(
const
Obstacle
&
obstacle
,
const
LaneSequence
&
lane_sequence
,
const
double
time_to_end_state
,
std
::
array
<
double
,
5
>*
coefficients
);
void
GetLateralPolynomial
(
const
Obstacle
&
obstacle
,
...
...
@@ -69,11 +69,14 @@ class MoveSequencePredictor : public SequencePredictor {
const
double
time_to_end_state
,
std
::
array
<
double
,
6
>*
coefficients
);
double
ComputeTimeToLa
neCenterBySampling
(
const
Obstacle
&
obstacle
,
const
LaneSequence
&
lane_sequence
);
double
ComputeTimeToLa
tEndConditionBySampling
(
const
Obstacle
&
obstacle
,
const
LaneSequence
&
lane_sequence
);
double
ComputeTimeToLaneCenterByVelocity
(
const
Obstacle
&
obstacle
,
const
LaneSequence
&
lane_sequence
);
double
ComputeTimeToLatEndConditionByVelocity
(
const
Obstacle
&
obstacle
,
const
LaneSequence
&
lane_sequence
);
std
::
pair
<
double
,
double
>
ComputeLonEndState
(
const
Obstacle
&
obstacle
,
const
LaneSequence
&
lane_sequence
);
double
Cost
(
const
double
t
,
const
std
::
array
<
double
,
6
>&
lateral_coeffs
,
const
std
::
array
<
double
,
5
>&
longitudinal_coeffs
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录