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

Public Member Functions

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

Public Attributes

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

Static Public Attributes

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

Detailed Description

Produces messages from iterable or pushed data.

Definition at line 1242 of file inputs.py.

Constructor & Destructor Documentation

◆ __init__()

__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, starting from first
@param   args.nth_interval     minimum time interval between messages in topic,
                               as seconds or ROS duration
@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 Source.

Definition at line 1251 of file inputs.py.

Member Function Documentation

◆ close()

close (   self)
Closes current read() yielding, if any.

Reimplemented from Source.

Definition at line 1313 of file inputs.py.

◆ is_processable()

is_processable (   self,
  topic,
  msg,
  stamp,
  index = None 
)
Returns whether message passes source filters; registers status.

Reimplemented from Source.

Definition at line 1355 of file inputs.py.

◆ mark_queue()

mark_queue (   self,
  topic,
  msg,
  stamp 
)
Registers message produced from read_queue().

Definition at line 1336 of file inputs.py.

◆ push()

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 1343 of file inputs.py.

◆ read()

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 Source.

Definition at line 1283 of file inputs.py.

◆ read_queue()

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 1319 of file inputs.py.

◆ validate()

validate (   self)
Returns whether configured arguments are valid, prints error if not.

Reimplemented from Source.

Definition at line 1369 of file inputs.py.

Member Data Documentation

◆ DEFAULT_ARGS

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 1246 of file inputs.py.

◆ valid

valid

Definition at line 1372 of file inputs.py.


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