Giter Club home page Giter Club logo

ikfom's Introduction

IKFoM

IKFoM (Iterated Kalman Filters on Manifolds) is a computationally efficient and convenient toolkit for deploying iterated Kalman filters on various robotic systems, especially systems operating on high-dimension manifold. It implements a manifold-embedding Kalman filter which separates the manifold structures from system descriptions and is able to be used by only defining the system in a canonical form and calling the respective steps accordingly. The current implementation supports the full iterated Kalman filtering for systems on manifold and any of its sub-manifolds, and it is extendable to other types of manifold when necessary.

Developers

Dongjiao He

Our related video: https://youtu.be/sz_ZlDkl6fA

1. Prerequisites

1.1. Eigen && Boost

Eigen >= 3.3.4, Follow Eigen Installation.

Boost >= 1.65.

2. Usage when the measurement is of constant dimension and type.

Clone the repository:

    git clone https://github.com/hku-mars/IKFoM.git
  1. include the necessary head file:
#include<esekfom/esekfom.hpp>
  1. Select and instantiate the primitive manifolds:
    typedef MTK::SO3<double> SO3; // scalar type of variable: double
    typedef MTK::vect<3, double> vect3; // dimension of the defined Euclidean variable: 3
    typedef MTK::S2<double, 98, 10, 1> S2; // length of the S2 variable: 98/10; choose e1 as the original point of rotation: 1
  1. Build system state, input and measurement as compound manifolds which are composed of the primitive manifolds:
MTK_BUILD_MANIFOLD(state, // name of compound manifold: state
((vect3, pos)) // ((primitive manifold type, name of variable))
((vect3, vel))
((SO3, rot))
((vect3, bg))
((vect3, ba))
((S2, grav))
((SO3, offset_R_L_I))
((vect3, offset_T_L_I)) 
);
  1. Implement the vector field that is defined as , and its differentiation , , where w=0 could be left out:
Eigen::Matrix<double, state_length, 1> f(state &s, const input &i) {
	Eigen::Matrix<double, state_length, 1> res = Eigen::Matrix<double, state_length, 1>::Zero();
	res(0) = s.vel[0];
	res(1) = s.vel[1];
	res(2) = s.vel[2];
	return res;
}
Eigen::Matrix<double, state_length, state_dof> df_dx(state &s, const input &i) //notice S2 has length of 3 and dimension of 2 {
	Eigen::Matrix<double, state_length, state_dof> cov = Eigen::Matrix<double, state_length, state_dof>::Zero();
	cov.template block<3, 3>(0, 12) = Eigen::Matrix3d::Identity();
	return cov;
}
Eigen::Matrix<double, state_length, process_noise_dof> df_dw(state &s, const input &i) {
	Eigen::Matrix<double, state_length, process_noise_dof> cov = Eigen::Matrix<double, state_length, process_noise_dof>::Zero();
	cov.template block<3, 3>(12, 3) = -s.rot.toRotationMatrix();
	return cov;
}

Those functions would be called during the ekf state predict

  1. Implement the output equation and its differentiation , :
measurement h(state &s, bool &valid) // the iteration stops before convergence whenever the user set valid as false
{
	if (condition){ valid = false; 
	} // other conditions could be used to stop the ekf update iteration before convergence, otherwise the iteration will not stop until the condition of convergence is satisfied.
	measurement h_;
	h_.position = s.pos;
	return h_;
}
Eigen::Matrix<double, measurement_dof, state_dof> dh_dx(state &s, bool &valid) {} 
Eigen::Matrix<double, measurement_dof, measurement_noise_dof> dh_dv(state &s, bool &valid) {}

Those functions would be called during the ekf state update

  1. Instantiate an esekf object kf and initialize it with initial or default state and covariance.

(1) initial state and covariance:

state init_state;
esekfom::esekf<state, process_noise_dof, input, measurement, measurement_noise_dof>::cov init_P;
esekfom::esekf<state, process_noise_dof, input, measurement, measurement_noise_dof> kf(init_state,init_P);

(2) default state and covariance:

esekfom::esekf<state, process_noise_dof, input, measurement, measurement_noise_dof> kf;

where process_noise_dof is the dimension of process noise, with the type of std int, and so for measurement_noise_dof.

  1. Deliver the defined models, std int maximum iteration numbers Maximum_iter, and the std array for testing convergence epsi into the esekf object:
double epsi[state_dof] = {0.001};
fill(epsi, epsi+state_dof, 0.001); // if the absolute of innovation of ekf update is smaller than epso, the update iteration is converged
kf.init(f, df_dx, df_dw, h, dh_dx, dh_dv, Maximum_iter, epsi);
  1. In the running time, once an input in or a measurement z is received dt after the last propagation or update, a propagation is executed:
kf.predict(dt, Q, in); // process noise covariance: Q, an Eigen matrix
  1. Once a measurement z is received, an iterated update is executed:
kf.update_iterated(z, R); // measurement noise covariance: R, an Eigen matrix

Remarks(1):

  • We also combine the output equation and its differentiation into an union function, whose usage is the same as the above steps 1-4, and steps 5-9 are shown as follows.
  1. Implement the output equation and its differentiation , :
measurement h_share(state &s, esekfom::share_datastruct<state, measurement, measurement_noise_dof> &share_data) 
{
	if(share_data.converge) {} // this value is true means iteration is converged 
	if(condition) share_data.valid = false; // the iteration stops before convergence when this value is false if other conditions are satified
	share_data.h_x = H_x; // H_x is the result matrix of the first differentiation 
	share_data.h_v = H_v; // H_v is the result matrix of the second differentiation
	share_data.R = R; // R is the measurement noise covariance
	share_data.z = z; // z is the obtained measurement 

	measurement h_;
	h_.position = s.pos;
	return h_;
}

This function would be called during ekf state update, and the output function and its derivatives, the measurement and the measurement noise would be obtained from this one union function

  1. Instantiate an esekf object kf and initialize it with initial or default state and covariance.

(1) initial state and covariance:

state init_state;
esekfom::esekf<state, process_noise_dof, input, measurement, measurement_noise_dof>::cov init_P;
esekfom::esekf<state, process_noise_dof, input, measurement, measurement_noise_dof> kf(init_state,init_P);

(2) default state and covariance:

esekfom::esekf<state, process_noise_dof, input, measurement, measurement_noise_dof> kf;
  1. Deliver the defined models, std int maximum iteration numbers Maximum_iter, and the std array for testing convergence epsi into the esekf object:
double epsi[state_dof] = {0.001};
fill(epsi, epsi+state_dof, 0.001); // if the absolute of innovation of ekf update is smaller than epso, the update iteration is converged
kf.init_share(f, df_dx, df_dw, h_share, Maximum_iter, epsi);
  1. In the running time, once an input in or a measurement z is received dt after the last propagation or update, a propagation is executed:
kf.predict(dt, Q, in); // process noise covariance: Q
  1. Once a measurement z is received, an iterated update is executed:
kf.update_iterated_share();

Remarks(2):

  • The value of the state x and the covariance P are able to be changed by functions change_x() and change_P():
state set_x;
kf.change_x(set_x);
esekfom::esekf<state, process_noise_dof, input, measurement, measurement_noise_dof>::cov set_P;
kf.change_P(set_P);

3. Usage when the measurement is an Eigen vector of changing dimension.

Clone the repository:

    git clone https://github.com/hku-mars/IKFoM.git
  1. include the necessary head file:
#include<esekfom/esekfom.hpp>
  1. Select and instantiate the primitive manifolds:
    typedef MTK::SO3<double> SO3; // scalar type of variable: double
    typedef MTK::vect<3, double> vect3; // dimension of the defined Euclidean variable: 3
    typedef MTK::S2<double, 98, 10, 1> S2; // length of the S2 variable: 98/10; choose e1 as the original point of rotation: 1
  1. Build system state and input as compound manifolds which are composed of the primitive manifolds:
MTK_BUILD_MANIFOLD(state, // name of compound manifold: state
((vect3, pos)) // ((primitive manifold type, name of variable))
((vect3, vel))
((SO3, rot))
((vect3, bg))
((vect3, ba))
((S2, grav))
((SO3, offset_R_L_I))
((vect3, offset_T_L_I)) 
);
  1. Implement the vector field that is defined as , and its differentiation , , where w=0 could be left out:
Eigen::Matrix<double, state_length, 1> f(state &s, const input &i) {
	Eigen::Matrix<double, state_length, 1> res = Eigen::Matrix<double, state_length, 1>::Zero();
	res(0) = s.vel[0];
	res(1) = s.vel[1];
	res(2) = s.vel[2];
	return res;
}
Eigen::Matrix<double, state_length, state_dof> df_dx(state &s, const input &i) //notice S2 has length of 3 and dimension of 2 {
	Eigen::Matrix<double, state_length, state_dof> cov = Eigen::Matrix<double, state_length, state_dof>::Zero();
	cov.template block<3, 3>(0, 12) = Eigen::Matrix3d::Identity();
	return cov;
}
Eigen::Matrix<double, state_length, process_noise_dof> df_dw(state &s, const input &i) {
	Eigen::Matrix<double, state_length, process_noise_dof> cov = Eigen::Matrix<double, state_length, process_noise_dof>::Zero();
	cov.template block<3, 3>(12, 3) = -s.rot.toRotationMatrix();
	return cov;
}

Those functions would be called during ekf state predict

  1. Implement the output equation and its differentiation , :
Eigen::Matrix<double, Eigen::Dynamic, 1> h(state &s, bool &valid) //the iteration stops before convergence when valid is false {
	if (condition){ valid = false; 
	} // other conditions could be used to stop the ekf update iteration before convergence, otherwise the iteration will not stop until the condition of convergence is satisfied.
	Eigen::Matrix<double, Eigen::Dynamic, 1> h_;
	h_(0) = s.pos[0];
	return h_;
}
Eigen::Matrix<double, Eigen::Dynamic, state_dof> dh_dx(state &s, bool &valid) {} 
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> dh_dv(state &s, bool &valid) {}

Those functions would be called during ekf state update

  1. Instantiate an esekf object kf and initialize it with initial or default state and covariance.

(1) initial state and covariance:

state init_state;
esekfom::esekf<state, process_noise_dof, input>::cov init_P;
esekfom::esekf<state, process_noise_dof, input> kf(init_state,init_P);

(2) default state and covariance:

esekfom::esekf<state, process_noise_dof, input> kf;

where process_noise_dof is the dimension of process noise, with the type of std int, and so for measurement_noise_dof

  1. Deliver the defined models, std int maximum iteration numbers Maximum_iter, and the std array for testing convergence epsi into the esekf object:
double epsi[state_dof] = {0.001};
fill(epsi, epsi+state_dof, 0.001); // if the absolute of innovation of ekf update is smaller than epso, the update iteration is converged
kf.init_dyn(f, df_dx, df_dw, h, dh_dx, dh_dv, Maximum_iter, epsi);
  1. In the running time, once an input in or an measurement z is received dt after the last propagation or update, a propagation is executed:
kf.predict(dt, Q, in); // process noise covariance: Q, an Eigen matrix
  1. Once a measurement z is received, an iterated update is executed:
kf.update_iterated_dyn(z, R); // measurement noise covariance: R, an Eigen matrix

Remarks(1):

  • We also combine the output equation and its differentiation into an union function, whose usage is the same as the above steps 1-4, and steps 5-9 are shown as follows.
  1. Implement the output equation and its differentiation , :
Eigen::Matrix<double, Eigen::Dynamic, 1> h_dyn_share(state &s, esekfom::dyn_share_datastruct<double> &dyn_share_data) 
{
	if(dyn_share_data.converge) {} // this value is true means iteration is converged 
	if(condition) share_data.valid = false; // the iteration stops before convergence when this value is false if other conditions are satified
	dyn_share_data.h_x = H_x; // H_x is the result matrix of the first differentiation
	dyn_share_data.h_v = H_v; // H_v is the result matrix of the second differentiation 
	dyn_share_data.R = R; // R is the measurement noise covariance
	dyn_share_data.z = z; // z is the obtained measurement 

	Eigen::Matrix<double, Eigen::Dynamic, 1> h_;
	h_(0) = s.pos[0];
	return h_;
}
This function would be called during ekf state update, and the output function and its derivatives, the measurement and the measurement noise would be obtained from this one union function
  1. Instantiate an esekf object kf and initialize it with initial or default state and covariance. (1) initial state and covariance:
state init_state;
esekfom::esekf<state, process_noise_dof, input>::cov init_P;
esekfom::esekf<state, process_noise_dof, input> kf(init_state,init_P);

(2) default state and covariance:

esekfom::esekf<state, process_noise_dof, input> kf;
  1. Deliver the defined models, std int maximum iteration numbers Maximum_iter, and the std array for testing convergence epsi into the esekf object:
double epsi[state_dof] = {0.001};
fill(epsi, epsi+state_dof, 0.001); // if the absolute of innovation of ekf update is smaller than epso, the update iteration is converged
kf.init_dyn_share(f, df_dx, df_dw, h_dyn_share, Maximum_iter, epsi);
  1. In the running time, once an input in or a measurement z is received dt after the last propagation or update, a propagation is executed:
kf.predict(dt, Q, in); // process noise covariance: Q, an Eigen matrix
  1. Once a measurement z is received, an iterated update is executed:
kf.update_iterated_dyn_share();

Remarks(2):

  • The value of the state x and the covariance P are able to be changed by functions change_x() and change_P():
state set_x;
kf.change_x(set_x);
esekfom::esekf<state, process_noise_dof, input>::cov set_P;
kf.change_P(set_P);

4. Usage when the measurement is a changing manifold during the run time.

Clone the repository:

    git clone https://github.com/hku-mars/IKFoM.git
  1. include the necessary head file:
#include<esekfom/esekfom.hpp>
  1. Select and instantiate the primitive manifolds:
    typedef MTK::SO3<double> SO3; // scalar type of variable: double
    typedef MTK::vect<3, double> vect3; // dimension of the defined Euclidean variable: 3
    typedef MTK::S2<double, 98, 10, 1> S2; // length of the S2 variable: 98/10; choose e1 as the original point of rotation: 1
  1. Build system state and input as compound manifolds which are composed of the primitive manifolds:
MTK_BUILD_MANIFOLD(state, // name of compound manifold: state
((vect3, pos)) // ((primitive manifold type, name of variable))
((vect3, vel))
((SO3, rot))
((vect3, bg))
((vect3, ba))
((S2, grav))
((SO3, offset_R_L_I))
((vect3, offset_T_L_I)) 
);
  1. Implement the vector field that is defined as , and its differentiation , , where w=0 could be left out:
Eigen::Matrix<double, state_length, 1> f(state &s, const input &i) {
	Eigen::Matrix<double, state_length, 1> res = Eigen::Matrix<double, state_length, 1>::Zero();
	res(0) = s.vel[0];
	res(1) = s.vel[1];
	res(2) = s.vel[2];
	return res;
}
Eigen::Matrix<double, state_length, state_dof> df_dx(state &s, const input &i) //notice S2 has length of 3 and dimension of 2 {
	Eigen::Matrix<double, state_length, state_dof> cov = Eigen::Matrix<double, state_length, state_dof>::Zero();
	cov.template block<3, 3>(0, 12) = Eigen::Matrix3d::Identity();
	return cov;
}
Eigen::Matrix<double, state_length, process_noise_dof> df_dw(state &s, const input &i) {
	Eigen::Matrix<double, state_length, process_noise_dof> cov = Eigen::Matrix<double, state_length, process_noise_dof>::Zero();
	cov.template block<3, 3>(12, 3) = -s.rot.toRotationMatrix();
	return cov;
}

Those functions would be called during ekf state predict

  1. Implement the differentiation of the output equation , :
Eigen::Matrix<double, Eigen::Dynamic, state_dof> dh_dx(state &s, bool &valid) {} //the iteration stops before convergence when valid is false
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> dh_dv(state &s, bool &valid) {}

Those functions would be called during ekf state update

  1. Instantiate an esekf object kf and initialize it with initial or default state and covariance.

(1) initial state and covariance:

state init_state;
esekfom::esekf<state, process_noise_dof, input>::cov init_P;
esekfom::esekf<state, process_noise_dof, input> kf(init_state,init_P);

(2)

esekfom::esekf<state, process_noise_dof, input> kf;

Where process_noise_dof is the dimension of process noise, of type of std int

  1. Deliver the defined models, std int maximum iteration numbers Maximum_iter, and the std array for testing convergence epsi into the esekf object:
double epsi[state_dof] = {0.001};
fill(epsi, epsi+state_dof, 0.001); // if the absolute of innovation of ekf update is smaller than epso, the update iteration is converged
kf.init_dyn_runtime(f, df_dx, df_dw, dh_dx, dh_dv, Maximum_iter, epsi);
  1. In the running time, once an input in or a measurement z is received dt after the last propagation or update, a propagation is executed:
kf.predict(dt, Q, in); // process noise covariance: Q
  1. Once a measurement z is received, build system measurement as compound manifolds following step 3 and implement the output equation :
measurement h(state &s, bool &valid) //the iteration stops before convergence when valid is false
{
	if (condition) valid = false; // the update iteration could be stopped when the condition other than convergence is satisfied
	measurement h_;
	h_.pos = s.pos;
	return h_;
}

then an iterated update is executed:

kf.update_iterated_dyn_runtime(z, R, h); // measurement noise covariance: R, an Eigen matrix

Remarks(1):

  • We also combine the output equation and its differentiation into an union function, whose usage is the same as the above steps 1-4, and steps 5-9 are shown as follows.
  1. Instantiate an esekf object kf and initialize it with initial or default state and covariance.

(1) initial state and covariance:

state init_state;
esekfom::esekf<state, process_noise_dof, input>::cov init_P;
esekfom::esekf<state, process_noise_dof, input> kf(init_state,init_P);

(2) default state and covariance:

esekfom::esekf<state, process_noise_dof, input> kf;
  1. Deliver the defined models, std int maximum iteration numbers Maximum_iter, and the std array for testing convergence epsi into the esekf object:
double epsi[state_dof] = {0.001};
fill(epsi, epsi+state_dof, 0.001); // if the absolute of innovation of ekf update is smaller than epso, the update iteration is converged
kf.init_dyn_runtime_share(f, df_dx, df_dw, Maximum_iter, epsi);
  1. In the running time, once an input in or a measurement z is received dt after the last propagation or update, a propagation is executed:
kf.predict(dt, Q, in); // process noise covariance: Q. an Eigen matrix
  1. Once a measurement z is received, build system measurement as compound manifolds following step 3 and implement the output equation and its differentiation , :
measurement h_dyn_runtime_share(state &s, esekfom::dyn_runtime_share_datastruct<double> &dyn_runtime_share_data) 
{
	if(dyn_runtime_share_data.converge) {} // this value is true means iteration is converged 
	if(condition) dyn_runtime_share_data.valid = false; // the iteration stops before convergence when this value is false, if conditions other than convergence is satisfied
	dyn_runtime_share_data.h_x = H_x; // H_x is the result matrix of the first differentiation 
	dyn_runtime_share_data.h_v = H_v; // H_v is the result matrix of the second differentiation
	dyn_runtime_share_data.R = R; // R is the measurement noise covariance
	
	measurement h_;
	h_.pos = s.pos;
	return h_;
}

This function would be called during ekf state update, and the output function and its derivatives, the measurement and the measurement noise would be obtained from this one union function

then an iterated update is executed:

kf.update_iterated_dyn_runtime_share(z, h_dyn_runtime_share);

Remarks(2):

  • The value of the state x and the covariance P are able to be changed by functions change_x() and change_P():
state set_x;
kf.change_x(set_x);
esekfom::esekf<state, process_noise_dof, input>::cov set_P;
kf.change_P(set_P);

5. Run samples

Clone the repository:

    git clone https://github.com/hku-mars/IKFoM.git

Sample 1. In the Sample_1 file folder, there is the scource code that applys the IKFoM on the original source code from FAST LIO. Please follow the README.md shown in that repository excepting the step 2. Build, which is modified as:

cd ~/catkin_ws/src
cp -r ~/IKFoM/Samples/FAST_LIO FAST_LIO
cd ..
catkin_make
source devel/setup.bash

Livox Avia rosbag: Can be downloaded from here

For the indoor bag, run:

roslaunch fast_lio mapping_avia.launch
rosbag play YOUR_DOWNLOADED.bag

For the outdoor bag, run:

roslaunch fast_lio mapping_avia_outdoor.launch
rosbag play YOUR_DOWNLOADED.bag

Sample 2. In the Sample_2 file folder, there is the scource code that applys the IKFoM on the original source code from LINS. Please follow the README.md shown in that repository excepting the step Compile, which is modified as:

cd ~/catkin_ws/src
cp -r ~/IKFoM/Samples/LINS---LiDAR-inertial-SLAM LINS---LiDAR-inertial-SLAM
cd ..
catkin_make -j1
source devel/setup.bash

LIO-SAM Dataset: Can be found here, in which, Campus_dataset(large) and Campus_dataset(small) are tested in our paper.

Run

roslaunch lins run_port_exp.launch
rosbag play YOUR_DOWNLOADED.bag --clock

6.Acknowledgments

Thanks for C. Hertzberg, R. Wagner, U. Frese, and L. Schroder. Integratinggeneric sensor fusion algorithms with sound state representationsthrough encapsulation of manifolds.

ikfom's People

Contributors

joanna-he 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  avatar  avatar  avatar  avatar

ikfom's Issues

How to compute equation (38)?

I am confusing how to compute equation (38) in "Kalman Filters on Differentiable Manifolds" even though I figure out the method in "The iterated kalman filter update as a gauss-newton method". They have different loss functions.
image

Yaw角观测函数如何写

作者您好,我现在对载体有一个yaw角的观测量,请问如何写对应的h和h_x呢,有对应的示例吗,感激不尽!

Question about the observation model

Could you help me understand the error-state Kalman filter on your paper? According to (33), the observation model (the likelihood) is defined as $p(𝐃_{k+1}^j 𝐯_{k+1} \mid δ𝐱_j)$. Why the left-hand side of the bar is not $𝐳_{k+1}$ but $𝐃_{k+1}^j 𝐯_{k+1}$?

请教一下,在FAST-LIO的应用例子中初始化的时候为什么只初始化了bg,没有初始化 ba

在FAST_LIO/src文件夹的IMU_Processing文件里,IMU_init函数中

  state_ikfom init_state = kf_state.get_x();
  init_state.grav = S2(- mean_acc / mean_acc.norm() * G_m_s2);

  //state_inout.rot = Eye3d; // Exp(mean_acc.cross(V3D(0, 0, -1 / scale_gravity)));
  init_state.bg  = mean_gyr;
  init_state.offset_T_L_I = Lidar_T_wrt_IMU;
  init_state.offset_R_L_I = Lidar_R_wrt_IMU;
  kf_state.change_x(init_state);

ba不也是存在的bias且需要初始化吗

add interface to supprt get sub state's index

is there possible to support get sub state's index in states vector, here is examples that commly use:
define states vector x = [vec3(p),so3(q),vec3(vel),vec(extrisic_p), so3(extrinsic_q)]

if I want to operate substates vel, the code fowlling is bound to the absolute position of sub states in states vector
x[6] = *;x[7]=*,x[8]=
but, if there is an interface to get sub state index, the code above do not have any changes when I change the states ordering,like:
x[x.vel.start_index()] = *;x[x.vel.start_index() + 1]=*,x[x.vel.start_index() + 2]=
as getting sub state is a very common operation, when I change the states ordering, too much code related to states index have to be changed and very easy got into trouble.

2-sphere manifold in example 6

Hi, author,
Thanks for your hard-core paper and sharing to community very much! I have three questions and want to ask for your help. Could you recommend some reference materials about 2-sphere manifold? Thanks for your help and time!
image

bug: the scale of the exponential value is zero

Description

In the code, the scale is set to scalar_type(1/2) when the exponential value is used. This is to ensure that there is a compile-time conversion between the scalar type of the class and the scalar type of the exponential value. However, this can cause an issue because the value is computed at compile time with integer division, which result zero.

Position

You can find this issue in the code by searching for scalar_type(1/2). The issue is ever present in the exponential computation.

Small test

#include <iostream>
template <class scale_type> class Test {
public:
  Test() { std::cout << scale_type(1 / 2) << ' '; }
};

int main() {
  Test<int> t0;
  Test<float> t1;
  Test<double> t2;
  return 0;
}

Result:

0 0 0

Question about Eq. (60)

Hello, Author

Your paper is really informative and helpful to understand Iterated error-state Kalman filter 👍

I have one question while reading your paper's eq. (60).
image

As far as I know, A(.) matrix is the Right Jacobian of SO(3). Then below formulas will meet.
image

But IKFoM paper uses A^T instead of A matrix. I looked for the paper [38] you referred but I couldn't find the clue of it. Is it a correct way to derivate like A^T instead of A?

Thanks in advance!

我在配置sample1中的FAST-LIO时编译产生如下报错,请问原因是什么?

/home/ROS_WS/M_EKF_ws/src/FAST_LIO/include/IKFoM_toolkit/esekfom/esekfom.hpp: In member function ‘void esekfom::esekf<state, process_noise_dof, input, measurement, measurement_noise_dof>::update_iterated_dyn_share_modified_extrinsic(double)’: /home/ROS_WS/M_EKF_ws/src/FAST_LIO/include/IKFoM_toolkit/esekfom/esekfom.hpp:2695:20: error: there are no arguments to ‘K_’ that depend on a template parameter, so a declaration of ‘K_’ must be available [-fpermissive] 2695 | sen_p(j) = K_(idx+j,i); | ^~ /home/ROS_WS/M_EKF_ws/src/FAST_LIO/include/IKFoM_toolkit/esekfom/esekfom.hpp:2695:20: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
我应该是按照教程先做了FAST-LIO的1. Prerequisites然后将2. build替换成了IKFoM的代码再catkin_make,流程上似乎没有问题?

A question about the S2 manifold

Thank you so much for your wonderful work. I would like to ask how to determine the orthogonal basis B in the tangent space of S2 manifold. The relevant code seems to be

				if (vec[0] + length > tolerance<scalar>())
				{

					res << -vec[1], -vec[2],
						length - vec[1] * vec[1] / (length + vec[0]), -vec[2] * vec[1] / (length + vec[0]),
						-vec[2] * vec[1] / (length + vec[0]), length - vec[2] * vec[2] / (length + vec[0]);
					res /= length;
				}
				else
				{
					res = Eigen::Matrix<scalar, 3, 2>::Zero();
					res(1, 1) = -1;
					res(2, 0) = 1;
				}

Can you list some relevant materials for me to learn about this and the M and N matrix used in S2 manifold?

用于融合定位

在机器人定位过程中,往往激光处理需要0.1~0.2秒时间t,激光定位的结果就存在时延。

我想在激光定位结果出现之前可以用ikfom接收里程计和imu的预测结果,等激光定位结果出来之后,根据激光定位的结果再修正。

IKFom我看了代码目前没有处理不同时间戳的部分。在建图项目里,比如fast-lio里是通过提前同步数据来解决这个问题的。

我想请教一下,想达成这个效果有什么办法比较好呢?

常量维度测量值更新函数定义问题

作者您好,想请教一个问题:
Readme里面看到当测量值是常量维度时的第5步,需要实现一个输出等式"Implement the output equation h(x,v)",并求相关的偏导
假如我现在需要在原有的激光雷达的测量更新基础上,再利用rtk提供的位置信息,对fast-lio的状态向量中位置P进行测量更新,我定义如下的函数是否可行?期待您的回复
image

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.