Closed okvik closed 1 year ago
Hi,
Good catch!
As you have guessed, the whole point of simple_launch
is to focus on robotics so yeah, it is much better to hide this complexity inside the try_perform
function than going into details on adding quotes around IPs as launch arguments.
Thanks for the PR, I'll merge it and prepare a new release.
Consider a launch file that declares an argument meant to be used as a string, in this example an IP address.
Performing the substitution as above inside the opaque function context results in an
SyntaxError
being thrown since the given literal value10.0.30.112
-- as seen byast.literal_eval
-- cannot be interpreted as valid Python.My suggested fix is simply catching this exception and returning any such "invalid" inputs as strings.
It might be worth noting that one can bodge a fix on the user side as follows:
Note the additional quotes to force interpretation as a Python string.
P.S. Thank you for making this wonderful library. With it, I no longer feel existential dread when faced with launching off a few ROS 2 nodes...