|
| __init__ (self, args=None, **kwargs) |
|
| close_batch (self) |
| Clears cached messages.
|
|
| conditions_get_topics (self) |
| Returns a list of all topics used in conditions (may contain wildcards).
|
|
| conditions_register_message (self, topic, msg) |
| Retains message for condition evaluation if in condition topic.
|
|
| conditions_set_topic_state (self, topic, pure) |
| Sets whether topic is purely used for conditions not matching.
|
|
| has_conditions (self) |
| Returns whether there are any conditions configured.
|
|
| is_conditions_topic (self, topic, pure=True) |
| Returns whether topic is used for checking condition.
|
|
| is_processable (self, topic, msg, stamp, index=None) |
| Returns whether message passes passes current state conditions, if any.
|
|
| validate (self) |
| Returns whether conditions have valid syntax, sets options, prints errors.
|
|
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 <topic */control_enable>.data and <topic */cmd_vel>.linear.x > 0
and <topic */cmd_vel>.angular.z < 0.02
.
Definition at line 286 of file inputs.py.