Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
0a2fbf32
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,发现更多精彩内容 >>
提交
0a2fbf32
编写于
8月 06, 2017
作者:
K
kechxu
提交者:
Jiangtao Hu
8月 06, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add 'return false' for errors and replace some push_back to emplace to avoid copy
上级
cb06b0a5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
8 deletion
+10
-8
modules/planning/optimizer/dp_poly_path/dp_road_graph.cc
modules/planning/optimizer/dp_poly_path/dp_road_graph.cc
+10
-8
未找到文件。
modules/planning/optimizer/dp_poly_path/dp_road_graph.cc
浏览文件 @
0a2fbf32
...
@@ -87,7 +87,7 @@ bool DPRoadGraph::FindPathTunnel(const common::TrajectoryPoint &init_point,
...
@@ -87,7 +87,7 @@ bool DPRoadGraph::FindPathTunnel(const common::TrajectoryPoint &init_point,
frenet_frame_point
.
set_l
(
l
);
frenet_frame_point
.
set_l
(
l
);
frenet_frame_point
.
set_dl
(
dl
);
frenet_frame_point
.
set_dl
(
dl
);
frenet_frame_point
.
set_ddl
(
ddl
);
frenet_frame_point
.
set_ddl
(
ddl
);
frenet_path
.
push_back
(
frenet_frame_point
);
frenet_path
.
push_back
(
std
::
move
(
frenet_frame_point
)
);
current_s
+=
path_resolution
;
current_s
+=
path_resolution
;
}
}
accumulated_s
+=
path_length
;
accumulated_s
+=
path_length
;
...
@@ -169,14 +169,14 @@ bool DPRoadGraph::GenerateMinCostPath(
...
@@ -169,14 +169,14 @@ bool DPRoadGraph::GenerateMinCostPath(
vehicle_config
.
vehicle_param
(),
speed_data_
);
vehicle_config
.
vehicle_param
(),
speed_data_
);
std
::
vector
<
std
::
vector
<
DPRoadGraphNode
>>
graph_nodes
(
path_waypoints
.
size
());
std
::
vector
<
std
::
vector
<
DPRoadGraphNode
>>
graph_nodes
(
path_waypoints
.
size
());
graph_nodes
[
0
].
push_back
(
DPRoadGraphNode
(
init_sl_point_
,
nullptr
,
0.0
)
);
graph_nodes
[
0
].
emplace_back
(
init_sl_point_
,
nullptr
,
0.0
);
for
(
std
::
size_t
level
=
1
;
level
<
path_waypoints
.
size
();
++
level
)
{
for
(
std
::
size_t
level
=
1
;
level
<
path_waypoints
.
size
();
++
level
)
{
const
auto
&
prev_dp_nodes
=
graph_nodes
[
level
-
1
];
const
auto
&
prev_dp_nodes
=
graph_nodes
[
level
-
1
];
const
auto
&
level_points
=
path_waypoints
[
level
];
const
auto
&
level_points
=
path_waypoints
[
level
];
for
(
std
::
size_t
i
=
0
;
i
<
level_points
.
size
();
++
i
)
{
for
(
std
::
size_t
i
=
0
;
i
<
level_points
.
size
();
++
i
)
{
const
auto
&
cur_point
=
level_points
[
i
];
const
auto
&
cur_point
=
level_points
[
i
];
graph_nodes
[
level
].
push_back
(
DPRoadGraphNode
(
cur_point
,
nullptr
)
);
graph_nodes
[
level
].
emplace_back
(
cur_point
,
nullptr
);
auto
&
cur_node
=
graph_nodes
[
level
].
back
();
auto
&
cur_node
=
graph_nodes
[
level
].
back
();
for
(
std
::
size_t
j
=
0
;
j
<
prev_dp_nodes
.
size
();
++
j
)
{
for
(
std
::
size_t
j
=
0
;
j
<
prev_dp_nodes
.
size
();
++
j
)
{
const
auto
&
prev_dp_node
=
prev_dp_nodes
[
j
];
const
auto
&
prev_dp_node
=
prev_dp_nodes
[
j
];
...
@@ -251,6 +251,7 @@ bool DPRoadGraph::MakeStaticObstacleDecision(
...
@@ -251,6 +251,7 @@ bool DPRoadGraph::MakeStaticObstacleDecision(
{
path_point
.
x
(),
path_point
.
y
()},
&
adc_sl
))
{
{
path_point
.
x
(),
path_point
.
y
()},
&
adc_sl
))
{
AERROR
<<
"get_point_in_Frenet_frame error for ego vehicle "
AERROR
<<
"get_point_in_Frenet_frame error for ego vehicle "
<<
path_point
.
x
()
<<
" "
<<
path_point
.
y
();
<<
path_point
.
x
()
<<
" "
<<
path_point
.
y
();
return
false
;
}
else
{
}
else
{
adc_sl_points
.
push_back
(
std
::
move
(
adc_sl
));
adc_sl_points
.
push_back
(
std
::
move
(
adc_sl
));
}
}
...
@@ -289,7 +290,7 @@ bool DPRoadGraph::MakeStaticObstacleDecision(
...
@@ -289,7 +290,7 @@ bool DPRoadGraph::MakeStaticObstacleDecision(
object_stop_ptr
->
set_distance_s
(
FLAGS_dp_path_decision_buffer
);
object_stop_ptr
->
set_distance_s
(
FLAGS_dp_path_decision_buffer
);
object_stop_ptr
->
set_reason_code
(
object_stop_ptr
->
set_reason_code
(
StopReasonCode
::
STOP_REASON_OBSTACLE
);
StopReasonCode
::
STOP_REASON_OBSTACLE
);
decisions
->
push_back
(
std
::
make_pair
(
obstacle
->
Id
(),
object_stop
)
);
decisions
->
emplace_back
(
obstacle
->
Id
(),
object_stop
);
ignore
=
false
;
ignore
=
false
;
break
;
break
;
}
else
{
}
else
{
...
@@ -301,7 +302,7 @@ bool DPRoadGraph::MakeStaticObstacleDecision(
...
@@ -301,7 +302,7 @@ bool DPRoadGraph::MakeStaticObstacleDecision(
ObjectNudge
*
object_nudge_ptr
=
object_nudge
.
mutable_nudge
();
ObjectNudge
*
object_nudge_ptr
=
object_nudge
.
mutable_nudge
();
object_nudge_ptr
->
set_distance_l
(
FLAGS_dp_path_decision_buffer
);
object_nudge_ptr
->
set_distance_l
(
FLAGS_dp_path_decision_buffer
);
object_nudge_ptr
->
set_type
(
ObjectNudge
::
RIGHT_NUDGE
);
object_nudge_ptr
->
set_type
(
ObjectNudge
::
RIGHT_NUDGE
);
decisions
->
push_back
(
std
::
make_pair
(
obstacle
->
Id
(),
object_nudge
)
);
decisions
->
emplace_back
(
obstacle
->
Id
(),
object_nudge
);
ignore
=
false
;
ignore
=
false
;
break
;
break
;
}
else
if
(
sl_boundary
.
end_l
()
<
adc_sl
.
l
()
&&
}
else
if
(
sl_boundary
.
end_l
()
<
adc_sl
.
l
()
&&
...
@@ -312,7 +313,7 @@ bool DPRoadGraph::MakeStaticObstacleDecision(
...
@@ -312,7 +313,7 @@ bool DPRoadGraph::MakeStaticObstacleDecision(
ObjectNudge
*
object_nudge_ptr
=
object_nudge
.
mutable_nudge
();
ObjectNudge
*
object_nudge_ptr
=
object_nudge
.
mutable_nudge
();
object_nudge_ptr
->
set_distance_l
(
FLAGS_dp_path_decision_buffer
);
object_nudge_ptr
->
set_distance_l
(
FLAGS_dp_path_decision_buffer
);
object_nudge_ptr
->
set_type
(
ObjectNudge
::
LEFT_NUDGE
);
object_nudge_ptr
->
set_type
(
ObjectNudge
::
LEFT_NUDGE
);
decisions
->
push_back
(
std
::
make_pair
(
obstacle
->
Id
(),
object_nudge
)
);
decisions
->
emplace_back
(
obstacle
->
Id
(),
object_nudge
);
ignore
=
false
;
ignore
=
false
;
break
;
break
;
}
}
...
@@ -323,7 +324,7 @@ bool DPRoadGraph::MakeStaticObstacleDecision(
...
@@ -323,7 +324,7 @@ bool DPRoadGraph::MakeStaticObstacleDecision(
// IGNORE
// IGNORE
ObjectDecisionType
object_ignore
;
ObjectDecisionType
object_ignore
;
object_ignore
.
mutable_ignore
();
object_ignore
.
mutable_ignore
();
decisions
->
push_back
(
std
::
make_pair
(
obstacle
->
Id
(),
object_ignore
)
);
decisions
->
emplace_back
(
obstacle
->
Id
(),
object_ignore
);
}
}
}
}
return
true
;
return
true
;
...
@@ -343,6 +344,7 @@ bool DPRoadGraph::MakeDynamicObstcleDecision(
...
@@ -343,6 +344,7 @@ bool DPRoadGraph::MakeDynamicObstcleDecision(
if
(
!
ComputeBoundingBoxesForAdc
(
path_data
.
frenet_frame_path
(),
if
(
!
ComputeBoundingBoxesForAdc
(
path_data
.
frenet_frame_path
(),
evaluate_time_slots
,
&
adc_by_time
))
{
evaluate_time_slots
,
&
adc_by_time
))
{
AERROR
<<
"fill_adc_by_time error"
;
AERROR
<<
"fill_adc_by_time error"
;
return
false
;
}
}
for
(
const
auto
*
path_obstacle
:
path_obstacles
)
{
for
(
const
auto
*
path_obstacle
:
path_obstacles
)
{
...
@@ -363,7 +365,7 @@ bool DPRoadGraph::MakeDynamicObstcleDecision(
...
@@ -363,7 +365,7 @@ bool DPRoadGraph::MakeDynamicObstcleDecision(
ObjectDecisionType
object_follow
;
ObjectDecisionType
object_follow
;
ObjectFollow
*
object_follow_ptr
=
object_follow
.
mutable_follow
();
ObjectFollow
*
object_follow_ptr
=
object_follow
.
mutable_follow
();
object_follow_ptr
->
set_distance_s
(
FLAGS_dp_path_decision_buffer
);
object_follow_ptr
->
set_distance_s
(
FLAGS_dp_path_decision_buffer
);
decisions
->
push_back
(
std
::
make_pair
(
obstacle
->
Id
(),
object_follow
)
);
decisions
->
emplace_back
(
obstacle
->
Id
(),
object_follow
);
break
;
break
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录