Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
4d8af009
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,发现更多精彩内容 >>
提交
4d8af009
编写于
8月 06, 2017
作者:
J
Jiangtao Hu
提交者:
Dong Li
8月 06, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
planning: connect decider into em_planner.
上级
3c77ff2f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
47 addition
and
35 deletion
+47
-35
modules/planning/planner/em/BUILD
modules/planning/planner/em/BUILD
+20
-19
modules/planning/planner/em/decider.cc
modules/planning/planner/em/decider.cc
+12
-12
modules/planning/planner/em/decider.h
modules/planning/planner/em/decider.h
+4
-4
modules/planning/planner/em/em_planner.cc
modules/planning/planner/em/em_planner.cc
+9
-0
modules/planning/planner/em/em_planner.h
modules/planning/planner/em/em_planner.h
+2
-0
未找到文件。
modules/planning/planner/em/BUILD
浏览文件 @
4d8af009
...
...
@@ -2,6 +2,25 @@ load("//tools:cpplint.bzl", "cpplint")
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
name
=
"decider"
,
srcs
=
[
"decider.cc"
,
],
hdrs
=
[
"decider.h"
,
],
deps
=
[
"//external:gflags"
,
"//modules/common:log"
,
"//modules/common/status"
,
"//modules/planning/common:planning_common"
,
"//modules/planning/proto:planning_proto"
,
"//modules/planning/reference_line"
,
"@eigen//:eigen"
,
],
)
cc_library
(
name
=
"em_planner"
,
srcs
=
[
...
...
@@ -11,6 +30,7 @@ cc_library(
"em_planner.h"
,
],
deps
=
[
":decider"
,
"//external:gflags"
,
"//modules/common:log"
,
"//modules/common/proto:pnc_point_proto"
,
...
...
@@ -37,23 +57,4 @@ cc_library(
],
)
cc_library
(
name
=
"decider"
,
srcs
=
[
"decider.cc"
,
],
hdrs
=
[
"decider.h"
,
],
deps
=
[
"//external:gflags"
,
"//modules/common:log"
,
"//modules/common/status"
,
"//modules/planning/common:planning_common"
,
"//modules/planning/proto:planning_proto"
,
"//modules/planning/reference_line"
,
"@eigen//:eigen"
,
],
)
cpplint
()
modules/planning/planner/em/decider.cc
浏览文件 @
4d8af009
...
...
@@ -24,13 +24,16 @@
namespace
apollo
{
namespace
planning
{
Decider
::
Decider
()
{
decision_
.
Clear
();
}
Decider
::
Decider
(
DecisionResult
*
decision_result
)
:
decision_
(
decision_result
)
{
}
const
DecisionResult
&
Decider
::
Decision
()
const
{
return
decision_
;
}
const
DecisionResult
&
Decider
::
Decision
()
const
{
return
*
decision_
;
}
int
Decider
::
MakeDecision
(
Frame
*
frame
,
PathDecision
*
const
path_decision
)
{
decision_
.
Clear
();
int
Decider
::
MakeDecision
(
Frame
*
frame
)
{
decision_
->
Clear
();
auto
path_decision
=
frame
->
path_decision
();
bool
estop
=
0
;
if
(
estop
)
{
MakeEStopDecision
(
path_decision
);
...
...
@@ -93,7 +96,7 @@ int Decider::MakeMainStopDecision(Frame* frame,
}
if
(
stop_obstacle
!=
nullptr
)
{
MainStop
*
main_stop
=
decision_
.
mutable_main_decision
()
->
mutable_stop
();
MainStop
*
main_stop
=
decision_
->
mutable_main_decision
()
->
mutable_stop
();
main_stop
->
set_reason_code
(
stop_decision
->
reason_code
());
main_stop
->
set_reason
(
"stop by "
+
stop_obstacle
->
Id
());
main_stop
->
mutable_stop_point
()
->
set_x
(
stop_decision
->
stop_point
().
x
());
...
...
@@ -113,7 +116,7 @@ int Decider::MakeMainStopDecision(Frame* frame,
}
int
Decider
::
SetObjectDecisions
(
PathDecision
*
const
path_decision
)
{
ObjectDecisions
*
object_decisions
=
decision_
.
mutable_object_decision
();
ObjectDecisions
*
object_decisions
=
decision_
->
mutable_object_decision
();
const
auto
&
path_obstacles
=
path_decision
->
path_obstacles
();
for
(
const
auto
path_obstacle
:
path_obstacles
.
Items
())
{
...
...
@@ -135,15 +138,15 @@ int Decider::SetObjectDecisions(PathDecision* const path_decision) {
int
Decider
::
MakeEStopDecision
(
PathDecision
*
const
path_decision
)
{
CHECK_NOTNULL
(
path_decision
);
decision_
.
Clear
();
decision_
->
Clear
();
// TODO: to be added
// MainEmergencyStop* main_estop =
// decision_
.
mutable_main_decision()->mutable_estop();
// decision_
->
mutable_main_decision()->mutable_estop();
// main_estop->set_reason_code();
// main_estop->set_reason();
ObjectDecisions
*
object_decisions
=
decision_
.
mutable_object_decision
();
ObjectDecisions
*
object_decisions
=
decision_
->
mutable_object_decision
();
const
auto
&
path_obstacles
=
path_decision
->
path_obstacles
();
for
(
const
auto
path_obstacle
:
path_obstacles
.
Items
())
{
...
...
@@ -152,9 +155,6 @@ int Decider::MakeEStopDecision(PathDecision* const path_decision) {
const
auto
&
obstacle
=
path_obstacle
->
Obstacle
();
object_decision
->
set_id
(
obstacle
->
Id
());
object_decision
->
add_object_decision
()
->
mutable_avoid
();
;
// TODO: add prediction
// object_decision->mutable_prediction()->CopyFrom(*(obstacle->prediction()));
}
return
0
;
}
...
...
modules/planning/planner/em/decider.h
浏览文件 @
4d8af009
...
...
@@ -36,12 +36,12 @@ namespace planning {
class
Decider
{
public:
Decider
(
);
explicit
Decider
(
DecisionResult
*
decision_result
);
~
Decider
()
=
default
;
const
DecisionResult
&
Decision
()
const
;
int
MakeDecision
(
Frame
*
frame
,
PathDecision
*
const
path_decision
);
// TODO(all): fix the return code to use Status object.
int
MakeDecision
(
Frame
*
frame
);
private:
int
MakeMainStopDecision
(
Frame
*
frame
,
...
...
@@ -50,7 +50,7 @@ class Decider {
int
SetObjectDecisions
(
PathDecision
*
const
path_decision
);
private:
DecisionResult
decision_
;
DecisionResult
*
decision_
=
nullptr
;
// not owned
};
}
// namespace planning
...
...
modules/planning/planner/em/em_planner.cc
浏览文件 @
4d8af009
...
...
@@ -35,6 +35,7 @@
#include "modules/planning/optimizer/dp_st_speed/dp_st_speed_optimizer.h"
#include "modules/planning/optimizer/qp_spline_path/qp_spline_path_optimizer.h"
#include "modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_speed_optimizer.h"
#include "modules/planning/planner/em/decider.h"
namespace
apollo
{
namespace
planning
{
...
...
@@ -115,6 +116,12 @@ void EMPlanner::RecordDebugInfo(const std::string& name,
ptr_stats
->
set_time_ms
(
time_diff_ms
);
}
void
EMPlanner
::
PopulateDecision
(
Frame
*
frame
)
{
auto
planning_pb
=
frame
->
MutableADCTrajectory
();
Decider
decider
(
planning_pb
->
mutable_decision
());
decider
.
MakeDecision
(
frame
);
}
Status
EMPlanner
::
Plan
(
const
TrajectoryPoint
&
planning_start_point
,
Frame
*
frame
,
PublishableTrajectory
*
ptr_publishable_trajectory
)
{
...
...
@@ -156,6 +163,8 @@ Status EMPlanner::Plan(const TrajectoryPoint& planning_start_point,
*
ptr_publishable_trajectory
=
std
::
move
(
computed_trajectory
);
PopulateDecision
(
frame
);
// Add debug information.
if
(
FLAGS_enable_record_debug
&&
ptr_debug
!=
nullptr
)
{
auto
*
reference_line
=
ptr_debug
->
mutable_planning_data
()
->
add_path
();
...
...
modules/planning/planner/em/em_planner.h
浏览文件 @
4d8af009
...
...
@@ -72,6 +72,8 @@ class EMPlanner : public Planner {
std
::
vector
<
common
::
SpeedPoint
>
GenerateInitSpeedProfile
(
const
double
init_v
,
const
double
init_a
);
// TODO(all): change to return Status.
void
PopulateDecision
(
Frame
*
frame
);
void
RecordDebugInfo
(
const
std
::
string
&
name
,
const
PlanningData
*
planning_data
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录