catkin_simple 的使用
Catkin simple 可用于规范catkin package, 并简化CMakeLists
- Dependencies are just listed once as
build-dependin thepackage.xml, not also asrun-dependetc. - 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 的使用的更多相关文章
- ROS新闻 Towards ROS-native drones 无人机支持方案
PX4/Firmware:https://github.com/PX4/Firmware PXFmini An open autopilot daughter-board for the Raspbe ...
- ROS(indigo)swarm_robot 群机器人示例Gazebo
ROS(indigo)swarm_robot 群机器人示例Gazebo 参考网址:https://github.com/yangliu28/swarm_robot_ros_sim 安装提示:catki ...
- ROS--自定义消息类型
一.msg 用于发布-订阅的通信方式中. 1.在包的src 中创建msg文件夹. 2.在msg文件夹中,创建.msg文件 3.编辑.msg文件 4.编辑package.xml , 添加依赖 <b ...
- ROS基础-基本概念和简单工具(1)
1.什么是ROS? Robot operating System ,简单说机器人操作系统,弱耦合的分布式进程框架,通过进程间的消息传递和管理.实现硬件抽象和设备控制. 2.节点(node) node ...
随机推荐
- hdu 5640 King's Cake(模拟)
Problem Description It is the king's birthday before the military parade . The ministers prepared ...
- Unity 功夫猫
最近在家里闲着蛋疼,突然看到一个HTML游戏感觉挺可爱的,就把素材拿过来自己写了一遍. 游戏有很多细节还是没有模仿出来. 里面有一个2DUGUI帧动画播放插件,写了我3个通宵. 还是对Unity的扩展 ...
- Swift——(一)为Swift内置类型加入属性
在看苹果官方的Swift Language的时候,遇到实验:Write an extension for the Double type that add an absoluteValue prope ...
- MongoDB学习笔记03
限制结果的返回数量可以使用limit.skip sort用一个对象作为参数:一组键/值对,键对应文档的键名,值代表排序的方向(1:升序,-1:降序):如果指定了多个键,则按照多个键的顺序诸个排序. M ...
- BackgroundWorker 后台进程控制窗体label、richtextbook内容刷新
昨天写了一个从文章中提取关键词的程序,写完处理的逻辑后又花了好几个小时在用户友好性上.加了几个progressBar,有显示总进度的.有显示分布进度的..因为程序要跑好几个小时才能执行好,只加个总进度 ...
- IE iframe 中 js 的 cookie 读写不到的解决办法
1.看这里(改服务器配置) http://www.cr173.com/html/16696_1.html 2.使用object模拟iframe,不使用iframe框架 <html> < ...
- QT TCP/IP
QT 网络通信(TCP/IP) 服务端: 一.监听新的客户端接入(QTcpServer) 重写函数 incomingConnection(qintptr socketDescriptor) 二.服务端 ...
- git merge的recursive策略和merge-base
git的合并策略总共有3种,一种是resovle,一种是recursive,一种是octopus.其中resolve和recursive适用于合并2个branch,octopus适用于合并3个或者3个 ...
- 设计模式 之 Organizing the Catalog 组织目录
Design patterns vary in their granularity and level of abstraction. Because thereare many design pat ...
- PK投票效果
/** *createTime:2015-07-21 *updateTime:2015-06-22 *author:刘俊 *Description:PK投票 *phone:13469119119 ** ...