grepros 1.3.0
grep for ROS bag files and live topics
Loading...
Searching...
No Matches
McapSink Class Reference
Inheritance diagram for McapSink:
Inheritance graph

Public Member Functions

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

Public Attributes

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

Static Public Attributes

 DEFAULT_ARGS = dict(META=False, WRITE_OPTIONS={}, VERBOSE=False)
 Constructor argument defaults.
 
tuple FILE_EXTENSIONS = (".mcap", )
 Auto-detection file extensions.
 
- Static Public Attributes inherited from Sink
 DEFAULT_ARGS = dict(META=False)
 Constructor argument defaults.
 
tuple FILE_EXTENSIONS = ()
 Auto-detection file extensions for subclasses, as (".ext", )
 
- Static Public Attributes inherited from RolloverSinkMixin
 DEFAULT_ARGS = dict(WRITE=None, WRITE_OPTIONS={}, VERBOSE=False)
 Constructor argument defaults.
 
str FILE_META_TEMPLATE = "{name} ({size})"
 
str 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)].
 
str START_META_TEMPLATE = "{mcount} in {tcount} to "
 

Detailed Description

Writes messages to MCAP file.

Definition at line 569 of file mcap.py.

Constructor & Destructor Documentation

◆ __init__()

__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 Sink.

Definition at line 579 of file mcap.py.

Member Function Documentation

◆ close()

close (   self)
Closes output file if open, emits metainfo.

Reimplemented from Sink.

Definition at line 656 of file mcap.py.

◆ close_output()

close_output (   self)
Closes output file, if any.

Reimplemented from RolloverSinkMixin.

Definition at line 666 of file mcap.py.

◆ emit()

emit (   self,
  topic,
  msg,
  stamp = None,
  match = None,
  index = None 
)
Writes out message to MCAP file.

Reimplemented from Sink.

Definition at line 636 of file mcap.py.

◆ validate()

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

Reimplemented from Sink.

Definition at line 611 of file mcap.py.

Member Data Documentation

◆ close

close

Definition at line 608 of file mcap.py.

◆ DEFAULT_ARGS

DEFAULT_ARGS = dict(META=False, WRITE_OPTIONS={}, VERBOSE=False)
static

Constructor argument defaults.

Definition at line 576 of file mcap.py.

◆ FILE_EXTENSIONS

tuple FILE_EXTENSIONS = (".mcap", )
static

Auto-detection file extensions.

Definition at line 573 of file mcap.py.

◆ filename

filename

Definition at line 678 of file mcap.py.

◆ valid

valid

Definition at line 630 of file mcap.py.


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