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

Publishes messages to ROS topics. More...

Inheritance diagram for LiveSink:
Inheritance graph

Public Member Functions

 __init__ (self, args=None, **kwargs)
 
 bind (self, source)
 Attaches source to sink and blocks until connected to ROS.
 
 close (self)
 Shuts down publishers.
 
 emit (self, topic, msg, stamp=None, match=None, index=None)
 Publishes message to output topic.
 
 validate (self)
 Returns whether ROS environment is set for publishing, and output topic configuration is valid, emits error if not.
 
- Public Member Functions inherited from Sink
 __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

 valid
 
- Public Attributes inherited from Sink
 args
 
 source
 inputs.Source instance bound to this sink
 
 valid
 Result of validate()
 

Static Public Attributes

 DEFAULT_ARGS
 Constructor argument defaults.
 
- 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", )
 

Detailed Description

Publishes messages to ROS topics.

Definition at line 780 of file outputs.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
  args = None,
**  kwargs 
)
Parameters
argsarguments as namespace or dictionary, case-insensitive
args.livewhether reading messages from live ROS topics
args.queue_size_outpublisher queue size (default 10)
args.publish_prefixoutput topic prefix, prepended to input topic
args.publish_suffixoutput topic suffix, appended to output topic
args.publish_fixnamesingle output topic name to publish to, overrides prefix and suffix if given
args.metawhether to emit metainfo
args.verbosewhether to emit debug information
kwargsany and all arguments as keyword overrides, case-insensitive

Reimplemented from Sink.

Definition at line 800 of file outputs.py.

Member Function Documentation

◆ bind()

bind (   self,
  source 
)

Attaches source to sink and blocks until connected to ROS.

Reimplemented from Sink.

Definition at line 828 of file outputs.py.

◆ close()

close (   self)

Shuts down publishers.

Reimplemented from Sink.

Definition at line 852 of file outputs.py.

◆ emit()

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

Publishes message to output topic.

Reimplemented from Sink.

Definition at line 806 of file outputs.py.

◆ validate()

validate (   self)

Returns whether ROS environment is set for publishing, and output topic configuration is valid, emits error if not.

Reimplemented from Sink.

Definition at line 838 of file outputs.py.

Member Data Documentation

◆ DEFAULT_ARGS

DEFAULT_ARGS
static
Initial value:
= dict(LIVE=False, META=False, QUEUE_SIZE_OUT=10, PUBLISH_PREFIX="",
PUBLISH_SUFFIX="", PUBLISH_FIXNAME="", VERBOSE=False)

Constructor argument defaults.

Definition at line 784 of file outputs.py.

◆ valid

valid

Definition at line 849 of file outputs.py.


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