diff options
author | Martin Miller | 2017-03-19 22:14:13 -0500 |
---|---|---|
committer | Martin Miller | 2017-03-19 22:14:13 -0500 |
commit | da0989a2dada2fa195035be1443cf27710cdc32c (patch) | |
tree | 2ef139db6d14bcebb16e00da70ad426cfbf55501 /src | |
parent | 2a08bf8b469131e82aa259a3be65a6b5dc8c1be0 (diff) | |
download | refslam-da0989a2dada2fa195035be1443cf27710cdc32c.zip refslam-da0989a2dada2fa195035be1443cf27710cdc32c.tar.gz |
Forgot to add this file several commits ago.
types.h contains all of the type definitions, they were moved out of
main.h because I couldn't successfully compile that way.
Diffstat (limited to 'src')
-rw-r--r-- | src/types.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/types.h b/src/types.h new file mode 100644 index 0000000..9608f74 --- /dev/null +++ b/src/types.h @@ -0,0 +1,71 @@ +#ifndef types_INC +#define types_INC + +#include <Eigen/Dense> +#define MAXLINE 8192 +#define MAXFILENAME 1024 + +using Eigen::Matrix; +using Eigen::Matrix3d; +using Eigen::Quaterniond; +using Eigen::Vector3d; +// A struct for storing PVA covariance. +typedef struct { + Matrix3d position,velocity,attitude; +} covariance_t; + +// A struct for storing x,y,z data. +typedef struct { + double x,y,z; +} tuple; + +// A struct for storing velocity in world frame +typedef struct { + double east, north, up; +} velocity_t; + +// A struct for storing attitude data. +typedef struct { + double roll,pitch,yaw; +} attitude_t; + +// A struct for storing UTM data. +typedef struct { + double northing,easting,up; + int zone_i; + char zone_c; +} UTM; + +// A struct for storing GPS data. +typedef struct { + double latitude, longitude, altitude; +} gps; + +// Message types +typedef enum {BESTUTM,IMG,INSCOVS,INSPVAS,RAWIMUS} message_type; + +/* + * The message struct is a general container for all message types. Not all + * members are used for all messages, so care must be taken not to use garbage + * values. + */ +typedef struct { + int secs,nsecs; +} timestamp; + +typedef struct { + // These should always be set. + timestamp stamp; + message_type msg_type; + + // Only the members needed by the msg_type are stored. + tuple angular_velocity; + attitude_t attitude; + char image_names[2][MAXFILENAME]; + tuple linear_acceleration; + gps position; + UTM utm; + velocity_t velocity; + covariance_t covariance; +} message; +#endif /* ----- #ifndef types_INC ----- */ |