Add the possibility to compensate an external disturbance torques#112
Conversation
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.
|
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? |
ThomasDuvinage
left a comment
There was a problem hiding this comment.
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.
… external torques update function
|
a150ade removes the reference on the external torques makes it optional and add a function in |
Add a copy of each constructors of
MotionConstrCommon,MotionConstrandMotionSpringConstrthat includes an additional reference to anEigen::VectorXdthat contains an estimation or the exact value of the external disturbance torques to be compensated for.MotionConstrCommonset abooldepending on which constructor is called to know if external torques should be accounted for.computeMatrixandcomputeTorquefunction ofMotionConstrCommonif external torques needs to be compensated.