ethz-asl / kalibr

The Kalibr visual-inertial calibration toolbox
Other
4.29k stars 1.4k forks source link

The mathematical detail in BSpline::curveQuadraticIntegralDiag() #383

Open chengfzy opened 4 years ago

chengfzy commented 4 years ago

Hello, everyone. I'm studying the code of kalibr and trying to figure out the algorithm details for IMU-Camera calibration. kalibr uses the BSpline to represent the trajectory of IMU(or camera), and in the BSpline initialization, the below methods are called.

  1. void BSplinePose::initPoseSplineSparse(const Eigen::VectorXd & times, const Eigen::Matrix<double,6,Eigen::Dynamic> & poses, int numSegments, double lambda), see code in line
  2. Then call void BSpline::initSplineSparse(const Eigen::VectorXd & times, const Eigen::MatrixXd & interpolationPoints, int numSegments, double lambda), see code in line

I'm trying to understand the mathematics detail in BSpline::initSplineSparse(). Currently, I have understand several things,

  1. The method void BSpline::initSplineSparse() is the sparse version of `void BSpline::initSpline3()', see code in line
  2. The initialization method will build a equation Ax = B
  3. The first part of the equation is C(t) = U(t) M V, which means the BSpline value evaluated at time t will be C(t).
  4. The second part of the equation assumes the quadratic integral is zero during each segment.
    // make this conditional on the order of the spline:
    if (splineOrder_ == 2)
        A += curveQuadraticIntegralDiag(W, 1);
    else
        A += curveQuadraticIntegralDiag(W, 2);

However, I couldn't understand the mathematical details in method Eigen::MatrixXd BSpline::curveQuadraticIntegralDiag(const Eigen::VectorXd& Wdiag, int derivativeOrder)(see code in line). Is anyone know the details? or some paper could be referenced?

JzHuai0108 commented 6 months ago

I think you will find [1] and [2, ch 14] helpful.

[1] Furgale, P., Tong, C. H., Barfoot, T. D., & Sibley, G. (2015). Continuous-time batch trajectory estimation using temporal basis functions. The International Journal of Robotics Research, 34(14), 1688-1710. [2] De Boor C (2001) A Practical Guide to Splines. New York, USA: Springer Verlag.