Creating a catkin Package
# catkin_create_pkg[depend1] [depend2] [depend3]$ catkin_create_pkg beginner_tutorials std_msgs rospy roscpp
Building a catkin workspace and sourcing the setup file
$ cd ~/catkin_ws$ catkin_make#To add the workspace to your ROS environment you need to source the generated setup file$ . ~/catkin_ws/devel/setup.bash
First-order dependencies
$ rospack depends1 beginner_tutorials #查看功能包‘beginner_tutorials’的一阶依赖关系#一个功能包的依赖关系都存储在‘package.xml’文件中$ roscd beginner_tutorials #进到功能包目录下$ cat package.xml #打开且编写文件'package.xml'
Indirect dependencies
$ rospack depends1 rospy #很多情况下,依赖项也有自己的依赖项,查看'rospy'的依赖项 $ rospack depends beginner_tutorials #可以递归地确定所有的依赖性
Using to build a catkin workspace