Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
90de3141
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,发现更多精彩内容 >>
提交
90de3141
编写于
12月 14, 2019
作者:
X
Xiangquan Xiao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cyber: Prepare for python3 by running 2to3 tool.
上级
3ebf453f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
38 deletion
+39
-38
cyber/tools/cyber_channel/cyber_channel
cyber/tools/cyber_channel/cyber_channel
+16
-16
cyber/tools/cyber_launch/cyber_launch
cyber/tools/cyber_launch/cyber_launch
+2
-2
cyber/tools/cyber_node/cyber_node
cyber/tools/cyber_node/cyber_node
+12
-12
cyber/tools/cyber_service/cyber_service
cyber/tools/cyber_service/cyber_service
+9
-8
未找到文件。
cyber/tools/cyber_channel/cyber_channel
浏览文件 @
90de3141
...
...
@@ -27,7 +27,7 @@ from cyber_py import cyber_time
def
print_channel_type
(
channel_name
):
msgtype
=
cyber
.
ChannelUtils
.
get_msgtype
(
channel_name
)
print
channel_name
,
" type is ["
,
msgtype
,
"]"
print
(
channel_name
,
" type is ["
,
msgtype
,
"]"
)
def
_channel_cmd_type
(
argv
):
...
...
@@ -56,7 +56,7 @@ class CyberChannelBw(object):
self
.
window_size
=
window_size
if
window_size
<=
0
or
window_size
>
50000
:
self
.
window_size
=
100
print
"bw window_size: "
,
self
.
window_size
print
(
"bw window_size: "
,
self
.
window_size
)
def
callback_bw
(
self
,
rawdata
):
with
self
.
lock
:
...
...
@@ -158,7 +158,7 @@ class CyberChannelHz(object):
if
window_size
<=
0
or
window_size
>
50000
:
window_size
=
50000
self
.
window_size
=
window_size
print
"hz window_size: "
,
window_size
print
(
"hz window_size: "
,
window_size
)
def
callback_hz
(
self
,
m
):
with
self
.
lock
:
...
...
@@ -255,33 +255,33 @@ def print_role(rolsattr_rawdata):
msg
=
RoleAttributes
()
msg
.
ParseFromString
(
rolsattr_rawdata
)
except
DecodeError
:
print
"RoleAttributes ParseFromString failed. size is "
,
len
(
rolsattr_rawdata
)
print
(
"RoleAttributes ParseFromString failed. size is "
,
len
(
rolsattr_rawdata
)
)
return
print
"
\t
roleid
\t\t
"
,
msg
.
id
print
"
\t
hostname
\t
"
,
msg
.
host_name
print
"
\t
processid
\t
"
,
msg
.
process_id
print
"
\t
nodename
\t
"
,
msg
.
node_name
print
"
\t
msgtype
\t\t
"
,
msg
.
message_type
print
(
"
\t
roleid
\t\t
"
,
msg
.
id
)
print
(
"
\t
hostname
\t
"
,
msg
.
host_name
)
print
(
"
\t
processid
\t
"
,
msg
.
process_id
)
print
(
"
\t
nodename
\t
"
,
msg
.
node_name
)
print
(
"
\t
msgtype
\t\t
"
,
msg
.
message_type
)
def
channel_info
(
channel_name
):
channlesinfo_dict
=
cyber
.
ChannelUtils
.
get_channels_info
()
time
.
sleep
(
1
)
if
len
(
channlesinfo_dict
)
==
0
:
print
"channelsinfo dict is null"
print
(
"channelsinfo dict is null"
)
return
# for key in channlesinfo_dict.keys():
# print key
if
channel_name
!=
""
:
print
channel_name
print
(
channel_name
)
for
role_data
in
channlesinfo_dict
[
channel_name
]:
print_role
(
role_data
)
else
:
channels
=
sorted
(
channlesinfo_dict
.
keys
())
print
"The number of channels is: "
,
len
(
channels
)
print
(
"The number of channels is: "
,
len
(
channels
)
)
for
channel
in
channels
:
print
channel
print
(
channel
)
for
role_data
in
channlesinfo_dict
[
channel
]:
print_role
(
role_data
)
...
...
@@ -312,9 +312,9 @@ def _channel_cmd_info(argv):
def
print_channel_list
():
channels
=
sorted
(
cyber
.
ChannelUtils
.
get_channels
())
print
"The number of channels is: "
,
len
(
channels
)
print
(
"The number of channels is: "
,
len
(
channels
)
)
for
channel
in
channels
:
print
channel
print
(
channel
)
def
_channel_cmd_list
(
argv
):
...
...
@@ -346,7 +346,7 @@ class CyberChannelecho(object):
# print raw_data # str
msgtype
=
cyber
.
ChannelUtils
.
get_msgtype
(
self
.
channel_name
,
0
)
print
cyber
.
ChannelUtils
.
get_debugstring_rawmsgdata
(
msgtype
,
raw_data
)
print
(
cyber
.
ChannelUtils
.
get_debugstring_rawmsgdata
(
msgtype
,
raw_data
)
)
def
channel_echo
(
channel_name
):
...
...
cyber/tools/cyber_launch/cyber_launch
浏览文件 @
90de3141
...
...
@@ -354,11 +354,11 @@ def start(launch_file=''):
if
process_name
is
None
:
process_name
=
'mainboard_default_'
+
str
(
os
.
getpid
())
process_name
=
process_name
.
strip
()
if
dictionary
.
has_key
(
str
(
process_name
))
:
if
str
(
process_name
)
in
dictionary
:
dictionary
[
str
(
process_name
)]
+=
1
else
:
dictionary
[
str
(
process_name
)]
=
1
if
not
dag_dict
.
has_key
(
str
(
process_name
))
:
if
str
(
process_name
)
not
in
dag_dict
:
dag_dict
[
str
(
process_name
)]
=
[
str
(
dag_conf
)]
else
:
dag_dict
[
str
(
process_name
)].
append
(
str
(
dag_conf
))
...
...
cyber/tools/cyber_node/cyber_node
浏览文件 @
90de3141
...
...
@@ -30,23 +30,23 @@ def print_node_info(node_name, sleep_s=2):
msg
.
ParseFromString
(
roleattr_rawdata
)
assert
(
node_name
==
msg
.
node_name
)
except
:
print
"RoleAttributes ParseFromString failed. size is "
,
len
(
roleattr_rawdata
)
print
(
"RoleAttributes ParseFromString failed. size is "
,
len
(
roleattr_rawdata
)
)
return
print
"nodename
\t
"
,
msg
.
node_name
print
"processid
\t
"
,
msg
.
process_id
print
"hostname
\t
"
,
msg
.
host_name
print
(
"nodename
\t
"
,
msg
.
node_name
)
print
(
"processid
\t
"
,
msg
.
process_id
)
print
(
"hostname
\t
"
,
msg
.
host_name
)
print
"[Reading Channels]:"
print
(
"[Reading Channels]:"
)
reader_channels
=
sorted
(
cyber
.
NodeUtils
.
get_readersofnode
(
node_name
,
0
))
for
channel
in
reader_channels
:
print
channel
print
""
print
(
channel
)
print
(
""
)
print
"[Writing Channels]:"
print
(
"[Writing Channels]:"
)
writer_channels
=
sorted
(
cyber
.
NodeUtils
.
get_writersofnode
(
node_name
,
0
))
for
channel
in
writer_channels
:
print
channel
print
""
print
(
channel
)
print
(
""
)
def
_node_cmd_info
(
argv
):
...
...
@@ -77,10 +77,10 @@ def _node_cmd_info(argv):
def
print_node_list
():
nodes
=
cyber
.
NodeUtils
.
get_nodes
()
print
"The number of nodes is: "
,
len
(
nodes
)
print
(
"The number of nodes is: "
,
len
(
nodes
)
)
nodes
.
sort
()
for
node_name
in
nodes
:
print
node_name
print
(
node_name
)
def
_node_cmd_list
(
argv
):
...
...
cyber/tools/cyber_service/cyber_service
浏览文件 @
90de3141
...
...
@@ -30,13 +30,14 @@ def print_service_info(service_name, sleep_s=2):
msg
.
ParseFromString
(
roleattr_rawdata
)
assert
(
service_name
==
msg
.
service_name
)
except
:
print
"RoleAttributes ParseFromString failed. size is "
,
len
(
roleattr_rawdata
),
", service name: "
,
service_name
print
(
"RoleAttributes ParseFromString failed. size is "
,
len
(
roleattr_rawdata
),
", service name: "
,
service_name
)
return
print
msg
.
service_name
print
"
\t
processid
\t
"
,
msg
.
process_id
print
"
\t
nodename
\t
"
,
msg
.
node_name
print
"
\t
hostname
\t
"
,
msg
.
host_name
print
""
print
(
msg
.
service_name
)
print
(
"
\t
processid
\t
"
,
msg
.
process_id
)
print
(
"
\t
nodename
\t
"
,
msg
.
node_name
)
print
(
"
\t
hostname
\t
"
,
msg
.
host_name
)
print
(
""
)
def
_service_cmd_info
(
argv
):
...
...
@@ -67,9 +68,9 @@ def _service_cmd_info(argv):
def
print_service_list
():
services
=
sorted
(
cyber
.
ServiceUtils
.
get_services
())
print
"The number of services is: "
,
len
(
services
)
print
(
"The number of services is: "
,
len
(
services
)
)
for
service_name
in
services
:
print
service_name
print
(
service_name
)
def
_service_cmd_list
(
argv
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录