grepros 1.2.2
grep for ROS bag files and live topics
Loading...
Searching...
No Matches
Sink Class Reference

Output base class. More...

Inheritance diagram for Sink:
Inheritance graph

Public Member Functions

 __init__ (self, args=None, **kwargs)
 
 __enter__ (self)
 Context manager entry.
 
 __exit__ (self, exc_type, exc_value, traceback)
 Context manager exit, closes sink.
 
 autodetect (cls, target)
 Returns true if target is recognizable as output for this sink class.
 
 bind (self, source)
 Attaches source to sink.
 
 close (self)
 Shuts down output, closing any files or connections.
 
 configure (self, args=None, **kwargs)
 Updates sink configuration.
 
 emit (self, topic, msg, stamp=None, match=None, index=None)
 Outputs ROS message.
 
 emit_meta (self)
 Outputs source metainfo like bag header as debug stream, if not already emitted.
 
 flush (self)
 Writes out any pending data to disk.
 
 is_highlighting (self)
 Returns whether this sink requires highlighted matches.
 
 thread_excepthook (self, text, exc)
 Handles exception, used by background threads.
 
 validate (self)
 Returns whether sink prerequisites are met (like ROS environment set if LiveSink).
 

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 
)
Parameters
argsarguments as namespace or dictionary, case-insensitive
args.metawhether to emit metainfo
kwargsany 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 47 of file outputs.py.

Member Function Documentation

◆ __enter__()

__enter__ (   self)

Context manager entry.

Definition at line 57 of file outputs.py.

◆ __exit__()

__exit__ (   self,
  exc_type,
  exc_value,
  traceback 
)

Context manager exit, closes sink.

Definition at line 61 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 123 of file outputs.py.

◆ bind()

bind (   self,
  source 
)

Attaches source to sink.

Reimplemented in LiveSink, and MultiSink.

Definition at line 85 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 106 of file outputs.py.

◆ configure()

configure (   self,
  args = None,
**  kwargs 
)

Updates sink configuration.

Parameters
argsarguments as namespace or dictionary, case-insensitive
kwargsany and all arguments as keyword overrides, case-insensitive

Reimplemented in MultiSink.

Definition at line 95 of file outputs.py.

◆ emit()

emit (   self,
  topic,
  msg,
  stamp = None,
  match = None,
  index = None 
)

Outputs ROS message.

Parameters
topicfull name of ROS topic the message is from
msgROS message
stampmessage ROS timestamp, if not current ROS time
matchROS message with values tagged with match markers if matched, else None
indexmessage index in topic, if any

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

Definition at line 81 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 65 of file outputs.py.

◆ flush()

flush (   self)

Writes out any pending data to disk.

Reimplemented in MultiSink, and HtmlSink.

Definition at line 111 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 118 of file outputs.py.

◆ thread_excepthook()

thread_excepthook (   self,
  text,
  exc 
)

Handles exception, used by background threads.

Definition at line 115 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 99 of file outputs.py.

Member Data Documentation

◆ args

args

Definition at line 51 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 55 of file outputs.py.

◆ valid

valid

Result of validate()

Definition at line 53 of file outputs.py.


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