Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

WholeBodyDynamics device not launched when running launch-wholebodydynamics.xml #277

Closed
gabrielenava opened this issue Jul 3, 2019 · 19 comments

Comments

@gabrielenava
Copy link
Collaborator

The wholebodydynamics device that should be launched by the launch-wholebodydynamics.xml file is actually not launched. Namely, I am talking about this line: https://github.com/robotology/codyco-modules/blob/master/src/devices/wholeBodyDynamics/app/launch-wholebodydynamics-icub-six-fts-sim.xml#L95

Here there are no errors: the line is simply skipped and I have no idea why. But the file exists, and if I substitute the path to the file with the content of the file inside launch-wholebodydynamics.xml` I am finally able to run the Yoga demo. But this is not a good solution.

@traversaro
Copy link
Contributor

Did you fixed the problem in #276 ?
What is location of the files that you are trying to run in the yarprobotinterface?

@gabrielenava
Copy link
Collaborator Author

I fixed the invalid DTD problem locally on my laptop, see #276 (comment). I will open a PR for fixing the remote branch too.

the launch-wholebodydynamics.xml file is located in $PATH_TO_SUPERBUILD_INSTALL/share/codyco/robots/iCubGazeboV2_5/ and the wholebodydynamics-external.xml is located in $PATH_TO_SUPERBUILD_INSTALL/share/codyco/robots/iCubGazeboV2_5/estimators. Superbuild paths seem to be set correctly an I set them by sourcing the setup.sh file.

@traversaro
Copy link
Contributor

Have you tried to test it with another devices file to check if that is loaded instead?

@gabrielenava
Copy link
Collaborator Author

All the other devices in the file are correctly loaded: https://github.com/robotology/codyco-modules/blob/master/src/devices/wholeBodyDynamics/app/launch-wholebodydynamics-icub-six-fts-sim.xml#L89

The wholebodydynamics device itself is loaded without any problem if I copy the content of wholebodydynamics-external.xml instead of using the path to the xml file as specified currently in the launch-wholebodydynamics.xml file: https://github.com/robotology/codyco-modules/blob/master/src/devices/wholeBodyDynamics/app/launch-wholebodydynamics-icub-six-fts-sim.xml#L95

@traversaro
Copy link
Contributor

I got it. I asked if you could load any other devices files, similar to wholebodydynamics-external.xml but with less devices or something similar.

@gabrielenava
Copy link
Collaborator Author

I did now the following test:

  • I modified the launch-wholebodydynamics.xml. I removed the right foot FT sensor device and I put it in a file called device-test.xml. Then, I modified this path to point my device-test file instead of wholebodydynamics-external.xml. The two files are in the same folder.

I run YARP_ROBOT_NAME=iCubgazeboV2_5 yarprobotinterface --config launch-wholebodydynamics.xml. The last device loaded is the left foot FT:

[INFO]created device <analogsensorclient>. See C++ class AnalogSensorClient for documentation.
yarp: Port /wholeBodyDynamics/l_foot_ft_sensor active at tcp://140.93.4.152:10079/
yarp: Port /wholeBodyDynamics/l_foot_ft_sensor/rpc:o active at tcp://140.93.4.152:10080/
yarp: Receiving input from /icubSim/left_foot/analog:o to /wholeBodyDynamics/l_foot_ft_sensor using udp
yarp: Sending output from /wholeBodyDynamics/l_foot_ft_sensor/rpc:o to /icubSim/left_foot/analog:o/rpc:i using tcp
[INFO]created device <analogsensorclient>. See C++ class AnalogSensorClient for documentation.

Therefore it seems the problem is not in the wholebodydynamics-external.xml file.

@prashanthr05
Copy link

I also experience this issue.

@prashanthr05
Copy link

prashanthr05 commented Jul 4, 2019

I made the following quick hack and it apparently works,

In the launch-wholebodydynamics-icub-six-fts-sim.xml
I changed
https://github.com/robotology/codyco-modules/blob/75a681590889a13967351911f694dd7a0a9c14df/src/devices/wholeBodyDynamics/app/launch-wholebodydynamics-icub-six-fts-sim.xml#L2
to

<robot name="@WBD_YARP_ROBOT_NAME" portprefix="icubSim" build="1"  xmlns:xi="http://www.w3.org/2001/XInclude">

Then I changed
https://github.com/robotology/codyco-modules/blob/75a681590889a13967351911f694dd7a0a9c14df/src/devices/wholeBodyDynamics/app/launch-wholebodydynamics-icub-six-fts-sim.xml#L95
to

    <xi:include href="estimators/wholebodydynamics-external.xml" />

In the wholebodydynamics-icub-external-six-fts-sim.xml,
I commented the lines ,
https://github.com/robotology/codyco-modules/blob/75a681590889a13967351911f694dd7a0a9c14df/src/devices/wholeBodyDynamics/app/wholebodydynamics-icub-external-six-fts-sim.xml#L4
and
https://github.com/robotology/codyco-modules/blob/75a681590889a13967351911f694dd7a0a9c14df/src/devices/wholeBodyDynamics/app/wholebodydynamics-icub-external-six-fts-sim.xml#L75

then finally changed,
https://github.com/robotology/codyco-modules/blob/75a681590889a13967351911f694dd7a0a9c14df/src/devices/wholeBodyDynamics/app/wholebodydynamics-icub-external-six-fts-sim.xml#L5
to

<device xmlns:xi="http://www.w3.org/2001/XInclude" name="wholebodydynamics" type="wholebodydynamics">

@prashanthr05
Copy link

prashanthr05 commented Jul 4, 2019

Were there any recent changes in the parsing done by yarprobotinterface?

The only change as listed in the changelog of YARP 3.2 release seems to be,

Tools
yarprobotinterface
YARP//DTD yarprobotinterface 3.0//EN is now the default parser for robot xml configuration files.
yarprobotinterface will not run anymore deprecated DTD format v1.0

@GiulioRomualdi
Copy link
Contributor

Same problem with the latest version of YARP

@GiulioRomualdi
Copy link
Contributor

Thanks to @prashanthr05 suggestion the problem is solved. I open a PR

@traversaro
Copy link
Contributor

Guys, do you have any idea why this is now necessary? I am a bit out of time to check this out, but it could be interesting.

@prashanthr05
Copy link

Guys, do you have any idea why this is now necessary? I am a bit out of time to check this out, but it could be interesting.

I faced this problem after updating YARP to 3.2, specifically to this commit robotology/yarp@7ee03f8. and this line

<devices file="estimators/wholebodydynamics-external.xml" />

in the configuration file was not being parsed by the yarprobotinterface.

@traversaro
Copy link
Contributor

Yes, I was asking because I fear that we are actually doing a workaround but the actual bug is in YARP, but if no one has bandwidth to investigate that I am ok to merge Giulio's PR. Opening a bug in YARP without a minimun working example is probably just creating noise.

@nunoguedelha
Copy link
Collaborator

I just experienced the same issue. Actually the issue is solved by using the current format supported by YARP for including device config files (we are more familiar with it now).
I just replaced

<!-- estimators -->
<devices file="estimators/wholebodydynamics-external.xml" />

by

<!-- estimators -->
<devices>
<xi:include href="estimators/wholebodydynamics-external.xml" />
</devices>

As it is done in for any other inclusion.
@prashanthr05 had already done this more or less, but I didn't need the other workarounds:

  • There is no need for changing the included file for removing the tag <devices>.
  • The following prefix is no more required
<device xmlns:xi="http://www.w3.org/2001/XInclude" name=... />
  • Nor setting the xmlns:xi include tool at the top (apparently), probably becasue now it is a default?

I'm pushing a fix in the same PR opened by @GiulioRomualdi #280.

@nunoguedelha
Copy link
Collaborator

CC @CarlottaSartore

@traversaro
Copy link
Contributor

Thanks @nunoguedelha

@nunoguedelha
Copy link
Collaborator

Fixed by by #280 .

@traversaro
Copy link
Contributor

Thanks @nunoguedelha .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants