22 #ifndef OV_EVAL_ALIGNUTILS_H 23 #define OV_EVAL_ALIGNUTILS_H 25 #include <Eigen/Eigen> 53 static inline double get_best_yaw(
const Eigen::Matrix<double, 3, 3> &C) {
54 double A = C(0, 1) - C(1, 0);
55 double B = C(0, 0) + C(1, 1);
65 static inline Eigen::Matrix<double, 3, 1>
get_mean(
const std::vector<Eigen::Matrix<double, 3, 1>> &data) {
66 Eigen::Matrix<double, 3, 1> mean = Eigen::Matrix<double, 3, 1>::Zero();
67 for (
size_t i = 0; i < data.size(); i++) {
68 mean.noalias() += data[i];
86 static void align_umeyama(
const std::vector<Eigen::Matrix<double, 3, 1>> &data,
const std::vector<Eigen::Matrix<double, 3, 1>> &model,
87 Eigen::Matrix<double, 3, 3> &R, Eigen::Matrix<double, 3, 1> &t,
double &
s,
bool known_scale,
bool yaw_only);
94 static void perform_association(
double offset,
double max_difference, std::vector<double> &est_times, std::vector<double> >_times,
95 std::vector<Eigen::Matrix<double, 7, 1>> &est_poses, std::vector<Eigen::Matrix<double, 7, 1>> >_poses);
102 static void perform_association(
double offset,
double max_difference, std::vector<double> &est_times, std::vector<double> >_times,
103 std::vector<Eigen::Matrix<double, 7, 1>> &est_poses, std::vector<Eigen::Matrix<double, 7, 1>> >_poses,
104 std::vector<Eigen::Matrix3d> &est_covori, std::vector<Eigen::Matrix3d> &est_covpos,
105 std::vector<Eigen::Matrix3d> >_covori, std::vector<Eigen::Matrix3d> >_covpos);
110 #endif // OV_EVAL_ALIGNUTILS_H static void perform_association(double offset, double max_difference, std::vector< double > &est_times, std::vector< double > >_times, std::vector< Eigen::Matrix< double, 7, 1 >> &est_poses, std::vector< Eigen::Matrix< double, 7, 1 >> >_poses)
Will intersect our loaded data so that we have common timestamps.
Evaluation and recording utilities.
static Eigen::Matrix< double, 3, 1 > get_mean(const std::vector< Eigen::Matrix< double, 3, 1 >> &data)
Gets mean of the vector of data.
Helper functions for the trajectory alignment class.
static void align_umeyama(const std::vector< Eigen::Matrix< double, 3, 1 >> &data, const std::vector< Eigen::Matrix< double, 3, 1 >> &model, Eigen::Matrix< double, 3, 3 > &R, Eigen::Matrix< double, 3, 1 > &t, double &s, bool known_scale, bool yaw_only)
Given a set of points in a model frame and a set of points in a data frame, finds best transform betw...
static double get_best_yaw(const Eigen::Matrix< double, 3, 3 > &C)
Gets best yaw from Frobenius problem. Equation (17)-(18) in Zhang et al. 2018 IROS paper...