Skip to main content

HPL RV for ROS

This project provides tools to create and deploy runtime monitors for your Robot Operating System applications.

Installing

This package can be installed with pip:

pip install hpl-rv-ros

Usage

You can use this project to generate code both as a library and as a standalone tool.

First, you will need a mapping of ROS topic types to message types. This can be specified in YAML or JSON formats, when provided as a file. For example:

%YAML 1.2
# file: topics.yaml
---
/a: std_msgs/Int64
/b: std_msgs/Int64
/p: std_msgs/Bool
/q: std_msgs/Bool

Then, you will also need to provide a HPL specification. This can be either a list of properties, or a .hpl file, depending on how you want to use this package.

As a Standalone Tool

This package provides the hpl-rv-ros CLI script.

Required Arguments

  1. a path to the topic type mapping file
  2. either a list of properties or a list of .hpl files, depending on flags

Optional Arguments

  • flag --rospy: generate ROS1 code instead of ROS2 code
  • flag -f or --files: treat positional arguments as a list of paths to .hpl files instead of a list of properties
  • argument -o or --output: pass a path to an output file for the generated code (default: print to screen)

Example

To generate ROS2 code:

hpl-rv-ros -f -o rclpy_node.py topics.yaml properties.hpl

To generate ROS1 code:

hpl-rv-ros --rospy -f -o rospy_node.py topics.yaml properties.hpl

As a Library

This repository provides the hplrv_ros Python package.

Example

from typing import Dict, List
from pathlib import Path
from hpl.ast import HplProperty
from hpl.parser import property_parser
from hplrv_ros.rclpy import generate_node as generate_rclpy
from hplrv_ros.rospy import generate_node as generate_rospy

parser = property_parser()

topic_types: Dict[str, str] = { '/a': 'std_msgs/Int32' }
properties: List[HplProperty] = [parser.parse('globally: no /a {data > 0}')]

rclpy_code: str = generate_rclpy(properties, topic_types)
rospy_code: str = generate_rospy(properties, topic_types)

path: Path = Path('rclpy_node.py')
path.write_text(rclpy_code, encoding='utf-8')
path = Path('rospy_node.py')
path.write_text(rospy_code, encoding='utf-8')

GitHub Features

The .github directory comes with a number of files to configure certain GitHub features.

  • Various Issue templates can be found under ISSUE_TEMPLATE.
  • A Pull Request template can be found at PULL_REQUEST_TEMPLATE.md.
  • Automatically mark issues as stale after a period of inactivity. The configuration file can be found at .stale.yml.
  • Keep package dependencies up to date with Dependabot. The configuration file can be found at dependabot.yml.
  • Keep Release Drafts automatically up to date with Pull Requests, using the Release Drafter GitHub Action. The configuration file can be found at release-drafter.yml and the workflow at workflows/release-drafter.yml.
  • Automatic package building and publishing when pushing a new version tag to main. The workflow can be found at workflows/publish-package.yml.

Tooling

This package sets up various tox environments for static checks, testing, building and publishing. It is also configured with pre-commit hooks to perform static checks and automatic formatting.

If you do not use tox, you can build the package with build and install a development version with pip.

Assume cd into the repository's root.

To install the pre-commit hooks:

pre-commit install

To run type checking:

tox -e typecheck

To run linting tools:

tox -e lint

To run automatic formatting:

tox -e format

To run tests:

tox

To build the package:

tox -e build

To build the package (with build):

python -m build

To clean the previous build files:

tox -e clean

To test package publication (publish to Test PyPI):

tox -e publish

To publish the package to PyPI:

tox -e publish -- --repository pypi

To install an editable version:

pip install -e .

Metadata

Release files for hpl-rv-ros 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hpl-rv-ros 1.1.0
File Size Uploaded Provenance Actions
hpl-rv-ros-1.1.0.tar.gz 18.0 kB Without provenance Details for hpl-rv-ros-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hpl-rv-ros 1.1.0
File Interpreter ABI Platform Actions
hpl_rv_ros-1.1.0-py3-none-any.whl Python 3 none any Details for hpl_rv_ros-1.1.0-py3-none-any.whl

Total release size: 29.4 kB

Release files / hpl-rv-ros-1.1.0.tar.gz

Download URL hpl-rv-ros-1.1.0.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a3f265732c97eb950aa8e906f553575dc7463d8810da453338c1cd4b5ba074c2
BLAKE2b-256 checksum
How to use checksums
5cc358729fa1fd19bc553e36888e7fcd2c9f7161fa5682e439f296deea7429b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / hpl_rv_ros-1.1.0-py3-none-any.whl

Download URL hpl_rv_ros-1.1.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55194b4f1f9fee3bdb92a334ae39ee579af9fcb9c3262fa74ee5d5aba7909258
BLAKE2b-256 checksum
How to use checksums
10994ca506d29662b9b960b6370fa79591eea1a715f752590a99676922db2914
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Security for hpl-rv-ros 1.1.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page