ROS学习手记 - 2 Build Package 生成包
2015-07-05 20:05
507 查看
=== 在上一篇的基础上,Create并Customize了Package之后,要Build Package ===
来源:http://wiki.ros.org/ROS/Tutorials/BuildingPackages
这里catkin_make使用了CMake 的workflow来操作,科普一下这个workflow:
具体关于CMakeLists.txt文件,请看http://wiki.ros.org/catkin/CMakeLists.txt
make are called to configure and build your packages.
The devel folder is the default location of thedevel space, which is where your executables and libraries go
before you install your packages.
虽然跟教程上有点不同,但没遇到错误,就这样吧。。
====== 【总结】 ======
【建立一个catkin Package的步骤】
了解Package的基本概念
1. 相对ROS的角色和地位。
2. Package文件夹至少要包含的文件:package.xml & CMakeLists.txt &
3. 拒绝嵌套
4. Packages 在catkin workspace中的文件分布结构
建立一个catkin Package的步骤
1. 可用的创建命令:roscreate-pkg or catkin
2. 创建的命令
# cd $YOUR ROS WORKSPACE$/src
# catkin_create_pkg <package_name> [depend1] [depend2] [depend3]
3. 编译catkin workspace 和 source the setup file
# cd $YOUR ROS WORKSPACE$
# catkin_make
add the workspace to ROS env., source the generated setup file
$ . ~/catkin_ws/devel/setup.bash
4. 定制化你的Package
这一部分就比较细了,参考ROS_Tutorials_CreatingPackage - ROS Wiki
来源:http://wiki.ros.org/ROS/Tutorials/BuildingPackages
1. 确认source有没有完成 (版本: hydro):
$ source /opt/ros/hydro/setup.bash
2. Using catkin_make
使用方法:# In a catkin workspace $ catkin_make [make_targets] [-DCMAKE_VARIABLES=...]
这里catkin_make使用了CMake 的workflow来操作,科普一下这个workflow:
3. 如何写ROS的Publisher and Subscriber(C++)
因为要涉及到对CMakeLists.txt的写法,需要先了解这个文章:http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29具体关于CMakeLists.txt文件,请看http://wiki.ros.org/catkin/CMakeLists.txt
4. 关于workspace下的build devel src文件夹
The build folder is the default location of thebuild space and is wherecmake andmake are called to configure and build your packages.
The devel folder is the default location of thedevel space, which is where your executables and libraries go
before you install your packages.
5. Build the package
catkin_make命令执行情况如下:exbot@ubuntu:~/catkin_ws$ ls build devel src exbot@ubuntu:~/catkin_ws$ catkin_make Base path: /home/exbot/catkin_ws Source space: /home/exbot/catkin_ws/src Build space: /home/exbot/catkin_ws/build Devel space: /home/exbot/catkin_ws/devel Install space: /home/exbot/catkin_ws/install #### #### Running command: "make cmake_check_build_system" in "/home/exbot/catkin_ws/build" #### -- Using CATKIN_DEVEL_PREFIX: /home/exbot/catkin_ws/devel -- Using CMAKE_PREFIX_PATH: /opt/ros/hydro -- This workspace overlays: /opt/ros/hydro -- Using PYTHON_EXECUTABLE: /usr/bin/python -- Python version: 2.7 -- Using Debian Python package layout -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /home/exbot/catkin_ws/build/test_results -- Found gtest sources under '/usr/src/gtest': gtests will be built -- catkin 0.5.86 -- BUILD_SHARED_LIBS is on -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ~~ traversing 7 packages in topological order: -- ~~ - beginner_tutorials -- ~~ - exbotxi_bringup -- ~~ - exbotxi_description -- ~~ - exbotxi_example -- ~~ - exbotxi_nav -- ~~ - exbotxi_rviz -- ~~ - exbotxi_teleop -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- +++ processing catkin package: 'beginner_tutorials' -- ==> add_subdirectory(beginner_tutorials) -- +++ processing catkin package: 'exbotxi_bringup' -- ==> add_subdirectory(exbot_xi/exbotxi_bringup) -- +++ processing catkin package: 'exbotxi_description' -- ==> add_subdirectory(exbot_xi/exbotxi_description) -- +++ processing catkin package: 'exbotxi_example' -- ==> add_subdirectory(exbot_xi/exbotxi_example) -- +++ processing catkin package: 'exbotxi_nav' -- ==> add_subdirectory(exbot_xi/exbotxi_nav) -- +++ processing catkin package: 'exbotxi_rviz' -- ==> add_subdirectory(exbot_xi/exbotxi_rviz) -- +++ processing catkin package: 'exbotxi_teleop' -- ==> add_subdirectory(exbot_xi/exbotxi_teleop) -- Configuring done -- Generating done -- Build files have been written to: /home/exbot/catkin_ws/build #### #### Running command: "make -j1 -l1" in "/home/exbot/catkin_ws/build" #### [100%] Built target move exbot@ubuntu:~/catkin_ws$
虽然跟教程上有点不同,但没遇到错误,就这样吧。。
====== 【总结】 ======
【建立一个catkin Package的步骤】
了解Package的基本概念
1. 相对ROS的角色和地位。
2. Package文件夹至少要包含的文件:package.xml & CMakeLists.txt &
3. 拒绝嵌套
4. Packages 在catkin workspace中的文件分布结构
建立一个catkin Package的步骤
1. 可用的创建命令:roscreate-pkg or catkin
2. 创建的命令
# cd $YOUR ROS WORKSPACE$/src
# catkin_create_pkg <package_name> [depend1] [depend2] [depend3]
3. 编译catkin workspace 和 source the setup file
# cd $YOUR ROS WORKSPACE$
# catkin_make
add the workspace to ROS env., source the generated setup file
$ . ~/catkin_ws/devel/setup.bash
4. 定制化你的Package
这一部分就比较细了,参考ROS_Tutorials_CreatingPackage - ROS Wiki
相关文章推荐
- require.js 应用实例
- iPhone 应用程序开发 UIView和VIWindow
- Hive 接口介绍(Web UI/JDBC)
- 日志三:GUI事件处理
- unknown command-line argument or argument value build错误
- 《开源框架那点事儿20》:发布TinyUI前端框架
- Lucene Search(2)-filter,collector,querybuild
- NGUI 学习
- EasyUI Layout布局控件的缓存问题
- NGUI之视频接入与播放控制
- Google-Guice入门介绍
- Java快速排序(QuickSort)算法实现
- 日志二:GUI编程及文件对话框的使用
- java 中的 String (to be continued)
- Ogre编程入门与进阶】第十七章 Ogre3D 和CEGUI 的结合
- LeetCode: Distinct Subsequences [115]
- UISearchBar控件-让我们来搞定!
- easyui中tree型控件不正常显示的处理方法
- UVA 1151 Buy or Build (MST最小生成树,kruscal,变形)
- 1.QT该容器QVector,QList,QSet,QMap,QQueue,QStack,QMultiMap,QSingleList等待