-
Notifications
You must be signed in to change notification settings - Fork 38
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
Decided how to handle different storing order in the repo #100
Comments
Is this really a problem? I mean, now that KinDynComputations will support MatrixView, I don't see a lot of reasons for using iDynTree Matrices over regular Eigen matrices, so it is not clear to me where you need to have an iDynTree matrix in blf and then pass it to a function that takes in input Eigen::Ref . |
What if you use void foo(Eigen::Ref<Eigen::MatrixXd, 0, Stride<Dynamic,Dynamic>> m)
{
return;
}
foo( Map<MatrixXd, 0, Stride<Dynamic,Dynamic>>(array1, 2, 3, Stride<Dynamic,Dynamic>(1, 3))); ? |
I hope it will happen soon but I've several problems with the implementation. @S-Dafarra I try to focus on the |
@GiulioRomualdi probably we can close this right? |
yes exactly. Just a small recap. As @traversaro wrote in #100 (comment) is not really necessary. Furthermore now thanks to robotology/idyntree#734 and robotology/idyntree#736 the usage of |
As written in the Eigen documentation, the default storage order of matrices is
ColMajor
, however iniDynTree
the matrices are stored asRowMajor
.This raises a problem when we try to use the
Eigen::Ref
. Right now, in all the interfaces we useEigen::Ref<Eigen::MatrixXd>
for passing matrices, thanks to this we can write:The same applies also with maps
Unfortunately
iDynTree
store the matrices inRowMajor
and the following lines of code will not compileThis is a huge problem because we cannot call the functions we implemented so far with
Map
ofRowMajor
object (we cannot useiDynTree
easily).Discussing with @S-Dafarra we noticed that it is possible to play with the
Eigen::Stride
for viewing anRowMajor
matrix to aColMajor
one.For instance:
gives the following output
Unfortunately, this does not solve our problem since
does not compile and give us the following error:
So far I found two possible solutions:
We start using only the
RowMajor
matrices inblf
pros
:iDynTree
cons
:manif
still working?We templatize everything
pros
:cons
:@traversaro @prashanth @S-Dafarra
The text was updated successfully, but these errors were encountered: