MCAPChannel¶
- class osi_utilities.tracefile.mcap_channel.MCAPChannel(mcap_writer)[source]¶
Bases:
objectHelper for writing OSI messages to an external MCAP writer.
Use this when you already have a
mcap.writer.Writerinstance and want to add OSI channels/messages to it.Usage:
from mcap.writer import Writer with open("output.mcap", "wb") as f: writer = Writer(f) writer.start() channel = MCAPChannel(writer) channel.add_channel("ground_truth", GroundTruth) channel.write_message(gt_msg, "ground_truth") writer.finish()
- Parameters:
mcap_writer (McapRawWriter)
- add_channel(topic, message_class, metadata=None)[source]¶
Register an OSI channel with the external writer.