ROS1 support for the Python MCAP library
Project description
Python MCAP Ros1 support
This package provides ROS1 support for the Python MCAP file format reader & writer.
Installation
You can install directly via pip. This also requires the rosbag package from the ROS package index.
pip install --index-url https://rospypi.github.io/simple genpy
pip install mcap-ros1-support
Or you can install via Pipenv and a Pipfile. This requires specifying the source for the rosbag package like this:
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[[source]]
url = "https://rospypi.github.io/simple"
verify_ssl = true
name = "ros"
[packages]
mcap-ros1-support = "*"
genpy = "*"
Reading ROS1 Messages
# Reading from a MCAP file
from mcap_ros1.reader import read_ros1_messages
for msg in read_ros1_messages("my_data.mcap"):
print(f"{msg.topic}: f{msg.ros_msg}")
Writing ROS1 Messages
from mcap_ros1.writer import Writer as Ros1Writer
from std_msgs.msg import String
output = open("example.mcap", "w+b")
ros_writer = Ros1Writer(output=output)
for i in range(0, 10):
ros_writer.write_message("chatter", String(data=f"string message {i}"))
ros_writer.finish()
Stay in touch
Join our Slack channel to ask questions, share feedback, and stay up to date on what our team is working on.
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
Close
Hashes for mcap_ros1_support-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa7cdac0168a02d97bd61e17ee544b39db5113d5e0c54b72d0a3300e3c0db2e1 |
|
MD5 | 9c198993fcf2d712b613ceef1f259263 |
|
BLAKE2b-256 | 19a6f20864128d3cb9fc2f3c74c1d4e0899b9a4ea2d9b7eb97a76a2c2c71fcba |