ROS2 设计文档阅读- 编译系统 Ament

参考:The build system "ament_cmake" and the meta build tool "ament_tools"

2018-06 里面的cmakelists例子有点过时了

原因:

ROS2 设计包含有多个模块(多个package),编译会比较复杂,

确定编译顺序,依赖关联,设置环境变量...

依赖:通用的工具Cmake 和Python setuptools

ament_tools被. Since ros2/ros2#486 ROS 2 uses colcon as the build tool.

to read:colcon - collective construction — colcon documentation

前身: ROS1: Catkin, RO2: Ament

cpp:需要有cmakelists

python: src/目录下的 setup.py

The ament tool will copy the package manifest into the install location. It will also extend the environment variables PYTHONPATH and PATH to include the Python modules and executables provided by the package.

通过 ~/.bashrc查看

Depending on where the packages are being installed it might be necessary to setup the environment in order to find all resources. E.g. the location of installed executables should be on the PATH, installed Python code should be on the PYTHONPATH etc.

colcon bulid后,install 目录下有一个 setup.bash, 还有local_setup.bash

source install/setup.bash

The local_setup.* files will update environment variables as specified by the package. Even when the package is built without the ament tool these setup files are being generated.

更新环境变量,这样,你运行代码时,才能找到对应的包,需要的环境变量。

目前支持: 串行编译,并行编译 在将来会支持

Ament 安装你的package:

涉及到,把文件从/src 拷贝到 安装路径(通常设置 install/下)

还有一种方式: to try:

Optional symlinked install

It is very important to maximize the efficiency of the development cycle of changing code, building, and installing it and then run it to confirm the changes. Commonly the installation steps involve copying some resources from the source space to their final destination in the install location. ament provides an option to use symbolic links instead (if the platform supports that). This enables the developer to change the resources in the source space and skipping the installation step in many situations.

For CMake packages this is achieved by optionally overriding the CMake install() function. For Python packages the development mode is used to install the package. The symlinked install is an optional feature and must be enabled explicitly by the developer using the command line option --symlink-install.

编译错误检测:可以集成:Cppcheck - A tool for static C/C++ code analysis

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值