66 template <
int Rows,
int Cols>
67 [[nodiscard]]
bool read(Matrix<Rows, Cols> &x,
const std::string ¶m)
71 using vector = std::vector<fp>;
72 using vectorvector = std::vector<std::vector<fp>>;
77 if constexpr (Rows == 1 || Cols == 1)
79 vector vec = node_[param].as<vector>();
80 if constexpr (Rows == -1)
88 x = Map<Matrix<Rows, Cols>>(vec.data(), rows, cols);
92 vectorvector mat = node_[param].as<vectorvector>();
93 vector vec = utils::flatten(mat);
94 if constexpr (Rows == 1 && Cols == 1)
97 cols = vec.size() / mat.size();
99 x = Map<Matrix<Rows, Cols, Eigen::RowMajor>>(vec.data(), rows, cols);
101 if constexpr (Rows == 1)
104 (std::ostringstream{} << x).str());
109 (std::ostringstream{} << x.transpose()).str());
114 (std::ostringstream{} << x).str());
133 template <
typename Scalar>
134 [[nodiscard]]
bool read(Quaternion &q,
const std::string ¶m)
138 using vector = std::vector<fp>;
139 vector vec = node_[param].as<vector>();
140 q = Quaternion(vec).normalize();
142 (std::ostringstream{} << q).str());
157 template <
typename T>
158 [[nodiscard]]
bool read(T &p,
const std::string ¶m)
162 p = node_[param].as<T>();
164 (std::ostringstream{} << p).str());
171 template <
typename T,
typename Convertible>
172 void readDefault(T &p,
const Convertible &def,
const std::string ¶m)
174 static_assert(std::is_convertible_v<Convertible, T>);
179 (std::ostringstream{} << p).str());
196 void parseCameraParameters(SE3 &extrinsics,
198 DistortionModel &distortion_model,
199 VectorX &distortion_coefficients,
201 fp ×hift_cam_imu,
203 MaskType &mask_type);
212 void parseGivenOrigin(SE23 &T, Vector6 &b, fp &t0);
219 void parseEqualizationMethod(EqualizationMethod &eq);
226 void parseFeatureRepresentation(FeatureRepresentation &rep);
233 void parseProjectionMethod(ProjectionMethod &proj);
240 void parseDetectorType(FeatureDetector &detector);
251 void parseInitialCovariance(Matrix9 &D_cov, Matrix6 &delta_cov, Matrix6 &E_cov, Matrix4 &L_cov);
261 void parseProcessNoise(fp &w_std, fp &a_std, fp &bw_std, fp &ba_std);
270 void parsePixStd(fp &pix_std,
const StateOptions &opts);
277 void parseZeroVelocityUpdate(ZeroVelocityUpdate &zvu);
280 std::string filepath_;
static void warn(const T &msg)
Format a warn message and log it in yellow.
Definition logger.hpp:108