osrf / capabilities

Implements the concept of capabilities as part of the robots-in-concert system.
Other
8 stars 26 forks source link

Recommendation on interfacing with capabilities #26

Closed bit-pirate closed 10 years ago

bit-pirate commented 10 years ago

While integrating the capabilities into the app manager, I started to wonder what is the recommended way to interface with the capability server. So far I did it the standard ROS way, i.e. using services and topics. When starting to work with the capability specifications, I realised this is not very convenient and when looking for a solution I found the various available python convenience functions, such as these here: https://github.com/osrf/capabilities/blob/master/src/capabilities/specs/interface.py

Hence, I wonder, if I should request improvements on the ROS API or just switch to use those python tools. What would be the recommended way and why?

bit-pirate commented 10 years ago

Issues #20 and #21 are related.

wjwwood commented 10 years ago

So to get a working copy of interfaces, providers, and semantic interfaces, use these:

Both the discovery module and the service discovery module eventually return a SpecIndex object, which can give you basically all the information you need:

http://docs.ros.org/hydro/api/capabilities/html/capabilities.discovery.html#capabilities.discovery.SpecIndex

If you are having trouble using the SpecIndex, please let me know and I can try and improve it for your use case. You can also see how I am using it in rqt_capabilities:

https://github.com/osrf/rqt_capabilities/blob/master/src/rqt_capabilities/dotcode.py#L42 (look at how the spec_index is being used.

wjwwood commented 10 years ago

I'm gonna close this one, please comment if you still have questions/issues.