ROS学习笔记1-Beginner level

来源:互联网 发布:改串号软件 编辑:程序博客网 时间:2024/05/22 13:51

PART 1-Navigating the ROS Filesystem

1. rospack find [package_name]

2. roscd [ locationname[ /sudir] ]

    subdirections: roscd roscpp/cmake

    roscd log ( take you you to the folder where ROS stores log files)

3. rosls [ locationname[ /sudir] ]

PART 2-Creating a ROS package

1. Packages in a catkin workspace


2. Creating a catkin package

catkin_create_pkg <package_name> [depend1] [depend2] [depend3]

3. Building a catkin workspace and sourcing the setup file

build :

$ cd ~/catkin_ws$ catkin_make
source:

$ . ~/catkin_ws/devel/setup.bash
4. Package dependencies

$ rospack depends1 beginner_tutorials 
These dependencies for a package are stored in the package.xml file. To see it:

$ roscd beginner_tutorials$ cat package.xml
a dependency will also have its own dependencies.

$ rospack depends1 rospy
A package can have quite a few indirect dependencies.

$ rospack depends beginner_tutorials
5. Customizing your package

a. Customizing the package.xml

   1 <?xml version="1.0"?>   2 <package>   3   <name>beginner_tutorials</name>   4   <version>0.1.0</version>   5   <description>The beginner_tutorials package</description>   6    7   <maintainer email="you@yourdomain.tld">Your Name</maintainer>   8   <license>BSD</license>   9   <url type="website">http://wiki.ros.org/beginner_tutorials</url>  10   <author email="you@yourdomain.tld">Jane Doe</author>  11   12   <buildtool_depend>catkin</buildtool_depend>  13   14   <build_depend>roscpp</build_depend>  15   <build_depend>rospy</build_depend>  16   <build_depend>std_msgs</build_depend>  17   18   <run_depend>roscpp</run_depend>  19   <run_depend>rospy</run_depend>  20   <run_depend>std_msgs</run_depend>  21   22 </package>

原创粉丝点击