Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
grepros.plugins.mcap.McapSink Class Reference
Inheritance diagram for grepros.plugins.mcap.McapSink:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, args=None, **kwargs)
 
def close (self)
 
def close_output (self)
 
def emit (self, topic, msg, stamp=None, match=None, index=None)
 
def validate (self)
 
- Public Member Functions inherited from grepros.outputs.Sink
def __enter__ (self)
 
def __exit__ (self, exc_type, exc_value, traceback)
 
def autodetect (cls, target)
 
def bind (self, source)
 
def emit_meta (self)
 
def flush (self)
 
def is_highlighting (self)
 
def thread_excepthook (self, text, exc)
 
- Public Member Functions inherited from grepros.outputs.RolloverSinkMixin
def ensure_rollover (self, topic, msg, stamp)
 
def format_output_meta (self)
 
def get_write_options (cls, label)
 
def make_filename (self)
 
def size (self)
 

Public Attributes

 filename
 
 valid
 
- Public Attributes inherited from grepros.outputs.Sink
 args
 
 source
 inputs.Source instance bound to this sink More...
 
 valid
 Result of validate() More...
 
- Public Attributes inherited from grepros.outputs.RolloverSinkMixin
 filename
 Current output file path. More...
 

Static Public Attributes

 DEFAULT_ARGS = dict(META=False, WRITE_OPTIONS={}, VERBOSE=False)
 Constructor argument defaults. More...
 
tuple FILE_EXTENSIONS = (".mcap", )
 Auto-detection file extensions. More...
 
- Static Public Attributes inherited from grepros.outputs.Sink
 DEFAULT_ARGS = dict(META=False)
 Constructor argument defaults. More...
 
tuple FILE_EXTENSIONS = ()
 Auto-detection file extensions for subclasses, as (".ext", ) More...
 
- Static Public Attributes inherited from grepros.outputs.RolloverSinkMixin
 DEFAULT_ARGS = dict(VERBOSE=False, WRITE=None, WRITE_OPTIONS={})
 Constructor argument defaults. More...
 
string FILE_META_TEMPLATE = "{name} ({size})"
 
string MULTI_META_TEMPLATE = "\n- {name} ({size}, {mcount}, {tcount})"
 
list OPTIONS_TEMPLATES
 Command-line help templates for rollover options, as [(name, text with s label placeholder)]. More...
 
string START_META_TEMPLATE = "{mcount} in {tcount} to "
 

Private Member Functions

def _ensure_open (self)
 

Private Attributes

 _close_printed
 
 _file
 
 _overwrite
 
 _schemas
 
 _writer
 

Detailed Description

Writes messages to MCAP file.

Definition at line 562 of file mcap.py.

Constructor & Destructor Documentation

◆ __init__()

def grepros.plugins.mcap.McapSink.__init__ (   self,
  args = None,
**  kwargs 
)
@param   args                 arguments as namespace or dictionary, case-insensitive;
                      or a single path as the file to write
@param   args.write           base name of MCAP files to write
@param   args.write_options   {"overwrite": whether to overwrite existing file
                                    (default false),
                       "rollover-size": bytes limit for individual output files,
                       "rollover-count": message limit for individual output files,
                       "rollover-duration": time span limit for individual output files,
                                            as ROS duration or convertible seconds,
                       "rollover-template": output filename template, supporting
                                            strftime format codes like "%H-%M-%S"
                                            and "%(index)s" as output file index}
@param   args.meta            whether to print metainfo
@param   args.verbose         whether to print debug information
@param   kwargs               any and all arguments as keyword overrides, case-insensitive

Reimplemented from grepros.outputs.Sink.

Definition at line 572 of file mcap.py.

Member Function Documentation

◆ _ensure_open()

def grepros.plugins.mcap.McapSink._ensure_open (   self)
private
Opens output file if not already open.

Definition at line 665 of file mcap.py.

◆ close()

def grepros.plugins.mcap.McapSink.close (   self)
Closes output file if open, emits metainfo.

Reimplemented from grepros.outputs.Sink.

Definition at line 647 of file mcap.py.

◆ close_output()

def grepros.plugins.mcap.McapSink.close_output (   self)
Closes output file, if any.

Reimplemented from grepros.outputs.RolloverSinkMixin.

Definition at line 657 of file mcap.py.

◆ emit()

def grepros.plugins.mcap.McapSink.emit (   self,
  topic,
  msg,
  stamp = None,
  match = None,
  index = None 
)
Writes out message to MCAP file.

Reimplemented from grepros.outputs.Sink.

Definition at line 627 of file mcap.py.

◆ validate()

def grepros.plugins.mcap.McapSink.validate (   self)
Returns whether required libraries are available (mcap, mcap_ros1/mcap_ros2)
and overwrite is valid and file is writable.

Reimplemented from grepros.outputs.Sink.

Definition at line 604 of file mcap.py.

Member Data Documentation

◆ _close_printed

grepros.plugins.mcap.McapSink._close_printed
private

Definition at line 599 of file mcap.py.

◆ _file

grepros.plugins.mcap.McapSink._file
private

Definition at line 595 of file mcap.py.

◆ _overwrite

grepros.plugins.mcap.McapSink._overwrite
private

Definition at line 598 of file mcap.py.

◆ _schemas

grepros.plugins.mcap.McapSink._schemas
private

Definition at line 597 of file mcap.py.

◆ _writer

grepros.plugins.mcap.McapSink._writer
private

Definition at line 596 of file mcap.py.

◆ DEFAULT_ARGS

grepros.plugins.mcap.McapSink.DEFAULT_ARGS = dict(META=False, WRITE_OPTIONS={}, VERBOSE=False)
static

Constructor argument defaults.

Definition at line 569 of file mcap.py.

◆ FILE_EXTENSIONS

tuple grepros.plugins.mcap.McapSink.FILE_EXTENSIONS = (".mcap", )
static

Auto-detection file extensions.

Definition at line 566 of file mcap.py.

◆ filename

grepros.plugins.mcap.McapSink.filename

Definition at line 669 of file mcap.py.

◆ valid

grepros.plugins.mcap.McapSink.valid

Definition at line 623 of file mcap.py.


The documentation for this class was generated from the following file:


grepros
Author(s): Erki Suurjaak
autogenerated on Sat Jan 6 2024 03:11:30