arg and node with identical names on same level cause AttributeError
heuristicus opened this issue · 3 comments
Here's a launch file which can be used to reproduce the problem:
<launch>
<arg name="turtlesim_name" default="turtlesim_name"/>
<node pkg="turtlesim" type="turtlesim_node" name="turtlesim_name"/>
</launch>
The error that results is 'Node' object has no attribute 'value'
. This is caused by an attempted merge between the arg object and node object, on this line. It's more likely that this is a problem caused by the _add_to_tree
function not being specific enough when there are duplicate keys.
If the launch file is this way round, then the arg is not displayed at all.
<launch>
<node pkg="turtlesim" type="turtlesim_node" name="turtlesim_name"/>
<arg name="turtlesim_name" default="turtlesim_name"/>
</launch>
In the case of parameters, it works fine because they have a /
prepended to the string, so the key is not identical.
Perhaps instead of using only the name of the item as the key, it could be a tuple (item_name, item_number)
or something similar, where the number in the second tuple field is incremented if there are two identically named items on the same level.
I'm having a similar issue with a complex launchfile, so I'll subscribe to updates on this.
Thanks for the really cool package.
Thanks for the feedback to both of you! I already have a preliminary fix locally and should be able to finally test and commit it presumably tomorrow evening after ICRA has finished.
Many thanks @pschillinger !