Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
a8ac0646
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,发现更多精彩内容 >>
提交
a8ac0646
编写于
2月 15, 2018
作者:
J
Jiangtao Hu
提交者:
Liangliang Zhang
2月 15, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
scripts: make replay works for current working dir. add replay sequence script.
上级
e7d6fd0a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
16 deletion
+37
-16
modules/tools/replay/replay_sequence.py
modules/tools/replay/replay_sequence.py
+14
-9
scripts/replay.sh
scripts/replay.sh
+2
-7
scripts/replay_seq.sh
scripts/replay_seq.sh
+21
-0
未找到文件。
modules/tools/replay/replay_sequence.py
浏览文件 @
a8ac0646
...
...
@@ -25,8 +25,7 @@ import rospy
from
std_msgs.msg
import
String
from
google.protobuf
import
text_format
import
common.proto_utils
as
proto_utils
import
common.message_manager
as
message_manager
def
generate_message
(
filename
,
pb_type
):
f_handle
=
file
(
filename
,
'r'
)
...
...
@@ -40,22 +39,28 @@ def seq_publisher(seq_num, period):
"""publisher"""
rospy
.
init_node
(
'replay_node'
,
anonymous
=
True
)
messages
=
{}
for
topic
,
msg_type
in
proto_utils
.
topic_pb_dict
.
iteritems
():
for
msg
in
message_manager
.
topic_pb_list
:
topic
=
msg
.
topic
()
name
=
msg
.
name
()
msg_type
=
msg
.
msg_type
()
messages
[
topic
]
=
{}
filename
=
str
(
seq_num
)
+
"_"
+
topic
+
".pb.txt"
filename
=
str
(
seq_num
)
+
"_"
+
name
+
".pb.txt"
print
"trying to load pb file:"
,
filename
messages
[
topic
][
"publisher"
]
=
rospy
.
Publisher
(
topic
,
msg_type
,
queue_size
=
1
)
pb_msg
=
msg
_type
(
)
if
not
p
roto_utils
.
get_pb_from_file
(
filename
,
pb_msg
)
:
pb_msg
=
msg
.
parse_file
(
filename
)
if
not
p
b_msg
:
print
topic
,
" pb is none"
# continue
messages
[
topic
][
"value"
]
=
pb_msg
rate
=
rospy
.
Rate
(
int
(
1.0
/
period
))
# 10hz
while
not
rospy
.
is_shutdown
():
for
topic
,
module_features
in
messages
:
if
module_features
[
"value"
]
is
not
None
:
module_features
[
"publisher"
].
publish
(
module_features
[
"value"
])
for
topic
in
messages
:
if
messages
[
topic
][
"value"
]
is
not
None
:
print
"publish: "
,
topic
messages
[
topic
][
"publisher"
].
publish
(
messages
[
topic
][
"value"
])
rate
.
sleep
()
...
...
scripts/replay.sh
浏览文件 @
a8ac0646
...
...
@@ -16,11 +16,6 @@
# limitations under the License.
###############################################################################
# e.g. replay.sh 1_chassis.pb.txt
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
cd
"
${
DIR
}
/.."
source
"
${
DIR
}
/apollo_base.sh"
python modules/tools/replay/replay_file.py
$@
python /apollo/modules/tools/replay/replay_file.py
$@
scripts/replay_seq.sh
0 → 100755
浏览文件 @
a8ac0646
#!/usr/bin/env bash
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
# e.g. replay_seq.sh 11
python /apollo/modules/tools/replay/replay_sequence.py
$@
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录