robotology / whole-body-estimators

YARP devices that implement estimators for humanoid robots.
27 stars 12 forks source link

wholeBodyDynamics: the yarprobotinterface get stuck when launched from the urdf #126

Closed Nicogene closed 2 years ago

Nicogene commented 2 years ago

Adding the yarprobotinterface plugin instatiation in the urdf like this:

  <gazebo>
      <plugin name="robotinterface" filename="libgazebo_yarp_robotinterface.so">
      <yarpRobotInterfaceConfigurationFile>model://iCub/conf/icub.xml</yarpRobotInterfaceConfigurationFile>
    </plugin>
  </gazebo>

If icub.xml includes an XML running the wholeBodyDynamics device the yarprobotinterface get stuck because wbd await that some imu data is written, but the imu is not ready until the model is not completely loaded in gazebo

https://github.com/robotology/whole-body-estimators/blob/915b27e5e011a74fe1ca6eb0d6c63817e7e7c035/devices/wholeBodyDynamics/WholeBodyDynamicsDevice.cpp#L1812-L1829

In order to solve this chicken-egg problem, as @traversaro suggested it may be useful to add a flag for not reading from the IMU at startup