官术网_书友最值得收藏!

Creating a catkin workspace

The next step is to create a catkin workspace. A catkin workspace is a directory (folder) in which you can create or modify existing catkin packages. The catkin structure simplifies the build and installation process for your ROS packages. The ROS wiki website is http://wiki.ros.org/catkin/Tutorials/create_a_workspace.

A catkin workspace can contain up to three or more different subdirectories (/build, /devel, and /src), each of which serve a different role in the software development process.

We will label our catkin workspace catkin_ws. To create the catkin workspace, type the following commands:

$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace

Even though the workspace is empty (there are no packages in the src folder, just a single CMakeLists.txt link), you can still build the workspace by typing the following commands:

$ cd ~/catkin_ws/
$ catkin_make

The catkin_make command creates the catkin workspace. If you view your current directory contents, you should now have the build and devel folders. Inside the devel folder there are now several setup.*sh files. We will source the setup.bash file to overlay this workspace on top of your ROS environment:

$ source ~/catkin_ws/devel/setup.bash

Remember to add this source command to your .bashrc file by typing the following command:

$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc

To make sure your workspace is properly overlaid by the setup script, make sure the ROS_PACKAGE_PATH environment variable includes the directory you're in by typing the following command:

$ echo $ROS_PACKAGE_PATH

The output of the preceding command should be as follows:

/home/<username>/catkin_ws/src:/opt/ros/kinetic/share

Here, <username> is the name you chose for the user when Ubuntu was installed.

主站蜘蛛池模板: 砚山县| 平邑县| 桃园县| 城固县| 泾源县| 广德县| 阿拉尔市| 清流县| 揭西县| 南华县| 满城县| 获嘉县| 广宁县| 米易县| 德兴市| 高平市| 伊宁市| 庆阳市| 烟台市| 尚志市| 丰台区| 修文县| 河曲县| 甘泉县| 西宁市| 安义县| 眉山市| 江西省| 彰化市| 博罗县| 肇州县| 专栏| 延川县| 峨眉山市| 罗平县| 永吉县| 延长县| 吉安市| 长宁区| 纳雍县| 赣榆县|