You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
duburcqa
changed the title
[core] Add getForce(ReferenceFrame rf) getter to AbstractConstraint.
[core] Add force getter to AbstractConstraint.
Dec 10, 2021
How to handle the case where spatial force is not meaningful ?
Two options:
[1] Return an exception if not implemented by default to make it optional.
[2] Provide a lower-level abstract constraint class that it providing this extra method.
[1] goes against the concept of abstract class if some method cannot be called for derived classes, which is bad. While [2] makes it impossible to call computeForce without performing a static cast on AbstractConstraintBase.
I suggest going into the direction of [2]. However, constraintsHolder_t should be refactor to stop handling constraints only through the base class AbstractConstraintBase and instead storing the actual type. To do this properly, it requires the use of visitors and CRTP pattern.
A similar issue arises for being able to set the normal for contact constraints. Maybe an abstract class ContactConstraintBase dedicated to contact constraints should be added.
virtual pinocchio::Force computeForce(pinocchio::ReferenceFrame rf) const = 0;
The text was updated successfully, but these errors were encountered: