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. Codeforces Round #389(div 2)

    A =w= B QvQ C 题意:在一个格子图里给出一个路径 里面有UDLR四种移动方向 问 我在格子路径里面最少选几个点 可以让我沿着格子路径走 其实是在相邻的点与点之间走最短路 分析:贪心+模拟 ...

  2. handsontable常规配置的中文API

    常规配置: 1.固定行列位置 fixedRowsTop:行数 //固定顶部多少行不能垂直滚动 fixedColumnsLeft:列数 //固定左侧多少列不能水平滚动 2.拖拽行头或列头改变行或列的大小 ...

  3. jquery常用方法以及详解

    $("p").addClass(css中定义的样式类型); 给某个元素添加样式 $("img").attr({src:"test.jpg", ...

  4. UVA 673 (13.08.17)

     Parentheses Balance  You are given a string consisting of parentheses () and []. Astring of this ty ...

  5. 在Java中编写带占位符的SQL语句

    C#中SQL中带占位符的语句 假设有一张学员信息表Student,通过表中的ID来找学员,查询的SQL语句如下 string sql = string.Format("select * fr ...

  6. 基础命名空间:序列化 System.Runtime.Serialization

    对象通常都有状态(state),从一个对象中抽取这种状态,不论是将它存储于某地,还是通过网络传送,这种抽取动作称为“将一个对象序列化”,而反向处理过程,从一个被序列化的状态重建一个对象即为反序列化. ...

  7. Java访问kafka的时候java.nio.channels.ClosedChannelException解决办法

    import java.util.Properties; import kafka.javaapi.producer.Producer; import kafka.producer.KeyedMess ...

  8. SQLSERVER和sybase的差异

    sybase sqlserver *= left join =* right join

  9. Ubuntu安装samba服务器

    一.安装软件 sudo apt-get install samba 二.配置samba服务器/etc/samba/smb.conf 把默认的配置文件备份,按如下修改配置文件 [global] work ...

  10. linux相关小工具的使用(一)————代码相关工具

    在linux环境下,对于程序员来说,知道使用一些好用的小工具,对源代码的阅读.编译和调试都有着事半功倍的效果,这里我也是边学边写的原则,把自己知道的一丁点小知识分享给大家. 一.  源代码的阅读 首先 ...