Apollo星火计划笔记||L2 CyberRT学习 &Dreamview入门

753 阅读3分钟

携手创作,共同成长!这是我参与「掘金日新计划 · 8 月更文挑战」的第5天。

从ROS到CyberRT

Apollo的计算平台之前一直采用的是ROS,3.5版本用Cyber替换了这一架构。 替换的缘由主要有两点:

以下几个表格整理了cyer RT 和ROS 对比(表格摘自 :链接)

Cyber RTROS备注
Component组件之间通过Cyber channel通信
ChannelTopicchannel用于管理数据通信,用户可以通过publish/subscribe相同的channel来通信。
NodeNode每一个模块包含Node并通过Node来通信。一个模块通过定义read/write和/或service/client使用不同的通信模式
Reader/WriterPublish/Subscribe订阅者模式。往channel读写消息的类。通常作为Node的主要消息传输接口
Service/ClientService/Client请求/相应模式,支持节点之间双向通信。
MessageMessageCyber RT中用于模块间通信的数据单元,其实现基于protobuf。
ParameterParameterParameter服务提供全局参数访问的接口,该服务基于service/client模式。
Record fileBag file用于记录从channel发送或者接收的消息,回放record file可以重现之前的操作行为。
Launch fileLaunch file提供一种启动模块的便利途径。通过在launch file中定义一个或者多个dag文件,可以同时启动多个modules。
Task异步计算任务。
CRoutine协程,优化线程使用与系统资源分配。
Scheduler任务调度器,用户空间。
Dag file定义模块拓扑结构的配置文件。

常用工具对比

Cyber RTROS备注
cyber_launchroslaunch启动节点
cyber_channelrostopic查看某个topic的信息
cyber_moniterrqt?查看诊断消息
cyber_visualizerrviz?激光点云及摄像头可视化工具,需要安装NVIDIA显卡驱动及CUDA

常用命令迁移

Cyber RTROS备注
cyber_recorder play -f example.recordrosbag play example.bag播放一个包
cyber_recorder info example.recordrosbag info example.bag查看一个包的信息
cyber_recorder record -c /apollo/canbus/chassis \ /apollo/canbus/chassis_detailrosbag record /apollo/canbus/chassis \ /apollo/canbus/chassis_detail录制多个topic
cyber_recorder split -f input_file.record -o ouput_file.record -k “/apollo/planning”rosbag filter input.bag output.bag ‘topic != “/apollo/planning”’滤除一个topic
cyber_recorder split -f input_file.record -o ouput_file.record -k “/apollo/planning” -k “/apollo/relative_map”’rosbag filter csc.bag csc_no_plannig_and_relativemap.bag ‘topic != “/apollo/planning” and “/apollo/relative_map”’滤除多个topic
cyber_channel listrostopic list列出所有活动的topic
cyber_channel info /apollo/planningrostopic info /apollo/planning查看 /apollo/planning topic的概要信息
cyber_channel echo /apollo/planningrostopic echo /apollo/planning查看 /apollo/planning topic的内容
cyber_channel hz /apollo/planningrostopic hz /apollo/planning查看 /apollo/planning topic的发送频率
cyber_channel bw /apollo/planningrostopic bw /apollo/planning查看 /apollo/planning topic的带宽
cyber_channel type /apollo/planningrostopic type /apollo/planning查看 /apollo/planning topic的数据类型

硬件驱动

  • camera \相机V4L USB Ccameras, 支持大部分的USB webcams
  • canbus \车载总线,主要是pci卡,socket卡,usb卡(不太推荐)
  • gnss \组合导航(global navigation satellite system)
  • lidar \激光雷达
  • proto \ 消息格式文件
  • radar \毫米波雷达
  • tools
  • velodyne \激光雷达
  • video \网络摄像头

DreamView上手

在参考文献里列出了一些官方的入门教程,写的还算详细,我就不复制粘贴了,建议先阅读一遍入门文档的第四部分:四、使用Apollo Dreamview,然后根据视频进行操作就行。

image.png

第一个视频介绍了Dreamview工具的基础操作流程,大致内容和文档差不多,可以配合文档一起看。第二个视频则详细的说明了如何使用Route Editing工具进行路径规划,这个视频对官方文档起到了很大的补充作用,建议仔细观看后进行上手实操。 image.png

参考文献

1 上课讲师王方浩的某乎系列文章,强烈推荐,写的深入浅出

image.png 2 Cyber RT 与 ROS 对比

3 官方入门文档:使用 Dreamview查看数据包

4 官方实操视频(一):【开发者讲堂】学习笔记——Apollo Dreamview 简介

5 官方实操视频(二):【开发者讲堂】学习笔记——Apollo Routing Request Example