[LinearSystem] Check if state is mapped to contribute to the global vector#6081
Open
alxbilger wants to merge 1 commit intosofa-framework:masterfrom
Open
[LinearSystem] Check if state is mapped to contribute to the global vector#6081alxbilger wants to merge 1 commit intosofa-framework:masterfrom
alxbilger wants to merge 1 commit intosofa-framework:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consider this scene:
This scene does not pass the scene check. The reason is that it does not follow the logic of the visitors, so an error is emitted at the beginning of the simulation (but not if run directly in Python as SceneCheckers don't run). This is expected, and it's not a wrong error. Let's try to make this simulation working even if it does not pass the SceneChecker.
The Issue:
Currently, the simulation produces correct results (a parabola) despite the SceneChecker error. This is due to two bugs inadvertently cancelling each other out:
Execution Order Bug: Due to its position in the scene graph, a specific mapping executes after others, even though its applyJT should execute first.
Data Propagation Bug: The visitors in this PR do not correctly verify if they are operating on "main states." They incorrectly treat mapped_particle as a main state because no mapping is defined within that specific node. Consequently, the contribution from the mapped state is copied into the global vector anyway. This PR addresses this bug.
The Fix:
I have updated the visitors to use the existing MappingGraph. Instead of relying on the presence (or absence) of a mapping within a local node, the visitor now correctly identifies if a state is part of a mapping via the global graph.
Note:
Now the scene fails. The trajectory is no longer a parabola, but a straight line. It is expected because one bug remains.
[with-all-tests]
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if