Closed Mr-Red331 closed 1 year ago
In C++, only the upper part of the mass matrix is filled, for performance issues. You can use the Eigen API to consider the full matrix (M.selfadjointView<Eigen::Upper>())
Thanks! This method worked and my problem was solved.
And futhermore, I would be very grateful if you could tell me why this method could solve this problem.
Just display the mass matrix, and you will see that the lower part is full of 0s.
That means, in C++, the matrix M calculated with crba() is unfilled and incorrect, and only the filled Matrix M is the correct for calculate dynamics?
This behavior is expected and described here in the official pinocchio documentation.
Thanks very much, that is very helpful to me!
Hi, This is a question about the inconsistencies between crba() and rena(). I used two ways (rnea and crba) to calculate
tau
, but the result was inconsistent:Here is the specific process:
q, v, a, extf
;crba(model, data, q)
;computeCoriolisMatrix(model, data, q, v,)
;computeGeneralizedGravity(model, data, q)
;computeJointJacobian(model, data, q, joint, J)
andgetJointJacobian(model, data, joint, LOCAL, J)
;tau_crba = M*a + C*v + G - JT*extf
;tau_rnea = rnea(model, data, q, v, a, extf)
;But, the final result
tau_crba != tau_rnea
.At the same time, there is an interesting phenomenon: I let
a.setZero()
and the restq, v, extf
remains const random. After going through the above steps, I could get the resulttau_crba = tau_rnea
.So, is there any wrong in calculating
M
or definea
?