I wanted to run a module in Gazebo and synchronize it through the Network clock instead of the System clock. To do so, I run Gazebo with the option -slibgazebo_yarp_clock.so and the module with YARP_CLOCK=/clock, but the module ignored completely this setting and used the System clock (the output of isNetworkClock() was always false).
After discussing with @traversaro and @pattacini, we found out that the Yarp Network was defined after some manipulation on the Resource Finder.
yarp::os::ResourceFinder &rf = yarp::os::ResourceFinder::getResourceFinderSingleton();
...
yarp::os::Network yarp;
if (!yarp::os::Network::checkNetwork(5.0))
{
yError() << " YARP server not available!";
return EXIT_FAILURE;
}
The problem was solved by defining the Yarp Network before the code related to the Resource Finder. Nevertheless, I think it would be beneficial to get an error message to avoid this kind of mistake.
@barbalberto
Guess it's all kind of related with PR #1277, similar to issue #1595.
As discussed, yarp::os::Network is mandatory for using YARP classes.
We will add documentation soon.
What about keeping this issue open until the documentation is ready?
We have a label :label: for that! :laughing:
Most helpful comment
We have a label :label: for that! :laughing: