-
Notifications
You must be signed in to change notification settings - Fork 328
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
Undo binding of model getCoordinatesInMultibodyTreeOrder and introduc… #3656
Conversation
…e getCoordinateNamesInMultibodyTreeOrder for scripting users
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.
Overall looks good, just two minor suggestions.
CHANGELOG.md
Outdated
@@ -25,7 +25,7 @@ and `Blankevoort1991Ligament`, usages of `get_GeometryPath`, `upd_GeometryPath`, | |||
- Deleting elements from an `OpenSim::Coordinate` range now throws an exception during `finalizeFromProperties` (previously: | |||
it would let you do it, and throw later when `Coordinate::getMinRange()` or `Coordinate::getMaxRange()` were called, #3532) | |||
- Added `FunctionBasedPath`, a class for representing paths in `Force`s based on `Function` objects (#3389) | |||
- Fixed bindings to expose the method Model::getCoordinatesInMultibodyTreeOrder to scripting users (#3569) | |||
- Fixed bindings to expose the method Model::getCoordinateNamesInMultibodyTreeOrder to scripting users (#3569) |
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.
Minor, but you've added a new method, so you could state that here and highlight that is scripting friendly.
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.
Done
@@ -131,6 +131,8 @@ void testAssembleModelWithConstraints(string modelFile) | |||
for(int i=0; i< coords.getSize(); i++) { | |||
cout << "Coordinate " << coords[i].getName() << " get value = " << coords[i].getValue(state) << endl; | |||
} | |||
auto coordsInOrder = model.getCoordinateNamesInMultibodyTreeOrder(); | |||
cout << coordsInOrder << std::endl; |
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.
Consider adding a simple check that coordsInOrder
has the same size as the CoordinateSet
.
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.
Done
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.
Reviewed 1 of 3 files at r1, 2 of 3 files at r3, 2 of 2 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @aymanhab)
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 @aymanhab)
Thanks @nickbianco |
#3656) * Undo binding of model getCoordinatesInMultibodyTreeOrder and introduce getCoordinateNamesInMultibodyTreeOrder for scripting users * Fix dereferencing the ReferencePtr and exercise in test case * Fix compilation warnings/errors on linux and call site to index the SimTKArray * Fix int/size_t mixup that causes compilation errors on linux * Update CHANGELOG.md Use updated function name * Address feedback on PR in test, changelog language
…e getCoordinateNamesInMultibodyTreeOrder for scripting users
Fixes issue #0
Brief summary of changes
Using SimTK::ReferencePtr across binding was problematic due to methods optimized out. Adding a method to return names of coordinates instead to sidestep the memory management issue across the binding interface.
Testing I've completed
Looking for feedback on...
CHANGELOG.md (choose one)
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)