19 #ifndef ROBOT_CALIBRATION_CERES_MAGNETOMETER_ERROR_H 20 #define ROBOT_CALIBRATION_CERES_MAGNETOMETER_ERROR_H 22 #include <ceres/ceres.h> 39 bool operator()(
const T*
const params, T* residuals)
const 46 residuals[0] = (
x_ - params[1]) * (
x_ - params[1]) +
47 (
y_ - params[2]) * (
y_ - params[2]) +
48 (
z_ - params[3]) * (
z_ - params[3]) -
49 (params[0] * params[0]);
54 static ceres::CostFunction*
Create(
double x,
double y,
double z)
56 ceres::CostFunction* func
57 =
new ceres::AutoDiffCostFunction<HardIronOffsetError, 1, 4>(
new HardIronOffsetError(x, y, z));
66 #endif // ROBOT_CALIBRATION_CERES_MAGNETOMETER_ERROR_H
HardIronOffsetError(double x, double y, double z)
bool operator()(const T *const params, T *residuals) const
static ceres::CostFunction * Create(double x, double y, double z)
Cost functor for magnetometer sample when doing only hard iron offsets.