[C++] Euler to Rotation Matrix λ³ν
Euler angle(roll, pitch, yaw)μμ 3x3 νμ νλ ¬μ μ»μ΄λ³΄μ
κ°μ
λ‘보ν±μ€μμ μ’νκ³λ₯Ό λ€λ£¨λ€ 보면 ν΄λΉ κ°λ ννμ λ§μ΄ μ¬μ©νκ² λλ€.
μμ£Ό μ¬μ©νλλ°λ ν·κ°λ €μ λΈλ‘κ·Έμ κΈ°λ‘ν΄λλ€.
Euler β> Rotation Matrix
double roll, pitch, yaw;
roll = 0.0 * M_PI/180;
pitch = 0.0 * M_PI/180;
yaw = 0.0 * M_PI/180;
Eigen::AngleAxisd roll_axis_angle (roll, Eigen::Vector3d::UnitX());
Eigen::AngleAxisd pitch_axis_angle(pitch, Eigen::Vector3d::UnitY());
Eigen::AngleAxisd yaw_axis_angle (yaw, Eigen::Vector3d::UnitZ());
Eigen::Quaternion<double> q = yaw_axis_angle*pitch_axis_angle *roll_axis_angle;
Eigen::Matrix3d rot = q.matrix();
Leave a comment