Program Listing for File Conversions.h

Return to documentation for file (include/sick_safetyscanners2/utils/Conversions.h)

// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-

// -- BEGIN LICENSE BLOCK ----------------------------------------------

// -- END LICENSE BLOCK ------------------------------------------------

//----------------------------------------------------------------------
//----------------------------------------------------------------------

#ifndef SICK_SAFETYSCANNERS2_UTILS_CONVERSIONS_H
#define SICK_SAFETYSCANNERS2_UTILS_CONVERSIONS_H

#include <sick_safetyscanners_base/Types.h>

namespace sick {

inline std::string btoa(bool x) { return ((x) ? "true" : "false"); }

inline float degToRad(float deg) { return deg * M_PI / 180.0f; }

inline float radToDeg(float rad) { return rad * 180.0f / M_PI; }

inline uint16_t skipToPublishFrequency(int skip) { return skip + 1; }

} // End namespace sick
#endif // SICK_SAFETYSCANNERS2_UTILS_CONVERSIONS_H