ethz-asl / aslam_splines

B-spline implementations usable as design variables and expression sources for aslam_optimizer
Other
28 stars 16 forks source link

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

Open chengfzy opened 4 years ago

chengfzy commented 4 years ago

It's the same issue from https://github.com/ethz-asl/kalibr/issues/383

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?