Go to the documentation of this file.
43 #include <boost/utility.hpp>
44 #include <boost/type_traits.hpp>
50 #define SMALL_NUM 0.00000001
62 inline bool is_close(
double a,
double b,
double epsilon = 1e-4)
64 return std::fabs(a - b) <
epsilon;
75 for (std::vector<double>::const_iterator it =
angles.begin(); it!=
angles.end(); ++it)
83 return std::atan2(y, x);
87 inline bool smaller_than_abs(
double i,
double j) {
return std::fabs(i)<std::fabs(j);}
97 return x / (1 + fabs(x));
106 template <
typename P1,
typename P2>
109 return std::sqrt( std::pow(point2.x-point1.x,2) + std::pow(point2.y-point1.y,2) );
119 template <
typename V1,
typename V2>
120 inline double cross2d(
const V1& v1,
const V2& v2)
122 return v1.x()*v2.y() - v2.x()*v1.y();
148 inline const T&
get_const_reference(
const T& val,
typename boost::disable_if<boost::is_pointer<T> >::type* dummy = 0) {
return val;}
double cross2d(const V1 &v1, const V2 &v2)
Calculate the 2d cross product (returns length of the resulting vector along the z-axis in 3d)
const T & get_const_reference(const T *ptr)
Helper function that returns the const reference to a value defined by either its raw pointer type or...
RotType
Symbols for left/none/right rotations
double fast_sigmoid(double x)
Calculate a fast approximation of a sigmoid function.
double average_angles(const std::vector< double > &angles)
Return the average angle of an arbitrary number of given angles [rad].
double distance_points2d(const P1 &point1, const P2 &point2)
Calculate Euclidean distance between two 2D point datatypes.
bool is_close(double a, double b, double epsilon=1e-4)
Check whether two variables (double) are close to each other.
bool smaller_than_abs(double i, double j)
Small helper function: check if |a|<|b|.
teb_local_planner
Author(s): Christoph Rösmann
autogenerated on Sun Jan 7 2024 03:45:15