当前位置: 首页 > news >正文

Cyber​​ RT 开发人员工具

从自动驾驶技术出发,Apollo开发者社区带你一起探索自动驾驶开发的奥秘,给每一位对自动驾驶充满热爱的你带来最实质的帮助,助力你的每一次研发。本文将介绍Apollo Cyber RT 开发人员工具,主要从以下几点为大家进行详细讲解:

  • 概览

  • Cyber_visualizer

  • Cyber_monitor

  • 熟悉Cyber_monitor的UI

  • Cyber_recorder

  • Rosbag_to_record

1. 概览

Apollo Cyber RT 框架附带了一系列用于日常开发的有用工具,包括一个可视化工具cyber_visualizer和两个命令行工具cyber_monitorcyber_recorder

注:使用工具需要Apollo Docker环境,请按照Apollo wiki进入Docker

Apollo Cyber RT 的所有工具都依赖于 Apollo Cyber RT 库,因此在使用任何 Apollo Cyber RT 工具之前,必须获取 setup.bash 文件以进行环境设置,如下所示:

source /your-path-to-apollo-install-dir/cyber/setup.bash

2. Cyber_visualizer

2.1. 安装并运行

cyber_visualizer 是用于在Apollo Cyber RT中显示通道数据的可视化工具。

source /your-path-to-apollo-install-dir/cyber/setup.bash cyber_visualizer

2.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_monitor

3.1. 安装并运行

命令行工具cyber_monitor提供了终端中实时频道信息列表的清晰视图 Apollo Cyber RT。

source /your-path-to-apollo-install-dir/cyber/setup.bash cyber_monitor

3.2. 有用的命令

  • 显示帮助信息

使用 -h 选项获取关于 Cyber_monitor 的帮助

cyber_monitor -h
  • 指定通道

使用 -c 选项,可以让 Cyber_monitor 仅监控指定的频道,例如:

cyber_monitor -c ChannelName

4. 熟悉Cyber_monitor的UI

启动命令行工具后,会注意到它类似于cyber_visualizer。它通过拓扑自动收集所有通道的信息,并在两列(通道名称、通道数据类型)中显示。

通道信息的默认显示为红色。但是,如果有数据流经 a 通道,则该通道对应的行显示为绿色。如下图所示:

与 Cyber_monitor 交互

常用命令

ESC | q key ---- Exit Backspace ---- Back h | H ---- Show help page

拓扑和通道的常用命令:

PageDown | Ctrl+d --- Next 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

5. Cyber_recorder

cyber_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 file

5.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 Ctrl+C to stop replay, or Space to pause. [RUNNING] Record Time: 1532089404.688080 Progress: 6.024680 / 6.024680 play finished. file: 20180720202307.record

6. Rosbag_to_record

rosbag_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
http://www.zskr.cn/news/1313183.html

相关文章:

  • [实践|鸿蒙] 从HAP到APP:DevEco Studio编译构建全流程实战解析
  • 【LeetCode刷题日记】112.递归中的「减法思维」:一题带你打通二叉树路径求和的任督二脉
  • 【中等】数字字符串转换为字母组合的种数-Java:解法二
  • Google Earth Engine(GEE)——run with profiler查看我们所运行程序的描述、计算指标、内存、峰值内存和数量
  • 基于OpenCV与全志T527的嵌入式手势识别:从算法到工程实践
  • 国产多模态大模型:科学计算领域的“新质生产力”
  • 佛山广州佛山五大校区培训哪家好?全日制培训班推荐 - 检测回收中心
  • 【LLM】code agent bench
  • ChatGPT在软件开发中的实战应用:从代码生成到调试的AI助手指南
  • 用TP4056、PW5300和PW2051搞定你的STM32项目供电:从3.7V锂电池到3.3V/5V的完整电路设计
  • Stripe CLI安全最佳实践:如何保护你的API密钥和敏感数据
  • UVM验证中Sequence启动方式详解:从原理到实战避坑指南
  • 2025最权威的AI学术工具实测分析
  • Win11Debloat:终极Windows系统优化指南,三分钟提升电脑性能38%
  • 钦州金条回收银条回收铂金项链回收克拉钻石回收婚嫁首饰回收本地排名正规门店专业推荐哪家靠谱二手哪家强 - 检测回收中心
  • 如何快速上手ActionView:5分钟完成项目配置和问题创建
  • 3步搭建免费网盘直链解析服务:彻底告别下载限速烦恼
  • 2026届毕业生推荐的十大AI辅助写作方案横评
  • 从业15年网优老兵实话:5G网优工程师发展前景,看完不迷茫
  • 平凉黄金回收白银回收铂金回收钻石回收贵金属回收本地排名正规门店专业推荐哪家靠谱二手哪家强 - 检测回收中心
  • Whetstone.chatgpt:简化ChatGPT Function Calling开发的AI Agent框架
  • 模块化电力电子:标准化接口与软件定义如何重塑能源系统设计
  • NotebookLM权限继承链断裂?揭秘Google Cloud IAM Policy Analyzer在NotebookLM上下文中的3类隐性失效场景
  • 告别繁琐组态:用SVG + JavaScript 5分钟为你的工业设备创建可交互HMI组件
  • 上海髋关节置换医院怎么选?从核心维度拆解选型逻辑 - 奔跑123
  • 把 SAP Central Business Configuration 的 Implementation Workspace 搭起来,别把云实施做成另一个 SPRO
  • Loop:让Mac窗口管理变得优雅而高效
  • yutu项目解析:模块化AI开发工具集如何加速LLM应用构建
  • 基于MCP协议的AI求职助手部署与实战指南
  • The founder‘s playbook: Building an AI-native startup创始人手册:打造原生AI初创企业