Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
9d46f0d2
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,发现更多精彩内容 >>
提交
9d46f0d2
编写于
7月 26, 2017
作者:
K
kechxu
提交者:
Jiangtao Hu
7月 26, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
implement pedestrian prediction trajectory generation
上级
26b2dbd1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
85 addition
and
0 deletion
+85
-0
modules/prediction/common/prediction_gflags.cc
modules/prediction/common/prediction_gflags.cc
+3
-0
modules/prediction/common/prediction_gflags.h
modules/prediction/common/prediction_gflags.h
+3
-0
modules/prediction/predictor/pedestrian/regional_predictor.cc
...les/prediction/predictor/pedestrian/regional_predictor.cc
+65
-0
modules/prediction/predictor/pedestrian/regional_predictor.h
modules/prediction/predictor/pedestrian/regional_predictor.h
+14
-0
未找到文件。
modules/prediction/common/prediction_gflags.cc
浏览文件 @
9d46f0d2
...
...
@@ -59,6 +59,9 @@ DEFINE_double(max_lane_angle_diff, M_PI / 2.0,
"Max angle difference for a candiate lane"
);
DEFINE_bool
(
enable_pedestrian_acc
,
false
,
"Enable calculating speed by acc"
);
DEFINE_double
(
coeff_mul_sigma
,
2.0
,
"coefficient multiply standard deviation"
);
DEFINE_double
(
pedestrian_max_speed
,
10.0
,
"speed upper bound for pedestrian"
);
DEFINE_double
(
pedestrian_min_acc
,
-
4.0
,
"minimum pedestrian acceleration"
);
DEFINE_double
(
pedestrian_max_acc
,
2.0
,
"maximum pedestrian acceleration"
);
// Obstacle trajectory
DEFINE_double
(
lane_sequence_threshold
,
0.5
,
...
...
modules/prediction/common/prediction_gflags.h
浏览文件 @
9d46f0d2
...
...
@@ -50,6 +50,9 @@ DECLARE_double(target_lane_gap);
DECLARE_double
(
max_lane_angle_diff
);
DECLARE_bool
(
enable_pedestrian_acc
);
DECLARE_double
(
coeff_mul_sigma
);
DECLARE_double
(
pedestrian_max_speed
);
DECLARE_double
(
pedestrian_min_acc
);
DECLARE_double
(
pedestrian_max_acc
);
// Obstacle trajectory
DECLARE_double
(
lane_sequence_threshold
);
...
...
modules/prediction/predictor/pedestrian/regional_predictor.cc
浏览文件 @
9d46f0d2
...
...
@@ -70,6 +70,71 @@ void RegionalPredictor::Predict(Obstacle* obstacle) {
// TODO(kechxu) implement
}
void
RegionalPredictor
::
GenerateStillTrajectory
(
const
Eigen
::
Vector2d
&
position
,
const
double
heading
,
const
double
speed
,
const
double
total_time
,
std
::
vector
<
TrajectoryPoint
>*
points
)
{
double
delta_ts
=
FLAGS_prediction_freq
;
double
x
=
position
[
0
];
double
y
=
position
[
1
];
double
direction_x
=
std
::
cos
(
heading
);
double
direction_y
=
std
::
sin
(
heading
);
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
total_time
/
delta_ts
);
++
i
)
{
TrajectoryPoint
point
;
point
.
mutable_path_point
()
->
set_x
(
x
);
point
.
mutable_path_point
()
->
set_y
(
y
);
point
.
mutable_path_point
()
->
set_theta
(
heading
);
point
.
set_v
(
speed
);
point
.
set_relative_time
(
i
*
delta_ts
);
points
->
push_back
(
std
::
move
(
point
));
x
+=
direction_x
*
speed
*
delta_ts
;
y
+=
direction_y
*
speed
*
delta_ts
;
}
}
void
RegionalPredictor
::
GenerateMovingTrajectory
(
const
Eigen
::
Vector2d
&
position
,
const
Eigen
::
Vector2d
&
velocity
,
const
Eigen
::
Vector2d
&
acceleration
,
const
apollo
::
common
::
math
::
KalmanFilter
<
double
,
2
,
2
,
4
>&
kf
,
const
double
total_time
,
std
::
vector
<
TrajectoryPoint
>*
left_points
,
std
::
vector
<
TrajectoryPoint
>*
right_points
)
{
double
delta_ts
=
FLAGS_prediction_freq
;
Eigen
::
Vector2d
vel
=
velocity
;
CompressVector2d
(
FLAGS_pedestrian_max_speed
,
&
vel
);
Eigen
::
Vector2d
acc
=
acceleration
;
CompressVector2d
(
FLAGS_pedestrian_max_acc
,
&
acc
);
double
speed
=
std
::
hypot
(
vel
[
0
],
vel
[
1
]);
// candidate point sequences
std
::
vector
<
TrajectoryPoint
>
middle_points
;
std
::
vector
<
TrajectoryPoint
>
boundary_points
;
TrajectoryPoint
starting_point
;
starting_point
.
mutable_path_point
()
->
set_x
(
0.0
);
starting_point
.
mutable_path_point
()
->
set_y
(
0.0
);
starting_point
.
set_v
(
speed
);
Eigen
::
Vector2d
translated_vec
(
0.0
,
0.0
);
GetTrajectoryCandidatePoints
(
translated_vec
,
vel
,
acc
,
kf
,
total_time
,
&
middle_points
,
&
boundary_points
);
if
(
middle_points
.
empty
()
||
boundary_points
.
size
()
<
2
)
{
ADEBUG
<<
"No valid points found."
;
return
;
}
UpdateTrajectoryPoints
(
starting_point
,
vel
,
delta_ts
,
middle_points
,
boundary_points
,
left_points
,
right_points
);
for
(
size_t
i
=
0
;
i
<
left_points
->
size
();
++
i
)
{
TranslatePoint
(
position
[
0
],
position
[
1
],
&
(
left_points
->
operator
[](
i
)));
TranslatePoint
(
position
[
0
],
position
[
1
],
&
(
right_points
->
operator
[](
i
)));
}
}
void
RegionalPredictor
::
GetTrajectoryCandidatePoints
(
const
Eigen
::
Vector2d
&
position
,
const
Eigen
::
Vector2d
&
velocity
,
...
...
modules/prediction/predictor/pedestrian/regional_predictor.h
浏览文件 @
9d46f0d2
...
...
@@ -50,6 +50,20 @@ class RegionalPredictor : public Predictor {
*/
void
Predict
(
Obstacle
*
obstacle
)
override
;
void
GenerateStillTrajectory
(
const
Eigen
::
Vector2d
&
position
,
const
double
heading
,
const
double
speed
,
const
double
total_time
,
std
::
vector
<
apollo
::
common
::
TrajectoryPoint
>*
points
);
void
GenerateMovingTrajectory
(
const
Eigen
::
Vector2d
&
position
,
const
Eigen
::
Vector2d
&
velocity
,
const
Eigen
::
Vector2d
&
acceleration
,
const
apollo
::
common
::
math
::
KalmanFilter
<
double
,
2
,
2
,
4
>&
kf
,
const
double
total_time
,
std
::
vector
<
apollo
::
common
::
TrajectoryPoint
>*
left_points
,
std
::
vector
<
apollo
::
common
::
TrajectoryPoint
>*
right_points
);
void
GetTrajectoryCandidatePoints
(
const
Eigen
::
Vector2d
&
position
,
const
Eigen
::
Vector2d
&
velocity
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录