Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
c714d03e
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,发现更多精彩内容 >>
提交
c714d03e
编写于
8月 28, 2017
作者:
D
Dong Li
提交者:
Jiangtao Hu
8月 28, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
planning: use vehicle position in planning debug
上级
5db6cebb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
43 addition
and
45 deletion
+43
-45
modules/planning/proto/planning_internal.proto
modules/planning/proto/planning_internal.proto
+1
-1
modules/tools/mapshow/plot_planning.py
modules/tools/mapshow/plot_planning.py
+42
-44
未找到文件。
modules/planning/proto/planning_internal.proto
浏览文件 @
c714d03e
...
...
@@ -90,7 +90,7 @@ message STGraphDebug {
repeated
apollo.common.SpeedPoint
speed_profile
=
4
;
}
// next id: 1
5
// next id: 1
6
message
PlanningData
{
// input
optional
apollo.localization.LocalizationEstimate
adc_position
=
7
;
...
...
modules/tools/mapshow/plot_planning.py
浏览文件 @
c714d03e
...
...
@@ -64,27 +64,20 @@ sl_aggregated_boundary_low_line = None
sl_aggregated_boundary_high_line
=
None
def
localization_callback
(
localization_pb
):
localization
.
update_localization_pb
(
localization_pb
)
def
planning_callback
(
planning_pb
):
planning
.
update_planning_pb
(
planning_pb
)
planning
.
compute_path_data
()
planning
.
compute_speed_data
()
planning
.
compute_st_data
()
planning
.
compute_sl_data
()
localization
.
update_localization_pb
(
planning_pb
.
debug
.
planning_data
.
adc_position
)
def
add_listener
():
rospy
.
init_node
(
'plot_planning'
,
anonymous
=
True
)
rospy
.
Subscriber
(
'/apollo/planning'
,
planning_pb2
.
ADCTrajectory
,
rospy
.
Subscriber
(
'/apollo/planning'
,
planning_pb2
.
ADCTrajectory
,
planning_callback
)
rospy
.
Subscriber
(
'/apollo/localization/pose'
,
localization_pb2
.
LocalizationEstimate
,
localization_callback
)
def
update
(
frame_number
):
...
...
@@ -121,29 +114,26 @@ def update(frame_number):
planning
.
replot_path_data
(
path_line_pool
)
planning
.
replot_speed_data
(
speed_line_pool
)
planning
.
replot_sl_data
(
sl_static_obstacle_lower_boundary
,
sl_static_obstacle_upper_boundary
,
sl_dynamic_obstacle_lower_boundary
,
sl_dynamic_obstacle_upper_boundary
,
sl_map_lower_boundary
,
sl_map_upper_boundary
,
sl_path
,
sl_aggregated_boundary_low_line
,
sl_aggregated_boundary_high_line
)
planning
.
replot_sl_data
(
sl_static_obstacle_lower_boundary
,
sl_static_obstacle_upper_boundary
,
sl_dynamic_obstacle_lower_boundary
,
sl_dynamic_obstacle_upper_boundary
,
sl_map_lower_boundary
,
sl_map_upper_boundary
,
sl_path
,
sl_aggregated_boundary_low_line
,
sl_aggregated_boundary_high_line
)
if
len
(
planning
.
st_data_s
.
keys
())
>=
1
:
planning
.
replot_st_data
(
obstacle_line_pool
,
st_line_1
,
obstacle_annotation_pool
,
planning
.
st_data_s
.
keys
()[
0
])
planning
.
replot_st_data
(
obstacle_line_pool
,
st_line_1
,
obstacle_annotation_pool
,
planning
.
st_data_s
.
keys
()[
0
])
if
len
(
planning
.
st_data_s
.
keys
())
>=
2
:
planning
.
replot_st_data
(
obstacle_line_pool2
,
st_line_
2
,
obstacle_annotation_pool2
,
planning
.
st_data_s
.
keys
()[
1
])
planning
.
replot_st_data
(
obstacle_line_pool2
,
st_line_2
,
obstacle_annotation_pool
2
,
planning
.
st_data_s
.
keys
()[
1
])
localization
.
replot_vehicle
(
vehicle_position_line
,
vehicle_polygon_line
)
try
:
ax
.
set_xlim
(
localization
.
localization_pb
.
pose
.
position
.
x
-
60
,
localization
.
localization_pb
.
pose
.
position
.
x
+
60
)
localization
.
localization_pb
.
pose
.
position
.
x
+
60
)
ax
.
set_ylim
(
localization
.
localization_pb
.
pose
.
position
.
y
-
60
,
localization
.
localization_pb
.
pose
.
position
.
y
+
60
)
localization
.
localization_pb
.
pose
.
position
.
y
+
60
)
except
:
pass
ax
.
relim
()
...
...
@@ -169,19 +159,25 @@ def init_line_pool(central_x, central_y):
colors
=
[
'b'
,
'g'
,
'r'
,
'k'
]
for
i
in
range
(
path_line_pool_size
):
line
,
=
ax
.
plot
([
central_x
],
[
central_y
],
colors
[
i
%
len
(
colors
)],
lw
=
3
+
i
*
3
,
alpha
=
0.2
)
line
,
=
ax
.
plot
(
[
central_x
],
[
central_y
],
colors
[
i
%
len
(
colors
)],
lw
=
3
+
i
*
3
,
alpha
=
0.2
)
path_line_pool
.
append
(
line
)
for
i
in
range
(
speed_line_pool_size
):
line
,
=
ax1
.
plot
([
central_x
],
[
central_y
],
colors
[
i
%
len
(
colors
)]
+
"."
,
lw
=
3
,
alpha
=
0.5
)
line
,
=
ax1
.
plot
(
[
central_x
],
[
central_y
],
colors
[
i
%
len
(
colors
)]
+
"."
,
lw
=
3
,
alpha
=
0.5
)
speed_line_pool
.
append
(
line
)
st_line_1
,
=
ax2
.
plot
(
[
0
],
[
0
],
colors
[
i
%
len
(
colors
)]
+
"."
,
lw
=
3
,
alpha
=
0.5
)
st_line_2
,
=
ax3
.
plot
(
[
0
],
[
0
],
colors
[
i
%
len
(
colors
)]
+
"."
,
lw
=
3
,
alpha
=
0.5
)
st_line_1
,
=
ax2
.
plot
(
[
0
],
[
0
],
colors
[
i
%
len
(
colors
)]
+
"."
,
lw
=
3
,
alpha
=
0.5
)
st_line_2
,
=
ax3
.
plot
(
[
0
],
[
0
],
colors
[
i
%
len
(
colors
)]
+
"."
,
lw
=
3
,
alpha
=
0.5
)
sl_static_obstacle_lower_boundary
,
=
\
ax4
.
plot
([
0
],
[
0
],
"r-"
,
lw
=
0.3
,
alpha
=
0.8
)
...
...
@@ -202,23 +198,21 @@ def init_line_pool(central_x, central_y):
ax4
.
plot
([
0
],
[
0
],
"k-"
,
lw
=
1
,
ms
=
2
)
for
i
in
range
(
obstacle_line_pool_size
):
line
,
=
ax2
.
plot
([
0
],
[
0
],
'r-'
,
lw
=
3
,
alpha
=
0.5
)
line
,
=
ax2
.
plot
([
0
],
[
0
],
'r-'
,
lw
=
3
,
alpha
=
0.5
)
anno
=
ax2
.
text
(
0
,
0
,
""
)
obstacle_line_pool
.
append
(
line
)
obstacle_annotation_pool
.
append
(
anno
)
for
i
in
range
(
obstacle_line_pool_size2
):
line
,
=
ax3
.
plot
([
0
],
[
0
],
'r-'
,
lw
=
3
,
alpha
=
0.5
)
line
,
=
ax3
.
plot
([
0
],
[
0
],
'r-'
,
lw
=
3
,
alpha
=
0.5
)
anno
=
ax3
.
text
(
0
,
0
,
""
)
obstacle_line_pool2
.
append
(
line
)
obstacle_annotation_pool2
.
append
(
anno
)
ax2
.
set_xlim
(
-
3
,
9
)
ax2
.
set_ylim
(
-
10
,
90
)
ax2
.
set_ylim
(
-
10
,
90
)
ax3
.
set_xlim
(
-
3
,
9
)
ax3
.
set_ylim
(
-
10
,
90
)
ax3
.
set_ylim
(
-
10
,
90
)
vehicle_position_line
,
=
ax
.
plot
([
central_x
],
[
central_y
],
'go'
,
alpha
=
0.3
)
vehicle_polygon_line
,
=
ax
.
plot
([
central_x
],
[
central_y
],
'g-'
)
...
...
@@ -230,10 +224,14 @@ if __name__ == '__main__':
parser
=
argparse
.
ArgumentParser
(
description
=
"plot_planning is a tool to display "
"planning trajs on a map."
,
"planning trajs on a map."
,
prog
=
"plot_planning.py"
)
parser
.
add_argument
(
"-m"
,
"--map"
,
action
=
"store"
,
type
=
str
,
required
=
False
,
"-m"
,
"--map"
,
action
=
"store"
,
type
=
str
,
required
=
False
,
default
=
default_map_path
,
help
=
"Specify the map file in txt or binary format"
)
args
=
parser
.
parse_args
()
...
...
@@ -257,8 +255,8 @@ if __name__ == '__main__':
map
=
Map
()
map
.
load
(
args
.
map
)
map
.
draw_lanes
(
ax
,
False
,
[])
central_y
=
sum
(
ax
.
get_ylim
())
/
2
central_x
=
sum
(
ax
.
get_xlim
())
/
2
central_y
=
sum
(
ax
.
get_ylim
())
/
2
central_x
=
sum
(
ax
.
get_xlim
())
/
2
init_line_pool
(
central_x
,
central_y
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录