58 template <
int Rows,
int Cols>
59 [[nodiscard]]
bool read(Matrix<Rows, Cols> &x,
const std::string ¶m)
63 using vector = std::vector<fp>;
64 using vectorvector = std::vector<std::vector<fp>>;
69 if constexpr (Rows == 1 || Cols == 1)
71 vector vec = node_[param].as<vector>();
72 if constexpr (Rows == -1)
80 x = Map<Matrix<Rows, Cols>>(vec.data(), rows, cols);
84 vectorvector mat = node_[param].as<vectorvector>();
85 vector vec = utils::flatten(mat);
86 if constexpr (Rows == 1 && Cols == 1)
89 cols = vec.size() / mat.size();
91 x = Map<Matrix<Rows, Cols, Eigen::RowMajor>>(vec.data(), rows, cols);
93 if constexpr (Rows == 1)
96 (std::ostringstream{} << x).str());
101 (std::ostringstream{} << x.transpose()).str());
106 (std::ostringstream{} << x).str());
125 template <
typename Scalar>
126 [[nodiscard]]
bool read(Quaternion &q,
const std::string ¶m)
130 using vector = std::vector<fp>;
131 vector vec = node_[param].as<vector>();
132 q = Quaternion(vec).normalize();
134 (std::ostringstream{} << q).str());
149 template <
typename T>
150 [[nodiscard]]
bool read(T &p,
const std::string ¶m)
154 p = node_[param].as<T>();
156 (std::ostringstream{} << p).str());
163 template <
typename T,
typename Convertible>
164 void readDefault(T &p,
const Convertible &def,
const std::string ¶m)
166 static_assert(std::is_convertible_v<Convertible, T>);
171 (std::ostringstream{} << p).str());
188 void parseCameraParameters(SE3 &extrinsics,
190 DistortionModel &distortion_model,
191 VectorX &distortion_coefficients,
193 fp ×hift_cam_imu,
195 MaskType &mask_type);
204 void parseGivenOrigin(SE23 &T, Vector6 &b, fp &t0);
211 void parseEqualizationMethod(EqualizationMethod &eq);
218 void parseFeatureRepresentation(FeatureRepresentation &rep);
225 void parseProjectionMethod(ProjectionMethod &proj);
232 void parseDetectorType(FeatureDetector &detector);
243 void parseInitialCovariance(Matrix9 &D_cov, Matrix6 &delta_cov, Matrix6 &E_cov, Matrix4 &L_cov);
253 void parseProcessNoise(fp &w_std, fp &a_std, fp &bw_std, fp &ba_std);
262 void parsePixStd(fp &pix_std,
const StateOptions &opts);
269 void parseZeroVelocityUpdate(ZeroVelocityUpdate &zvu);
272 std::string filepath_;
static void warn(const T &msg)
Format a warn message and log it in yellow.
Definition logger.hpp:100