Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow opening and using the contacts:o port without skinDynLib #110

Open
S-Dafarra opened this issue Apr 16, 2021 · 8 comments
Open

Allow opening and using the contacts:o port without skinDynLib #110

S-Dafarra opened this issue Apr 16, 2021 · 8 comments

Comments

@S-Dafarra
Copy link
Collaborator

S-Dafarra commented Apr 16, 2021

At the moment, the contacts:o port is opened only if useSkinForContacts is set to true. See

if (useSkinForContacts)
{
yDebug() << "wholeBodyDynamics Statistics: Opening skin contact list ports.";
tick = yarp::os::Time::now();
ok = this->openSkinContactListPorts(config);
if( !ok )
{
yError() << "wholeBodyDynamics: Problem in opening skin-related port.";
return false;
}
yDebug() << "wholeBodyDynamics Statistics: Skin contact list opened in " << yarp::os::Time::now() - tick << "s.";
}
and
bool WholeBodyDynamicsDevice::openSkinContactListPorts(os::Searchable& config)
{
bool ok = this->portContactsInput.open(portPrefix+"/skin_contacts:i");
if(!ok) return ok;
ok = this->portContactsOutput.open(portPrefix+"/contacts:o");
if(!ok) return ok;

I tried to set useSkinForContacts to true without setting the IDYNTREE_SKINDYNLIB_LINKS, but then I had a lot of these errors related to

bool ok = conversionHelper.updateSkinContactListFromLinkContactWrenches(estimator.model(),estimateExternalContactWrenches,contactsEstimated);
coming from https://github.com/robotology/idyntree/blob/db312bfe9f490f991250603f05cea84a8c156899/src/icub/include/iDynTree/skinDynLibConversionsImplementation.h#L338.

Even if the error seems harmless, this is not sustainable since the wholeBodyDynamics device runs as a part of the robot main yarprobotinterface, thus filling up the logger in a very short time.

I have tried understanding how to set the IDYNTREE_SKINDYNLIB_LINKS group, but I could not figure out a correct configuration. In addition, it requires to specify a set of numbers that I have no clue how to get right, especially for a robot like iCub3 that is covered only in a small portion by the skin.

Any hint @traversaro @prashanthr05?

@prashanthr05
Copy link
Contributor

prashanthr05 commented Apr 16, 2021

I have never used the skin with WBD so far. But maybe looking into skinDynLib and related configuration files could possibly help?

@S-Dafarra
Copy link
Collaborator Author

I have never used the skin with WBD so far. But maybe looking into skinDynLib and related configuration files could possibly help?

Would you have any input on how to get the numbers to put in there, like https://github.com/robotology/robots-configuration/blob/f3fef4277717ae87d825a9a46d994ccd21fef3ec/iCubGenova04/estimators/wholebodydynamics.xml#L24-L40?

@S-Dafarra
Copy link
Collaborator Author

After a F2F discussion with @traversaro, a possibility would be to open yet another port publishing the content of estimateExternalContactWrenches.

@prashanthr05
Copy link
Contributor

I have never used the skin with WBD so far. But maybe looking into skinDynLib and related configuration files could possibly help?

Would you have any input on how to get the numbers to put in there, like https://github.com/robotology/robots-configuration/blob/f3fef4277717ae87d825a9a46d994ccd21fef3ec/iCubGenova04/estimators/wholebodydynamics.xml#L24-L40?

On some reading, I think this file might have some relevant information, https://github.com/robotology/icub-main/blob/master/src/libraries/skinDynLib/include/iCub/skinDynLib/common.h#L43 related to the body part enums.

@S-Dafarra
Copy link
Collaborator Author

I have never used the skin with WBD so far. But maybe looking into skinDynLib and related configuration files could possibly help?

Would you have any input on how to get the numbers to put in there, like https://github.com/robotology/robots-configuration/blob/f3fef4277717ae87d825a9a46d994ccd21fef3ec/iCubGenova04/estimators/wholebodydynamics.xml#L24-L40?

On some reading, I think this file might have some relevant information, https://github.com/robotology/icub-main/blob/master/src/libraries/skinDynLib/include/iCub/skinDynLib/common.h#L43 related to the body part enums.

Ah nice finding!

@S-Dafarra
Copy link
Collaborator Author

I have never used the skin with WBD so far. But maybe looking into skinDynLib and related configuration files could possibly help?

Would you have any input on how to get the numbers to put in there, like https://github.com/robotology/robots-configuration/blob/f3fef4277717ae87d825a9a46d994ccd21fef3ec/iCubGenova04/estimators/wholebodydynamics.xml#L24-L40?

On some reading, I think this file might have some relevant information, https://github.com/robotology/icub-main/blob/master/src/libraries/skinDynLib/include/iCub/skinDynLib/common.h#L43 related to the body part enums.

Ah nice finding!

While the first number is more or less clear, I am not sure what the second number is 🤔

@traversaro
Copy link
Member

I have never used the skin with WBD so far. But maybe looking into skinDynLib and related configuration files could possibly help?

Would you have any input on how to get the numbers to put in there, like https://github.com/robotology/robots-configuration/blob/f3fef4277717ae87d825a9a46d994ccd21fef3ec/iCubGenova04/estimators/wholebodydynamics.xml#L24-L40?

On some reading, I think this file might have some relevant information, https://github.com/robotology/icub-main/blob/master/src/libraries/skinDynLib/include/iCub/skinDynLib/common.h#L43 related to the body part enums.

Ah nice finding!

While the first number is more or less clear, I am not sure what the second number is 🤔

It used to be a reference to the link index in the corresponding iKin Chain, so for LEFT_ARM https://github.com/robotology/icub-main/blob/4215771441724b7ece6412d56d7f884f70cca703/src/libraries/iKin/include/iCub/iKin/iKinFwd.h#L1081, LEFT_LEG https://github.com/robotology/icub-main/blob/4215771441724b7ece6412d56d7f884f70cca703/src/libraries/iKin/include/iCub/iKin/iKinFwd.h#L1235, etc etc. In reality they refer to the equivalent data structures in iDyn . See https://github.com/robotology/icub-main/blob/master/src/libraries/iDyn/src/iDynContact.cpp#L93 for the code that used it.

@traversaro
Copy link
Member

In robotology/icub-main#462 you can find a PR that we should revive to finally end this confusion.

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

No branches or pull requests

3 participants