HKUST-Aerial-Robotics / VINS-Fusion

An optimization-based multi-sensor state estimator
GNU General Public License v3.0
3.45k stars 1.37k forks source link

Clarification needed on the configuration params of VINS-Fusion #199

Closed rreddy78 closed 1 year ago

rreddy78 commented 1 year ago

Hello @shaozu / @shaojie

There is a bit of confusion on the configuration of VINS-Fusion. I am testing both VINS-Mono and VINS-Fusion with CARLA Simulation Environment. VINS-Mono is working well with the following transform:

#Rotation from camera frame to imu frame, imu^R_cam
# extrinsicRotation is taken from the API output of the MYNTEYE camera
extrinsicRotation: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data:  [ 0.0, 0.0, 1.0,
           -1.0, 0.0, 0.0, 
            0.0,-1.0, 0.0]
#Translation from camera frame to imu frame, imu^T_cam
extrinsicTranslation: !!opencv-matrix
   rows: 3
   cols: 1
   dt: d
   data: [0.06,0.0, 0.0]

For VINS-Fusion the similar config is not working:

body_T_cam0: !!opencv-matrix
   rows: 4
   cols: 4
   dt: d
   data:  [0.,    0.,    1.,    0.,
          -1.,    0.,    0.,    -0.06, 
           0.,   -1.,    0.,    0.,
           0.,    0.,    0.,    1.]

body_T_cam1: !!opencv-matrix
   rows: 4
   cols: 4
   dt: d
   data:  [0.,    0.,    1.,    0.,
          -1.,    0.,    0.,    0.06, 
           0.,   -1.,    0.,    0.,
           0.,    0.,    0.,    1.]

These transforms are from the Camera frame to IMU frame ? In case VINS-Mono it seems to be so. However I doubt about it regarding VINS-Fusion. Because when I see kitti_config00-02.yaml, I see that:

body_T_cam0: !!opencv-matrix
   rows: 4
   cols: 4
   dt: d
   data: [1, 0, 0, 0,
          0, 1, 0, 0,
          0, 0, 1, 0,
          0, 0, 0, 1]

body_T_cam1: !!opencv-matrix
   rows: 4
   cols: 4
   dt: d
   data: [1, 0, 0, 0.537165718864418,
          0, 1, 0, 0,
          0, 0, 1, 0,
          0, 0, 0, 1]

Now I know in KITTI Vehicle setup this is not the Camera to IMU transform. So I think clarification and better documentation is needed.

rreddy78 commented 1 year ago

Oh man, I had made a terrible mistake with the distance between the stereo cameras. Thats why VINS-Fusion was failing!!! Using m instead of cm between the stereo camers!