58 #include <sys/types.h> 64 #include "rnr/rnrconfig.h" 69 #define M_TAU (2.0 * M_PI) 104 return d / 360.0 *
M_TAU;
116 return r /
M_TAU * 360.0;
140 inline double fcap(
double a,
double min,
double max)
142 return a<min? min: a>max? max: a;
154 inline int icap(
int a,
int min,
int max)
156 return a<min? min: a>max? max: a;
168 return b?
"true":
"false";
182 inline bool operator<(
const struct timeval& lhs,
const struct timeval& rhs)
184 if( lhs.tv_sec < rhs.tv_sec )
188 else if( (lhs.tv_sec == rhs.tv_sec) && (lhs.tv_usec < rhs.tv_usec) )
209 inline bool operator==(
const struct timeval& lhs,
const struct timeval& rhs)
211 return (lhs.tv_sec == rhs.tv_sec) && (lhs.tv_usec == rhs.tv_usec)?
230 #endif // _KUON_UTILS_H uint_t strToVersion(const std::string &str)
Convert version dotted string to integer equivalent.
const char * boolstr(bool b)
Boolean to string.
The <b><i>Kuon</i></b> namespace encapsulates all <b><i>Kuon</i></b> related constructs.
bool operator<(const struct timeval &lhs, const struct timeval &rhs)
Compare operator to test if left hand side time is earlier than the right hand side time...
int iabs(int a)
Integer absolute value.
int icap(int a, int min, int max)
Cap value within limits [min, max].
RoadNarrows Kuon robot top-level header file.
std::string getRealDeviceName(const std::string &strDevName)
Get real device name.
double fcap(double a, double min, double max)
Cap value within limits [min, max].
const char * getStrError(const int ecode)
Get the error string describing the error code.
#define M_TAU
tau = 2 * pi
double degToRad(double d)
Convert degrees to radians.
double radToDeg(double r)
Convert radians to degrees.
bool operator==(const struct timeval &lhs, const struct timeval &rhs)
Compare operator to test if left hand side time equals the right hand side time.