Ament index ressources through unified cli interface

Hi,

While jumping from project to project you might want to know what resources are available for discoverability (plugins, config files or other custom resources).
And ament_index_python provide the exact tooling in order to do that. However this is yet another endpoint one user needs to know.
What do we think about having integration with ros2cli. And proposing a new package named ros2index doing exactly what ament_index_python proposes.

1 Like

Could you maybe add a few examples of what you have on mind? (i.e. CLI command plus its output)

Sorry for coming back at you very late.

As of now you can do

$ ament_index nav2_costmap_2d__pluginlib__plugin
nav2_costmap_2d /opt/ros/humble
nonpersistent_voxel_layer       /opt/ros/humble
$ ament_index nav2_costmap_2d__pluginlib__plugin nav2_costmap_2d
/opt/ros/humble
<<<
share/nav2_costmap_2d/test/regression/order_layer.xml
share/nav2_costmap_2d/costmap_plugins.xml

>>>

And I’d like to have this api also available from ros2cli for having one entrypoint for everything.

e.g.

$ ros2 index list 
nav2_amcl__pluginlib__plugin
nav2_core__pluginlib__plugin
nav2_costmap_2d__pluginlib__plugin
nav2_mppi_controller__pluginlib__plugin
nav2_waypoint_follower__pluginlib__plugin

$ ros2 index get  nav2_costmap_2d__pluginlib__plugin
nav2_costmap_2d /opt/ros/humble
nonpersistent_voxel_layer       /opt/ros/humble
$ ros2 index get nav2_costmap_2d__pluginlib__plugin nav2_costmap_2d
/opt/ros/humble
<<<
share/nav2_costmap_2d/test/regression/order_layer.xml
share/nav2_costmap_2d/costmap_plugins.xml

>>>

And one to list the type of ressources one package index

$ ros2 pkg index nav2_costmap_2d
<<<
packages
rosidl_interfaces
parent_prefix_path
package_run_dependencies
nav2_costmap_2d__pluginlib__plugin
>>>