Open GiulioRomualdi opened 3 years ago
What did you have in mind?
If the fix is not difficult, probably it is easier to discuss with the code?
There are two possible options:
computeIntegral
in the AngularMomentumTask
. In this case, the user is in charge to call it. I'm not a big fan of this update
of the task. The update
must be called only by the TSID.
In this case the code will become (modulo hardcoded values)
diff --git a/src/TSID/src/AngularMomentumTask.cpp b/src/TSID/src/AngularMomentumTask.cpp
index dd459bc6..4ed96c21 100644
--- a/src/TSID/src/AngularMomentumTask.cpp
+++ b/src/TSID/src/AngularMomentumTask.cpp
@@ -70,6 +70,8 @@ bool AngularMomentumTask::setVariablesHandler(const System::VariablesHandler& va
iDynTree::toEigen(this->subA(contactWrench.variable)).rightCols<3>().setIdentity();
}
return true; }
@@ -162,10 +164,17 @@ bool AngularMomentumTask::update()
m_isValid = false;
m_R3Controller.setState(iDyn::toEigen(m_kinDyn->getCentroidalTotalMomentum().getAngularVec3())); m_R3Controller.computeControlLaw();
Furthermore, regarding the sampling period. Should we pass it through the parametersHandler?
I am probably missing/not remembering something. Where are we running the PID of the star trick? Can't we have something similar for this?
Concerning the addition of the integral term, I endorse its use in the on-line control loop. I just want to highlight that if we use pure integrations of the angular momentum instead of state-dependent approximations - see Remark 2 of Stability Analysis and Design of Momentum-based Controllers for Humanoid Robots - we may encounter the following issues:
Hi @DanielePucci, in the paper you linked the angular term called angular momentum integral is not equal to the integral of the angular momentum right? I was wandering on how to extend that work in a TSID framework instead of applying it in a pure momentum based controller. But I think we can discuss this as soon as I come back
Sure Giulio, we can discuss F2F whenever you like, anyways I did not want to block the introduction of the angular momentum integral, but just raise some points that may occur, so feel free to proceed with the classical time-based integrations!
Other forms of non-linear integral I used back in time (see simulation results) can be found in Time sub-optimal nonlinear PI and PID controllers applied to longitudinal headway car control
Following @gabrielenava's suggestions in Stability Analysis and Design of Momentum-based Controllers for Humanoid Robots I noticed that adding an integral term in the angular momentum tasks allows improving the convergence performances of angular momentum to the desired value.
The integral will be computed numerically on the error by the
update
function however it is important that update is called only once by TSID otherwise the outcome of the integrator will be wrong.What do you think @S-Dafarra @isorrentino @traversaro?