Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
7ce6c1f8
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,发现更多精彩内容 >>
提交
7ce6c1f8
编写于
11月 02, 2018
作者:
K
kechxu
提交者:
Jiangtao Hu
12月 13, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: junction code clean and small bugs fixed
上级
c29818f7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
24 deletion
+24
-24
modules/prediction/common/junction_analyzer.cc
modules/prediction/common/junction_analyzer.cc
+5
-3
modules/prediction/container/obstacles/obstacle.cc
modules/prediction/container/obstacles/obstacle.cc
+2
-0
modules/prediction/evaluator/vehicle/junction_mlp_evaluator.cc
...es/prediction/evaluator/vehicle/junction_mlp_evaluator.cc
+17
-20
modules/prediction/evaluator/vehicle/junction_mlp_evaluator.h
...les/prediction/evaluator/vehicle/junction_mlp_evaluator.h
+0
-1
未找到文件。
modules/prediction/common/junction_analyzer.cc
浏览文件 @
7ce6c1f8
...
...
@@ -61,14 +61,16 @@ void JunctionAnalyzer::SetAllJunctionExits() {
if
(
overlap_info_ptr
==
nullptr
)
{
continue
;
}
// TODO(all) consider to delete
if
(
overlap_info_ptr
->
overlap
().
object_size
()
!=
2
)
{
continue
;
}
for
(
const
auto
&
object
:
overlap_info_ptr
->
overlap
().
object
())
{
if
(
object
.
has_lane_overlap_info
())
{
std
::
string
lane_id
=
object
.
id
().
id
();
const
std
::
string
&
lane_id
=
object
.
id
().
id
();
auto
lane_info_ptr
=
PredictionMap
::
LaneById
(
lane_id
);
if
(
object
.
lane_overlap_info
().
end_s
()
+
1e-3
<
// TODO(all) move 0.1 to gflags
if
(
object
.
lane_overlap_info
().
end_s
()
+
0.1
<
lane_info_ptr
->
total_length
())
{
JunctionExit
junction_exit
;
double
s
=
object
.
lane_overlap_info
().
end_s
();
...
...
@@ -98,6 +100,7 @@ std::vector<JunctionExit> JunctionAnalyzer::GetJunctionExits(
lane_info_queue
.
pop
();
const
std
::
string
&
curr_lane_id
=
curr_lane
->
id
().
id
();
if
(
IsExitLane
(
curr_lane_id
))
{
// TODO(kechxu) deal with duplicates
junction_exits
.
push_back
(
junction_exits_
[
curr_lane_id
]);
continue
;
}
...
...
@@ -119,7 +122,6 @@ const JunctionFeature& JunctionAnalyzer::GetJunctionFeature(
return
junction_features_
[
start_lane_id
];
}
JunctionFeature
junction_feature
;
// TODO(all) not fill enter_lane yet
junction_feature
.
set_junction_id
(
GetJunctionId
());
junction_feature
.
set_junction_range
(
ComputeJunctionRange
());
std
::
vector
<
JunctionExit
>
junction_exits
=
GetJunctionExits
(
start_lane_id
);
...
...
modules/prediction/container/obstacles/obstacle.cc
浏览文件 @
7ce6c1f8
...
...
@@ -242,6 +242,7 @@ void Obstacle::BuildJunctionFeature() {
CHECK
(
prev_feature
.
junction_feature
().
enter_lane
().
has_lane_id
());
std
::
string
enter_lane_id
=
prev_feature
.
junction_feature
().
enter_lane
().
lane_id
();
// TODO(kechxu) deal with consecutive junctions
SetJunctionFeatureWithEnterLane
(
enter_lane_id
,
latest_feature_ptr
);
}
else
{
...
...
@@ -267,6 +268,7 @@ void Obstacle::SetJunctionFeatureWithoutEnterLane(
}
else
{
if
(
feature_ptr
->
lane
().
nearby_lane_feature_size
()
>
0
)
{
// TODO(kechxu) start with multiple lane ids
// TODO(kechxu) enlarge searching range for lanes in junction
start_lane_id
=
feature_ptr
->
lane
().
nearby_lane_feature
(
0
).
lane_id
();
}
}
...
...
modules/prediction/evaluator/vehicle/junction_mlp_evaluator.cc
浏览文件 @
7ce6c1f8
...
...
@@ -43,8 +43,8 @@ bool IsClosed(const double x0, const double y0, const double theta0,
const
double
x1
,
const
double
y1
,
const
double
theta1
)
{
// TODO(all) move constants to gflags
double
angle_diff
=
std
::
abs
(
common
::
math
::
AngleDiff
(
theta0
,
theta1
));
return
std
::
abs
(
x0
-
x1
)
<
1.0
&&
std
::
abs
(
y0
-
y1
)
&&
angle_diff
<
M_PI
*
0.25
;
double
distance
=
std
::
hypot
(
x0
-
x1
,
y0
-
y1
);
return
distance
<
1.0
&&
angle_diff
<
M_PI
*
0.25
;
}
JunctionMLPEvaluator
::
JunctionMLPEvaluator
()
{
...
...
@@ -52,7 +52,6 @@ JunctionMLPEvaluator::JunctionMLPEvaluator() {
}
void
JunctionMLPEvaluator
::
Clear
()
{
obstacle_feature_values_map_
.
clear
();
}
void
JunctionMLPEvaluator
::
Evaluate
(
Obstacle
*
obstacle_ptr
)
{
...
...
@@ -126,17 +125,13 @@ void JunctionMLPEvaluator::ExtractFeatureValues(
CHECK_NOTNULL
(
obstacle_ptr
);
int
id
=
obstacle_ptr
->
id
();
auto
it
=
obstacle_feature_values_map_
.
find
(
id
);
if
(
it
==
obstacle_feature_values_map_
.
end
())
{
std
::
vector
<
double
>
obstacle_feature_values
;
SetObstacleFeatureValues
(
obstacle_ptr
,
&
obstacle_feature_values
);
obstacle_feature_values_map_
[
id
]
=
obstacle_feature_values
;
}
std
::
vector
<
double
>
obstacle_feature_values
;
SetObstacleFeatureValues
(
obstacle_ptr
,
&
obstacle_feature_values
);
if
(
obstacle_feature_values
_map_
[
id
]
.
size
()
!=
OBSTACLE_FEATURE_SIZE
)
{
if
(
obstacle_feature_values
.
size
()
!=
OBSTACLE_FEATURE_SIZE
)
{
AERROR
<<
"Obstacle ["
<<
id
<<
"] has fewer than "
<<
"expected obstacle feature_values "
<<
obstacle_feature_values
_map_
[
id
]
.
size
()
<<
"."
;
<<
obstacle_feature_values
.
size
()
<<
"."
;
return
;
}
...
...
@@ -150,9 +145,10 @@ void JunctionMLPEvaluator::ExtractFeatureValues(
}
feature_values
->
insert
(
feature_values
->
end
(),
obstacle_feature_values_map_
[
id
].
begin
(),
obstacle_feature_values_map_
[
id
].
end
());
feature_values
->
insert
(
feature_values
->
end
(),
junction_feature_values
.
begin
(),
obstacle_feature_values
.
begin
(),
obstacle_feature_values
.
end
());
feature_values
->
insert
(
feature_values
->
end
(),
junction_feature_values
.
begin
(),
junction_feature_values
.
end
());
if
(
FLAGS_prediction_offline_mode
)
{
SaveOfflineFeatures
(
obstacle_ptr
->
mutable_latest_feature
(),
...
...
@@ -196,11 +192,11 @@ void JunctionMLPEvaluator::SetJunctionFeatureValues(
std
::
string
junction_id
=
feature_ptr
->
junction_feature
().
junction_id
();
double
junction_range
=
feature_ptr
->
junction_feature
().
junction_range
();
for
(
int
i
=
0
;
i
<
12
;
++
i
)
{
feature_values
->
push_back
(
0
);
feature_values
->
push_back
(
1
);
feature_values
->
push_back
(
1
);
feature_values
->
push_back
(
1
);
feature_values
->
push_back
(
0
);
feature_values
->
push_back
(
0
.0
);
feature_values
->
push_back
(
1
.0
);
feature_values
->
push_back
(
1
.0
);
feature_values
->
push_back
(
1
.0
);
feature_values
->
push_back
(
0
.0
);
}
int
num_junction_exit
=
feature_ptr
->
junction_feature
().
junction_exit_size
();
for
(
int
i
=
0
;
i
<
num_junction_exit
;
++
i
)
{
...
...
@@ -213,9 +209,10 @@ void JunctionMLPEvaluator::SetJunctionFeatureValues(
double
diff_heading
=
apollo
::
common
::
math
::
AngleDiff
(
heading
,
junction_exit
.
exit_heading
());
double
angle
=
std
::
atan2
(
diff_y
,
diff_x
);
// TODO(Hongyi) test d_idx
double
d_idx
=
(
angle
/
(
2.0
*
M_PI
))
*
12.0
;
int
idx
=
static_cast
<
int
>
(
floor
(
d_idx
>=
0
?
d_idx
:
d_idx
+
12
));
feature_values
->
operator
[](
idx
*
5
)
=
1
;
feature_values
->
operator
[](
idx
*
5
)
=
1
.0
;
feature_values
->
operator
[](
idx
*
5
+
1
)
=
diff_x
/
junction_range
;
feature_values
->
operator
[](
idx
*
5
+
2
)
=
diff_y
/
junction_range
;
feature_values
->
operator
[](
idx
*
5
+
3
)
=
...
...
modules/prediction/evaluator/vehicle/junction_mlp_evaluator.h
浏览文件 @
7ce6c1f8
...
...
@@ -100,7 +100,6 @@ class JunctionMLPEvaluator : public Evaluator {
double
ComputeProbability
(
const
std
::
vector
<
double
>&
feature_values
);
private:
std
::
unordered_map
<
int
,
std
::
vector
<
double
>>
obstacle_feature_values_map_
;
static
const
size_t
OBSTACLE_FEATURE_SIZE
=
3
;
static
const
size_t
JUNCTION_FEATURE_SIZE
=
60
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录