Skip to content
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

9改6问题 #92

Open
Iiguoren opened this issue Oct 17, 2024 · 2 comments
Open

9改6问题 #92

Iiguoren opened this issue Oct 17, 2024 · 2 comments

Comments

@Iiguoren
Copy link

作者大大我看代码发现主要变动在imuconvert中对RPY改为单位矩阵,而在后面transformupdate中与磁力计数据按照权重融合时候并没有关掉这个融合,这个RPY的单位阵不会有影响吗
``
if (cloudInfo.imu_available == true)
{
if (std::abs(cloudInfo.imu_pitch_init) < 1.4)
{
double imuWeight = imuRPYWeight;
tf2::Quaternion imuQuaternion;
tf2::Quaternion transformQuaternion;
double rollMid, pitchMid, yawMid;

            // slerp roll
            transformQuaternion.setRPY(transformTobeMapped[0], 0, 0);
            imuQuaternion.setRPY(cloudInfo.imu_roll_init, 0, 0);
            tf2::Matrix3x3(transformQuaternion.slerp(imuQuaternion, imuWeight)).getRPY(rollMid, pitchMid, yawMid);
            transformTobeMapped[0] = rollMid;

            // slerp pitch
            transformQuaternion.setRPY(0, transformTobeMapped[1], 0);
            imuQuaternion.setRPY(0, cloudInfo.imu_pitch_init, 0);
            tf2::Matrix3x3(transformQuaternion.slerp(imuQuaternion, imuWeight)).getRPY(rollMid, pitchMid, yawMid);
            transformTobeMapped[1] = pitchMid;
        }
    }

``

@JokerJohn
Copy link
Owner

@Iiguoren 你说到点子上了,这部分确实会有影响,需要关闭,但除了初始化,其他时候差别不大,所以没太在意。因为松耦合的原因,IMU这里的用途只是做scan-to-map匹配的初值。欢迎测试后提交下代码,我直接合并进去。

@cuilongfei1231
Copy link

cuilongfei1231 commented Nov 28, 2024

您好,在哪里关掉您说的这个融合??请问是哪个cpp文件,我没有找到在那个位置修改,“ transformupdate中与磁力计数据按照权重融合时候并没有关掉这个融合,这个RPY的单位阵不会有影响吗”
``
if (cloudInfo.imu_available == true)
{
if (std::abs(cloudInfo.imu_pitch_init) < 1.4)
{
double imuWeight = imuRPYWeight;
tf2::Quaternion imuQuaternion;
tf2::Quaternion transformQuaternion;
double rollMid, pitchMid, yawMid;

        // slerp roll
        transformQuaternion.setRPY(transformTobeMapped[0], 0, 0);
        imuQuaternion.setRPY(cloudInfo.imu_roll_init, 0, 0);
        tf2::Matrix3x3(transformQuaternion.slerp(imuQuaternion, imuWeight)).getRPY(rollMid, pitchMid, yawMid);
        transformTobeMapped[0] = rollMid;

        // slerp pitch
        transformQuaternion.setRPY(0, transformTobeMapped[1], 0);
        imuQuaternion.setRPY(0, cloudInfo.imu_pitch_init, 0);
        tf2::Matrix3x3(transformQuaternion.slerp(imuQuaternion, imuWeight)).getRPY(rollMid, pitchMid, yawMid);
        transformTobeMapped[1] = pitchMid;
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants