Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
640e0d9d
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,发现更多精彩内容 >>
提交
640e0d9d
编写于
12月 28, 2017
作者:
C
Calvin Miao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: fixed trajectory heading calculation
上级
c0d9b201
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
38 deletion
+17
-38
modules/prediction/common/prediction_util.cc
modules/prediction/common/prediction_util.cc
+2
-19
modules/prediction/predictor/lane_sequence/lane_sequence_predictor.cc
...iction/predictor/lane_sequence/lane_sequence_predictor.cc
+4
-1
modules/prediction/predictor/move_sequence/move_sequence_predictor.cc
...iction/predictor/move_sequence/move_sequence_predictor.cc
+4
-17
modules/prediction/predictor/sequence/sequence_predictor.cc
modules/prediction/predictor/sequence/sequence_predictor.cc
+6
-1
modules/prediction/predictor/sequence/sequence_predictor.h
modules/prediction/predictor/sequence/sequence_predictor.h
+1
-0
未找到文件。
modules/prediction/common/prediction_util.cc
浏览文件 @
640e0d9d
...
...
@@ -33,13 +33,9 @@ double Normalize(const double value, const double mean, const double std) {
return
(
value
-
mean
)
/
(
std
+
eps
);
}
double
Sigmoid
(
const
double
value
)
{
return
1
/
(
1
+
std
::
exp
(
-
1.0
*
value
));
}
double
Sigmoid
(
const
double
value
)
{
return
1
/
(
1
+
std
::
exp
(
-
1.0
*
value
));
}
double
Relu
(
const
double
value
)
{
return
(
value
>
0.0
)
?
value
:
0.0
;
}
double
Relu
(
const
double
value
)
{
return
(
value
>
0.0
)
?
value
:
0.0
;
}
int
SolveQuadraticEquation
(
const
std
::
vector
<
double
>&
coefficients
,
std
::
pair
<
double
,
double
>*
roots
)
{
...
...
@@ -179,19 +175,6 @@ void GenerateLaneSequenceTrajectoryPoints(
break
;
}
if
(
points
->
size
()
>
0
)
{
PathPoint
*
prev_point
=
points
->
back
().
mutable_path_point
();
double
x_diff
=
point
.
x
()
-
prev_point
->
x
();
double
y_diff
=
point
.
y
()
-
prev_point
->
y
();
if
(
std
::
fabs
(
x_diff
)
>
std
::
numeric_limits
<
double
>::
epsilon
()
||
std
::
fabs
(
y_diff
)
>
std
::
numeric_limits
<
double
>::
epsilon
())
{
theta
=
std
::
atan2
(
y_diff
,
x_diff
);
prev_point
->
set_theta
(
theta
);
}
else
{
theta
=
prev_point
->
theta
();
}
}
// update state
if
(
lane_speed
<=
0.0
)
{
ADEBUG
<<
"Non-positive lane_speed tacked : "
<<
lane_speed
;
...
...
modules/prediction/predictor/lane_sequence/lane_sequence_predictor.cc
浏览文件 @
640e0d9d
...
...
@@ -65,7 +65,10 @@ void LaneSequencePredictor::Predict(Obstacle* obstacle) {
return
;
}
std
::
string
lane_id
=
feature
.
lane
().
lane_feature
().
lane_id
();
std
::
string
lane_id
=
""
;
if
(
feature
.
lane
().
has_lane_feature
())
{
lane_id
=
feature
.
lane
().
lane_feature
().
lane_id
();
}
int
num_lane_sequence
=
feature
.
lane
().
lane_graph
().
lane_sequence_size
();
std
::
vector
<
bool
>
enable_lane_sequence
(
num_lane_sequence
,
true
);
FilterLaneSequences
(
feature
.
lane
().
lane_graph
(),
lane_id
,
...
...
modules/prediction/predictor/move_sequence/move_sequence_predictor.cc
浏览文件 @
640e0d9d
...
...
@@ -195,9 +195,9 @@ void MoveSequencePredictor::DrawManeuverTrajectoryPoints(
position
[
0
]
=
feature
.
t_position
().
x
();
position
[
1
]
=
feature
.
t_position
().
y
();
}
double
time_to_lane_center
=
std
::
max
(
FLAGS_default_time_to_lane_center
,
ComputeTimeToLaneCenterByVelocity
(
obstacle
,
lane_sequence
));
double
time_to_lane_center
=
std
::
max
(
FLAGS_default_time_to_lane_center
,
ComputeTimeToLaneCenterByVelocity
(
obstacle
,
lane_sequence
));
std
::
array
<
double
,
6
>
lateral_coeffs
;
std
::
array
<
double
,
5
>
longitudinal_coeffs
;
...
...
@@ -222,6 +222,7 @@ void MoveSequencePredictor::DrawManeuverTrajectoryPoints(
size_t
total_num
=
static_cast
<
size_t
>
(
total_time
/
period
);
size_t
num_to_center
=
static_cast
<
size_t
>
(
time_to_lane_center
/
period
);
AERROR
<<
"Obstacle: "
<<
obstacle
.
id
();
for
(
size_t
i
=
0
;
i
<
total_num
;
++
i
)
{
double
relative_time
=
static_cast
<
double
>
(
i
)
*
period
;
Eigen
::
Vector2d
point
;
...
...
@@ -248,20 +249,6 @@ void MoveSequencePredictor::DrawManeuverTrajectoryPoints(
}
prev_lane_l
=
lane_l
;
if
(
points
->
size
()
>
0
)
{
PathPoint
*
prev_point
=
points
->
back
().
mutable_path_point
();
double
x_diff
=
point
.
x
()
-
prev_point
->
x
();
double
y_diff
=
point
.
y
()
-
prev_point
->
y
();
if
(
std
::
fabs
(
x_diff
)
>
std
::
numeric_limits
<
double
>::
epsilon
()
||
std
::
fabs
(
y_diff
)
>
std
::
numeric_limits
<
double
>::
epsilon
())
{
theta
=
std
::
atan2
(
y_diff
,
x_diff
);
prev_point
->
set_theta
(
theta
);
}
else
{
theta
=
prev_point
->
theta
();
}
}
double
vs
=
EvaluateLongitudinalPolynomial
(
longitudinal_coeffs
,
relative_time
,
1
);
double
as
=
...
...
modules/prediction/predictor/sequence/sequence_predictor.cc
浏览文件 @
640e0d9d
...
...
@@ -88,7 +88,8 @@ void SequencePredictor::FilterLaneSequences(
// The obstacle has interference with ADC within a small distance
if
(
distance
<
FLAGS_lane_change_dist
&&
(
lane_change_type
[
i
]
==
LaneChangeType
::
LEFT
||
lane_change_type
[
i
]
==
LaneChangeType
::
RIGHT
))
{
lane_change_type
[
i
]
==
LaneChangeType
::
RIGHT
||
lane_change_type
[
i
]
==
LaneChangeType
::
ONTO_LANE
))
{
(
*
enable_lane_sequence
)[
i
]
=
false
;
ADEBUG
<<
"Filter trajectory ["
<<
ToString
(
sequence
)
<<
"] due to small distance "
<<
distance
<<
"."
;
...
...
@@ -163,6 +164,10 @@ SequencePredictor::LaneChangeType SequencePredictor::GetLaneChangeType(
const
std
::
string
&
lane_id
,
const
LaneSequence
&
lane_sequence
)
{
PredictionMap
*
map
=
PredictionMap
::
instance
();
if
(
lane_id
.
empty
())
{
return
LaneChangeType
::
ONTO_LANE
;
}
std
::
string
lane_change_id
=
lane_sequence
.
lane_segment
(
0
).
lane_id
();
if
(
lane_id
==
lane_change_id
)
{
return
LaneChangeType
::
STRAIGHT
;
...
...
modules/prediction/predictor/sequence/sequence_predictor.h
浏览文件 @
640e0d9d
...
...
@@ -37,6 +37,7 @@ class SequencePredictor : public Predictor {
LEFT
,
RIGHT
,
STRAIGHT
,
ONTO_LANE
,
INVALID
,
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录