Eigen trouble initializing Quaterniond from Angleaxisd

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Eigen trouble initializing Quaterniond from Angleaxisd



I am trying to set the value of an Eigen::Quaterniond object from an Eigen::AngleAxisd, as shown here.



I keep getting a "stack smashing" error:


Running main() from gmock_main.cc
*** stack smashing detected ***: <my executable> terminated

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)



when I run this simple test:


TEST_F(UtilTestCase,testEigenQuaternionFromAngleAxis)
{
Eigen::AngleAxisd veh2sensor(M_PI_2, Eigen::Vector3d::UnitZ());
Eigen::Quaterniond q_veh2sensor;
q_veh2sensor.setIdentity();
q_veh2sensor = veh2sensor;

EXPECT_NEAR(q_veh2sensor.x(),0.0,1e-6);
EXPECT_NEAR(q_veh2sensor.y(),0.0,1e-6);
EXPECT_NEAR(q_veh2sensor.z(),1.0 * sin(M_PI_4),1e-6);
EXPECT_NEAR(q_veh2sensor.w(),1.0 * cos(M_PI_4),1e-6);
}



When I run in the debugger, the code always fails at the line where I assign from veh2sensor to q_veh2sensor. In other words:



I somehow get a stack smashing error when attempting to convert between an AngleAxisd and a Quaterniond using the operator= method of the Quaterniond class.



Why on earth is this the case?









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Keycloak server returning user_not_found error when user is already imported with LDAP

PHP parse/syntax errors; and how to solve them?

How to scale/resize CVPixelBufferRef in objective C, iOS