// // Created by gufe on 4/9/21. // #ifndef SVO_IMU_INTEGRATION_H #define SVO_IMU_INTEGRATION_H #include #include #include #include #include #include #include #include #include #include using gtsam::symbol_shorthand::B; // Bias (ax,ay,az,gx,gy,gz) using gtsam::symbol_shorthand::V; // Vel (xdot,ydot,zdot) using gtsam::symbol_shorthand::P; // Pose3 (x,y,z,r,p,y) using gtsam::symbol_shorthand::L; // Landmark class Imu_Integration{ public: Imu_Integration(Sophus::SE3& SE_init); ~Imu_Integration(); bool reset(gtsam::ISAM2& optimizer,boost::shared_ptr& new_frame); bool reset(gtsam::LevenbergMarquardtOptimizer& optimizer,boost::shared_ptr& new_frame); bool update(double* imu= nullptr); bool predict(boost::shared_ptr&, boost::shared_ptr& last_frame ,std::size_t&,const double reproj_thresh); bool init(boost::shared_ptr&); Sophus::SE3 preintegrate_predict(); private: FILE* logtime; std::shared_ptr statePtr; std::shared_ptr imu_biasPtr; std::shared_ptr valuesPtr; std::shared_ptr graphPtr; boost::shared_ptr parameterPtr; std::shared_ptr preintegratedPtr; boost::shared_ptr ProjectNoisePtr; std::chrono::steady_clock::time_point t_1; std::uint32_t imu_factor_id=0; uint imu_n=0; std::shared_ptr optimizerParamPtr; gtsam::NavState Integ_predict; bool syn=false; }; #endif //SVO_IMU_INTEGRATION_H