External projects may want to be able to use the gzyarp::DeviceRegistry class, mainly for:
Get a pointer to the YARP devices created by gz-sim-yarp-plugins
Add new YARP devices to the gzyarp::DeviceRegistry singleton, so that devices added by plugins written in the style of gz-sim-yarp-plugins but mantained in downstream repos can create devices that then can be accessed by gz-sim-yarp-robotinterface-system .
#include <iostream>
#include <gzyarp/DeviceRegistry.h>
int main()
{
std::vector<std::string> modelScopedNames;
// This functions does no exist at the moment
gzyarp::DeviceRegistry::getHandler()->getModelScopedNames(modelScopedNames);
// Perform some operations with gzyarp::DeviceRegistry
// For example, print the number of devices
std::cout << "Number of models for which registered devices exist: " << modelScopedNames.size() << std::endl;
return 0;
}
External projects may want to be able to use the
gzyarp::DeviceRegistry
class, mainly for:gz-sim-yarp-plugins
gzyarp::DeviceRegistry
singleton, so that devices added by plugins written in the style ofgz-sim-yarp-plugins
but mantained in downstream repos can create devices that then can be accessed bygz-sim-yarp-robotinterface-system
.The example can be something like:
CMakeLists.txt
example.cpp: