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

Add process dynamics class for external contacts #759

Merged

Conversation

isorrentino
Copy link
Collaborator

@isorrentino isorrentino commented Nov 10, 2023

This PR introduced a process model for the external contacts defined as

$$ \dot{f} = -k f $$

In addition, the PR changes the logic to define a name for the dynamics. Indeed, the name of the dynamics has to match the name ukf_name defined in the model configuration file. This solves the problem described in #760 which was causing a segmentation fault when using the ft frame as the external contact frame.

cc @GiulioRomualdi @S-Dafarra

*/
struct FT : Sensor
struct FTSENSOR : Sensor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be FTSensor

Comment on lines 359 to 366
if (!group->getParameter("ukf_names", ukfNames))
{
blf::log()->error("{} The parameter handler could not find 'ukf_names' in the "
"configuration file for the group {}.",
logPrefix,
groupName);
return false;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove blf::

{
REQUIRE((output.ftWrenches[key] - value.row(sample).transpose()).isZero(0.1));
REQUIRE((output.contactWrenches[sensors["contact"][idx].ukfSensorName]).isZero(5.0));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for (auto const& [key, value] : dataset.fts)
for (int idx = 0; idx < sensors["ft"].size(); idx++)
{
REQUIRE((output.ftWrenches[sensors["ft"][idx].ukfSensorName] - dataset.fts[sensors["ft"][idx].sensorName].row(sample).transpose()).isZero(0.1));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use isApprox (https://eigen.tuxfamily.org/dox/classEigen_1_1DenseBase.html#ae8443357b808cd393be1b51974213f9c)

Suggested change
REQUIRE((output.ftWrenches[sensors["ft"][idx].ukfSensorName] - dataset.fts[sensors["ft"][idx].sensorName].row(sample).transpose()).isZero(0.1));
REQUIRE((output.ftWrenches[sensors["ft"][idx].ukfSensorName].isApprox( dataset.fts[sensors["ft"][idx].sensorName].row(sample).transpose()));

@isorrentino isorrentino force-pushed the rde/externalContactProcessModel branch 2 times, most recently from ba82548 to 78267f8 Compare November 20, 2023 09:58
@isorrentino
Copy link
Collaborator Author

I pushed the changes after your review. I saw that the CI is failing but the errors are not related to the code of this PR.

@isorrentino isorrentino force-pushed the rde/externalContactProcessModel branch from 78267f8 to 548afd0 Compare November 21, 2023 10:11
@isorrentino isorrentino force-pushed the rde/externalContactProcessModel branch from 548afd0 to 65bbf2e Compare December 13, 2023 10:00
@isorrentino
Copy link
Collaborator Author

Hi @GiulioRomualdi, I just rebased this branch on master. Feel free to review it again (if needed) or merge it.

@GiulioRomualdi GiulioRomualdi merged commit dc4d9fa into ami-iit:master Dec 13, 2023
11 of 12 checks passed
@isorrentino isorrentino deleted the rde/externalContactProcessModel branch February 9, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants