如何选择 catkin_make和catkin_make_isolated

问题

在编译cartographer的代码包的时候,会被建议使用catkin_make_isolated,为何不使用catkin_make呢?

原因

catkin_make was the first script around to build catkin workspace and is therefore used in many tutorials. It has several down sides (requiring non-standard logic in packages to declared cross-package target dependencies) and limitation (can't process plain CMake packages, requires all targets across all packages in a workspace to be unique). Therefore I wouldn't recommend to use it.
catkin_make_isolated is the script which was developed next which addresses all these shortcomings. It comes at the cost of being slower since it processes all packages sequentially. It is being used on build.ros.org in the devel and PR jobs. I would recommend using this if you want the most reliable solution (exclusively for ROS 1).
catkin_tools (called catkin build above) is similar to catkin_make_isolated but addresses the performance limitation by processing packages in parallel where possible. It also has a lot of usability features which makes it much easier to use and configure. On the downside this tool is not being actively maintained for the past years so I wouldn't recommend it either.
colcon is the new build tool developed for ROS 2 and works similar to catkin_tools with less usability features at the moment but being able to build any kind of packages (catkin, ament, CMake, Python setuptools, gradle, bazel, cargo, ...) on all major platforms (Linux, macOS, Windows). While developed for ROS 2 it in principle also works for ROS 1. If you are willing to use something more bleeding edge (which might come with quirks which haven't been resolved / polished yet) this might be an option. The big advantage is that the tool is very modular and actively developed and extended by multiple parties.

总的来说, catkin_make_isolated比catkin_make更好一点, catkin_make_isolated编译时,会认为每一个功能包都是一个独立的编译空间, 因此不会像catkin_make需要求所有定义的目标变量名必须是唯一值以免冲突, 而colcon工具目前主要在ros2上开发应用,当然也可以适用于ros1的开发。

使用

catkin_make_isolated --use-nija --install --pkg  [user's package name]

在ros下,如何添加环境变量呢?因为该命令将每个代码包独立编译以及创建开发目录,需要添加以下命令到.bashrc文件中, 才能保证使用rosrun等ros相关命令的时候, 才能找到相关的launch等文件,

source ~/catkin_ws/install_isolated/setup.bash
或者
source ~/catkin_ws/devel_isolated/pkg_name/setup.bash 
  • 12
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值