Can't pass "gazebo" as the value for launch file argument

asked 2022-01-08 17:50:33 -0500

aborger gravatar image

updated 2022-01-08 18:15:36 -0500

I found an interesting bug which I tested on two different machines running Ros Melodic. I was trying to pass "gazebo" to a launch file from another launch file, but it was acting as if no value being passed. Any other string works, but not gazebo.

I created two simple launch files to test with:

File: r.launch

<launch>
  <arg name="r"/>
  <param name="semantic" textfile="$(find package)/config/$(arg r).srdf"/>
 </launch>

File: test.launch

<launch>
  <include file="$(find package)/launch/r.launch">
    <arg name="r" value="gazebo"/>
  </include>
</launch>

If I launch test.launch I get "RLException: requires the 'r' arg to be set" which is what would happen if I did not pass a value for r at all. Interesting enough this only occurs when passing "gazebo" from another launch file, it can be passed successfully from a terminal.

I suppose this is not a large issue, but it did cost me a few hours to figure out why my variable was not getting set when I was clearly setting it to "gazebo".

edit retag flag offensive close merge delete

Comments

Actually, I suppose the issue is far stranger than that. I changed the name of the srdf file I was trying to load to sim, but now the issue happens when I try to pass sim...

aborger gravatar image aborger  ( 2022-01-08 18:21:39 -0500 )edit