(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Creating a workspace for catkin

Description: This tutorial covers how to setup a catkin workspace in which one or more catkin packages can be built.

Keywords: catkin workspace

Tutorial Level: BEGINNER

Next Tutorial: Creating catkin packages


  1. Prerequisites


This tutorial assumes that you have installed catkin and sourced your environment. If you installed catkin via apt-get for ROS Hydro, your command would look like this:

$ source /opt/ros/hydro/setup.bash


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


对于ROS Melodic和早期版本的Python 3用户:注意,如果你从源代码构建ROS来实现Python 3的兼容性,并适当地设置您的系统(即:安装所有必需的ROS Python包的Python 3版本,例如catkin),那么在干净的catkin工作区中的第一个catkin_make命令必须是:

$ catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3

这将会配置catkin_make使用Python 3,在以后的构建中可以只使用catkin_make


$ source devel/setup.bash



Next you should go ahead and learn how to use the workspace.

If you are following the ROS tutorials series instead of the catkin tutorials, please continue with Creating a ROS Package.

Wiki: cn/catkin/Tutorials/create_a_workspace (last edited 2020-12-20 17:07:31 by yakamoz423)