Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
f1b34a8d
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,发现更多精彩内容 >>
提交
f1b34a8d
编写于
3月 15, 2019
作者:
D
deidaraho
提交者:
Xiangquan Xiao
3月 20, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
planning: move ExprtChart from planning_base to online_planning for future extension
上级
27597ee5
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
96 addition
and
92 deletion
+96
-92
modules/planning/on_lane_planning.cc
modules/planning/on_lane_planning.cc
+94
-0
modules/planning/on_lane_planning.h
modules/planning/on_lane_planning.h
+2
-0
modules/planning/planning_base.cc
modules/planning/planning_base.cc
+0
-89
modules/planning/planning_base.h
modules/planning/planning_base.h
+0
-3
未找到文件。
modules/planning/on_lane_planning.cc
浏览文件 @
f1b34a8d
...
...
@@ -32,7 +32,9 @@
#include "modules/planning/common/trajectory_stitcher.h"
#include "modules/planning/on_lane_planning.h"
#include "modules/planning/planner/rtk/rtk_replay_planner.h"
#include "modules/planning/proto/planning_internal.pb.h"
#include "modules/planning/reference_line/reference_line_provider.h"
#include "modules/planning/tasks/task_factory.h"
#include "modules/planning/traffic_rules/traffic_decider.h"
#include "modules/planning/util/util.h"
...
...
@@ -48,6 +50,10 @@ using apollo::common::math::Vec2d;
using
apollo
::
common
::
time
::
Clock
;
using
apollo
::
hdmap
::
HDMapUtil
;
using
apollo
::
routing
::
RoutingResponse
;
using
apollo
::
dreamview
::
Chart
;
using
apollo
::
planning_internal
::
SLFrameDebug
;
using
apollo
::
planning_internal
::
SpeedPlan
;
using
apollo
::
planning_internal
::
STGraphDebug
;
OnLanePlanning
::~
OnLanePlanning
()
{
if
(
reference_line_provider_
)
{
...
...
@@ -487,5 +493,93 @@ bool OnLanePlanning::CheckPlanningConfig(const PlanningConfig& config) {
return
true
;
}
void
AddStGraph
(
const
STGraphDebug
&
st_graph
,
Chart
*
chart
)
{
chart
->
set_title
(
st_graph
.
name
());
auto
*
options
=
chart
->
mutable_options
();
options
->
mutable_x
()
->
set_min
(
-
2.0
);
options
->
mutable_x
()
->
set_max
(
10.0
);
options
->
mutable_x
()
->
set_label_string
(
"t(second)"
);
options
->
mutable_y
()
->
set_label_string
(
"s(meter)"
);
options
->
set_legend_display
(
false
);
for
(
const
auto
&
boundary
:
st_graph
.
boundary
())
{
auto
*
boundary_chart
=
chart
->
add_polygon
();
// from 'ST_BOUNDARY_TYPE_' to the end
std
::
string
type
=
StGraphBoundaryDebug_StBoundaryType_Name
(
boundary
.
type
()).
substr
(
17
);
boundary_chart
->
set_label
(
boundary
.
name
()
+
"_"
+
type
);
for
(
const
auto
&
point
:
boundary
.
point
())
{
auto
*
point_debug
=
boundary_chart
->
add_point
();
point_debug
->
set_x
(
point
.
t
());
point_debug
->
set_y
(
point
.
s
());
}
}
}
void
AddSlFrame
(
const
SLFrameDebug
&
sl_frame
,
Chart
*
chart
)
{
chart
->
set_title
(
sl_frame
.
name
());
auto
*
options
=
chart
->
mutable_options
();
options
->
mutable_x
()
->
set_min
(
0.0
);
options
->
mutable_x
()
->
set_max
(
80.0
);
options
->
mutable_x
()
->
set_label_string
(
"s (meter)"
);
options
->
mutable_y
()
->
set_min
(
-
8.0
);
options
->
mutable_y
()
->
set_max
(
8.0
);
options
->
mutable_y
()
->
set_label_string
(
"l (meter)"
);
auto
*
sl_line
=
chart
->
add_line
();
sl_line
->
set_label
(
"SL Path"
);
for
(
const
auto
&
sl_point
:
sl_frame
.
sl_path
())
{
auto
*
point_debug
=
sl_line
->
add_point
();
point_debug
->
set_x
(
sl_point
.
s
());
point_debug
->
set_x
(
sl_point
.
l
());
}
}
void
AddSpeedPlan
(
const
::
google
::
protobuf
::
RepeatedPtrField
<
SpeedPlan
>&
speed_plans
,
Chart
*
chart
)
{
chart
->
set_title
(
"Speed Plan"
);
auto
*
options
=
chart
->
mutable_options
();
options
->
mutable_x
()
->
set_min
(
0.0
);
options
->
mutable_x
()
->
set_max
(
80.0
);
options
->
mutable_x
()
->
set_label_string
(
"s (meter)"
);
options
->
mutable_y
()
->
set_min
(
0.0
);
options
->
mutable_y
()
->
set_max
(
50.0
);
options
->
mutable_y
()
->
set_label_string
(
"v (m/s)"
);
for
(
const
auto
&
speed_plan
:
speed_plans
)
{
auto
*
line
=
chart
->
add_line
();
line
->
set_label
(
speed_plan
.
name
());
for
(
const
auto
&
point
:
speed_plan
.
speed_point
())
{
auto
*
point_debug
=
line
->
add_point
();
point_debug
->
set_x
(
point
.
s
());
point_debug
->
set_y
(
point
.
v
());
}
// Set chartJS's dataset properties
auto
*
properties
=
line
->
mutable_properties
();
(
*
properties
)[
"borderWidth"
]
=
"2"
;
(
*
properties
)[
"pointRadius"
]
=
"0"
;
(
*
properties
)[
"fill"
]
=
"false"
;
(
*
properties
)[
"showLine"
]
=
"true"
;
if
(
speed_plan
.
name
()
==
"DpStSpeedOptimizer"
)
{
(
*
properties
)[
"color"
]
=
"
\"
rgba(27, 249, 105, 0.5)
\"
"
;
}
else
if
(
speed_plan
.
name
()
==
"QpSplineStSpeedOptimizer"
)
{
(
*
properties
)[
"color"
]
=
"
\"
rgba(54, 162, 235, 1)
\"
"
;
}
}
}
void
OnLanePlanning
::
ExportChart
(
const
planning_internal
::
Debug
&
debug_info
,
planning_internal
::
Debug
*
debug_chart
)
{
for
(
const
auto
&
st_graph
:
debug_info
.
planning_data
().
st_graph
())
{
AddStGraph
(
st_graph
,
debug_chart
->
mutable_planning_data
()
->
add_chart
());
}
for
(
const
auto
&
sl_frame
:
debug_info
.
planning_data
().
sl_frame
())
{
AddSlFrame
(
sl_frame
,
debug_chart
->
mutable_planning_data
()
->
add_chart
());
}
AddSpeedPlan
(
debug_info
.
planning_data
().
speed_plan
(),
debug_chart
->
mutable_planning_data
()
->
add_chart
());
}
}
// namespace planning
}
// namespace apollo
modules/planning/on_lane_planning.h
浏览文件 @
f1b34a8d
...
...
@@ -76,6 +76,8 @@ class OnLanePlanning : public PlanningBase {
void
ExportReferenceLineDebug
(
planning_internal
::
Debug
*
debug
);
bool
CheckPlanningConfig
(
const
PlanningConfig
&
config
);
void
GenerateStopTrajectory
(
ADCTrajectory
*
trajectory_pb
);
void
ExportChart
(
const
planning_internal
::
Debug
&
debug_info
,
planning_internal
::
Debug
*
debug_chart
);
private:
routing
::
RoutingResponse
last_routing_
;
...
...
modules/planning/planning_base.cc
浏览文件 @
f1b34a8d
...
...
@@ -54,94 +54,5 @@ void PlanningBase::FillPlanningPb(const double timestamp,
trajectory_pb
->
mutable_routing_header
()
->
CopyFrom
(
local_view_
.
routing
->
header
());
}
void
AddStGraph
(
const
STGraphDebug
&
st_graph
,
Chart
*
chart
)
{
chart
->
set_title
(
st_graph
.
name
());
auto
*
options
=
chart
->
mutable_options
();
options
->
mutable_x
()
->
set_min
(
-
2.0
);
options
->
mutable_x
()
->
set_max
(
10.0
);
options
->
mutable_x
()
->
set_label_string
(
"t(second)"
);
options
->
mutable_y
()
->
set_label_string
(
"s(meter)"
);
options
->
set_legend_display
(
false
);
for
(
const
auto
&
boundary
:
st_graph
.
boundary
())
{
auto
*
boundary_chart
=
chart
->
add_polygon
();
// from 'ST_BOUNDARY_TYPE_' to the end
std
::
string
type
=
StGraphBoundaryDebug_StBoundaryType_Name
(
boundary
.
type
()).
substr
(
17
);
boundary_chart
->
set_label
(
boundary
.
name
()
+
"_"
+
type
);
for
(
const
auto
&
point
:
boundary
.
point
())
{
auto
*
point_debug
=
boundary_chart
->
add_point
();
point_debug
->
set_x
(
point
.
t
());
point_debug
->
set_y
(
point
.
s
());
}
}
}
void
AddSlFrame
(
const
SLFrameDebug
&
sl_frame
,
Chart
*
chart
)
{
chart
->
set_title
(
sl_frame
.
name
());
auto
*
options
=
chart
->
mutable_options
();
options
->
mutable_x
()
->
set_min
(
0.0
);
options
->
mutable_x
()
->
set_max
(
80.0
);
options
->
mutable_x
()
->
set_label_string
(
"s (meter)"
);
options
->
mutable_y
()
->
set_min
(
-
8.0
);
options
->
mutable_y
()
->
set_max
(
8.0
);
options
->
mutable_y
()
->
set_label_string
(
"l (meter)"
);
auto
*
sl_line
=
chart
->
add_line
();
sl_line
->
set_label
(
"SL Path"
);
for
(
const
auto
&
sl_point
:
sl_frame
.
sl_path
())
{
auto
*
point_debug
=
sl_line
->
add_point
();
point_debug
->
set_x
(
sl_point
.
s
());
point_debug
->
set_x
(
sl_point
.
l
());
}
}
void
AddSpeedPlan
(
const
::
google
::
protobuf
::
RepeatedPtrField
<
SpeedPlan
>&
speed_plans
,
Chart
*
chart
)
{
chart
->
set_title
(
"Speed Plan"
);
auto
*
options
=
chart
->
mutable_options
();
options
->
mutable_x
()
->
set_min
(
0.0
);
options
->
mutable_x
()
->
set_max
(
80.0
);
options
->
mutable_x
()
->
set_label_string
(
"s (meter)"
);
options
->
mutable_y
()
->
set_min
(
0.0
);
options
->
mutable_y
()
->
set_max
(
50.0
);
options
->
mutable_y
()
->
set_label_string
(
"v (m/s)"
);
for
(
const
auto
&
speed_plan
:
speed_plans
)
{
auto
*
line
=
chart
->
add_line
();
line
->
set_label
(
speed_plan
.
name
());
for
(
const
auto
&
point
:
speed_plan
.
speed_point
())
{
auto
*
point_debug
=
line
->
add_point
();
point_debug
->
set_x
(
point
.
s
());
point_debug
->
set_y
(
point
.
v
());
}
// Set chartJS's dataset properties
auto
*
properties
=
line
->
mutable_properties
();
(
*
properties
)[
"borderWidth"
]
=
"2"
;
(
*
properties
)[
"pointRadius"
]
=
"0"
;
(
*
properties
)[
"fill"
]
=
"false"
;
(
*
properties
)[
"showLine"
]
=
"true"
;
if
(
speed_plan
.
name
()
==
"DpStSpeedOptimizer"
)
{
(
*
properties
)[
"color"
]
=
"
\"
rgba(27, 249, 105, 0.5)
\"
"
;
}
else
if
(
speed_plan
.
name
()
==
"QpSplineStSpeedOptimizer"
)
{
(
*
properties
)[
"color"
]
=
"
\"
rgba(54, 162, 235, 1)
\"
"
;
}
}
}
void
PlanningBase
::
ExportChart
(
const
planning_internal
::
Debug
&
debug_info
,
planning_internal
::
Debug
*
debug_chart
)
{
for
(
const
auto
&
st_graph
:
debug_info
.
planning_data
().
st_graph
())
{
AddStGraph
(
st_graph
,
debug_chart
->
mutable_planning_data
()
->
add_chart
());
}
for
(
const
auto
&
sl_frame
:
debug_info
.
planning_data
().
sl_frame
())
{
AddSlFrame
(
sl_frame
,
debug_chart
->
mutable_planning_data
()
->
add_chart
());
}
AddSpeedPlan
(
debug_info
.
planning_data
().
speed_plan
(),
debug_chart
->
mutable_planning_data
()
->
add_chart
());
}
}
// namespace planning
}
// namespace apollo
modules/planning/planning_base.h
浏览文件 @
f1b34a8d
...
...
@@ -75,9 +75,6 @@ class PlanningBase {
virtual
void
FillPlanningPb
(
const
double
timestamp
,
ADCTrajectory
*
const
trajectory_pb
);
virtual
void
ExportChart
(
const
planning_internal
::
Debug
&
debug_info
,
planning_internal
::
Debug
*
debug_chart
);
LocalView
local_view_
;
const
hdmap
::
HDMap
*
hdmap_
=
nullptr
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录