modern_robotics
utils.hpp
Go to the documentation of this file.
1 #ifndef MODERN_ROBOTICS__UTILS_HPP___
2 #define MODERN_ROBOTICS__UTILS_HPP___
3 
4 #include <armadillo>
5 #include <cmath>
6 #include <cstdlib>
7 
8 namespace mr
9 {
10 constexpr double tolerance = 1e-6;
11 
15 constexpr bool NearZero(const double z)
16 {
17  return std::fabs(z) < tolerance;
18 }
19 
23 const arma::vec Normalize(const arma::vec & vec);
24 } // namespace modern_robotics
25 
26 #endif
Definition: dynamics_of_open_chains.hpp:7
const arma::vec Normalize(const arma::vec &vec)
Normalize a vector to unit length.
Definition: utils.cpp:6
constexpr double tolerance
Definition: utils.hpp:10
constexpr bool NearZero(const double z)
Check if a number is close to zero.
Definition: utils.hpp:15