GLIM
Loading...
Searching...
No Matches
estimation_frame.hpp
1#pragma once
2
3#include <memory>
4#include <unordered_map>
5#include <Eigen/Core>
6#include <Eigen/Geometry>
7
8#include <gtsam_points/types/point_cloud.hpp>
9#include <gtsam_points/types/gaussian_voxelmap.hpp>
10#include <glim/preprocess/preprocessed_frame.hpp>
11
12namespace glim {
13
14enum class FrameID { WORLD, LIDAR, IMU };
15
21 using Ptr = std::shared_ptr<EstimationFrame>;
22 using ConstPtr = std::shared_ptr<const EstimationFrame>;
23
24 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
25
30 EstimationFrame::Ptr clone() const;
31
36 EstimationFrame::Ptr clone_wo_points() const;
37
42 const Eigen::Isometry3d T_world_sensor() const;
43
49 void set_T_world_sensor(FrameID frame_id, const Eigen::Isometry3d& T);
50
57 template <typename T>
58 T* get_custom_data(const std::string& key) {
59 const auto found = custom_data.find(key);
60 if (found == custom_data.end()) {
61 return nullptr;
62 }
63 return reinterpret_cast<T*>(found->second.get());
64 }
65
72 template <typename T>
73 const T* get_custom_data(const std::string& key) const {
74 const auto found = custom_data.find(key);
75 if (found == custom_data.end()) {
76 return nullptr;
77 }
78 return reinterpret_cast<const T*>(found->second.get());
79 }
80
81public:
82 long id;
83 double stamp;
84
85 Eigen::Isometry3d T_lidar_imu;
86 Eigen::Isometry3d T_world_lidar;
87 Eigen::Isometry3d T_world_imu;
88
89 Eigen::Vector3d v_world_imu;
90 Eigen::Matrix<double, 6, 1> imu_bias;
91
92 PreprocessedFrame::ConstPtr raw_frame;
93 Eigen::Matrix<double, 8, -1> imu_rate_trajectory;
94
95 FrameID frame_id;
96 gtsam_points::PointCloud::ConstPtr frame;
97 std::vector<gtsam_points::GaussianVoxelMap::Ptr> voxelmaps;
98
99 std::unordered_map<std::string, std::shared_ptr<void>> custom_data;
100};
101} // namespace glim
Odometry estimation frame.
Definition estimation_frame.hpp:20
Eigen::Vector3d v_world_imu
IMU velocity in the world frame.
Definition estimation_frame.hpp:89
Eigen::Matrix< double, 8, -1 > imu_rate_trajectory
IMU-rate trajectory 8 x N [t, x, y, z, qx, qy, qz, qw].
Definition estimation_frame.hpp:93
Eigen::Matrix< double, 6, 1 > imu_bias
IMU bias.
Definition estimation_frame.hpp:90
gtsam_points::PointCloud::ConstPtr frame
Deskewed points for state estimation.
Definition estimation_frame.hpp:96
Eigen::Isometry3d T_world_imu
IMU pose in the world space.
Definition estimation_frame.hpp:87
const Eigen::Isometry3d T_world_sensor() const
Get the sensor pose according to frame_id.
long id
Frame ID.
Definition estimation_frame.hpp:82
Eigen::Isometry3d T_lidar_imu
LiDAR-IMU transformation.
Definition estimation_frame.hpp:85
EIGEN_MAKE_ALIGNED_OPERATOR_NEW EstimationFrame::Ptr clone() const
Make a clone of the estimation frame. (Points data are shallow copied)
FrameID frame_id
Coordinate frame of $frame.
Definition estimation_frame.hpp:95
Eigen::Isometry3d T_world_lidar
LiDAR pose in the world space.
Definition estimation_frame.hpp:86
std::unordered_map< std::string, std::shared_ptr< void > > custom_data
User-defined custom data.
Definition estimation_frame.hpp:99
std::vector< gtsam_points::GaussianVoxelMap::Ptr > voxelmaps
Multi-resolution voxelmaps.
Definition estimation_frame.hpp:97
T * get_custom_data(const std::string &key)
Get the custom data and cast it to the specified type.
Definition estimation_frame.hpp:58
EstimationFrame::Ptr clone_wo_points() const
Make a clone of the estimation frame instance but without points data.
const T * get_custom_data(const std::string &key) const
Get the custom data and cast it to the specified type.
Definition estimation_frame.hpp:73
void set_T_world_sensor(FrameID frame_id, const Eigen::Isometry3d &T)
Set the sensor pose.
double stamp
Timestamp.
Definition estimation_frame.hpp:83
PreprocessedFrame::ConstPtr raw_frame
Raw input point cloud (LiDAR frame)
Definition estimation_frame.hpp:92