Classes | |
class | Empty |
class | Message |
class | NoMessageException |
class | Topic |
Public Member Functions | |
def | __init__ (self, args=None, **kwargs) |
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) |
def | is_processable (self, topic, msg, stamp, index=None) |
Static Public Attributes | |
DEFAULT_ARGS = dict(CONDITION=()) | |
Constructor argument defaults. More... | |
TOPIC_RGX = re.compile(r"<topic\s+([^\s><]+)\s*>") | |
Private Member Functions | |
def | _configure_conditions (self, args) |
def | _get_topic_instance (self, topic, remap=None) |
Private Attributes | |
_conditions | |
{condition with <topic x> as get_topic("x"): compiled code object} More... | |
_firstmsgs | |
_lastmsgs | |
_topic_limits | |
_topic_states | |
_topics_per_condition | |
_wildcard_topics | |
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`.
def grepros.inputs.ConditionMixin.__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 grepros.inputs.AppSource, grepros.inputs.TopicSource, and grepros.inputs.BagSource.
|
private |
|
private |
def grepros.inputs.ConditionMixin.close_batch | ( | self | ) |
Clears cached messages.
Reimplemented in grepros.inputs.BagSource.
def grepros.inputs.ConditionMixin.conditions_get_topics | ( | self | ) |
def grepros.inputs.ConditionMixin.conditions_register_message | ( | self, | |
topic, | |||
msg | |||
) |
def grepros.inputs.ConditionMixin.conditions_set_topic_state | ( | self, | |
topic, | |||
pure | |||
) |
def grepros.inputs.ConditionMixin.has_conditions | ( | self | ) |
def grepros.inputs.ConditionMixin.is_conditions_topic | ( | self, | |
topic, | |||
pure = True |
|||
) |
def grepros.inputs.ConditionMixin.is_processable | ( | self, | |
topic, | |||
msg, | |||
stamp, | |||
index = None |
|||
) |
Returns whether message passes passes current state conditions, if any.
Reimplemented in grepros.inputs.AppSource, grepros.inputs.TopicSource, and grepros.inputs.BagSource.
|
private |
|
private |
|
static |