My Project 1.0
Holistic Fusion: A Generic Framework for Multimodal Sensor Fusion
Loading...
Searching...
No Matches
UnaryMeasurementAbsolute.h
Go to the documentation of this file.
1/*
2Copyright 2024 by Julian Nubert, Robotic Systems Lab, ETH Zurich.
3All rights reserved.
4This file is released under the "BSD-3-Clause License".
5Please see the LICENSE file that has been included as part of this package.
6 */
7
8#ifndef HOLISTIC_FUSION_UNARY_MEASUREMENT_ABSOLUTE_H
9#define HOLISTIC_FUSION_UNARY_MEASUREMENT_ABSOLUTE_H
10
11// C++
12#include <optional>
13
14// Workspace
16
17namespace holistic_fusion {
18
27 public:
40 UnaryMeasurementAbsolute(const std::string& measurementName, const int measurementRate, const std::string& sensorFrameName,
41 const std::string& sensorFrameCorrectedName, const RobustNorm robustNorm, const double timeStamp,
42 const double covarianceViolationThreshold, const std::string& fixedFrameName, const std::string& worldFrameName,
43 const std::optional<Eigen::Matrix<double, 6, 1>>& initialSe3AlignmentNoise = std::nullopt,
44 const std::optional<Eigen::Matrix<double, 6, 1>>& se3AlignmentRandomWalk = std::nullopt)
49 // If initialSe3AlignmentNoise is not set, set it to zero
52 }
53 // If not provided, then fixed frame has to be the world frame
54 else {
56 // Check if fixed frame is world frame
58 throw std::runtime_error(
59 "UnaryMeasurementAbsolute: If initialSe3AlignmentNoise is not provided, fixed frame has to be the world frame.");
60 }
61 }
62
63 // If se3AlignmentRandomWalk is not set or zero, set it to zero
66 // If norm is not zero, set random walk flag
67 if (se3AlignmentRandomWalk_.norm() > 1e-08) {
69 }
70 } else {
73 }
74 }
75
76 // Destructor
77 ~UnaryMeasurementAbsolute() override = default;
78
79 // Summary for printout
80 [[nodiscard]] virtual std::string summary() const {
81 std::stringstream ss;
82 ss << std::endl;
83 ss << UnaryMeasurement::summary() << std::endl;
84 ss << "Fixed Frame: " << fixedFrameName_ << std::endl;
85 return ss.str();
86 }
87
88 // Overload << operator
89 friend std::ostream& operator<<(std::ostream& os, const UnaryMeasurementAbsolute& unaryMeasurementAbsolute) {
90 os << unaryMeasurementAbsolute.summary();
91 return os;
92 }
93
94 // Getters
95 [[nodiscard]] const std::string& fixedFrameName() const { return fixedFrameName_; }
96 [[nodiscard]] const std::string& worldFrameName() const { return worldFrameName_; }
97 [[nodiscard]] const Eigen::Matrix<double, 6, 1>& initialSe3AlignmentNoise() const { return initialSe3AlignmentNoise_; }
98 [[nodiscard]] const Eigen::Matrix<double, 6, 1>& se3AlignmentRandomWalk() const { return se3AlignmentRandomWalk_; }
99 [[nodiscard]] bool modelAsRandomWalkFlag() const { return modelAsRandomWalkFlag_; }
100
101 protected:
102 // Standard members
103 std::string fixedFrameName_;
104 std::string worldFrameName_;
105 Eigen::Matrix<double, 6, 1> initialSe3AlignmentNoise_;
106 Eigen::Matrix<double, 6, 1> se3AlignmentRandomWalk_;
108};
109
110} // namespace holistic_fusion
111
112#endif // HOLISTIC_FUSION_UNARY_MEASUREMENT_ABSOLUTE_H
const std::string & sensorFrameName() const
Definition Measurement.h:83
const std::string & sensorFrameCorrectedName() const
Definition Measurement.h:84
int measurementRate() const
Rest.
Definition Measurement.h:86
const std::string & measurementName() const
Names.
Definition Measurement.h:82
const RobustNorm & robustNorm() const
Definition Measurement.h:87
const Eigen::Matrix< double, 6, 1 > & se3AlignmentRandomWalk() const
UnaryMeasurementAbsolute(const std::string &measurementName, const int measurementRate, const std::string &sensorFrameName, const std::string &sensorFrameCorrectedName, const RobustNorm robustNorm, const double timeStamp, const double covarianceViolationThreshold, const std::string &fixedFrameName, const std::string &worldFrameName, const std::optional< Eigen::Matrix< double, 6, 1 > > &initialSe3AlignmentNoise=std::nullopt, const std::optional< Eigen::Matrix< double, 6, 1 > > &se3AlignmentRandomWalk=std::nullopt)
Constructor to create an absolute unary measurement.
friend std::ostream & operator<<(std::ostream &os, const UnaryMeasurementAbsolute &unaryMeasurementAbsolute)
Eigen::Matrix< double, 6, 1 > se3AlignmentRandomWalk_
const Eigen::Matrix< double, 6, 1 > & initialSe3AlignmentNoise() const
Eigen::Matrix< double, 6, 1 > initialSe3AlignmentNoise_
UnaryMeasurement(const std::string &measurementName, const int measurementRate, const std::string &sensorFrameName, const std::string &sensorFrameCorrectedName, const RobustNorm robustNorm, const double timeStamp, const double covarianceViolationThreshold)
Constructor to create a unary measurement.
virtual std::string summary() const
Class to represent a robust norm for a measurement.
Definition Measurement.h:28