ROS编译命令catkin简析

目前编译ROS的Package有两种方法:

  • catkin_make
  • catkin build

catkin_make

catkin_make 是一个命令行工具,它简化了catkin的标准工作流程。你可以认为catkin_make是在CMake标准工作流程中依次调用了cmake 和 make。

使用方法如下:

1
2
# 在catkin工作空间下
$ catkin_make [make_targets] [-DCMAKE_VARIABLES=...]

catkin

catkin是一个用于处理catkin元构建系统和catkin工作区的命令行工具。其用法如下:

1
2
3
4
5
6
7
8
9
10
11
`catkin VERB -h` for help on each verb listed below:

build Builds a catkin workspace.
clean Deletes various products of the build verb.
config Configures a catkin workspace's context.
create Creates catkin workspace resources like packages.
env Run an arbitrary command in a modified environment.
init Initializes a given folder as a catkin workspace.
list Lists catkin packages in the workspace or other arbitray folders.
locate Get the paths to various locations in a workspace.
profile Manage config profiles for a catkin workspace.

同样可使用catkin build命令编译ROS的package。

catkin_make与catkin build的区别

与catkin_make不同,catkin命令行工具不仅仅是围绕cmake和make命令的瘦包装器。 catkin build命令隔离地在工作空间的源空间中构建每个包,以防止构建时串扰。 因此,在其最简单的用法中,catkin构建的行为类似于catkin_make_isolated的并行化版本。

参考链接

  1. Migrating from catkin_make,by catkin_tools homepage.
  2. 编译ROS程序包,by ros wiki.