forked from HeYijia/vio_data_simulation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimu.h
54 lines (40 loc) · 1.12 KB
/
imu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// Created by hyj on 18-1-19.
//
#ifndef IMUSIMWITHPOINTLINE_IMU_H
#define IMUSIMWITHPOINTLINE_IMU_H
#include <eigen3/Eigen/Core>
#include <eigen3/Eigen/Geometry>
#include <iostream>
#include <vector>
#include "param.h"
struct MotionData
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
double timestamp;
Eigen::Matrix3d Rwb;
Eigen::Vector3d twb;
Eigen::Vector3d imu_acc;
Eigen::Vector3d imu_gyro;
Eigen::Vector3d imu_gyro_bias;
Eigen::Vector3d imu_acc_bias;
Eigen::Vector3d imu_velocity;
};
// euler2Rotation: body frame to interitail frame
Eigen::Matrix3d euler2Rotation( Eigen::Vector3d eulerAngles);
Eigen::Matrix3d eulerRates2bodyRates(Eigen::Vector3d eulerAngles);
class IMU
{
public:
IMU(Param p);
Param param_;
Eigen::Vector3d gyro_bias_;
Eigen::Vector3d acc_bias_;
Eigen::Vector3d init_velocity_;
Eigen::Vector3d init_twb_;
Eigen::Matrix3d init_Rwb_;
MotionData MotionModel(double t);
void addIMUnoise(MotionData& data);
void testImu(std::string src, std::string dist); // imu数据进行积分,用来看imu轨迹
};
#endif //IMUSIMWITHPOINTLINE_IMU_H