ros_catkin编译系统

Catkin

ROS对CMake进行了扩展,便有了Catkin编译系统

image-20221218111739692

image-20221218111756297

Catkin_make结构

image-20221218111834439

Catkin_make编译流程

create work space

1
2
3
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make

build

1
2
3
cd ~/catkin_ws
catkin_make
source ~/catkin_ws/devel/setup.bash # 编译完后需要 source 刷新环境

Catkin_make 文件系统

默认包含 src build devel ;

  • src 源代码包;
  • build catkin(Cmake) 的缓存信息和中间文件
  • devel 生成的目标文件(包括头文件,动态链接库,静态链接库,可执行文件)、环境变量
  • package是catkin工作空间的基本单元

image-20221218112610170

catkin_make指令

  • 构建〜/ catkin_ws / src中的所有packages
1
2
cd〜/ catkin_ws
catkin_make

等效于

1
2
3
4
5
6
7
8
cd〜/ catkin_ws
cd src
catkin_init_workspace
cd ..
mkdir build
cd build
cmake ../src -DCMAKE_INSTALL_PREFIX = .. / install -DCATKIN_DEVEL_PREFIX = .. / devel

  • build所有packages
1
catkin_make -DCATKIN_WHITELIST_PACKAGES =“”
  • build特定的package
1
catkin_make -DCATKIN_WHITELIST_PACKAGES =“ package1; package2”

Package

image-20221218112720689

image-20221218112737857

  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2020-2023 cyg
  • 访问人数: | 浏览次数: