ROS实操笔记一

浪子不回头ぞ 提交于 2020-12-31 02:26:09

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!