personalrobotics / aikido

Artificial Intelligence for Kinematics, Dynamics, and Optimization
https://personalrobotics.github.io/aikido/
BSD 3-Clause "New" or "Revised" License
213 stars 30 forks source link

Add util function to aikido::io to create a CompositeResourceRetriever #609

Open egordon opened 2 years ago

egordon commented 2 years ago

Currently, we almost exclusively use the CatkinResourceRetriever, which only accepts the package:// schema.

There are other ResourceRetrievers we can use that can accept other schemas (e.g. file://, dart://).

DART has a CompositeResourceRetriever object that is more flexible, delegating to individual retrievers based on the schema (or based on precedence, i.e., try one retriever, and then move on to another if the first fails).

To simplify the process of using ResourceRetrievers, we can add a utility function to the aikido::io module that returns a CompositeResourceRetriever that can handle at least package://, file://, dart:// and potentially no schema (i.e. file path relative to execution point) to use as a default.