ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Long answer short, yes it supports conditionals but you have to use the dedicated conditional functionality and not plain python. See this answer I recently wrote that describes how to do what you are asking.

You can see the currently supported conditions in the source code

At time of writing you can use: IfCondition, UnlessCondition, LaunchConfigurationEquals, LaunchConfigurationNotEquals

The IfCondition and UnlessCondition follow these rules:

A string will be considered True if it matches 'true' or '1'.
A string will be considered False if it matches 'false' or '0'.
Any other string content (including empty string) will result in an error.

You can use LaunchConfigurationEquals, LaunchConfigurationNotEquals to cover cases where the launch configuration does not follow the rules above.

Hope this helps!