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
Support variable mass properties #685
Comments
Not difficult, I think -- mostly bookkeeping to take care of. We have examples of this already. The first one that came to my mind is Thermostat which has the standard patttern: for example, Then the code in its realizeTopology() method allocates Model and Instance stage variables that hold the runtime values for those parameters. And those get initialized from the default values. For mass properties of MobilizedBodies I think I already assumed we would want them to vary so there may be a generic instance stage variable belonging to SimbodyMatterSubsystem that holds them all and could be used to implement the variable ones (been a while since I looked at that). |
Yeah, this state variable is what I was thinking of. That already holds runtime values for all the mass properties and other parameters. Those get initialized to the default values -- I think all you would need to do is add APIs for modifying these (and make sure they don't accidentally get overridden afterwards from the defaults). |
Thanks @sherm1 that's very helpful. Maybe we'll give it a shot. |
@nickbianco and I are hoping to support optimizing a body's mass in Moco. Right now, changing a body's mass require's invoking
OpenSim::Model::initSystem()
which is too expensive to do during direct collocation.I had hoped that Simbody would allow editing the mass properties in the state (at stage Instance). I found the following in the source code:
simbody/Simbody/src/MobilizedBodyImpl.h
Lines 257 to 261 in c6f465b
This indicates that Simbody does not yet support updating mass properties after
realizeTopology()
.@sherm1, do you have a sense of how difficult it would be implement a
MobilizedBody::setMassProperties(SimTK::State&)
?The text was updated successfully, but these errors were encountered: