catkin_make_isolated和ninja

这个命令用于非ROS的包,所以Cartographer用的是它。 缺点是处理pacakge 较慢,只适用于ROS1. 可以和ninja结合

1
catkin_make_isolated  --use-ninja --pkg cartographer_ros

只编译一个包,会真的跳过其他包,比catkin_make --pkg好用多了。 编译生成的文件在/workspace/devel_isolated/cartographer_ros/lib/cartographer_ros

如果加上--install,编译得到的可执行文件在/workspace/devel_isolated/cartographer_ros/install/lib/cartographer_ros


它会在工作空间生成文件夹devel_isolated, install_isolated, build_isolated

平时我们使用rosrun 运行的是 devel/lib 里的可执行文件,因为一般source的是 catkin_ws/devel/setup.zsh. 修改文件后,使用 catkin_make_isolated 编译,运行发现没有生效,需要先修改为 source catkin_ws/devel_isolated/setup.zsh, 以后就是用catkin_make_isolated

问题

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 Installing: /home/xiaoqiang/Documents/ros/install_isolated/share/cartographer_ros/launch
-- Installing: /home/xiaoqiang/Documents/ros/install_isolated/share/cartographer_ros/launch/software_institute.launch
-- Up-to-date: /home/xiaoqiang/Documents/ros/install_isolated/share/cartographer_ros/launch/\
CMake Error at cmake_install.cmake:142 (file):
file INSTALL cannot set permissions on
"/home/xiaoqiang/Documents/ros/install_isolated/share/cartographer_ros/launch/\"


FAILED: cd /home/xiaoqiang/Documents/ros/build_isolated/cartographer_ros && /usr/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.
<== Failed to process package 'cartographer_ros':
Command '['/home/xiaoqiang/Documents/ros/install_isolated/env.sh', 'ninja', 'install']' returned non-zero exit status 1

Reproduce this error by running:
==> cd /home/xiaoqiang/Documents/ros/build_isolated/cartographer_ros && /home/xiaoqiang/Documents/ros/install_isolated/env.sh ninja install

Command failed, exiting.

不知为何出现了文件夹 install_isolated/share/cartographer_ros/launch/\,删除后重新编译还是如此

参考:
catkin_make_isolated 官方说明
catkin_make vs catkin_make_isolated