tutorial1
1.查看ros有关环境变量
$ printenv | grep ROS
2.Create a ROS Workspace
$ mkdir -p ~/catkin_ws/src $ cd ~/catkin_ws/ $ catkin_make
添加当前workspace变量
$ source devel/setup.bash
查看确认变量添加成功
$ echo $ROS_PACKAGE_PATH /home/youruser/catkin_ws/src:/opt/ros/kinetic/share
tutorial2
ROS filesystem concepts
1.查找package信息
$ rospack find [package_name]
2. roscd,rosls
tutorial3
create a new package
1.最简单的包结构必须包含:
my_package/ CMakeLists.txt package.xml
2.创建包(src目录下)
# catkin_create_pkg <package_name> [depend1] [depend2] [depend3]
$ cd ~/catkin_ws/src
$ catkin_create_pkg beginner_tutorials std_msgs rospy roscpp
3.build(workspace目录)
$ cd ~/catkin_ws $ catkin_make
添加当前变量(这一步必做,不然找不到新建的包)
$ . ~/catkin_ws/devel/setup.bash
4.查看包依赖
直接依赖:
$rospack depends1 beginner_tutorials
递归依赖:depends1 替换成depends
5.修改package.xml和CMakeLists.txt
来源:oschina
链接:https://my.oschina.net/u/1863300/blog/2874817