1、Platform:Ubuntu16.04+ROS Kinetic Klame
2、After installation of ROS, It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched:
$: echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
$: source ~/.bashrc
3、catkin_ws工作空间:catkin是ROS定制的编译构建系统,是对CMake的扩展,编写规则类似。
4、建立工作空间:
$: mkdir -p ~/catkin_ws/src
$: cd ~/catkin_ws/
$: catkin_make
5、编译:
$: cd ~/catkin_ws/ #切记回到工作空间
$: catkin_make
$: source ~/catkin_ws/devel/setup.bash #编译完成后要source刷新环境
建议:
$: echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
$: source ~/.bashrc
6、catkin_ws软件框架:
待插图......
7、package是ROS软件的基本组织形式,catkin编译的基本单元,一个package可以包含多个可执行文件(节点)。
8、常用的包管理指令:
(1)查找某个pkg的地址:
$: rospack find [pkg_name]
列出本地所有的pkg:
$: rospack list
(2)跳转到某个pkg路径下:
$: roscd [pkg_name]
(3)列举某个pkg下的文件信息:
$: rosls [pkg_name]
(4)编辑pkg中的文件:
$: rosed [pkg_name] [file_name]
(5)创建一个pkg:
$: catkin_create_pkg [pkg_name] [deps]
(6)安装某个pkg所需的依赖(有时从github clone下来的包需要的依赖我们系统不一定有装):
$: rosdep install [pkg_name]
$: rosdep install --from-paths src --ignore-src --rosdistro=kinetic -y
9、节点node相关指令:
(1)启动一个节点:
$: rosrun [pkg_name] [node_name]
(2)列出当前运行的node信息:
$: rosnode list
(3)显示某个node 的详细信息:
$: rosnode info [node_name]
(4)结束某个node:
$: rosnode kill [node_name]
(5)启动master和多个node:
$: roslaunch [pkg_name] [file_name.launch]