-
Notifications
You must be signed in to change notification settings - Fork 49
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
Compute the whole-body-inertia and the average-angular-velocity. #75
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks!
Can you add some tests to check the computations are ok?
* Replace matrix inverse with 'llt().solve(m)' * Function parameter overloading * Clean the comments
…dal inertia. * Improve the average velocity computation: ci.llt().solveInPlace(av) * Simplify the for loop computation with the intermediate term: X_com_i
…dal inertia in issue jrl-umi3218#75 * Improve the average velocity computation: ci.llt().solveInPlace(av) * Simplify the for loop computation with the intermediate term: X_com_i
In my other repo, I made a quick assertion to make sure the |
* Replace matrix inverse with 'llt().solve(m)' * Function parameter overloading * Clean the comments
…dal inertia. * Improve the average velocity computation: ci.llt().solveInPlace(av) * Simplify the for loop computation with the intermediate term: X_com_i
0f4c318
to
5da5f10
Compare
Hi Yuquan, I added a test that test that but the test is failing. Could you have a look at it? I also rebased your branch on master and fixed warnings on clang to get the build to run correctly, I had to force push to your branch so please be careful when you pull on your side |
Yes, sure! I'll look into the test. |
…hole-body-inertia
…hole-body-inertia
@gergondet Hi Pierre, I am revisiting this issue again. I found something fishy with the BOOST_CHECK_SMALL((av.tail(3) - comVelocity).norm(), TOL); but passed: BOOST_CHECK_SMALL((ci*av - cm.vector()).norm(), TOL); I computed the Reference equations (I can provide further reference on this point if necessary):
Further, the linear momentum should be equal to the product of the COM velocity and the mass. But RBDyn can not pass such a test and the difference is huge if I do the following: cmm.computeMatrix(mb, mbc, com);
Eigen::MatrixXd cmmMatrix = cmm.matrix();
Eigen::VectorXd alpha(mb.nrDof());
double mass = 6.0;
std::cout<<" Momemtum diff is: "<<((cmmMatrix * alpha).tail(3) - mass*comVelocity).transpose(); In the above example, I found the mass from other computations. |
Hi Yuquan, cmm.computeMatrix(mb, mbc, com);
Eigen::MatrixXd cmmMatrix = cmm.matrix();
Eigen::VectorXd alpha(mb.nrDof());
double mass = 6.0;
std::cout<<" Momemtum diff is: "<<((cmmMatrix * alpha).tail(3) - mass*comVelocity).transpose(); This sample as such is not correct, your alpha vector is a vector of size |
Hi Pierre, Sorry for the mistake. It is a redundant comment. Now I have removed it. Could you please run the example? The issue remains there. |
Hi Pierre, This is a kind reminder of the open issue. Maybe we can look at it together if you want. Yuquan |
As I discussed in the mc_rtc issue 245, these commit provide additional computations.