17 #ifndef CARTOGRAPHER_COMMON_MATH_H_ 18 #define CARTOGRAPHER_COMMON_MATH_H_ 25 #include "ceres/ceres.h" 44 constexpr T
Power(T base,
int exponent) {
45 return (exponent != 0) ? base *
Power(base, exponent - 1) : T(1);
55 constexpr
double DegToRad(
double deg) {
return M_PI * deg / 180.; }
58 constexpr
double RadToDeg(
double rad) {
return 180. * rad / M_PI; }
63 while (difference > M_PI) {
64 difference -= T(2. * M_PI);
66 while (difference < -M_PI) {
67 difference += T(2. * M_PI);
73 T
atan2(
const Eigen::Matrix<T, 2, 1>& vector) {
80 #endif // CARTOGRAPHER_COMMON_MATH_H_
T atan2(const Eigen::Matrix< T, 2, 1 > &vector)
constexpr double RadToDeg(double rad)
constexpr T Power(T base, int exponent)
constexpr double DegToRad(double deg)
T Clamp(const T value, const T min, const T max)
T NormalizeAngleDifference(T difference)