Registry / devops / pyros-genmsg

pyros-genmsg

JSON →
library0.5.8pypypi✓ verified 88d ago

Standalone Python library for generating ROS message and service data structures for various languages. Current version 0.5.8, release cadence is sporadic.

pip install pyros-genmsg
INSTALL
IMPORT
SIG · PYROS-GENMSG
P
pyros-genmsg
devopspythonv0.5.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

genmsg
✓ import genmsg
The package provides the 'genmsg' module, not 'pyros_genmsg' or similar.

Import genmsg and use MsgSpec/FieldSpec to define message structures.

import genmsg from genmsg import MsgSpec, FieldSpec # Generate a simple message spec msg_spec = MsgSpec(types=['int32'], names=['x'], text='int32 x', full_name='test/Point2D') print(msg_spec)
Debug
Known issues
gotchaThis library does NOT include ROS 2 support (pyros-genmsg is for ROS 1 genmsg replacement). Do not use with ROS 2.
fix
Use 'ros2' packages or 'genmsg' from ROS 2 distro.
affects: all
deprecatedMsgSpec initialization signature changed in recent versions. Older examples may use positional args differently.
fix
Use keyword arguments: MsgSpec(types=[...], names=[...], text="...", full_name="...").
affects: >=0.4
gotchaThe library expects ROS package paths to be set via environment variable ROS_PACKAGE_PATH, which may not be available in standalone scripts.
fix
Set os.environ['ROS_PACKAGE_PATH'] to the directory containing your .msg files before calling generation functions.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'genmsg'
The package is installed as pyros-genmsg but import uses 'genmsg'.
fix
pip install pyros-genmsg; then import genmsg.
AttributeError: module 'genmsg' has no attribute 'MsgSpec'
Very old version of genmsg (pre-0.4) where MsgSpec was named differently or not exposed.
fix
Upgrade pyros-genmsg to latest: pip install --upgrade pyros-genmsg.
ValueError: Invalid msg specification: 'int32 x'
Provided msg text does not follow ROS msg format (e.g., missing type/name pair).
fix
Ensure text uses ROS format: 'type name' per line, e.g., 'int32 x'.
Upgrade
Version history
0.5.8latest on PyPI · released Apr 18, 2019
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
pyros-genmsg — pip install pyros-genmsg · libregistry