ros2-pkg-create – Powerful ROS 2 Package Generator
ros2-pkg-create is an interactive CLI tool for quickly generating ROS 2 packages from basic pub/sub nodes to complex lifecycle components. It is meant to replace the official ros2 pkg create command.
Quick Demo
pip install ros2-pkg-create
ros2-pkg-create --template ros2_cpp_pkg .
Installation
pip install ros2-pkg-create
# (optional) bash auto-completion
activate-global-python-argcomplete
eval "$(register-python-argcomplete ros2-pkg-create)"
Templates & Features
ros2-pkg-create provides multiple templates, each covering a different questionnaire for generating all the components you need. See below for the list of supported features and questionnarie options. Note that all options can also be passed directly to the command, bypassing the interactive questionnaire (see Usage).
C++ Package (--template ros2_cpp_pkg)
Supported Features: publisher, subscriber, parameter loading, launch file, service server, action server, timer callback, component, lifecycle node, executor, docker-ros
Questionnaire
- Package name
- Description
- Maintainer | Maintainer email
- Author | Author email
- License
- Node name
- Class name of node
- Make it a component?
- Make it a lifecycle node?
- Type of Executor
- Add a launch file? | Type of launch file
- Add parameter loading?
- Add a subscriber?
- Add a publisher?
- Add a service server?
- Add an action server?
- Add a timer callback?
- Add a diagnostics updater to publish diagnostics?
- Add the docker-ros CI integration?
Python Package (--template ros2_python_pkg)
Supported Features: publisher, subscriber, parameter loading, launch file, service server, action server, timer callback, docker-ros
Questionnaire
- Package name
- Description
- Maintainer | Maintainer email
- Author | Author email
- License
- Node name
- Class name of node
- Add a launch file? | Type of launch file
- Add parameter loading?
- Add a subscriber?
- Add a publisher?
- Add a service server?
- Add an action server?
- Add a timer callback?
- Add a diagnostics updater to publish diagnostics?
- Add the docker-ros CI integration?
Interfaces Package (--template ros2_interfaces_pkg)
Supported Features: message, service, action
Questionnaire
- Package name
- Description
- Maintainer | Maintainer email
- Author | Author email
- License
- Interfaces types
- Message name
- Service name
- Action name
- Add the docker-ros CI integration?
Usage
usage: ros2-pkg-create [-h] [--defaults] [--use-local-templates] --template {ros2_interfaces_pkg,ros2_cpp_pkg,ros2_python_pkg} [--package-name PACKAGE_NAME] [--description DESCRIPTION] [--maintainer MAINTAINER]
[--maintainer-email MAINTAINER_EMAIL] [--author AUTHOR] [--author-email AUTHOR_EMAIL]
[--license {Apache-2.0,BSL-1.0,BSD-2.0,BSD-2-Clause,BSD-3-Clause,GPL-3.0-only,LGPL-2.1-only,LGPL-3.0-only,MIT,MIT-0}] [--node-name NODE_NAME] [--node-class-name NODE_CLASS_NAME] [--is-component]
[--no-is-component] [--is-lifecycle] [--no-is-lifecycle] [--executor-type {SingleThreadedExecutor,MultiThreadedExecutor,StaticSingleThreadedExecutor}] [--has-launch-file] [--no-has-launch-file]
[--launch-file-type {xml,py,yml}] [--has-params] [--no-has-params] [--has-subscriber] [--no-has-subscriber] [--has-publisher] [--no-has-publisher] [--has-service-server] [--no-has-service-server]
[--has-action-server] [--no-has-action-server] [--has-timer] [--no-has-timer] [--has-diagnostics] [--no-has-diagnostics] [--auto-shutdown] [--no-auto-shutdown]
[--interface-types {Message,Service,Action}] [--msg-name MSG_NAME] [--srv-name SRV_NAME] [--action-name ACTION_NAME] [--has-docker-ros] [--docker-ros-type {github,gitlab}] [--version]
destination
Creates a ROS 2 package from templates
positional arguments:
destination Destination directory
options:
-h, --help show this help message and exit
--defaults Use defaults for all options
--use-local-templates
Use locally installed templates instead of remotely pulling most recent ones
--template {ros2_interfaces_pkg,ros2_cpp_pkg,ros2_python_pkg}
Template
--package-name PACKAGE_NAME
Package name
--description DESCRIPTION
Description
--maintainer MAINTAINER
Maintainer
--maintainer-email MAINTAINER_EMAIL
Maintainer email
--author AUTHOR Author
--author-email AUTHOR_EMAIL
Author email
--license {Apache-2.0,BSL-1.0,BSD-2.0,BSD-2-Clause,BSD-3-Clause,GPL-3.0-only,LGPL-2.1-only,LGPL-3.0-only,MIT,MIT-0}
License
--node-name NODE_NAME
Node name
--node-class-name NODE_CLASS_NAME
Class name of node
--is-component Make it a component?
--no-is-component
--is-lifecycle Make it a lifecycle node?
--no-is-lifecycle
--executor-type {SingleThreadedExecutor,MultiThreadedExecutor,StaticSingleThreadedExecutor}
Type of Executor
--has-launch-file Add a launch file?
--no-has-launch-file
--launch-file-type {xml,py,yml}
Type of launch file
--has-params Add parameter loading
--no-has-params
--has-subscriber Add a subscriber?
--no-has-subscriber
--has-publisher Add a publisher?
--no-has-publisher
--has-service-server Add a service server?
--no-has-service-server
--has-action-server Add an action server?
--no-has-action-server
--has-timer Add a timer callback?
--no-has-timer
--has-diagnostics Add a diagnostics updater to publish diagnostics?
--no-has-diagnostics
--auto-shutdown Automatically shutdown the node after launch (useful in CI/CD)?
--no-auto-shutdown
--interface-types {Message,Service,Action}
Interfaces types
--msg-name MSG_NAME Message name
--srv-name SRV_NAME Service name
--action-name ACTION_NAME
Action name
--has-docker-ros Add the docker-ros CI integration?
--docker-ros-type {github,gitlab}
Type of docker-ros CI integration
--version show program's version number and exit
Acknowledgements
This work is accomplished within the projects 6GEM (FKZ 16KISK036K) and autotech.agil (FKZ 01IS22088A). We acknowledge the financial support for the projects by the Federal Ministry of Education and Research of Germany (BMBF).
Metadata
Release files for ros2-pkg-create 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ros2_pkg_create-1.3.0.tar.gz | 28.5 kB | Without provenance | Details for ros2_pkg_create-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ros2_pkg_create-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for ros2_pkg_create-1.3.0-py3-none-any.whl |
Total release size: 69.4 kB
Release files / ros2_pkg_create-1.3.0.tar.gz
| Download URL | ros2_pkg_create-1.3.0.tar.gz |
|---|---|
| Size | 28.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0e0b8e9eb84aa9a9af20c0245bbd89b8bc822198f400f0e0e6c6fa8dfdb4c562
|
|
BLAKE2b-256 checksum How to use checksums |
9bfa25b27118e5c54fc0596ff4d450f1477a9c0c504bdb0575a3085e45cc9808
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / ros2_pkg_create-1.3.0-py3-none-any.whl
| Download URL | ros2_pkg_create-1.3.0-py3-none-any.whl |
|---|---|
| Size | 40.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f2d97598099100c8af7c6bd19f030d184687b2ee0d78bef5b089f3165293add2
|
|
BLAKE2b-256 checksum How to use checksums |
5407f0655b23787f421502ab72265207448e4c9eceeec805e3b90bc7a5557dd4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for ros2-pkg-create 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.