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

Public Member Functions

 __init__ (self, args=None, **kwargs)
 
 __enter__ (self)
 
 __exit__ (self, exc_type, exc_value, traceback)
 
 autodetect (cls, target)
 
 bind (self, source)
 
 close (self)
 
 configure (self, args=None, **kwargs)
 
 emit (self, topic, msg, stamp=None, match=None, index=None)
 
 emit_meta (self)
 
 flush (self)
 
 is_highlighting (self)
 
 thread_excepthook (self, text, exc)
 
 validate (self)
 

Public Attributes

 args
 
 source
 inputs.Source instance bound to this sink
 
 valid
 Result of validate()
 

Static Public Attributes

 DEFAULT_ARGS = dict(META=False)
 Constructor argument defaults.
 
tuple FILE_EXTENSIONS = ()
 Auto-detection file extensions for subclasses, as (".ext", )
 

Detailed Description

Output base class.

Definition at line 32 of file outputs.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
  args = None,
**  kwargs 
)
@param   args        arguments as namespace or dictionary, case-insensitive
@param   args.meta   whether to emit metainfo
@param   kwargs      any and all arguments as keyword overrides, case-insensitive

Reimplemented in ConsoleSink, BagSink, LiveSink, AppSink, CsvSink, BaseDataSink, HtmlSink, PostgresSink, SqliteSink, McapSink, ParquetSink, SqlSink, and MultiSink.

Definition at line 41 of file outputs.py.

Member Function Documentation

◆ __enter__()

__enter__ (   self)
Context manager entry.

Definition at line 56 of file outputs.py.

◆ __exit__()

__exit__ (   self,
  exc_type,
  exc_value,
  traceback 
)
Context manager exit, closes sink.

Definition at line 60 of file outputs.py.

◆ autodetect()

autodetect (   cls,
  target 
)
Returns true if target is recognizable as output for this sink class.

Reimplemented in BagSink, and PostgresSink.

Definition at line 122 of file outputs.py.

◆ bind()

bind (   self,
  source 
)
Attaches source to sink.

Reimplemented in LiveSink, and MultiSink.

Definition at line 84 of file outputs.py.

◆ close()

close (   self)
Shuts down output, closing any files or connections.

Reimplemented in BagSink, LiveSink, MultiSink, CsvSink, BaseDataSink, HtmlSink, McapSink, ParquetSink, and SqlSink.

Definition at line 105 of file outputs.py.

◆ configure()

configure (   self,
  args = None,
**  kwargs 
)
Updates sink configuration.

@param   args    arguments as namespace or dictionary, case-insensitive
@param   kwargs  any and all arguments as keyword overrides, case-insensitive

Reimplemented in MultiSink.

Definition at line 88 of file outputs.py.

◆ emit()

emit (   self,
  topic,
  msg,
  stamp = None,
  match = None,
  index = None 
)
Outputs ROS message.

@param   topic  full name of ROS topic the message is from
@param   msg    ROS message
@param   stamp  message ROS timestamp, if not current ROS time
@param   match  ROS message with values tagged with match markers if matched, else None
@param   index  message index in topic, if any

Reimplemented in ConsoleSink, BagSink, LiveSink, AppSink, MultiSink, CsvSink, BaseDataSink, HtmlSink, SqliteSink, McapSink, ParquetSink, and SqlSink.

Definition at line 71 of file outputs.py.

◆ emit_meta()

emit_meta (   self)
Outputs source metainfo like bag header as debug stream, if not already emitted.

Reimplemented in ConsoleSink, AppSink, and MultiSink.

Definition at line 64 of file outputs.py.

◆ flush()

flush (   self)
Writes out any pending data to disk.

Reimplemented in MultiSink, and HtmlSink.

Definition at line 110 of file outputs.py.

◆ is_highlighting()

is_highlighting (   self)
Returns whether this sink requires highlighted matches.

Reimplemented in ConsoleSink, AppSink, MultiSink, and HtmlSink.

Definition at line 117 of file outputs.py.

◆ thread_excepthook()

thread_excepthook (   self,
  text,
  exc 
)
Handles exception, used by background threads.

Definition at line 113 of file outputs.py.

◆ validate()

validate (   self)
Returns whether sink prerequisites are met (like ROS environment set if LiveSink).

Reimplemented in ConsoleSink, BagSink, LiveSink, AppSink, MultiSink, CsvSink, BaseDataSink, HtmlSink, PostgresSink, SqliteSink, McapSink, ParquetSink, and SqlSink.

Definition at line 98 of file outputs.py.

Member Data Documentation

◆ args

args

Definition at line 50 of file outputs.py.

◆ DEFAULT_ARGS

DEFAULT_ARGS = dict(META=False)
static

Constructor argument defaults.

Definition at line 39 of file outputs.py.

◆ FILE_EXTENSIONS

tuple FILE_EXTENSIONS = ()
static

Auto-detection file extensions for subclasses, as (".ext", )

Definition at line 36 of file outputs.py.

◆ source

source

inputs.Source instance bound to this sink

Definition at line 54 of file outputs.py.

◆ valid

valid

Result of validate()

Definition at line 52 of file outputs.py.


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