ROS1 对 Python MCAP 库的支持
项目描述
Python MCAP Ros1 支持
该软件包为 Python MCAP 文件格式读写器提供 ROS1 支持。
安装
可以直接通过 pip 安装。这也需要 ROS 包索引中的 rosbag 包。
pip install --index-url https://rospypi.github.io/simple genpy
pip install mcap-ros1-support
或者您可以通过Pipenv和 Pipfile 安装。这需要像这样指定 rosbag 包的源:
[[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 = "*"
读取 ROS1 消息
# 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}")
编写 ROS1 消息
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()
保持联系
加入我们的Slack 频道,提出问题、分享反馈并及时了解我们团队的工作进展。
项目详情
关
mcap_ros1_support -0.3.0-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | aa7cdac0168a02d97bd61e17ee544b39db5113d5e0c54b72d0a3300e3c0db2e1 |
|
MD5 | 9c198993fcf2d712b613ceef1f259263 |
|
布莱克2-256 | 19a6f20864128d3cb9fc2f3c74c1d4e0899b9a4ea2d9b7eb97a76a2c2c71fcba |