Skip to main content

Powerful ROS 2 Package Generator

Project description

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.

[!IMPORTANT]
This repository is open-sourced and maintained by the Institute for Automotive Engineering (ika) at RWTH Aachen University.
ROS is the backbone of many research topics within our Vehicle Intelligence & Automated Driving domain.
If you would like to learn more about how we can support your advanced driver assistance and automated driving efforts, feel free to reach out to us!
:email: opensource@ika.rwth-aachen.de

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)"

[!WARNING]
Outside of a virtual environment, pip may default to a user-site installation of executables to ~/.local/bin, which may not be present in your shell's PATH. If running ros2-pkg-create errors with ros2-pkg-create: command not found, add the directory to your path. (More information)

echo "export PATH=\$HOME/.local/bin:\$PATH" >> ~/.bashrc
source ~/.bashrc

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, 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?
  • 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 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 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_python_pkg,ros2_cpp_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] [--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] [--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]
                       [--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_python_pkg,ros2_cpp_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
  --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
  --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?
  --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).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ros2_pkg_create-1.0.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

ros2_pkg_create-1.0.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file ros2_pkg_create-1.0.1.tar.gz.

File metadata

  • Download URL: ros2_pkg_create-1.0.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ros2_pkg_create-1.0.1.tar.gz
Algorithm Hash digest
SHA256 752878ec9fa332becc9c2978ca617381ff3e2aee1b6f5123e60e3ee9e10d1ab2
MD5 2a25669617c813e56dcc4e476c66b2b0
BLAKE2b-256 327e8e6430eb29a704aafba270693d9b988c520f73b7d9af1a2baa49f24d952c

See more details on using hashes here.

File details

Details for the file ros2_pkg_create-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ros2_pkg_create-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d277efea063375c0b53bbd950d7d68c72d264f8c10c3e68391ce24bfc10e451
MD5 74c68ea7dd1f2d1651ddf4c06259bc78
BLAKE2b-256 a8ed79cdb791d2872cf5d3a294e5ff3cea79e47a3ae30d8ff79c8a94dd42af2a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page