grepros 1.2.2
grep for ROS bag files and live topics
|
Output base class. More...
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", ) | |
Output base class.
Definition at line 32 of file outputs.py.
__init__ | ( | self, | |
args = None , |
|||
** | kwargs | ||
) |
args | arguments as namespace or dictionary, case-insensitive |
args.meta | whether to emit metainfo |
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 47 of file outputs.py.
__enter__ | ( | self | ) |
Context manager entry.
Definition at line 57 of file outputs.py.
__exit__ | ( | self, | |
exc_type, | |||
exc_value, | |||
traceback | |||
) |
Context manager exit, closes sink.
Definition at line 61 of file outputs.py.
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 | ( | self, | |
source | |||
) |
Attaches source to sink.
Reimplemented in LiveSink, and MultiSink.
Definition at line 85 of file outputs.py.
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 | ( | self, | |
args = None , |
|||
** | kwargs | ||
) |
Updates sink configuration.
args | arguments as namespace or dictionary, case-insensitive |
kwargs | any and all arguments as keyword overrides, case-insensitive |
Reimplemented in MultiSink.
Definition at line 95 of file outputs.py.
emit | ( | self, | |
topic, | |||
msg, | |||
stamp = None , |
|||
match = None , |
|||
index = None |
|||
) |
Outputs ROS message.
topic | full name of ROS topic the message is from |
msg | ROS message |
stamp | message ROS timestamp, if not current ROS time |
match | ROS message with values tagged with match markers if matched, else None |
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 81 of file outputs.py.
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 | ( | self | ) |
Writes out any pending data to disk.
Reimplemented in MultiSink, and HtmlSink.
Definition at line 111 of file outputs.py.
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 | ( | self, | |
text, | |||
exc | |||
) |
Handles exception, used by background threads.
Definition at line 115 of file outputs.py.
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.
args |
Definition at line 51 of file outputs.py.
|
static |
Constructor argument defaults.
Definition at line 39 of file outputs.py.
|
static |
Auto-detection file extensions for subclasses, as (".ext", )
Definition at line 36 of file outputs.py.
source |
inputs.Source instance bound to this sink
Definition at line 55 of file outputs.py.
valid |
Result of validate()
Definition at line 53 of file outputs.py.