Ubuntu 16.04 catkin_make 常见操作

本文介绍在ROS环境中使用catkin_make构建单个包的方法,包括使用--only-pkg-with-deps参数指定目标包构建,以及如何通过catkin_make-DCATKIN_WHITELIST_PACKAGES恢复构建所有包的状态。此外,还推荐了另一种更优的构建方式,即使用Catkin-Tools,其提供了更简洁的catkinbuild命令进行单个包的构建。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

参考博客:https://answers.ros.org/question/54178/how-to-build-just-one-package-using-catkin_make/

1. catkin_make 构建单个包

catkin_make --only-pkg-with-deps <target_package>

构建单个包完成之后可以使用如下指令恢复构建全部包的状态

catkin_make -DCATKIN_WHITELIST_PACKAGES=""

2. 另外一种更好的方式是使用Catkin-Tools

sudo apt-get install python-catkin-tools

2.1构建单个包

catkin build <target_package>

2.2可以再包的根目录下构建当前包

catkin build --this

  

转载于:https://www.cnblogs.com/flyinggod/p/11480959.html

ncut@ubuntu:~$ sudo apt-get install ros-kinetic-usb-cam [sudo] password for ncut: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package ros-kinetic-usb-cam ncut@ubuntu:~$ cd catkin_ws/src ncut@ubuntu:~/catkin_ws/src$ git clone http://github.com/bosch-ros-pkg/usb_cam.git Cloning into 'usb_cam'... warning: redirecting to https://github.com/bosch-ros-pkg/usb_cam.git/ remote: Enumerating objects: 3476, done. remote: Counting objects: 100% (776/776), done. remote: Compressing objects: 100% (281/281), done. remote: Total 3476 (delta 576), reused 520 (delta 495), pack-reused 2700 (from 4) Receiving objects: 100% (3476/3476), 1.92 MiB | 458.00 KiB/s, done. Resolving deltas: 100% (1625/1625), done. ncut@ubuntu:~/catkin_ws/src$ cd ~/catkin_ws ncut@ubuntu:~/catkin_ws$ catkin_make Base path: /home/ncut/catkin_ws Source space: /home/ncut/catkin_ws/src Build space: /home/ncut/catkin_ws/build Devel space: /home/ncut/catkin_ws/devel Install space: /home/ncut/catkin_ws/install #### #### Running command: "cmake /home/ncut/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/ncut/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/ncut/catkin_ws/install -G Unix Makefiles" in "/home/ncut/catkin_ws/build" #### -- Using CATKIN_DEVEL_PREFIX: /home/ncut/catkin_ws/devel -- Using CMAKE_PREFIX_PATH: /home/ncut/catkin_ws/devel;/home/ncut/robot_ws/devel;/opt/ros/melodic -- This workspace overlays: /home/ncut/catkin_ws/devel;/home/ncut/robot_ws/devel;/opt/ros/melodic -- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2") -- Using PYTHON_EXECUTABLE: /usr/bin/python2 -- Using Debian Python package layout -- Using empy: /usr/bin/empy -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /home/ncut/catkin_ws/build/test_results -- Found gtest sources under '/usr/src/googletest': gtests will be built -- Found gmock sources under '/usr/src/googletest': gmock will
03-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值