17 #ifndef CARTOGRAPHER_MAPPING_INTERNAL_3D_ROTATION_PARAMETERIZATION_H_ 18 #define CARTOGRAPHER_MAPPING_INTERNAL_3D_ROTATION_PARAMETERIZATION_H_ 21 #include "ceres/jet.h" 22 #include "ceres/rotation.h" 29 bool operator()(
const T* x,
const T* delta, T* x_plus_delta)
const {
30 const T clamped_delta =
common::Clamp(delta[0], T(-0.5), T(0.5));
32 q_delta[0] = ceres::sqrt(1. - clamped_delta * clamped_delta);
35 q_delta[3] = clamped_delta;
43 bool operator()(
const T* x,
const T* delta, T* x_plus_delta)
const {
46 const T sin_delta_over_delta =
47 delta_norm < 1e-6 ? T(1.) : ceres::sin(delta_norm) / delta_norm;
49 q_delta[0] = delta_norm < 1e-6 ? T(1.) : ceres::cos(delta_norm);
50 q_delta[1] = sin_delta_over_delta * delta[0];
51 q_delta[2] = sin_delta_over_delta * delta[1];
67 #endif // CARTOGRAPHER_MAPPING_INTERNAL_3D_ROTATION_PARAMETERIZATION_H_
bool operator()(const T *x, const T *delta, T *x_plus_delta) const
bool operator()(const T *x, const T *delta, T *x_plus_delta) const
void QuaternionProduct(const double *const z, const T *const w, T *const zw)
T Clamp(const T value, const T min, const T max)