Use value of LaunchConfiguration in ROS2 launch file like a variable
Hello,
I want to add two strings together, passed as LaunchConfiguration in my launch file. I have found many answers on that regarding a boolean and to use conditions instead, but is there something simillar to work with the value of the launch description directly in the code? (e.g. use the path to read a file )
EDIT:
I found IfCondition(PythonExpression(["'", LaunchConfiguration('test'), "' == 'true']))._predicate_func(LaunchContext)).perform(LaunchContext)
Maybe something simmilar can be used to get the real value.
launch_ros.parameter_descriptions.ParameterValue(value, value_type=str)
could also be a possible option
Thanks
You need to check opaquefunction for retrieving the value as string and manipulating according to your needs. Seems to be multiple stages in launch. You can read more about it here #q396345