Catkin simple 可用于规范catkin package, 并简化CMakeLists 

  • Dependencies are just listed once as build-depend in the package.xml, not also as run-depend etc.
  • Dependencies 无需在 CMakeLists.txt 中列出
  • Explicit linking of dependencies is not needed anymore (e.g. no target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES}) needed)
  • Explicit inclusion of catkin include not needed anymore (e.g. no include_directories(${catkin_INCLUDES}) needed)
  • Export and installation commands are both one-liners.

工具安装:

cd $CATKIN_WS/src
git clone git@github.com:catkin/catkin_simple.git
cd $CATKIN_WS
catkin_make

示例代码:

https://github.com/simonlynen/catkin_and_catkin_simple

示例CMakelists 解释:

https://github.com/catkin/catkin_simple/blob/master/README.md

 cmake_minimum_required(VERSION 2.8.)
project(foo) find_package(catkin_simple REQUIRED) catkin_simple(ALL_DEPS_REQUIRED) //调用 catkin_simple,call package.xml中的所用build_depend,并do find_package(...)操作
                    //当所有的package 成功找到,a list of "catkin build dependencies"出现,并传给find_package(catkin REQUIRED COMPONETS...)
                    //然后增加local include 和 catkin include 目录,并传给include_directories(...)
                    //最后发现并编译ROS messages,services and actions which in msg/src/action 文件夹,注意当且仅当package.xml中build_depend 包含message_generation才执行该操作
                    //同样查找并编译dynamic_reconfigure 文件in cfg文件夹,注意当且仅当build_depend 包含dynamic_reconfigure
  
cs_add_library(my_lib src/my_lib.cpp) //首先call directly through to add_library
                       //然后call target_link_libraries(my_lib ${catkin_LIBRARIES})去链接新库(注意build_depend需要包含新库)
                       //最后it does some bookkeeping so that your library target can be implicitly used later??? cs_add_executable(my_exec src/main.cpp)//calls CMake's add_executable(...) instead.
target_link_libraries(my_exec my_lib) //注意这句话需要写出来 there is no way to enforce order of target creation. The executable is still automatically linked against the catkin libraries cs_install() //creates an installation rule for any libraries and executables you created with cs_ prefixed commands cs_install_scripts(scripts/my_script.py) cs_export() //calls catkin_package(...) under the hood, extending that call with any libraries created and catkin_depends found automatically with catkin_simple

存在的限制:

 There are several known assumptions and incorrect behaviors in catkin_simple which are a result of the trade-off of correctness for convenience.

 There is no warning when a catkin package is not found during find_package.
There is over linking, as all libraries of all dependencies are linked against all targets indiscriminately.
Assumes that the include folder is meant to be in the include path.
If new .msg or .srv files are added, they will not be detected until you force CMake to run again
All targets have a target dependency on any downstream message generation, which results in sub-optimal parallelization of targets, as there are unnecessary dependencies created.

catkin_simple 的使用的更多相关文章

  1. ROS新闻 Towards ROS-native drones 无人机支持方案

    PX4/Firmware:https://github.com/PX4/Firmware PXFmini An open autopilot daughter-board for the Raspbe ...

  2. ROS(indigo)swarm_robot 群机器人示例Gazebo

    ROS(indigo)swarm_robot 群机器人示例Gazebo 参考网址:https://github.com/yangliu28/swarm_robot_ros_sim 安装提示:catki ...

  3. ROS--自定义消息类型

    一.msg 用于发布-订阅的通信方式中. 1.在包的src 中创建msg文件夹. 2.在msg文件夹中,创建.msg文件 3.编辑.msg文件 4.编辑package.xml , 添加依赖 <b ...

  4. ROS基础-基本概念和简单工具(1)

    1.什么是ROS? Robot operating System ,简单说机器人操作系统,弱耦合的分布式进程框架,通过进程间的消息传递和管理.实现硬件抽象和设备控制. 2.节点(node) node ...

随机推荐

  1. 04747_Java语言程序设计(一)_第5章_图形界面设计(一)

    例5.1一个用JFrame类创建窗口的Java应用程序. import javax.swing.*; public class Example5_1 { public static void main ...

  2. Android学习总结——实时显示系统时间

    我们都知道System.currentTimeMillis()可以获取系统当前的时间,这里要实时显示就可以开启一个线程,然后通过handler发消息,来实时的更新TextView上显示的系统时间.具体 ...

  3. FZU 2108(dfs模拟,大数取余)

     K Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Pr ...

  4. ora-24247:网络访问被访问控制列表(ACL)拒绝

    用dba账户使用下面脚本授予报错账户访问外部网络服务的权限,以SCOTT为例: BEGIN -- Only uncomment the following line if ACL "netw ...

  5. Funsion Charts 学习(二)

    下载FusionCharts 3.1网址为 http://www.onlinedown.net/soft/92224.htm 第一个demo 新建一个文件夹,命名为demo 在文件夹中新建一个两个文件 ...

  6. 1215.1——动态分配内存的补充realloc

    当再次在原来申请的内存基础上再加内存的时候用realloc,如果第一次分配的内存后面存储地方够用,则连着原来的申请,如果不够用,就重新找到一块够用的地方,然后把原来的复制过去 int main(int ...

  7. CSS 设计彻底研究(四)盒子的浮动与定位

    第四章 盒子的浮动与定位 本章的重点和难点是深刻地理解”浮动“和”定位“这两个重要的性质,对于复杂页面的排版至关重要. 4.1 盒子的浮动 在标准流中,一个块级元素在水平方向会自动伸张,直到包含它的元 ...

  8. javascript版1024游戏源码

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...

  9. pom.xml配置

    1:头部引用 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3 ...

  10. hdu1597

    Problem Description 假设: S1 = 1 S2 = 12 S3 = 123 S4 = 1234 ......... S9 = 123456789 S10 = 1234567891 ...