-
Notifications
You must be signed in to change notification settings - Fork 322
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
Expose more simbody methods needed by advanced users #3618
Conversation
@nickbianco not sure if you have a minute to review this. Thank you |
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.
One quick question.
@@ -522,7 +522,21 @@ OpenSim_OBJECT_NONTEMPLATE_DEFS(Model, ModelComponent); | |||
GeneralForceSubsystem allocated by this %Model. **/ | |||
SimTK::GeneralForceSubsystem& updForceSubsystem() | |||
{ return *_forceSubsystem; } | |||
|
|||
/** (Advanced) Get read only access to internal Simbody RigidBodyForces at Dynamics stage **/ | |||
const SimTK::Vector_<SimTK::SpatialVec>& getRigidBodyForces(const SimTK::State& state) |
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.
Does SimTK::Vector_<SimTK::SpatialVec>
get wrapped properly in the bindings? I don't see a %template
for it.
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.
Yes it does here's the signature from the newly generated Model.java
public VectorOfSpatialVec getGravityBodyForces(State state) {
....
}
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.
Should we create our own SWIG template to follow the convention for other vectors like VectorVec3
? Perhaps VectorSpatialVec
? I definitely wouldn't know to search for the signature VectorOfSpatialVec
without knowing it existed already. (I'm assuming VectorOfSpatialVec
is auto-generated by SWIG).
Failure is the other intermittent osx failure unrelated to this PR. |
@nickbianco The name of the class is not swig generated, it's defined here opensim-core/Bindings/simbody.i Line 220 in 4b75cbc
since at least 2015 I agree there's inconsistency with other naming conventions but it's hard to tell why it was done this way or who is using these classes so a rename would be breaking backward compatibility. We can discuss further at dev meeting |
@aymanhab gotcha, not sure how I missed that while searching. In that case, it doesn't make sense to potentially break backwards-compatibility with this PR. |
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.
Thanks @nickbianco Much appreciated 👍 |
Fixes issue #3414, #3490
Brief summary of changes
Added 3 methods previously not accessible to advanced users.
Testing I've completed
Diffed resulting Model.java files and the three methods were added and are utilizing other existing classes
Looking for feedback on...
Documentation/description of the methods and if there're other related questions/concerns
CHANGELOG.md (choose one)
This change is