其他
技术文档|Apollo Cyber RT 开发人员工具
概览
Cyber_visualizer
Cyber_monitor
熟悉Cyber_monitor的UI
Cyber_recorder
Rosbag_to_record
username@computername:~$: source /your-path-to-apollo-install-dir/cyber/setup.bash
安装并运行
username@computername:~$: source /your-path-to-apollo-install-dir/cyber/setup.bash
username@computername:~$: cyber_visualizer
启动cyber_visualizer后,会看到如下界面:
当数据流经Apollo Cyber RT 中的通道时,所有通道的列表ChannelNames如下图所示。例如,可以使用Apollo Cyber RT的记录工具(cyber_recorder)从另一个终端重放数据,然后cyber_visualizer将接收所有活动通道的信息(来自重放数据)并显示出来。
通过单击工具栏中的选项,可以启用参考网格、显示点云、添加图像或同时显示多个相机的数据。如果Show Grid启用了选项,可以通过双击下面列表中的Color项目来设置网格的颜色,默认颜色为灰色。还可以编辑的值以调整网格中的单元格数量。对于点云或图像,可以通过其子项选择源通道,子项可以播放或停止来自相应通道的数据。如下图,按钮部分的三个摄像机通道数据和顶部的一个点云通道数据同时显示。 Grid ChannelNames CellCount ChannelName Action
要在 3D 点云场景中调整虚拟摄像机,可以在点云显示部分右键单击。将弹出一个对话框,如下图所示:
自由型相机:对于点云场景中的这种类型的相机,可以通过按住鼠标左键或右键并移动它来更改相机的姿势。要更改相机的间距,可以滚动鼠标滚轮。 目标类型相机:对于点云场景中的这种类型的相机,要改变相机的视角,可以按住鼠标左键再移动。要更改相机到观察点的距离(默认观察点为坐标系原点 (0,0,0)),可以滚动鼠标滚轮。
安装并运行
username@computername:~$: source /your-path-to-apollo-install-dir/cyber/setup.bash
username@computername:~$: cyber_monitor
有用的命令
显示帮助信息
使用 -h 选项获取关于 Cyber_monitor 的帮助
username@computername:~$: cyber_monitor -h
指定通道
使用 -c 选项,可以让 Cyber_monitor 仅监控指定的频道,例如:
username@computername:~$: cyber_monitor -c ChannelName
与 Cyber_monitor 交互
常用命令:
ESC | q key ---- Exit
Backspace ---- Back
h | H ---- Show help page
拓扑和通道的常用命令:
PageUp | Ctrl+u --- Previous
Up, down or w, s keys ---- Move the current highlight line up and down
Right arrow or d key ---- Enter highlight line, display highlighted line data in detail
Left arrow or a key ------ Return to the previous layer from the current
Enter key ----- Same as d key
仅用于拓扑的命令:
f | F ----- Display frame rate
t | T ----- Display channel message type
Space ----- Close|Open channel (only valid for channels with data arrival; yellow color after channel is closed)
仅用于频道的命令:
i | I ----- Display channel Reader and Writer information
b | B ------ Display channel message content
查看通道中重复的数据字段:
n | N ---- Repeat the next data in the domain
m | M ---- Repeat one data on the domain
启动cyber_recorder:
$ source /your-path-to-apollo-install-dir/cyber/setup.bash
$ cyber_recorder
usage: cyber_recorder <command>> [<args>]
The cyber_recorder commands are:
info Show information of an exist record.
play Play an exist record.
record Record same topic.
split Split an exist record.
recover Recover an exist record.
Cyber_recorder 的命令
查看记录文件的信息:
$ cyber_recorder info -h
usage: cyber_recorder info [options]
-h, --help show help message
录制记录文件:
$ cyber_recorder record -h
usage: cyber_recorder record [options]
-o, --output <file> output record file
-a, --all all channels
-c, --white-channel <name> only record the specified channel
-k, --black-channel <name> not record the specified channel
-i, --segment-interval <seconds> record segmented every n second(s)
-m, --segment-size <MB> record segmented every n megabyte(s)
-h, --help show help message
播放录音文件:
$ cyber_recorder play -husage: cyber_recorder play [options] -f, --file <file> input record file -a, --all play all -c, --white-channel <name> only play the specified channel -k, --black-channel <name> not play the specified channel -l, --loop loop play -r, --rate <1.0> multiply the play rate by FACTOR -b, --begin <2018-07-01 00:00:00> play the record begin at -e, --end <2018-07-01 00:01:00> play the record end at -s, --start <seconds> play started at n seconds -d, --delay <seconds> play delayed n seconds -p, --preload <seconds> play after trying to preload n second(s) -h, --help show help message
要拆分记录文件:
$ cyber_recorder split -h
usage: cyber_recorder split [options]
-f, --file <file> input record file
-o, --output <file> output record file
-a, --all all channels
-c, --white-channel <name> only split the specified channel
-k, --black-channel <name> not split the specified channel
-b, --begin <2018-07-01 00:00:00> begin at assigned time
(in the form of String, e.g. "2018-07-01 00:00:00")
-e, --end <2018-07-01 01:00:00> end at assigned time
(in the form of String, e.g. "2018-07-01 00:00:00")
要修复记录文件:
$ cyber_recorder recover -husage: cyber_recorder recover [options] -f, --file <file> input record file -o, --output <file> output record file
使用cyber_recorder的例子
检查记录文件的详细信息:
$ cyber_recorder info demo.record
record_file: demo.record
version: 1.0
duration: 19.995227 Seconds
begin_time: 2018-04-17 06:25:36
end_time: 2018-04-17 06:25:55
size: 28275479 Bytes (26.965598 MB)
is_complete: true
message_number: 15379
channel_number: 16
channel_info: /apollo/localization/pose 2000 messages : apollo.localization.LocalizationEstimate
/tf 4000 messages : apollo.transform.TransformStampeds
/apollo/control 2000 messages : apollo.control.ControlCommand
/apollo/sensor/gnss/odometry 2000 messages : apollo.localization.Gps
/apollo/canbus/chassis 2000 messages : apollo.canbus.Chassis
/apollo/sensor/gnss/imu 1999 messages : apollo.drivers.gnss.Imu
/apollo/sensor/gnss/rtk_obs 41 messages : apollo.drivers.gnss.EpochObservation
/apollo/sensor/gnss/ins_stat 20 messages : apollo.drivers.gnss.InsStat
/apollo/sensor/gnss/best_pose 20 messages : apollo.drivers.gnss.GnssBestPose
/apollo/perception/obstacles 400 messages : apollo.perception.PerceptionObstacles
/apollo/prediction 400 messages : apollo.prediction.PredictionObstacles
/apollo/sensor/conti_radar 270 messages : apollo.drivers.ContiRadar
/apollo/planning 200 messages : apollo.planning.ADCTrajectory
/apollo/monitor/static_info 1 messages : apollo.data.StaticInfo
/apollo/sensor/gnss/rtk_eph 25 messages : apollo.drivers.gnss.GnssEphemeris
/apollo/monitor 3 messages : apollo.common.monitor.MonitorMessage
记录一个记录文件:
$ cyber_recorder record -a
[RUNNING] Record : total channel num : 1 total msg num : 5
...
重放记录文件:
file: 20180720202307.record, chunk_number: 1, begin_time: 1532089398663399667, end_time: 1532089404688079759, message_number: 75
please wait for loading and playing back record...
Hit Ctrl+C to stop replay, or Space to pause.
[RUNNING] Record Time: 1532089404.688080 Progress: 6.024680 / 6.024680
play finished. file: 20180720202307.record
/apollo/perception/obstacles
/apollo/planning
/apollo/prediction
/apollo/canbus/chassis
/apollo/control
/apollo/guardian
/apollo/localization/pose
/apollo/perception/traffic_light
/apollo/drive_event
/apollo/sensor/gnss/odometry
/apollo/monitor/static_info
/apollo/monitor
/apollo/canbus/chassis_detail
/apollo/control/pad
/apollo/navigation
/apollo/routing_request
/apollo/routing_response
/tf
/tf_static
/apollo/sensor/conti_radar
/apollo/sensor/delphi_esr
/apollo/sensor/gnss/best_pose
/apollo/sensor/gnss/imu
/apollo/sensor/gnss/ins_stat
/apollo/sensor/gnss/rtk_eph
/apollo/sensor/gnss/rtk_obs
/apollo/sensor/velodyne64/compensator/PointCloud2
安装并运行
启动 rosbag_to_record:
$ source /your-path-to-apollo-install-dir/cyber/setup.bash
$ rosbag_to_record
Usage:
rosbag_to_record input.bag output.record
例子
我们可以将Apollo2.5 演示包转换为记录文件:
$ rosbag_to_record demo_2.5.bag demo.record
record_file: demo.record
version: 1.0
duration: 19.995227 Seconds
begin_time: 2018-04-17 06:25:36
end_time: 2018-04-17 06:25:55
size: 28275479 Bytes (26.965598 MB)
is_complete: true
message_number: 15379
channel_number: 16
channel_info: /apollo/localization/pose 2000 messages : apollo.localization.LocalizationEstimate
/tf 4000 messages : apollo.transform.TransformStampeds
/apollo/control 2000 messages : apollo.control.ControlCommand
/apollo/sensor/gnss/odometry 2000 messages : apollo.localization.Gps
/apollo/canbus/chassis 2000 messages : apollo.canbus.Chassis
/apollo/sensor/gnss/imu 1999 messages : apollo.drivers.gnss.Imu
/apollo/sensor/gnss/rtk_obs 41 messages : apollo.drivers.gnss.EpochObservation
/apollo/sensor/gnss/ins_stat 20 messages : apollo.drivers.gnss.InsStat
/apollo/sensor/gnss/best_pose 20 messages : apollo.drivers.gnss.GnssBestPose
/apollo/perception/obstacles 400 messages : apollo.perception.PerceptionObstacles
/apollo/prediction 400 messages : apollo.prediction.PredictionObstacles
/apollo/sensor/conti_radar 270 messages : apollo.drivers.ContiRadar
/apollo/planning 200 messages : apollo.planning.ADCTrajectory
/apollo/monitor/static_info 1 messages : apollo.data.StaticInfo
/apollo/sensor/gnss/rtk_eph 25 messages : apollo.drivers.gnss.GnssEphemeris
/apollo/monitor 3 messages : apollo.common.monitor.MonitorMessage
Conversion finished! Took 0.505623051 seconds in total.
*《Apollo Cyber RT 开发人员工具》
https://github.com/ApolloAuto/apollo/blob/master/docs/cyber/CyberRT_Developer_Tools.md