loam 中各种旋转各种坐标变换
⽂章⽬录
cannon欧拉⾓
1. 从旋转所相对的坐标系来看,分成两种:
extrinsic:每⼀次旋转,都相对于固定的基坐标系进⾏
intrinsic:每⼀次旋转,都相对于旋转后的新坐标系进⾏
2. 从旋转轴类型上,分成两类:
Proper Euler angles:有重复旋转的轴
Tait–Bryan angles: 没有重复旋转的轴
heal
总结成下表:
从loam的程序来看,可能选择的是上表中这种类型
AccumulateRotation 函数
假设基坐标系——也就是第⼀帧的系为0系,上⼀帧得到的车辆坐标系为1系,本帧车辆坐标系为2系,本次larOdometry求解后得到1系和2系的相对旋转关系。则,本函数,计算的是:
通过下⾯的matlab符号计算可以进⾏公式验证
syms cx cy cz lx ly lz ox oy oz R1 R2 R3;
R1 = [cos(cy),0,sin(cy);0,1,0;-sin(cy),0,cos(cy)] * ...
garp[1,0,0;0,cos(cx),-sin(cx);0,sin(cx),cos(cx)] * ...
[cos(cz),-sin(cz),0;sin(cz),cos(cz),0;0,0,1]
R2 = [cos(ly),0,sin(ly);0,1,0;-sin(ly),0,cos(ly)] * ...
[1,0,0;0,cos(lx),-sin(lx);0,sin(lx),cos(lx)] * ...
[cos(lz),-sin(lz),0;sin(lz),cos(lz),0;0,0,1]
R3 = R1 * R2
Y X Z 123R 21R =2010R ⋅21
R
TransformToStartIMU 函数
雀斑的治疗方法
该函数在去畸变函数中,作⽤是将⼀个特定时刻的激光点的坐标变换到,当前帧第⼀个点对应的车辆坐标系下。假设,imu给出的
品味英文rollpitchyaw⾓度相对于⼀个固定的设计坐标系0系。当前激光点对应的车辆坐标系为2系,当前帧第⼀个激光点对应的车辆坐标系为1系以下代码实现/********************************************************************************
Ry*Rx*Rz*Pl, transform point to the global frame
*********************************************************************************/
//绕z 轴旋转(imuRollCur)
float x1 = cos(imuRollCur) * p->x - sin(imuRollCur) * p->y;
float y1 = sin(imuRollCur) * p->x + cos(imuRollCur) * p->y;
float z1 = p->z;
/
意义英文/绕x 轴旋转(imuPitchCur)
float x2 = x1;
float y2 = cos(imuPitchCur) * y1 - sin(imuPitchCur) * z1;
float z2 = sin(imuPitchCur) * y1 + cos(imuPitchCur) * z1;
//绕y 轴旋转(imuYawCur)
动物世界2
float x3 = cos(imuYawCur) * x2 + sin(imuYawCur) * z2;
娜娜外f挂网float y3 = y2;
zyzfloat z3 = -sin(imuYawCur) * x2 + cos(imuYawCur) * z2;以下代码实现//绕y 轴旋转(-imuYawStart)
float x4 = cos(imuYawStart) * x3 - sin(imuYawStart) * z3;
float y4 = y3;
float z4 = sin(imuYawStart) * x3 + cos(imuYawStart) * z3;
emperor/
/绕x 轴旋转(-imuPitchStart)
float x5 = x4;
float y5 = cos(imuPitchStart) * y4 + sin(imuPitchStart) * z4;
float z5 = -sin(imuPitchStart) * y4 + cos(imuPitchStart) * z4;
//绕z 轴旋转(-imuRollStart),然后叠加平移量
p->x = cos(imuRollStart) * x5 + sin(imuRollStart) * y5 + imuShiftFromStartXCur;
p->y = -sin(imuRollStart) * x5 + cos(imuRollStart) * y5 + imuShiftFromStartYCur;
p->z = z5 + imuShiftFromStartZCur;p =020
R ⋅2p
p =101R ⋅20R ⋅2p