ov_core namespace
Core algorithms for Open VINS.
This has the core algorithms that all projects within the Open VINS ecosystem leverage. The purpose is to allow for the reuse of code that could be shared between different localization systems (i.e. msckf-based, batch-based, etc.). These algorithms are the foundation which is necessary before we can even write an estimator that can perform localization. The key components of the ov_
- Closed-form preintegration [3]
- 3d feature initialization
- Inertial state initialization
- Visual-inertial simulator and SE(3) b-spline
- KLT, descriptor, aruco, and simulation feature trackers
- Groundtruth dataset reader
- Quaternion and other manifold math operations
- Generic type system and their implementations
Please take a look at classes that we offer for the user to leverage as each has its own documentation. If you are looking for the estimator please take a look at the ov_
Classes
- class BsplineSE3
- B-Spline which performs interpolation over SE(3) manifold.
- class CpiBase
- Base class for continuous preintegration integrators.
- class CpiV1
- Model 1 of continuous preintegration.
- class CpiV2
- Model 2 of continuous preintegration.
- class DatasetReader
- Helper functions to read in dataset files.
- class Feature
- Sparse feature class used to collect measurements.
- class FeatureDatabase
- Database containing features we are currently tracking.
- class FeatureInitializer
- Class that triangulates feature.
- struct FeatureInitializerOptions
- Struct which stores all our feature initializer options.
- class FeatureRepresentation
- Class has useful feature representation types.
- class Grider_DOG
- Does Difference of Gaussian (DoG) in a grid pattern.
- class Grider_FAST
- Extracts FAST features in a grid pattern.
- class IMU
- Derived Type class that implements an IMU state.
- class InertialInitializer
- Initializer for visual-inertial system.
- class JPLQuat
- Derived Type class that implements JPL quaternion.
- class Landmark
- Type that implements a persistant SLAM feature.
- class PoseJPL
- Derived Type class that implements a 6 d.o.f pose.
- class Simulator
- Master simulator class that will create artificial measurements for our visual-inertial algorithms.
- class TrackAruco
- Tracking of OpenCV Aruoc tags.
- class TrackBase
- Visual feature tracking base class.
- class TrackDescriptor
- Descriptor-based visual tracking.
- class TrackKLT
- KLT tracking of features.
- class TrackSIM
- Simulated tracker for when we already have uv measurements!
- class Type
- Base class for estimated variables.
- class Vec
- Derived Type class that implements vector variables.
Functions
- auto rot_2_quat(const Eigen::Matrix<double, 3, 3>& rot) -> Eigen::Matrix<double, 4, 1>
- Returns a JPL quaternion from a rotation matrix.
- auto skew_x(const Eigen::Matrix<double, 3, 1>& w) -> Eigen::Matrix<double, 3, 3>
- Skew-symmetric matrix from a given 3x1 vector.
- auto quat_2_Rot(const Eigen::Matrix<double, 4, 1>& q) -> Eigen::Matrix<double, 3, 3>
- Converts JPL quaterion to SO(3) rotation matrix.
- auto quat_multiply(const Eigen::Matrix<double, 4, 1>& q, const Eigen::Matrix<double, 4, 1>& p) -> Eigen::Matrix<double, 4, 1>
- Multiply two JPL quaternions.
- auto vee(const Eigen::Matrix<double, 3, 3>& w_x) -> Eigen::Matrix<double, 3, 1>
- Returns vector portion of skew-symmetric.
- auto exp_so3(const Eigen::Matrix<double, 3, 1>& w) -> Eigen::Matrix<double, 3, 3>
- SO(3) matrix exponential.
- auto log_so3(const Eigen::Matrix<double, 3, 3>& R) -> Eigen::Matrix<double, 3, 1>
- SO(3) matrix logarithm.
- auto exp_se3(Eigen::Matrix<double, 6, 1> vec) -> Eigen::Matrix4d
- SE(3) matrix exponential function.
- auto log_se3(Eigen::Matrix4d mat) -> Eigen::Matrix<double, 6, 1>
- SE(3) matrix logarithm.
- auto hat_se3(const Eigen::Matrix<double, 6, 1>& vec) -> Eigen::Matrix4d
- Hat operator for R^6 -> Lie Algebra se(3)
- auto Inv_se3(const Eigen::Matrix4d& T) -> Eigen::Matrix4d
- SE(3) matrix analytical inverse.
- auto Inv(Eigen::Matrix<double, 4, 1> q) -> Eigen::Matrix<double, 4, 1>
- JPL Quaternion inverse.
- auto Omega(Eigen::Matrix<double, 3, 1> w) -> Eigen::Matrix<double, 4, 4>
- Integrated quaternion from angular velocity.
- auto quatnorm(Eigen::Matrix<double, 4, 1> q_t) -> Eigen::Matrix<double, 4, 1>
- Normalizes a quaternion to make sure it is unit norm.
- auto Jl_so3(Eigen::Matrix<double, 3, 1> w) -> Eigen::Matrix<double, 3, 3>
- Computes left Jacobian of SO(3)
- auto Jr_so3(Eigen::Matrix<double, 3, 1> w) -> Eigen::Matrix<double, 3, 3>
- Computes right Jacobian of SO(3)
Function documentation
Eigen::Matrix<double, 4, 1> ov_ core:: rot_2_quat(const Eigen::Matrix<double, 3, 3>& rot)
Returns a JPL quaternion from a rotation matrix.
| Parameters | |
|---|---|
| rot in | 3x3 rotation matrix |
| Returns | 4x1 quaternion |
This is based on the equation 74 in Indirect Kalman Filter for 3D Attitude Estimation. In the implementation, we have 4 statements so that we avoid a division by zero and instead always divide by the largest diagonal element. This all comes from the definition of a rotation matrix, using the diagonal elements and an off-diagonal.
Eigen::Matrix<double, 3, 3> ov_ core:: skew_x(const Eigen::Matrix<double, 3, 1>& w)
Skew-symmetric matrix from a given 3x1 vector.
| Parameters | |
|---|---|
| w in | 3x1 vector to be made a skew-symmetric |
| Returns | 3x3 skew-symmetric matrix |
This is based on equation 6 in Indirect Kalman Filter for 3D Attitude Estimation:
Eigen::Matrix<double, 3, 3> ov_ core:: quat_2_Rot(const Eigen::Matrix<double, 4, 1>& q)
Converts JPL quaterion to SO(3) rotation matrix.
| Parameters | |
|---|---|
| q in | JPL quaternion |
| Returns | 3x3 SO(3) rotation matrix |
This is based on equation 62 in Indirect Kalman Filter for 3D Attitude Estimation:
Eigen::Matrix<double, 4, 1> ov_ core:: quat_multiply(const Eigen::Matrix<double, 4, 1>& q,
const Eigen::Matrix<double, 4, 1>& p)
Multiply two JPL quaternions.
| Parameters | |
|---|---|
| q in | First JPL quaternion |
| p in | Second JPL quaternion |
| Returns | 4x1 resulting p*q quaternion |
This is based on equation 9 in Indirect Kalman Filter for 3D Attitude Estimation. We also enforce that the quaternion is unique by having q_4 be greater than zero.
Eigen::Matrix<double, 3, 3> ov_ core:: exp_so3(const Eigen::Matrix<double, 3, 1>& w)
SO(3) matrix exponential.
| Parameters | |
|---|---|
| w in | 3x1 vector we will take the exponential of |
| Returns | SO(3) rotation matrix |
SO(3) matrix exponential mapping from the vector to SO(3) lie group. This formula ends up being the Rodrigues formula. This definition was taken from "Lie Groups for 2D and 3D Transformations" by Ethan Eade equation 15. http:/
Eigen::Matrix<double, 3, 1> ov_ core:: log_so3(const Eigen::Matrix<double, 3, 3>& R)
SO(3) matrix logarithm.
| Parameters | |
|---|---|
| R in | 3x3 SO(3) rotation matrix |
| Returns | 3x1 in the se(3) space [omegax, omegay, omegaz] |
This definition was taken from "Lie Groups for 2D and 3D Transformations" by Ethan Eade equation 17 & 18. http:/
Eigen::Matrix4d ov_ core:: exp_se3(Eigen::Matrix<double, 6, 1> vec)
SE(3) matrix exponential function.
| Parameters | |
|---|---|
| vec | 6x1 in the se(3) space [omega, u] |
| Returns | 4x4 SE(3) matrix |
Equation is from Ethan Eade's reference: http:/
where we have the following definitions
Eigen::Matrix<double, 6, 1> ov_ core:: log_se3(Eigen::Matrix4d mat)
SE(3) matrix logarithm.
| Parameters | |
|---|---|
| mat | 4x4 SE(3) matrix |
| Returns | 6x1 in the se(3) space [omega, u] |
Equation is from Ethan Eade's reference: http:/
where we have the following definitions
Eigen::Matrix4d ov_ core:: hat_se3(const Eigen::Matrix<double, 6, 1>& vec)
Hat operator for R^6 -> Lie Algebra se(3)
| Parameters | |
|---|---|
| vec | 6x1 in the se(3) space [omega, u] |
| Returns | Lie algebra se(3) 4x4 matrix |
Eigen::Matrix4d ov_ core:: Inv_se3(const Eigen::Matrix4d& T)
SE(3) matrix analytical inverse.
| Parameters | |
|---|---|
| T in | SE(3) matrix |
| Returns | inversed SE(3) matrix |
It seems that using the .inverse() function is not a good way. This should be used in all cases we need the inverse instead of numerical inverse. https://github.com/rpng/open_
Eigen::Matrix<double, 4, 1> ov_ core:: Inv(Eigen::Matrix<double, 4, 1> q)
JPL Quaternion inverse.
| Parameters | |
|---|---|
| q in | quaternion we want to change |
| Returns | inversed quaternion |
See equation 21 in Indirect Kalman Filter for 3D Attitude Estimation.
Eigen::Matrix<double, 4, 4> ov_ core:: Omega(Eigen::Matrix<double, 3, 1> w)
Integrated quaternion from angular velocity.
See equation (48) of trawny tech report Indirect Kalman Filter for 3D Attitude Estimation.
Eigen::Matrix<double, 4, 1> ov_ core:: quatnorm(Eigen::Matrix<double, 4, 1> q_t)
Normalizes a quaternion to make sure it is unit norm.
| Parameters | |
|---|---|
| q_t | Quaternion to normalized |
| Returns | Normalized quaterion |
Eigen::Matrix<double, 3, 3> ov_ core:: Jl_so3(Eigen::Matrix<double, 3, 1> w)
Computes left Jacobian of SO(3)
| Parameters | |
|---|---|
| w | axis-angle |
| Returns | The left Jacobian of SO(3) |
The left Jacobian of SO(3) is defined equation (7.77b) in State Estimation for Robotics by Timothy D. Barfoot. Specifically it is the following (with and ):
Eigen::Matrix<double, 3, 3> ov_ core:: Jr_so3(Eigen::Matrix<double, 3, 1> w)
Computes right Jacobian of SO(3)
| Parameters | |
|---|---|
| w | axis-angle |
| Returns | The right Jacobian of SO(3) |
The right Jacobian of SO(3) is related to the left by Jl(-w)=Jr(w). See equation (7.87) in State Estimation for Robotics by Timothy D. Barfoot. See Jl_