Skip to main content

Create ROS2 lifecycle package boilerplate from a minimal config file

Project description

ROS2 lifecycle package creator

CLI tool to generate boilerplate source, CMakeLists.txt, launch, package.xml and readme files for ROS2 lifecycle nodes upto a minimum compilable package.

This package works best with standard ROS2 messages and for custom interfaces follow the naming conventions like in ROS2 official packages.

Demo

  • running with the example config
ros2-lifecycle-pkg-create --config_file example/object_segmenter.yaml --target_dir object_segmenter
  • output directory
object_segmenter
├── .clang-format
├── CMakeLists.txt
├── include
│   └── object_segmenter
│       └── object_segmenter.hpp
├── launch
│   └── object_segmenter.launch.py
├── package.xml
├── README.md
└── src
    ├── object_segmenter.cpp
    └── object_segmenter_node.cpp

Install using pip

  • from your python environment run
python -m pip install ros2-lifecycle-package-creator
  • then run
ros2-lifecycle-pkg-create --help

Install and run locally using poetry

  • make sure poetry is installed, then run
# from top level (same where README.md is located)
poetry install
  • enter the poetry env
eval $(poetry env activate)
  • now run
ros2-lifecycle-pkg-create --help

Run locally without poetry

  • install dependencies
pip install jinja2 pyyaml
  • run
python src/main.py --config example/object_segmenter.yaml --target_dir /path/to/ros2_ws/src/example_pkg

What this package generates

  • node.cpp
  • node.hpp
  • main.cpp executable
  • node.launch.py with activated node
  • package.xml with required subscriber and publisher dependencies
  • CMakeLists.txt with required subscriber and publisher dependencies
  • README.md with provided subscriber and publisher data
  • adds .clang-format file as provided in repo here

Setup

config_file

author: authors name
email: authors_email
license: license_name
node_name: NodeName
namespace: some_namespace
description: some description
subscribers:
  topic1: type1
  topic2: type2
publishers:
  topic3: type3
  topic4: type4

Susbcribers and publishers will have handles that will have names topic1_sub_ or topic3_pub_ respectively. Topics will be named exactly as they are specified. eg: topic1

target_dir

The package files will be put in target_dir ensure its empty or doesnt exist (will be created)

TODO

  • add license file
  • add license header
  • add parameter helpers
  • add actions and services

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_lifecycle_package_creator-0.1.4.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ros2_lifecycle_package_creator-0.1.4-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file ros2_lifecycle_package_creator-0.1.4.tar.gz.

File metadata

  • Download URL: ros2_lifecycle_package_creator-0.1.4.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.16 Linux/6.8.0-1021-azure

File hashes

Hashes for ros2_lifecycle_package_creator-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d8db0050f41debfbbe1791352566d91a0d33342ebf4c68ba2206013c48c29edd
MD5 aa2f381e23e3f9fdfaa313a947caf84c
BLAKE2b-256 25fb90a5ab0274e82e0da1d1d288cabdefe53d5e98745c7cbee6ac59cb42a7a2

See more details on using hashes here.

File details

Details for the file ros2_lifecycle_package_creator-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for ros2_lifecycle_package_creator-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5727db495b9869ee7e32d36a4deefa28115c7803aa8783cf5ce802c7fe828432
MD5 c9febf611d7fc8b71276e3d7fb4a8873
BLAKE2b-256 72499266a15f1b965cba1fcb68a44f6d9d54a7b81a25d2b8939d36deac1356d3

See more details on using hashes here.

Supported by

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