-
Notifications
You must be signed in to change notification settings - Fork 165
Closed
Description
The concept of a "Condition" is a predicate that applies to certain kinds of entities like (but not exclusively) launch.Action.
This is the equivalent of if and unless attributes in roslaunch from ROS 1:
https://wiki.ros.org/roslaunch/XML#if_and_unless_attributes
The proposed launch.Condition would:
- take a predicate which would be a list of substitutions
- convert the list of substitutions into a string when the associated entity is visited
- evaluate the resulting predicate string for true/false
There could be sub classes for convenience like launch.IfCondition and launch.UnlessCondition.
Conditions will need to be part of the interface of any entity which can be affected by them (i.e. either Action or LaunchDescriptionEntity should have a condition argument to the constructor.
One thing I haven't decided on is how to combine multiple conditions, the options are:
- only ever take one condition, require compound conditions to be evaluated with
Substitutions likelaunch.substitutions.PythonExpression - take a list of conditions, and do a boolean 'and' across all of them
- take only one condition, but have additional convenience classes based on
Condition, likeCompoundConditionorAndCondition/OrCondition.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request