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

Fix non-deterministic test failure in test_gravity_term #40

Merged
merged 1 commit into from
May 15, 2023
Merged

Conversation

traversaro
Copy link
Contributor

This PR fixes the non-deterministic test failure discussed in conda-forge/staged-recipes#21894 (comment) and #38 .
The source of the non-determinism was the use of non-initialized memory, as a idyntree.bindings.Twist object was created, but never initialized to zero. In most of the cases their actual value was zero, but sometime its value was actually something else, resulting in a test failure. See the following code snippet for an example:

>>> import idyntree
>>> a = idyntree.bindings.Twist()
>>> a.toString()
'4.64577e-310 0 6.91004e-310  6.91004e-310 0 2.07508e-322 \n'
>>> a = idyntree.bindings.Twist.Zero()
>>> a.toString()
'0 0 0  0 0 0 \n'

@traversaro traversaro requested a review from Giulero May 14, 2023 21:28
@traversaro traversaro mentioned this pull request May 14, 2023
@Giulero
Copy link
Collaborator

Giulero commented May 14, 2023

Thanks a lot @traversaro for spotting and solving this issue!

@Giulero Giulero merged commit 1338a01 into main May 15, 2023
8 checks passed
@traversaro traversaro deleted the fixtests branch May 15, 2023 07:17
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

Successfully merging this pull request may close these issues.

None yet

2 participants