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

Adding a cache variable to ExpressionBasedBushingForce leads to out-of-date cache entry in testComponents.cpp #3881

Open
nickbianco opened this issue Aug 19, 2024 · 0 comments
Labels

Comments

@nickbianco
Copy link
Member

When attempting to add a cache variable to ExpressionBasedBushingForce for the purposes of returning an Output value, I encountered the following error when running testComponents:

Error detected by Simbody method getCacheEntry: State Cache entry was out of date at Stage Dynamics. This entry depends on version 1 of Stage Velocity but was last updated at version 0.

The error occurs when calling getValueAsString() at this line. Strangely, modifying auxiliaryTestFunctions for randomizing Vec6 properties to the following somehow fixes the issue (or at least hides it):

} else if (ts == "Vec6" && !isList) {
      Property<SimTK::Vec6>& prop = Property<SimTK::Vec6>::updAs(ap);
      prop = SimTK::Vec6(abs(rand()), abs(rand()), abs(rand()), 
               abs(rand()), abs(rand()), abs(rand()));

The only property that uses Vec6 is Body's inertia property. I'm not sure what the interaction between the property and cache variable is, or whether or not the issue is specific to ExpressionBasedBushingForce or TwoFrameLinker in general.

@nickbianco nickbianco added the bug label Aug 19, 2024
@nickbianco nickbianco changed the title Adding a cache variable to ExpressionBasedBushingForce leads to out-of-date in testComponents.cpp Adding a cache variable to ExpressionBasedBushingForce leads to out-of-date cache entry in testComponents.cpp Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant