New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[launch] add concept of Conditions #105

Closed
wjwwood opened this Issue Jul 11, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@wjwwood
Copy link
Member

wjwwood commented Jul 11, 2018

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 like launch.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, like CompoundCondition or AndCondition/OrCondition.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment