pschillinger / rqt_launchtree

An RQT plugin for hierarchical launchfile configuration introspection.
BSD 3-Clause "New" or "Revised" License
47 stars 21 forks source link

arg and node with identical names on same level cause AttributeError #1

Closed heuristicus closed 8 years ago

heuristicus commented 8 years ago

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.

felixduvallet commented 8 years ago

I'm having a similar issue with a complex launchfile, so I'll subscribe to updates on this. Thanks for the really cool package.

pschillinger commented 8 years ago

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.

felixduvallet commented 8 years ago

Many thanks @pschillinger !