从自动驾驶技术出发Apollo开发者社区带你一起探索自动驾驶开发的奥秘给每一位对自动驾驶充满热爱的你带来最实质的帮助助力你的每一次研发。本文将介绍Apollo Cyber RT 开发人员工具主要从以下几点为大家进行详细讲解概览Cyber_visualizerCyber_monitor熟悉Cyber_monitor的UICyber_recorderRosbag_to_record1. 概览Apollo Cyber RT 框架附带了一系列用于日常开发的有用工具包括一个可视化工具cyber_visualizer和两个命令行工具cyber_monitor和cyber_recorder。注使用工具需要Apollo Docker环境请按照Apollo wiki进入DockerApollo Cyber RT 的所有工具都依赖于 Apollo Cyber RT 库因此在使用任何 Apollo Cyber RT 工具之前必须获取 setup.bash 文件以进行环境设置如下所示source /your-path-to-apollo-install-dir/cyber/setup.bash2. Cyber_visualizer2.1. 安装并运行cyber_visualizer 是用于在Apollo Cyber RT中显示通道数据的可视化工具。source /your-path-to-apollo-install-dir/cyber/setup.bash cyber_visualizer2.2. 与 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)可以滚动鼠标滚轮。也可以直接在对话框中修改相机信息改变相机在点云场景中的观察状态。“Step”项是对话框中的步长值。将鼠标放在摄像机通道的图像上可以双击左键在左侧菜单栏突出显示对应的数据通道。右击图像弹出删除摄像机通道的菜单。播放和暂停按钮单击Play按钮时将显示所有频道。当单击Pause按钮时所有通道将停止显示在工具上。3. Cyber_monitor3.1. 安装并运行命令行工具cyber_monitor提供了终端中实时频道信息列表的清晰视图 Apollo Cyber RT。source /your-path-to-apollo-install-dir/cyber/setup.bash cyber_monitor3.2. 有用的命令显示帮助信息使用 -h 选项获取关于 Cyber_monitor 的帮助cyber_monitor -h指定通道使用 -c 选项可以让 Cyber_monitor 仅监控指定的频道例如cyber_monitor -c ChannelName4. 熟悉Cyber_monitor的UI启动命令行工具后会注意到它类似于cyber_visualizer。它通过拓扑自动收集所有通道的信息并在两列通道名称、通道数据类型中显示。通道信息的默认显示为红色。但是如果有数据流经 a 通道则该通道对应的行显示为绿色。如下图所示与 Cyber_monitor 交互常用命令ESC | q key ---- Exit Backspace ---- Back h | H ---- Show help page拓扑和通道的常用命令PageDown | Ctrld --- Next PageUp | Ctrlu --- 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 domain5. Cyber_recordercyber_recorder是 Apollo Cyber RT 提供的录制/播放工具。它提供了许多有用的功能包括录制录制文件、播放录制文件、拆分录制文件、查看录制文件信息等。5.1. 安装并运行启动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.5.2.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 file5.3. 使用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记录一个记录文件$ cyber_recorder record -a [RUNNING] Record : total channel num : 1 total msg num : 5 ...重放记录文件$ cyber_recorder play -f 20180720202307.record file: 20180720202307.record, chunk_number: 1, begin_time: 1532089398663399667, end_time: 1532089404688079759, message_number: 75 please wait for loading and playing back record... Hit CtrlC to stop replay, or Space to pause. [RUNNING] Record Time: 1532089404.688080 Progress: 6.024680 / 6.024680 play finished. file: 20180720202307.record6. Rosbag_to_recordrosbag_to_record是 Apollo Cyber RT 提供的一个可以将 rosbag 转换为记录器文件的工具。现在该工具支持以下频道/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
Cyber RT 开发人员工具
从自动驾驶技术出发Apollo开发者社区带你一起探索自动驾驶开发的奥秘给每一位对自动驾驶充满热爱的你带来最实质的帮助助力你的每一次研发。本文将介绍Apollo Cyber RT 开发人员工具主要从以下几点为大家进行详细讲解概览Cyber_visualizerCyber_monitor熟悉Cyber_monitor的UICyber_recorderRosbag_to_record1. 概览Apollo Cyber RT 框架附带了一系列用于日常开发的有用工具包括一个可视化工具cyber_visualizer和两个命令行工具cyber_monitor和cyber_recorder。注使用工具需要Apollo Docker环境请按照Apollo wiki进入DockerApollo Cyber RT 的所有工具都依赖于 Apollo Cyber RT 库因此在使用任何 Apollo Cyber RT 工具之前必须获取 setup.bash 文件以进行环境设置如下所示source /your-path-to-apollo-install-dir/cyber/setup.bash2. Cyber_visualizer2.1. 安装并运行cyber_visualizer 是用于在Apollo Cyber RT中显示通道数据的可视化工具。source /your-path-to-apollo-install-dir/cyber/setup.bash cyber_visualizer2.2. 与 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)可以滚动鼠标滚轮。也可以直接在对话框中修改相机信息改变相机在点云场景中的观察状态。“Step”项是对话框中的步长值。将鼠标放在摄像机通道的图像上可以双击左键在左侧菜单栏突出显示对应的数据通道。右击图像弹出删除摄像机通道的菜单。播放和暂停按钮单击Play按钮时将显示所有频道。当单击Pause按钮时所有通道将停止显示在工具上。3. Cyber_monitor3.1. 安装并运行命令行工具cyber_monitor提供了终端中实时频道信息列表的清晰视图 Apollo Cyber RT。source /your-path-to-apollo-install-dir/cyber/setup.bash cyber_monitor3.2. 有用的命令显示帮助信息使用 -h 选项获取关于 Cyber_monitor 的帮助cyber_monitor -h指定通道使用 -c 选项可以让 Cyber_monitor 仅监控指定的频道例如cyber_monitor -c ChannelName4. 熟悉Cyber_monitor的UI启动命令行工具后会注意到它类似于cyber_visualizer。它通过拓扑自动收集所有通道的信息并在两列通道名称、通道数据类型中显示。通道信息的默认显示为红色。但是如果有数据流经 a 通道则该通道对应的行显示为绿色。如下图所示与 Cyber_monitor 交互常用命令ESC | q key ---- Exit Backspace ---- Back h | H ---- Show help page拓扑和通道的常用命令PageDown | Ctrld --- Next PageUp | Ctrlu --- 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 domain5. Cyber_recordercyber_recorder是 Apollo Cyber RT 提供的录制/播放工具。它提供了许多有用的功能包括录制录制文件、播放录制文件、拆分录制文件、查看录制文件信息等。5.1. 安装并运行启动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.5.2.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 file5.3. 使用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记录一个记录文件$ cyber_recorder record -a [RUNNING] Record : total channel num : 1 total msg num : 5 ...重放记录文件$ cyber_recorder play -f 20180720202307.record file: 20180720202307.record, chunk_number: 1, begin_time: 1532089398663399667, end_time: 1532089404688079759, message_number: 75 please wait for loading and playing back record... Hit CtrlC to stop replay, or Space to pause. [RUNNING] Record Time: 1532089404.688080 Progress: 6.024680 / 6.024680 play finished. file: 20180720202307.record6. Rosbag_to_recordrosbag_to_record是 Apollo Cyber RT 提供的一个可以将 rosbag 转换为记录器文件的工具。现在该工具支持以下频道/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