@ferstar
2015-08-03T23:23:56.000000Z
字数 1400
阅读 2181
ROS
查看ROS环境变量
export | grep ROS
输出
ROSLISP_PACKAGE_DIRECTORIES=''
ROS_DISTRO=jade
ROS_ETC_DIR=/opt/ros/jade/etc/ros
ROS_MASTER_URI=http://localhost:11311
ROS_PACKAGE_PATH=/opt/ros/jade/share:/opt/ros/jade/stacks
ROS_ROOT=/opt/ros/jade/share/ros
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace
输出
Creating symlink "/home/ferstar/catkin_ws/src/CMakeLists.txt" pointing to "/opt/ros/jade/share/catkin/cmake/toplevel.cmake"
$ cd ~/catkin_ws/
$ catkin_make
输出
Base path: /home/ferstar/catkin_ws
Source space: /home/ferstar/catkin_ws/src
Build space: /home/ferstar/catkin_ws/build
......
编译源码之前别忘了初始化下当前shell的环境变量,由于我们是用zsh的,所以这个初始化命令就变成了
source devel/setup.zsh
此命令执行正常后是没有任何输出的
为确保你的工作目录被安装脚本正确初始化,我们需要查看下ros软件包的路径有没有将我们新建的catkin_ws目录包含进去
echo $ROS_PACKAGE_PATH
输出
/home/ferstar/catkin_ws/src:/opt/ros/jade/share:/opt/ros/jade/stacks
至此你的ROS基本环境已经建立
下载新手教程软件包
sudo apt-get install ros-jade-ros-tutorials
输出
正常也没有输出,因为之前的准备工作默认已经装好了这个软件包
用法:rospack find [package_name]
例子:rospack find roscpp
输出:/opt/ros/jade/share/roscpp
用法:roscd [locationname[/subdir]]
例子:roscd roscpp
输出:无输出,会跳转至/opt/ros/jade/share/roscpp 目录
用法:roscd log
输出:近期运行ros软件包的log信息
用法:rosls [locationname[/subdir]]
例子:rosls roscpp_tutorials
输出:cmake launch package.xml srv
神器,不解释~
ros的所有命令只是相同作用的linux命令前面加了ros
而已