-
Notifications
You must be signed in to change notification settings - Fork 326
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
Update MocoTrajectory::generateSpeedsFromValues()
to not override auxiliary states
#3603
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, other than naming conventions that I was a little unclear on, if used widely elsewhere then you can ignore
Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @nickbianco)
OpenSim/Moco/MocoTrajectory.h
line 476 at r1 (raw file):
int getNumSpeeds() const { ensureUnsealed(); return (int)getSpeedIndices().size();
Not sure about the ensureUnsealed call having any side-effects, but if not then ignore
OpenSim/Moco/MocoTrajectory.h
line 485 at r1 (raw file):
int getNumAuxiliaryStates() const { ensureUnsealed();
Naming: in the past auxiliary states were used to imply muscle states and that was confusing, if this is used to mean something else across the board in Moco world then ignore
OpenSim/Moco/MocoTrajectory.h
line 551 at r1 (raw file):
multibodyStateNames.push_back(name); } }
Is the implication that /value, /speed are used exclusively for multibody states?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @aymanhab! Let me know if my responses are sufficient, or if you'd like any changes.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @aymanhab)
OpenSim/Moco/MocoTrajectory.h
line 476 at r1 (raw file):
Previously, aymanhab (Ayman Habib) wrote…
Not sure about the ensureUnsealed call having any side-effects, but if not then ignore
If the trajectory is sealed, you shouldn't be able to access anything. This call was missing from this method.
OpenSim/Moco/MocoTrajectory.h
line 485 at r1 (raw file):
Previously, aymanhab (Ayman Habib) wrote…
Naming: in the past auxiliary states were used to imply muscle states and that was confusing, if this is used to mean something else across the board in Moco world then ignore
Here, auxiliary states is referring to any state that is not a multibody state, including the muscle states but not limited to them. I believe "auxiliary" is the term Simbody uses for the non-multibody states.
OpenSim/Moco/MocoTrajectory.h
line 551 at r1 (raw file):
Previously, aymanhab (Ayman Habib) wrote…
Is the implication that /value, /speed are used exclusively for multibody states?
Yes, but I'm not sure if that's explicitly enforced anywhere. /value
and /speed
are baked in the code in many other places, so this assumption is mostly safe for now. If we wanted to allow non-multibody state names ending in '/value' or '/speed' we would need more comprehensive changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @nickbianco)
Fixes issue #3477
Brief summary of changes
This PR updates the logic in
MocoTrajectory::generateSpeedsFromValues()
so that any auxiliary (e.g., muscle-related) states do not get overridden. I've added some accessors to MocoTrajectory to make this fix more convenient, but these are nice additions beyond this fix.Testing I've completed
testMocoInterface.cpp
Looking for feedback on...
CHANGELOG.md (choose one)
This change is