-
Notifications
You must be signed in to change notification settings - Fork 471
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
MobilizedBody::Translation has confusing getMobilizerAcceleration() method #604
Comments
None of the MobilizedBody interface methods are supposed to be virtual. The virtual methods are located in the MobilizedBodyImpl class and its derived classes. There are two problems here:
The Translation mobilizer is the only Simbody joint whose API has a method Can you use getUDot() or getUDotAsVector() and forget about using getMobilizerAcceleration() for now? They are not exactly the same thing for some joints because udots are the time derivatives of a mobilizer's velocity coordinates u. For a translation joint the u's are the individual components of the translation vector from the mobilizer's F origin on the parent body to the M origin on the child (that is, V_FM) so the time derivative udot=A_FM, the acceleration of M's origin in F, which is what MobilizedBody::getMobilizerAcceleration() will return when it is implemented. But the mapping from udot to A_FM can be much more complicated for some joints which is presumably why the general getMobilizerAcceleration() method hasn't been implemented yet. Sherm |
I retitled this issue "MobilizedBody::Translation has confusing getMobilizerAcceleration() method" |
Andrea -- I addressed this by deprecating the badly-named methods in MobilizedBody::Translation and replacing them with names that don't conflict with the base class. The problem still exists that the base class method MobilizedBody::getMobilizerAcceleration() is unimplemented, but hopefully this will reduce future confusion. Sorry for the trouble, and thanks for reporting it. |
Hi, thank you for the support and reactivity, and I'm glad I can somehow contribute to this project :) |
@apalazzi, your contributions as a user are much appreciated! FYI, we also welcome code and documentation contributions from the community in case you don't like waiting around for fixes to get done. Please see CONTRIBUTING.md for more info. |
[Edited by sherm: see my comment below for a revised description.
The original description is here:]
the method MobilizedBody::getMobilizerAcceleration() is overriden in MobilizedBody::Translation but is not declared virtual; if a Translation class is then created with new and its pointer stored in a MobilizedBody* pointer, the call to getMobilizerAcceleration ends up executing MobilizedBody::getMobilizerAcceleration() and not Translation::getMobilizerAcceleration().
That is:
If the method is supposed to be overriden in subclasses it should be declared as virtual; or, if the Translation::getMobilizerAcceleration method is generic enough it should be moved to MobilizedBody.
The text was updated successfully, but these errors were encountered: