Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
6d0a60fb
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,发现更多精彩内容 >>
提交
6d0a60fb
编写于
12月 18, 2017
作者:
K
kechxu
提交者:
Jiangtao Hu
12月 18, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: fix incorrect perception velocity heading
上级
fabb1aeb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
2 deletion
+32
-2
modules/prediction/common/prediction_gflags.cc
modules/prediction/common/prediction_gflags.cc
+4
-0
modules/prediction/common/prediction_gflags.h
modules/prediction/common/prediction_gflags.h
+2
-0
modules/prediction/container/obstacles/obstacle.cc
modules/prediction/container/obstacles/obstacle.cc
+26
-2
未找到文件。
modules/prediction/common/prediction_gflags.cc
浏览文件 @
6d0a60fb
...
...
@@ -87,6 +87,10 @@ DEFINE_double(rnn_min_lane_relatice_s, 5.0,
DEFINE_double
(
perception_confidence_threshold
,
0.4
,
"Skip the perception obstacle if its confiderence is lower than "
"this threshold."
);
DEFINE_bool
(
enable_adjust_velocity_heading
,
true
,
"adjust velocity heading to lane heading"
);
DEFINE_double
(
heading_diff_thred
,
M_PI
/
6.0
,
"Threshold for adjusting on-lane obstacle heading"
);
// Obstacle trajectory
DEFINE_double
(
lane_sequence_threshold
,
0.5
,
...
...
modules/prediction/common/prediction_gflags.h
浏览文件 @
6d0a60fb
...
...
@@ -61,6 +61,8 @@ DECLARE_double(still_speed);
DECLARE_string
(
evaluator_vehicle_mlp_file
);
DECLARE_string
(
evaluator_vehicle_rnn_file
);
DECLARE_int32
(
max_num_obstacles
);
DECLARE_bool
(
enable_adjust_velocity_heading
);
DECLARE_double
(
heading_diff_thred
);
// evaluator
DECLARE_double
(
rnn_min_lane_relatice_s
);
...
...
modules/prediction/container/obstacles/obstacle.cc
浏览文件 @
6d0a60fb
...
...
@@ -144,7 +144,6 @@ bool Obstacle::IsNearJunction() {
void
Obstacle
::
Insert
(
const
PerceptionObstacle
&
perception_obstacle
,
const
double
timestamp
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
mutex_
);
if
(
feature_history_
.
size
()
>
0
&&
timestamp
<=
feature_history_
.
front
().
timestamp
())
{
AERROR
<<
"Obstacle ["
<<
id_
<<
"] received an older frame ["
...
...
@@ -277,13 +276,37 @@ void Obstacle::SetVelocity(const PerceptionObstacle& perception_obstacle,
velocity_z
=
perception_obstacle
.
velocity
().
z
();
}
}
double
velocity_heading
=
std
::
atan2
(
velocity_y
,
velocity_x
);
if
(
FLAGS_enable_adjust_velocity_heading
&&
IsOnLane
())
{
double
speed
=
std
::
hypot
(
velocity_x
,
velocity_y
);
double
theta
=
0.0
;
if
(
perception_obstacle
.
has_theta
())
{
theta
=
perception_obstacle
.
theta
();
}
double
heading_diff
=
std
::
abs
(
velocity_heading
-
theta
);
if
(
heading_diff
>
FLAGS_heading_diff_thred
)
{
if
(
history_size
()
==
0
)
{
velocity_x
=
speed
*
std
::
cos
(
theta
);
velocity_y
=
speed
*
std
::
sin
(
theta
);
}
else
{
double
prev_x
=
mutable_feature
(
0
)
->
position
().
x
();
double
prev_y
=
mutable_feature
(
0
)
->
position
().
y
();
double
diff_x
=
feature
->
position
().
x
()
-
prev_x
;
double
diff_y
=
feature
->
position
().
y
()
-
prev_y
;
velocity_heading
=
std
::
atan2
(
diff_y
,
diff_x
);
velocity_x
=
speed
*
std
::
cos
(
velocity_heading
);
velocity_y
=
speed
*
std
::
sin
(
velocity_heading
);
}
}
}
feature
->
mutable_velocity
()
->
set_x
(
velocity_x
);
feature
->
mutable_velocity
()
->
set_y
(
velocity_y
);
feature
->
mutable_velocity
()
->
set_z
(
velocity_z
);
double
speed
=
std
::
hypot
(
std
::
hypot
(
velocity_x
,
velocity_y
),
velocity_z
);
double
velocity_heading
=
std
::
atan2
(
velocity_y
,
velocity_x
);
velocity_heading
=
std
::
atan2
(
velocity_y
,
velocity_x
);
feature
->
set_velocity_heading
(
velocity_heading
);
feature
->
set_speed
(
speed
);
...
...
@@ -1074,6 +1097,7 @@ void Obstacle::SetMotionStatus() {
}
void
Obstacle
::
InsertFeatureToHistory
(
Feature
*
feature
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
mutex_
);
feature_history_
.
push_front
(
std
::
move
(
*
feature
));
ADEBUG
<<
"Obstacle ["
<<
id_
<<
"] inserted a frame into the history."
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录