You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ResourceFinder::findFileByName method then return any absolute path without changing it, but then searches for a filename without path using the YARP's way of searching for files (documented in https://www.yarp.it/latest//yarp_resource_finder_tutorials.html). In practice in most cases that file is located using the value of the YARP_ROBOT_NAME environment variable. This practice work fine if on a given system we only need to load configuration files for one given robot.
However, when we start embedding devices such as wholebodydynamics in simulated robots via the gazebo_yarp_robotinterface plugin, it may happen that you load different robots in the same machine. For example, with the stickBot simulation a common failure that I encountered in the last days is that the simulation did not started correctly because I forgot to set YARP_ROBOT_NAME=stickBot. Even worse, in the future somebody could forget to set correctly YARP_ROBOT_NAME, leading to silently corrupting the simulation results.
Proposed Solution
A quick solution for this is to support also for wholebodydynamics to load files using the ROS's style package:// or Gazebo's model:// URIs. Most of the logic for supporting those URIs is in iDynTree, so we would just need to expose it (see robotology/idyntree#942). Once that logic is exposed and used in wholebodydynamics, we could use it as:
coherently with how we specify the other configuration files in SDF, for example in the yarpRobotInterfaceConfigurationFile element, child of plugin for plugins of gazebo-yarp-plugins:
We could even think of submitting this functionality in YARP directly, so that any code that used rf.findFileByName could start supporting package:///model:// URIs in input.
We could even think of submitting this functionality in YARP directly, so that any code that used rf.findFileByName could start supporting package:///model:// URIs in input.
Problem
In the
wholebodydynamics
device we currently have amodelFile
parameter for specifying the model filename, that by default ismodel.urdf
(https://github.com/robotology/whole-body-estimators/tree/1d310fe342922ddd1095cdbeb6dbd4555dc01ce5/devices/wholeBodyDynamics#wholebodydynamicsdevice). This string is processed by this snippet of code to obtain the actual absolute filename (from this part of the code):The
ResourceFinder::findFileByName
method then return any absolute path without changing it, but then searches for a filename without path using the YARP's way of searching for files (documented in https://www.yarp.it/latest//yarp_resource_finder_tutorials.html). In practice in most cases that file is located using the value of theYARP_ROBOT_NAME
environment variable. This practice work fine if on a given system we only need to load configuration files for one given robot.However, when we start embedding devices such as
wholebodydynamics
in simulated robots via thegazebo_yarp_robotinterface
plugin, it may happen that you load different robots in the same machine. For example, with the stickBot simulation a common failure that I encountered in the last days is that the simulation did not started correctly because I forgot to setYARP_ROBOT_NAME=stickBot
. Even worse, in the future somebody could forget to set correctlyYARP_ROBOT_NAME
, leading to silently corrupting the simulation results.Proposed Solution
A quick solution for this is to support also for
wholebodydynamics
to load files using the ROS's stylepackage://
or Gazebo'smodel://
URIs. Most of the logic for supporting those URIs is in iDynTree, so we would just need to expose it (see robotology/idyntree#942). Once that logic is exposed and used inwholebodydynamics
, we could use it as:coherently with how we specify the other configuration files in SDF, for example in the
yarpRobotInterfaceConfigurationFile
element, child ofplugin
for plugins ofgazebo-yarp-plugins
:The text was updated successfully, but these errors were encountered: