安装并配置ROS环境
1.配置ROS环境
$ source /opt/ros/kinetic/setup.bash```
$ echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
$ source ~/.bashrc```
You will need to run this command on every new shell you open to have access to the ROS commands, unless you add this line to your .bashrc. This process allows you to install several ROS distributions (e.g. indigo and kinetic) on the same computer and switch between them.
2.Create a ROS Workspace
(这些命令适用于ROS Groovy及以后版本。)
创建一个** ctakin workspace **:
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace```
创建完成后工作空间是空的,**src**中没有**package**,只有一个**CMakeLists.txt**文件。但是仍然可以***build***工作空间:
$ cd ~/catkin_ws/
$ catkin_make```
组建完成后,在当前目录下会出现build和devel文件夹,在devel文件夹下有很多
setup.sh文件,source*其中任何一个都将你的工作空间覆盖在你的环境上。
确保工作空间被setup script覆盖,确保ROS_PACKAGE_PATH 环境变量包含你在的那个文件夹。
$ echo $ROS_PACKAGE_PATH
/home/youruser/catkin_ws/src:/opt/ros/kinetic/share:/opt/ros/kinetic/stacks```
网友评论