-
Notifications
You must be signed in to change notification settings - Fork 81
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
Command substitution: special characters inside XML comments causes launch to fail #136
Comments
That seems extremely weird. |
Wild guess: we're YAML parsing command output. Try adding quotes before and after the command substitution. |
Ouch! Yes, that's true, parameters values that are strings are parsed like yaml. |
Do you mean like this? <launch>
<node pkg="demo_nodes_cpp" exec="talker" output="screen">
<param name="foo" value="'$(command 'cat foo.urdf')'" />
</node>
</launch> I get the same error. |
Here's an example output with --debug:
|
TL;DR no, you need duplicated single quotes 🤦♂️ <launch>
<node pkg="demo_nodes_cpp" exec="talker" output="screen">
<param name="foo" value="''$(command 'cat foo.urdf')''" />
</node>
</launch> long version: We should definitly fix this, before the problem gets proliferated in multiple launch files. |
So I'm facing something similar to this issue. Has |
Currently, the following should work: <launch>
<node pkg="demo_nodes_cpp" exec="talker" output="screen">
<param name="foo" value="''$(command 'pwd')''" />
</node>
</launch> |
I just got back to looking at this. It almost works for me. I'm doing: <node name="robot_state_publisher" pkg="robot_state_publisher" exec="robot_state_publisher">
<param name="robot_description" value="''$(command '$(find-pkg-prefix xacro)/bin/xacro $(find-pkg-share krex2_description)/urdf/rp1a_robot.xacro')''"/>
</node> Which gives me this output: [ERROR] [launch]: Caught exception in launch (see debug for traceback): expected '<document start>', but found '<scalar>'
in "<unicode string>", line 96, column 11:
I'm not sure if just specifying tw ...
^ If I remove all the single-quotes from the comments in my xacro file, I can launch my robot. Any thoughts on what can be done about this? |
🤦♂️ That's a fun one.
I will describe first the problem. The value of |
I've actually started to work in a fix , though I haven't had time to finish it. |
Moving to |
This can be fixed now by avoiding using <launch>
<node pkg="demo_nodes_cpp" exec="talker" output="screen">
<param name="foo" value="$(command 'cat foo.urdf')" type="str"/>
</node>
</launch> The fix was introduced in #137. |
Bug report
Required Info:
Specifically, I've noticed that colons (
:
) and tab characters are not working.Steps to reproduce issue
I ran into this issue trying to pass a URDF from xacro to robot_state_publisher, like the example here. For some reason, if the URDF/xacro file contains a colon (
:
) or a tab character inside of an XML comment, then launch fails.Here's my example URDF file
foo.urdf
:And my launch file:
Expected behavior
The launch file succeeds and we see the talker node chatting.
Actual behavior
Error:
Additional information
The error seems to specifically occur if there is a colon followed by a space. E.g. making the following change works fine:
Replacing the colcon with a tab character also triggers the same error:
The text was updated successfully, but these errors were encountered: