MCPcopy Create free account
hub / github.com/ComputationalRobotics/XM-code / GravError

Class GravError

deps/glomap/glomap/estimators/cost_function.h:220–243  ·  view source on GitHub ↗

---------------------------------------- GravError ----------------------------------------

Source from the content-addressed store, hash-verified

218// GravError
219// ----------------------------------------
220struct GravError {
221 GravError(const Eigen::Vector3d& grav_obs) : grav_obs_(grav_obs) {}
222
223 template <typename T>
224 bool operator()(const T* const gvec, T* residuals) const {
225 Eigen::Matrix<T, 3, 1> grav_est;
226 grav_est << gvec[0], gvec[1], gvec[2];
227
228 for (int i = 0; i < 3; i++) {
229 residuals[i] = grav_est[i] - grav_obs_[i];
230 }
231
232 return true;
233 }
234
235 // Factory function
236 static ceres::CostFunction* CreateCost(const Eigen::Vector3d& grav_obs) {
237 return (new ceres::AutoDiffCostFunction<GravError, 3, 3>(
238 new GravError(grav_obs)));
239 }
240
241 private:
242 const Eigen::Vector3d& grav_obs_;
243};
244
245} // namespace glomap

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected