Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
24451743
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,发现更多精彩内容 >>
提交
24451743
编写于
11月 19, 2018
作者:
L
luoqi06
提交者:
Jiangtao Hu
12月 13, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Planning : update interface and fix enable chart
上级
96975899
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
26 deletion
+40
-26
modules/planning/open_space_planning.cc
modules/planning/open_space_planning.cc
+36
-23
modules/planning/open_space_planning.h
modules/planning/open_space_planning.h
+2
-3
modules/planning/planning_component.cc
modules/planning/planning_component.cc
+2
-0
未找到文件。
modules/planning/open_space_planning.cc
浏览文件 @
24451743
...
@@ -122,6 +122,9 @@ Status OpenSpacePlanning::Init(const PlanningConfig& config) {
...
@@ -122,6 +122,9 @@ Status OpenSpacePlanning::Init(const PlanningConfig& config) {
}
}
start_time_
=
Clock
::
NowInSeconds
();
start_time_
=
Clock
::
NowInSeconds
();
AINFO
<<
"Open Space Planner Init Done"
;
return
planner_
->
Init
(
config_
);
return
planner_
->
Init
(
config_
);
}
}
...
@@ -145,6 +148,8 @@ Status OpenSpacePlanning::InitFrame(const uint32_t sequence_num,
...
@@ -145,6 +148,8 @@ Status OpenSpacePlanning::InitFrame(const uint32_t sequence_num,
return
status
;
return
status
;
}
}
AINFO
<<
"Open Space Planner Init Frame Done"
;
return
Status
::
OK
();
return
Status
::
OK
();
}
}
...
@@ -206,10 +211,6 @@ void OpenSpacePlanning::RunOnce(const LocalView& local_view,
...
@@ -206,10 +211,6 @@ void OpenSpacePlanning::RunOnce(const LocalView& local_view,
status
=
InitFrame
(
frame_num
,
stitching_trajectory
.
back
(),
start_timestamp
,
status
=
InitFrame
(
frame_num
,
stitching_trajectory
.
back
(),
start_timestamp
,
vehicle_state
,
trajectory_pb
);
vehicle_state
,
trajectory_pb
);
if
(
FLAGS_enable_record_debug
)
{
frame_
->
RecordInputDebug
(
trajectory_pb
->
mutable_debug
());
}
trajectory_pb
->
mutable_latency_stats
()
->
set_init_frame_time_ms
(
trajectory_pb
->
mutable_latency_stats
()
->
set_init_frame_time_ms
(
Clock
::
NowInSeconds
()
-
start_timestamp
);
Clock
::
NowInSeconds
()
-
start_timestamp
);
...
@@ -272,6 +273,7 @@ void OpenSpacePlanning::RunOnce(const LocalView& local_view,
...
@@ -272,6 +273,7 @@ void OpenSpacePlanning::RunOnce(const LocalView& local_view,
ADEBUG
<<
"Planning pb:"
<<
trajectory_pb
->
header
().
DebugString
();
ADEBUG
<<
"Planning pb:"
<<
trajectory_pb
->
header
().
DebugString
();
frame_
->
mutable_trajectory
()
->
CopyFrom
(
*
trajectory_pb
);
frame_
->
mutable_trajectory
()
->
CopyFrom
(
*
trajectory_pb
);
const
uint32_t
n
=
frame_
->
SequenceNum
();
const
uint32_t
n
=
frame_
->
SequenceNum
();
FrameHistory
::
Instance
()
->
Add
(
n
,
std
::
move
(
frame_
));
FrameHistory
::
Instance
()
->
Add
(
n
,
std
::
move
(
frame_
));
}
}
...
@@ -280,36 +282,46 @@ Status OpenSpacePlanning::Plan(
...
@@ -280,36 +282,46 @@ Status OpenSpacePlanning::Plan(
const
double
current_time_stamp
,
const
double
current_time_stamp
,
const
std
::
vector
<
TrajectoryPoint
>&
stitching_trajectory
,
const
std
::
vector
<
TrajectoryPoint
>&
stitching_trajectory
,
ADCTrajectory
*
const
trajectory_pb
)
{
ADCTrajectory
*
const
trajectory_pb
)
{
auto
status
=
planner_
->
Plan
(
stitching_trajectory
.
back
(),
frame_
.
get
());
// TODO(QiL): update last_publishable_trajectory_ for stitching
trajectory_pb
->
CopyFrom
(
frame_
->
trajectory
());
auto
*
ptr_debug
=
trajectory_pb
->
mutable_debug
();
auto
*
ptr_debug
=
trajectory_pb
->
mutable_debug
();
if
(
FLAGS_enable_record_debug
)
{
if
(
FLAGS_enable_record_debug
)
{
ptr_debug
->
mutable_planning_data
()
->
mutable_init_point
()
->
CopyFrom
(
ptr_debug
->
mutable_planning_data
()
->
mutable_init_point
()
->
CopyFrom
(
stitching_trajectory
.
back
());
stitching_trajectory
.
back
());
ADEBUG
<<
"Open space init point added!"
;
}
}
auto
status
=
planner_
->
Plan
(
stitching_trajectory
.
back
(),
frame_
.
get
());
if
(
status
.
ok
()
&&
FLAGS_enable_record_debug
)
{
ptr_debug
->
mutable_planning_data
()
->
mutable_open_space
()
->
CopyFrom
(
if
(
status
.
ok
()
&&
FLAGS_enable_record_debug
&&
frame_
->
open_space_debug
());
FLAGS_open_space_planner_switchable
)
{
ADEBUG
<<
"Open space debug information added!"
;
frame_
.
get
()
->
RecordOpenSpacePlannerDebug
(
ptr_debug
);
}
}
// TODO(QiL): update last_publishable_trajectory_ for stitching
if
(
FLAGS_export_chart
)
{
trajectory_pb
->
CopyFrom
(
frame_
->
trajectory
());
ExportOpenSpaceChart
(
frame_
->
open_space_debug
(),
ptr_debug
);
ADEBUG
<<
"Open Space Planning debug from frame is : "
<<
frame_
->
open_space_debug
().
ShortDebugString
();
ADEBUG
<<
"Open Space Planning export chart with : "
<<
trajectory_pb
->
ShortDebugString
();
}
return
status
;
return
status
;
}
}
void
AddTrajectory
(
const
OpenSpaceDebug
&
open_space
,
Chart
*
chart
)
{
void
AddOpenSpaceTrajectory
(
const
OpenSpaceDebug
&
open_space_debug
,
Chart
*
chart
)
{
chart
->
set_title
(
"Open Space Trajectory Visualization"
);
chart
->
set_title
(
"Open Space Trajectory Visualization"
);
auto
*
options
=
chart
->
mutable_options
();
auto
*
options
=
chart
->
mutable_options
();
options
->
mutable_x
()
->
set_min
(
open_space
.
xy_boundary
(
0
));
options
->
mutable_x
()
->
set_min
(
open_space
_debug
.
xy_boundary
(
0
));
options
->
mutable_x
()
->
set_max
(
open_space
.
xy_boundary
(
1
));
options
->
mutable_x
()
->
set_max
(
open_space
_debug
.
xy_boundary
(
1
));
options
->
mutable_x
()
->
set_label_string
(
"x (meter)"
);
options
->
mutable_x
()
->
set_label_string
(
"x (meter)"
);
options
->
mutable_y
()
->
set_min
(
open_space
.
xy_boundary
(
2
));
options
->
mutable_y
()
->
set_min
(
open_space
_debug
.
xy_boundary
(
2
));
options
->
mutable_y
()
->
set_max
(
open_space
.
xy_boundary
(
3
));
options
->
mutable_y
()
->
set_max
(
open_space
_debug
.
xy_boundary
(
3
));
options
->
mutable_y
()
->
set_label_string
(
"y (meter)"
);
options
->
mutable_y
()
->
set_label_string
(
"y (meter)"
);
for
(
const
auto
&
obstacle
:
open_space
.
obstacles
())
{
for
(
const
auto
&
obstacle
:
open_space
_debug
.
obstacles
())
{
auto
*
polygon
=
chart
->
add_polygon
();
auto
*
polygon
=
chart
->
add_polygon
();
polygon
->
set_label
(
obstacle
.
id
());
polygon
->
set_label
(
obstacle
.
id
());
for
(
int
vertice_index
=
0
;
for
(
int
vertice_index
=
0
;
...
@@ -320,7 +332,7 @@ void AddTrajectory(const OpenSpaceDebug& open_space, Chart* chart) {
...
@@ -320,7 +332,7 @@ void AddTrajectory(const OpenSpaceDebug& open_space, Chart* chart) {
}
}
}
}
for
(
const
auto
&
trajectory
:
open_space
.
trajectories
().
trajectory
())
{
for
(
const
auto
&
trajectory
:
open_space
_debug
.
trajectories
().
trajectory
())
{
auto
*
line
=
chart
->
add_line
();
auto
*
line
=
chart
->
add_line
();
line
->
set_label
(
trajectory
.
name
());
line
->
set_label
(
trajectory
.
name
());
for
(
const
auto
&
point
:
trajectory
.
trajectory_point
())
{
for
(
const
auto
&
point
:
trajectory
.
trajectory_point
())
{
...
@@ -338,12 +350,13 @@ void AddTrajectory(const OpenSpaceDebug& open_space, Chart* chart) {
...
@@ -338,12 +350,13 @@ void AddTrajectory(const OpenSpaceDebug& open_space, Chart* chart) {
}
}
}
}
void
OpenSpacePlanning
::
ExportChart
(
const
planning_internal
::
Debug
&
debug_info
,
void
OpenSpacePlanning
::
ExportOpenSpaceChart
(
planning_internal
::
Debug
*
debug_chart
)
{
const
planning_internal
::
OpenSpaceDebug
&
debug_info
,
planning_internal
::
Debug
*
debug_chart
)
{
// Export Trajectory Visualization Chart.
// Export Trajectory Visualization Chart.
if
(
FLAGS_
open_space_planner_switchable
&&
FLAGS_
enable_record_debug
)
{
if
(
FLAGS_enable_record_debug
)
{
Add
Trajectory
(
debug_info
.
planning_data
().
open_space
()
,
Add
OpenSpaceTrajectory
(
debug_info
,
debug_chart
->
mutable_planning_data
()
->
add_chart
());
debug_chart
->
mutable_planning_data
()
->
add_chart
());
}
}
}
}
...
...
modules/planning/open_space_planning.h
浏览文件 @
24451743
...
@@ -67,8 +67,8 @@ class OpenSpacePlanning : public PlanningBase {
...
@@ -67,8 +67,8 @@ class OpenSpacePlanning : public PlanningBase {
const
std
::
vector
<
common
::
TrajectoryPoint
>&
stitching_trajectory
,
const
std
::
vector
<
common
::
TrajectoryPoint
>&
stitching_trajectory
,
ADCTrajectory
*
const
trajectory
)
override
;
ADCTrajectory
*
const
trajectory
)
override
;
void
Export
Chart
(
const
planning_internal
::
Debug
&
debug_info
,
void
Export
OpenSpaceChart
(
const
planning_internal
::
OpenSpace
Debug
&
debug_info
,
planning_internal
::
Debug
*
debug_chart
)
override
;
planning_internal
::
Debug
*
debug_chart
)
;
private:
private:
common
::
Status
InitFrame
(
const
uint32_t
sequence_num
,
common
::
Status
InitFrame
(
const
uint32_t
sequence_num
,
...
@@ -76,7 +76,6 @@ class OpenSpacePlanning : public PlanningBase {
...
@@ -76,7 +76,6 @@ class OpenSpacePlanning : public PlanningBase {
const
double
start_time
,
const
double
start_time
,
const
common
::
VehicleState
&
vehicle_state
,
const
common
::
VehicleState
&
vehicle_state
,
ADCTrajectory
*
output_trajectory
);
ADCTrajectory
*
output_trajectory
);
void
ExportReferenceLineDebug
(
planning_internal
::
Debug
*
debug
);
bool
CheckPlanningConfig
(
const
PlanningConfig
&
config
);
bool
CheckPlanningConfig
(
const
PlanningConfig
&
config
);
private:
private:
...
...
modules/planning/planning_component.cc
浏览文件 @
24451743
...
@@ -124,10 +124,12 @@ bool PlanningComponent::Proc(
...
@@ -124,10 +124,12 @@ bool PlanningComponent::Proc(
}
}
if
(
!
CheckInput
())
{
if
(
!
CheckInput
())
{
AERROR
<<
"Input check failed"
;
return
false
;
return
false
;
}
}
ADCTrajectory
adc_trajectory_pb
;
ADCTrajectory
adc_trajectory_pb
;
AINFO
<<
"Call RunOnce in Planning"
;
planning_base_
->
RunOnce
(
local_view_
,
&
adc_trajectory_pb
);
planning_base_
->
RunOnce
(
local_view_
,
&
adc_trajectory_pb
);
common
::
util
::
FillHeader
(
node_
->
Name
(),
&
adc_trajectory_pb
);
common
::
util
::
FillHeader
(
node_
->
Name
(),
&
adc_trajectory_pb
);
planning_writer_
->
Write
(
std
::
make_shared
<
ADCTrajectory
>
(
adc_trajectory_pb
));
planning_writer_
->
Write
(
std
::
make_shared
<
ADCTrajectory
>
(
adc_trajectory_pb
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录