Eigen member alignment
In my class FlightControl, I'm getting the assertion on unaligned arrays error
FlightControl: /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:109: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 16>::plain_array() [with T = double; int Size = 12; int MatrixOrArrayOptions = 0]: Assertion `(internal::UIntPtr(eigen_unaligned_array_assert_workaround_gcc47(array)) & (15)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ****"' failed.
In my private members, I have:
Eigen::Matrix<double, 2, 6> k_;
I followed the instructions and added the macro
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
in my public section, right below the constructor, but that did not fix the issue.
I am using Arch Linux with Eigen 3.3.9 and GCC 10.2 with C++17 ('-stdc++=1z'), so I don't think case 4 is my problem. I also do not pass eigen objects by value, although I do initialize an eigen matrix from an std vector like so:
k_ = Eigen::Matrix<FloatingType, 2, 6>(someStdVector.data());
But that works just fine, even in runtime.
My code was working for a while, but today I ran a system upgrade (Eigen and Gcc were not upgraded. Cmake was upgraded, but I downgraded it and still have the issue) and then my code ran into this issue. I can make a work around by reinitializing the eigen matrix from the std::array every loop, but I'm wondering if there is a clean way to fix my problem, or if anyone can give me any insight as to how this problem could have suddenly happened when the exact same code was working before.
Thanks!