Translations between Protobuf and ROS message definitions
Project description
proto_ros
This project provides utilities for the translation between Protocol Buffers message definitions (proto files) and ROS message definitions (msg files).
proto2msg
The proto2msg script translates Protobuf (proto) files into equivalent ROS Message (msg) files.
Usage:
proto2msg <proto_dir> <msg_dir> (--recursive)
For each proto file in proto_dir equivalent msg files are created in msg_dir.
To translate a single protofile use the following command:
Usage: protoc --proto_path=<proto_dir> --msg_out=<msg_dir> <file.proto>
Limitations
- proto3 syntax
- enums are translated to constants
- No support for 'oneof' and 'any' types
- No support for extensions
- No support for options
- No support for service
The Protobuf Compiler (protoc) parses the proto file and provides it packed in a CodeGeneratorRequest to the protoc_gen_msg plugin (via stdin). This plugin generates a set of ROS message definition (msg) files from the parsed proto file. It returns the generated msg files packed in a CodeGeneratorResponse (via stdout) to the compiler.
msg2proto
The msg2proto script translates ROS message (msg) files into Protobuf (proto) files.
Usage:
msg2proto <msg_dir> <proto_dir> (--package <packagename>)
For each msg file in msg_dir an equivalent proto file is created in proto_dir.
Limitations:
- proto3 syntax
- no support for default values (defaults are skipped)
- constants are translated to comments
- no support for string and array bounds (both treated as unbounded)
We defined a Parsing Expression Grammar for ROS messages and use Parsimonious for the actual parsing.
Installation
Install protoc, the Protobuf compiler:
sudo apt install protobuf-compiler
Install our proto_ros package from PyPi:
pip install proto_ros
Or install it from GitHub:
pip install "git+https://github.com/dortmans/proto_ros.git"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file proto_ros-0.1.0.tar.gz.
File metadata
- Download URL: proto_ros-0.1.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a530413fa12e3effad710a8aec5c2459a5a16c34637e3efc194300a7eed3978b
|
|
| MD5 |
0f4c933b1d1a1821e9a67e36379bf3af
|
|
| BLAKE2b-256 |
8fd26dbabe2b9eff6b6b223eb873e3a9d61d44ea8364cd27f8927f7e7747b2b8
|
File details
Details for the file proto_ros-0.1.0-py3-none-any.whl.
File metadata
- Download URL: proto_ros-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e45d80feb135dd1d074489a977a8b0409244cf62db961176aa2e13f7e4178ec5
|
|
| MD5 |
3929f095fcfc516b6263689ad3fa41d8
|
|
| BLAKE2b-256 |
98cc2cbf422385a337fbf1c1a4ff7ec6ac43bc132fb0a89d10669babd246ce2e
|