Skip to content

ros2 nodl show not finding nodl descriptions when installed from subdirectory with ament_nodl #41

@wjwwood

Description

@wjwwood

So, I have a line like this in my example:

nodl_export_node_description_file(nodl/fake_imu.nodl.xml)

This installs the file and an ament_index marker file to:

$ tree install/
install/
├── ros2launch_security_examples
│   └── share
│       ├── ament_index
│       │   └── resource_index
│       │       ├── nodl_desc
│       │       │   └── ros2launch_security_examples
...
│       └── ros2launch_security_examples
│           ├── nodl
│           │   ├── fake_imu.nodl.xml
...

The ament_index marker file contains:

$ cat install/ros2launch_security_examples/share/ament_index/resource_index/nodl_desc/ros2launch_security_examples
share/ros2launch_security_examples/nodl/fake_imu.nodl.xml
share/ros2launch_security_examples/nodl/imu_sink.nodl.xml

But if I run ros2 nodl I get:

$ ros2 nodl show ros2launch_security_examples
ros2launch_security_examples has no NoDL files in its ament index.

The expected behavior is that it finds these files, but it does not.

If I move the .nodl.xml files out of the subdirectory, then everything works:

$ ros2 nodl show ros2launch_security_examples
{'name': 'imu_sink', 'executable': 'imu_sink', 'actions': {}, 'parameters': {}, 'services': {}, 'topics': {'imu': {'name': 'imu', 'type': 'sensor_msgs/msg/Imu', 'role': <PubSubRole.SUBSCRIPTION: 'subscription'>}}}
{'name': 'fake_imu', 'executable': 'fake_imu', 'actions': {}, 'parameters': {}, 'services': {}, 'topics': {'imu': {'name': 'imu', 'type': 'sensor_msgs/msg/Imu', 'role': <PubSubRole.PUBLISHER: 'publisher'>}}}

Based on the documentation of nodl_export_node_description_file() and the contents of the ament_index file, I would have expected any hierarchy of directories for the nodl description files to be ok. But the python library (and therefore the cli tool) seem to expect all description files to be in the root of the package's share directory:

https://github.com/ubuntu-robotics/nodl/blob/3457cbf9242738ab831f84a0360cffb175d1f415/nodl_python/nodl/_index.py#L38

So is this expected behavior or maybe a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions