Skip to content

Add the possibility to compensate an external disturbance torques#112

Open
mathieu-celerier wants to merge 2 commits intojrl-umi3218:masterfrom
mathieu-celerier:topic/add-feedforward-torque-motion-constraint
Open

Add the possibility to compensate an external disturbance torques#112
mathieu-celerier wants to merge 2 commits intojrl-umi3218:masterfrom
mathieu-celerier:topic/add-feedforward-torque-motion-constraint

Conversation

@mathieu-celerier
Copy link
Copy Markdown

Add a copy of each constructors of MotionConstrCommon, MotionConstr and MotionSpringConstr that includes an additional reference to an Eigen::VectorXd that contains an estimation or the exact value of the external disturbance torques to be compensated for. MotionConstrCommon set a bool depending on which constructor is called to know if external torques should be accounted for.

  • This is required to know if the reference is properly initialized. This value is later used in the computeMatrix and computeTorque function of MotionConstrCommon if external torques needs to be compensated.

Add a copy of each constructors of `MotionConstrCommon`, `MotionConstr`
and `MotionSpringConstr` that includes an additional reference to an
`Eigen::VectorXd` that contains an estimation or the exact value of the
external disturbance torques to be compensated for.
`MotionConstrCommon` set a `bool` depending on which constructor is
called to know if external torques should be accounted for.
- This is required to know if the reference is properly initialized.
This value is later used in the `computeMatrix` and `computeTorque`
function of `MotionConstrCommon` if external torques needs to be
compensated.
@Alhuuin
Copy link
Copy Markdown

Alhuuin commented Feb 13, 2026

At first glance, I’m wondering whether overloading the constructors is necessary, since the changes are minimal. Wouldn't an additional argument with a default value (possibly using std::optional) be sufficient?

Copy link
Copy Markdown
Contributor

@ThomasDuvinage ThomasDuvinage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Please find below a review of the PR.
The main concern of this review is the usage of reference for extTorque_. A suggestion regarding this point has been made in one comment.

I agree with @Alhuuin comment on using std::optional, it would make the code simpler.

Comment thread src/QPMotionConstr.cpp Outdated
Comment thread src/Tasks/QPMotionConstr.h Outdated
@mathieu-celerier
Copy link
Copy Markdown
Author

a150ade removes the reference on the external torques makes it optional and add a function in MotionConstrCommon to set its value.
For now, there is no automatic reset of the optional at each update or a mechanism similar, I am not sure that it is necessary but it could be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants