Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
grepros.inputs.AppSource Class Reference
Inheritance diagram for grepros.inputs.AppSource:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, args=None, **kwargs)
 
def close (self)
 
def is_processable (self, topic, msg, stamp, index=None)
 
def mark_queue (self, topic, msg, stamp)
 
def push (self, topic, msg=None, stamp=None)
 
def read (self)
 
def read_queue (self)
 
- Public Member Functions inherited from grepros.inputs.Source
def __enter__ (self)
 
def __exit__ (self, exc_type, exc_value, traceback)
 
def __iter__ (self)
 
def bind (self, sink)
 
def close_batch (self)
 
def format_message_meta (self, topic, msg, stamp, index=None)
 
def format_meta (self)
 
def get_batch (self)
 
def get_message_class (self, typename, typehash=None)
 
def get_message_definition (self, msg_or_type)
 
def get_message_meta (self, topic, msg, stamp, index=None)
 
def get_message_type_hash (self, msg_or_type)
 
def get_meta (self)
 
def notify (self, status)
 
def thread_excepthook (self, text, exc)
 
def validate (self)
 
- Public Member Functions inherited from grepros.inputs.ConditionMixin
def close_batch (self)
 
def conditions_get_topics (self)
 
def conditions_register_message (self, topic, msg)
 
def conditions_set_topic_state (self, topic, pure)
 
def has_conditions (self)
 
def is_conditions_topic (self, topic, pure=True)
 

Static Public Attributes

 DEFAULT_ARGS
 Constructor argument defaults. More...
 
- Static Public Attributes inherited from grepros.inputs.Source
 DEFAULT_ARGS
 Constructor argument defaults. More...
 
string MESSAGE_META_TEMPLATE = "{topic} #{index} ({type} {dt} {stamp})"
 Template for message metainfo line. More...
 
- Static Public Attributes inherited from grepros.inputs.ConditionMixin
 DEFAULT_ARGS = dict(CONDITION=())
 Constructor argument defaults. More...
 
 TOPIC_RGX = re.compile(r"<topic\s+([^\s><]+)\s*>")
 

Private Member Functions

def _configure (self)
 

Private Attributes

 _queue
 
 _reading
 

Additional Inherited Members

- Public Attributes inherited from grepros.inputs.Source
 args
 
 bar
 ProgressBar instance, if any. More...
 
 preprocess
 Apply all filter arguments when reading, not only topic and type. More...
 
 sink
 outputs.Sink instance bound to this source More...
 
 topics
 All topics in source, as {(topic, typenane, typehash): total message count or None}. More...
 
 valid
 Result of validate() More...
 

Detailed Description

Produces messages from iterable or pushed data.

Definition at line 1023 of file inputs.py.

Constructor & Destructor Documentation

◆ __init__()

def grepros.inputs.AppSource.__init__ (   self,
  args = None,
**  kwargs 
)
@param   args                  arguments as namespace or dictionary, case-insensitive;
                       or iterable yielding messages
@param   args.topic            ROS topics to read if not all
@param   args.type             ROS message types to read if not all
@param   args.skip_topic       ROS topics to skip
@param   args.skip_type        ROS message types to skip
@param   args.start_time       earliest timestamp of messages to read
@param   args.end_time         latest timestamp of messages to read
@param   args.start_index      message index within topic to start from
@param   args.end_index        message index within topic to stop at
@param   args.unique           emit messages that are unique in topic
@param   args.select_field     message fields to use for uniqueness if not all
@param   args.noselect_field   message fields to skip for uniqueness
@param   args.nth_message      read every Nth message in topic
@param   args.nth_interval     minimum time interval between messages in topic
@param   args.condition        Python expressions that must evaluate as true
                       for message to be processable, see ConditionMixin
@param   args.iterable         iterable yielding (topic, msg, stamp) or (topic, msg);
                       yielding `None` signals end of content
@param   kwargs                any and all arguments as keyword overrides, case-insensitive

Reimplemented from grepros.inputs.Source.

Definition at line 1032 of file inputs.py.

Member Function Documentation

◆ _configure()

def grepros.inputs.AppSource._configure (   self)
private
Adjusts start/end time filter values to current time.

Definition at line 1148 of file inputs.py.

◆ close()

def grepros.inputs.AppSource.close (   self)
Closes current read() yielding, if any.

Reimplemented from grepros.inputs.Source.

Definition at line 1093 of file inputs.py.

◆ is_processable()

def grepros.inputs.AppSource.is_processable (   self,
  topic,
  msg,
  stamp,
  index = None 
)
Returns whether message passes source filters.

Reimplemented from grepros.inputs.Source.

Definition at line 1132 of file inputs.py.

◆ mark_queue()

def grepros.inputs.AppSource.mark_queue (   self,
  topic,
  msg,
  stamp 
)
Registers message produced from read_queue().

Definition at line 1115 of file inputs.py.

◆ push()

def grepros.inputs.AppSource.push (   self,
  topic,
  msg = None,
  stamp = None 
)
Pushes a message to be yielded from read().

@param   topic  topic name, or `None` to signal end of content
@param   msg    ROS message
@param   stamp  message ROS timestamp, defaults to current wall time if `None`

Definition at line 1121 of file inputs.py.

◆ read()

def grepros.inputs.AppSource.read (   self)
Yields messages from iterable or pushed data, as (topic, msg, ROS timestamp).

Blocks until a message is available, or source is closed.

Reimplemented from grepros.inputs.Source.

Definition at line 1065 of file inputs.py.

◆ read_queue()

def grepros.inputs.AppSource.read_queue (   self)
Returns (topic, msg, stamp) from push queue, or `None` if no queue
or message in queue is condition topic only.

Definition at line 1099 of file inputs.py.

Member Data Documentation

◆ _queue

grepros.inputs.AppSource._queue
private

Definition at line 1060 of file inputs.py.

◆ _reading

grepros.inputs.AppSource._reading
private

Definition at line 1061 of file inputs.py.

◆ DEFAULT_ARGS

grepros.inputs.AppSource.DEFAULT_ARGS
static
Initial value:
= dict(TOPIC=(), TYPE=(), SKIP_TOPIC=(), SKIP_TYPE=(), START_TIME=None,
END_TIME=None, START_INDEX=None, END_INDEX=None, UNIQUE=False,
SELECT_FIELD=(), NOSELECT_FIELD=(), NTH_MESSAGE=1, NTH_INTERVAL=0,
CONDITION=(), ITERABLE=None)

Constructor argument defaults.

Definition at line 1027 of file inputs.py.


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


grepros
Author(s): Erki Suurjaak
autogenerated on Sat Jan 6 2024 03:11:30