Skip to content
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

[core] Add force getter to AbstractConstraint #471

Open
duburcqa opened this issue Dec 10, 2021 · 1 comment
Open

[core] Add force getter to AbstractConstraint #471

duburcqa opened this issue Dec 10, 2021 · 1 comment
Labels
core new feature P0 Highest priority issue

Comments

@duburcqa
Copy link
Owner

duburcqa commented Dec 10, 2021

virtual pinocchio::Force computeForce(pinocchio::ReferenceFrame rf) const = 0;

@duburcqa duburcqa changed the title [core] Add getForce(ReferenceFrame rf) getter to AbstractConstraint. [core] Add force getter to AbstractConstraint. Dec 10, 2021
@duburcqa duburcqa added core new feature P0 Highest priority issue labels Dec 10, 2021
@duburcqa
Copy link
Owner Author

duburcqa commented 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.

@duburcqa duburcqa added P1 Mid priority issue and removed P0 Highest priority issue labels Apr 2, 2022
@duburcqa duburcqa added P0 Highest priority issue and removed P1 Mid priority issue labels Aug 10, 2023
@duburcqa duburcqa changed the title [core] Add force getter to AbstractConstraint. [core] Add force getter to AbstractConstraint Oct 9, 2023
@duburcqa duburcqa moved this to To do in Jiminy 1.9 Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core new feature P0 Highest priority issue
Projects
Status: To do
Development

No branches or pull requests

1 participant