CathIAS / TLIO

Tight Learned Inertial Odometry
Other
277 stars 69 forks source link

About the attitude.txt file used in the code. #22

Closed wystephen closed 3 years ago

wystephen commented 3 years ago
    @classmethod
    def from_attitude_file(cls, dataset, args):
        ret = cls()
        attitude_filter_path = osp.join(args.root_dir, dataset, "atttitude.txt")
        with open(attitude_filter_path, "r") as f:
            line = f.readline()
            line = f.readline()
        init_calib = np.fromstring(line, sep=",")
        ret.accelScaleInv = init_calib[1:10].reshape((3, 3))
        ret.gyroScaleInv = init_calib[10:19].reshape((3, 3))
        ret.gyroGSense = init_calib[19:28].reshape((3, 3))
        ret.accelBias = init_calib[28:31].reshape((3, 1))
        ret.gyroBias = init_calib[31:34].reshape((3, 1))
        return ret

According to this code in src/tracker/imu_calib.py. The attitude.txt contained the information that should be provided in calib_state.txt? And this may differ from the README?

calib_state.txt VIO calibration states at image rate (used in data_io.py) [t, acc_scale_inv (9), gyr_scale_inv (9), gyro_g_sense (9), b_acc (3), b_gyr (3)] Note: Changing calibration states from VIO. atttitude.txt AHRS attitude from IMU [t, qw, qx, qy, qz]

CathIAS commented 3 years ago

Yes! Thanks for the question. The first two lines of attitude.txt file has the offline calibration, while the calib_state.txt has the online calibration from VIO. Only the offline calibration is used while running the filter. You can change this to use with your own offline calibration file.