roscreate contains the roscreate-pkg and roscreate-stack tools, which are command-line tools for creating new ROS packages and stacks, respectively. Packages are frequently created by people copying an existing package and then modifying it's build and manifest.xml files. This frequently results in errors, so the roscreate-pkg tool is meant to be just as easy, but less error prone. Similarly, stack.xml files are difficult to create by hand as one must correctly specify the union of all package dependencies.
The roscreate-pkg command-line tool creates a new ROS package with common package files: manifest.xml, CMakeLists.txt, mainpage.dox, and Makefile. It addresses the common problem of packages being created using pre-existing packages, which leads to errors in build files and manifests.
IMPORTANT: the directory that you run roscreate-pkg in matters. You must run it in a directory that can be located from your ROS_PACKAGE_PATH (see ROS environment variables). Furthermore, you cannot run it inside of another ROS package.
To create a new package in the current directory:
$ roscreate-pkg pkgname
To test that this worked, you can use roscd:
$ roscd pkgname
You can also specify dependencies of that package:
$ roscreate-pkg pkgname depend1 depend2 depend3
$ roscreate-pkg foopkg roslib roscpp std_msgs
The roscreate-stack command-line tool creates or updates a ROS stack, which mainly involves the creation of a stack.xml file. It is the most convenient way of automatically updating a stack. It's best to use this tool with a directory that already contains the packages you wish to put into your stack. This tool can save a lot of effort in computing the union of all the dependencies for a particular stack, so its use is highly recommended.
To create or update a stack in the current directory:
$ roscreate-stack .
- Show the calculated stack dependencies only.