GithubHelp home page GithubHelp logo

dzunigan / imu_initialization Goto Github PK

View Code? Open in Web Editor NEW
131.0 131.0 19.0 61.97 MB

Implementation of "An Analytical Solution to the IMU Initialization Problem for Visual-Inertial Systems"

License: GNU General Public License v3.0

CMake 7.36% C++ 89.90% Shell 0.28% MATLAB 2.45%

imu_initialization's People

Contributors

dzunigan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

imu_initialization's Issues

Acc Bias

Great work!
How do you calculate the acc bias? I do not konw how to reproduce the data provided in the paper.

Covariance in the code

Thanks for your work. I have some confusion about the covariance calculation in line 196 in include/methods.h, and I have not found the related formula in the paper. Is there any derivation about that?
cov

Reference to the paper

This is a great implementation, but I cannot find the similar paper mentioned and I am assuming this IMU initialization is similar to one mentioned in ORB SLAM 3 where they are talking about Inertial only optimization and also some reference from Visual Inertial monocular SLAM with map reuse

Imu_Init with Vins-Mono

Hello, thanks for your contribution.

I am trying to add the code to Vins-mono, but the gyro bias is not converged in my code.

The gryo bias factor code as follows

class GyroscopeBiasCostFunction : public ceres::SizedCostFunction<3, 3> {
    public:
        GyroscopeBiasCostFunction(std::shared_ptr<IntegrationBase> pIntj, const Eigen::Matrix3d &Ri, const Eigen::Matrix3d &Rj) :
            pIntj_(pIntj), Ri_(Ri), Rj_(Rj) 
        {
            Eigen::SelfAdjointEigenSolver<Eigen::Matrix3d> solver(pIntj_ -> covariance.block<3,3>(3,3));
            SqrtInformation_ = solver.operatorSqrt();
        }

        virtual ~GyroscopeBiasCostFunction() {}

        bool Evaluate(double const* const* parameters, double* residuals, double** jacabians) const override {
            Eigen::Map<const Eigen::Vector3d> bg(parameters[0]);

            Eigen::Matrix3d dq_dbg = pIntj_ -> jacobian.block<3, 3>(3, 12);
            Eigen::Vector3d dbg = bg - pIntj_ ->linearized_bg;
            Eigen::Quaterniond corrected_delta_q = pIntj_ -> delta_q * Utility::deltaQ(dq_dbg * dbg);
            // Eigen::Vector3d delta_bg = pIntj_ -> jacobian.block<3,3>(3,12) * (bg - pIntj_ -> linearized_bg);
            // Eigen::Matrix3d deltaR = pIntj_ -> delta_q.toRotationMatrix() * Utility::ExpSO3(delta_bg.x(), delta_bg.y(), delta_bg.z());
            const Eigen::Matrix3d eR = corrected_delta_q.toRotationMatrix().transpose() * Ri_.transpose() * Rj_;
            const Eigen::Vector3d err = Utility::LogSO3(eR);

            Eigen::Map<Eigen::Vector3d> e(residuals);
            e = err;
            e = SqrtInformation_ * e;

            if(jacabians != nullptr) {
                if(jacabians[0] != nullptr) {
                
                    const Eigen::Matrix3d invJr = Utility::InverseRightJacobianSO3(err[0], err[1], err[2]);

                    Eigen::Map<Eigen::Matrix<double, 3, 3, Eigen::RowMajor>> J(jacabians[0]);
                    Eigen::Vector3d J_RbgMultipDbg = pIntj_ -> jacobian.block<3,3>(3,12) * dbg;
                    J = -invJr * eR.transpose() * Utility::RightJacobianSO3(J_RbgMultipDbg.x(), J_RbgMultipDbg.y(), J_RbgMultipDbg.z()) * pIntj_ -> jacobian.block<3,3>(3,12);
                    J = SqrtInformation_ * J;
                }
            }

            return true;
        }

    EIGEN_MAKE_ALIGNED_OPERATOR_NEW

    private:
    std::shared_ptr<IntegrationBase> pIntj_;
    const Eigen::Matrix3d Ri_, Rj_;
    Eigen::Matrix3d SqrtInformation_;
};

Then my optimiation code as follows:

    Eigen::Vector3d bias_;
    bias_.setZero();

    ceres::Problem problem;
    map<double, ImageFrame>::iterator frame_i;
    map<double, ImageFrame>::iterator frame_j;
    for (frame_i = all_image_frame.begin(); next(frame_i) != all_image_frame.end(); frame_i++) {
        frame_j = next(frame_i);
        const Eigen::Matrix3d &Ri = frame_i->second.R;
        const Eigen::Matrix3d &Rj = frame_j->second.R;
        
        std::shared_ptr<IntegrationBase> p_int(new IntegrationBase(*(frame_j -> second.pre_integration)));
        ceres::CostFunction* cost_function = new GyroscopeBiasCostFunction(p_int, Ri, Rj);
        problem.AddResidualBlock(cost_function, nullptr, bias_.data());
    }

    TicToc time0;
    ceres::Solver::Options options;
    options.minimizer_progress_to_stdout = true;
    ceres::Solver::Summary summary;

But the final output of bias is Zero. Then I printed the optimization process and found that the cost was very small before optimization.
iter cost cost_change |gradient| |step| tr_ratio tr_radius ls_iter iter_time total_time
0 1.578785e-12 0.00e+00 1.54e-11 0.00e+00 0.00e+00 1.00e+04 0 3.79e-05 8.99e-05

So I would like to ask you, what is wrong with the code. Thank you very much again.

proposed_noweight

Thanks for your work. When I compile this code, there is an error about "proposed_noweight()" in experiment01a . It seems that this function was not declared in this scope. So I don't know how to deal with.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.