Provides topic conditions evaluation.
Evaluates a set of Python expressions, with a namespace of:
- msg: current message being checked
- topic: current topic being read
- <topic /any/name> messages in named or wildcarded topic
<topic ..> gets replaced with an object with the following behavior:
- len(obj) -> number of messages processed in topic
- bool(obj) -> whether there are any messages in topic
- obj[pos] -> topic message at position (from latest if negative, first if positive)
- obj.x -> attribute x of last message
All conditions need to evaluate as true for a message to be processable.
If a condition tries to access attributes of a message not yet present,
condition evaluates as false.
If a condition topic matches more than one real topic (by wildcard or by
different types in one topic), evaluation is done for each set of
topics separately, condition passing if any set passes.
Example condition: `<topic */control_enable>.data and <topic */cmd_vel>.linear.x > 0`
`and <topic */cmd_vel>.angular.z < 0.02`.
Definition at line 258 of file inputs.py.
| __init__ |
( |
|
self, |
|
|
|
args = None, |
|
|
** |
kwargs |
|
) |
| |
@param args arguments as namespace or dictionary, case-insensitive
@param args.condition Python expressions that must evaluate as true
for message to be processable, see ConditionMixin
@param kwargs any and all arguments as keyword overrides, case-insensitive
Reimplemented in BagSource, LiveSource, and AppSource.
Definition at line 365 of file inputs.py.