29 #ifndef INCLUDE_HOKUYOAIST_UTILS_H__ 30 #define INCLUDE_HOKUYOAIST_UTILS_H__ 34 #include <flexiport/port.h> 40 typedef unsigned char uint8_t;
41 typedef unsigned int uint32_t;
42 #if defined(HOKUYOAIST_STATIC) 43 #define HOKUYOAIST_EXPORT 44 #elif defined(hokuyoaist_EXPORTS) 45 #define HOKUYOAIST_EXPORT __declspec(dllexport) 47 #define HOKUYOAIST_EXPORT __declspec(dllimport) 51 #define HOKUYOAIST_EXPORT 61 double const M_PI = 3.14159265358979323846;
65 inline double RTOD(
double rad)
67 return rad * 180.0 /
M_PI;
72 inline double DTOR(
double deg)
74 return deg * M_PI / 180.0;
83 typename std::vector<T>::iterator first(v.begin());
84 typename std::vector<T>::iterator
median(first + (v.end() - first) / 2);
85 std::nth_element(first, median, v.end());
93 #endif // INCLUDE_HOKUYOAIST_UTILS_H__
T median(std::vector< T > &v)
Find the median value of a std::vector.