启动文件#
概述#
Autoware 使用 ROS 2 启动系统启动软件.如果您不熟悉 ROS 2 Launch 系统,请参阅 官方文档 以对它有一个基本的了解.
指南#
Autoware 中启动文件的组织#
Autoware 主要有两个与启动文件组织相关的存储库:autoware_universe 和 autoware_launch.
autoware_universe#
autoware_universe 包含主要 Autoware 模块的代码,其 launch 目录负责启动每个模块的节点.Autoware 软件堆栈是根据 架构 组织的,因此您可能会发现我们尝试匹配类似于架构的启动结构(文件拆分、命名空间).例如,tier4_map_launch 子目录对应于 map 模块,其他 tier4_*_launch 子目录也是如此.
autoware_launch#
autoware_launch 是引用 autoware_universe 的存储库.介绍这个仓库的主要目的,就是提供启动 Autoware 软件栈的通用入口,即调用每个模块的启动文件.
autoware.launch.xml是道路驾驶场景的基本启动文件.
从内容中可以看出,整个启动文件分为几个不同的模块,包括 Vehicle、System、Map、Sensing、Localization、Perception、Planning、Control 等.通过将 launch_* 参数设置为等于 true 或 false ,我们可以确定要加载哪些模块.
logging_simulator.launch.xml通常与记录的 ROS 包一起使用,以调试目标模块(例如 Sensing、Localization 或 Perception)是否正常运行.
planning_simulator.launch.xml基于 Planning Simulator 工具,主要用于通过模拟交通规则、与动态对象的交互以及对自主车辆的控制命令来测试/验证 Planning 模块.
e2e_simulator.launch.xml是数字孪生仿真环境的启动器.
graph LR
A11[logging_simulator.launch.xml]-.->A10[autoware.launch.xml]
A12[planning_simulator.launch.xml]-.->A10[autoware.launch.xml]
A13[e2e_simulator.launch.xml]-.->A10[autoware.launch.xml]
A10-->A21[tier4_map_component.launch.xml]
A10-->A22[xxx.launch.py]
A10-->A23[tier4_localization_component.launch.xml]
A10-->A24[xxx.launch.xml]
A10-->A25[tier4_sensing_component.launch.xml]
A23-->A30[localization.launch.xml]
A30-->A31[pose_estimator.launch.xml]
A30-->A32[util.launch.xml]
A30-->A33[pose_twist_fusion_filter.launch.xml]
A30-->A34[xxx.launch.xml]
A30-->A35[twist_estimator.launch.xml]
A33-->A41[stop_filter.launch.xml]
A33-->A42[ekf_localizer.launch.xml]
A33-->A43[twist2accel.launch.xml]
在 Autoware 中添加一个新软件包#
如果新创建的包具有可执行节点,则我们希望包中包含示例启动文件和配置,就像前面的 directory structure 页面中显示的建议结构一样.
为了在启动 Autoware 时自动加载新添加的程序包,您需要对相应的启动文件进行一些必要的更改.例如,如果使用 ICP 而不是 NDT 作为点云注册算法,则可以修改 autoware_universe/launch/tier4_localization_launch/launch/pose_estimator/pose_estimator.launch.xml 文件以加载新添加的 ICP 包.
参数管理#
引入 autoware_launch 仓库的另一个目的是促进 Autoware 的参数管理.考虑到这种情况:如果我们想将 Autoware 集成到特定的车辆上并修改参数,我们必须分叉 autoware_universe 除了参数之外还有很多代码,并且经常被开发人员更新.通过将这些参数集成到 autoware_launch 中,我们只需 fork autoware_launch 存储库即可自定义 Autoware 参数.以 localization 模块为例:
- 定位(Localization)组件的所有
启动参数都列在autoware_launch/autoware_launch/config/localization下的文件中. Launch Parameters文件路径在autoware_launch/autoware_launch/launch/components/tier4_localization_component.launch.xml文件中设置.- 在
autoware_universe/launch/tier4_localization_launch/launch中,如果参数配置文件中给出了参数,则启动文件会加载启动参数.您仍然可以使用每个包中的默认参数在 autoware_universe 中启动 tier4_localization_launch.