31 #ifndef PARSING_UTILITIES_HPP 32 #define PARSING_UTILITIES_HPP 43 #include <boost/math/constants/constants.hpp> 55 constexpr
double pi_half = boost::math::constants::pi<double>() / 2.0;
72 return deg * boost::math::constants::degree<T>();
81 return deg * boost::math::constants::degree<T>() *
82 boost::math::constants::degree<T>();
91 return rad * boost::math::constants::radian<T>();
97 inline Eigen::Matrix3d
rpyToRot(
double roll,
double pitch,
double yaw)
100 double sa, ca, sb, cb, sc, cc;
103 sb = std::sin(pitch);
104 cb = std::cos(pitch);
108 M << cb * cc, -ca * sc + sa * sb * cc, sc * sa + ca * sb * cc, cb * sc,
109 ca * cc + sa * sb * sc, -sa * cc + ca * sb * sc, -sb, sa * cb, ca * cb;
138 bool parseDouble(
const std::string&
string,
double& value);
159 bool parseFloat(
const std::string&
string,
float& value);
182 bool parseInt16(
const std::string&
string, int16_t& value, int32_t base = 10);
205 bool parseInt32(
const std::string&
string, int32_t& value, int32_t base = 10);
221 bool parseUInt8(
const std::string&
string, uint8_t& value, int32_t base = 10);
244 bool parseUInt16(
const std::string&
string, uint16_t& value, int32_t base = 10);
267 bool parseUInt32(
const std::string&
string, uint32_t& value, int32_t base = 10);
326 uint16_t
getCrc(
const uint8_t* buffer);
334 uint16_t
getId(
const uint8_t* buffer);
342 uint16_t
getLength(
const uint8_t* buffer);
350 uint32_t
getTow(
const uint8_t* buffer);
358 uint16_t
getWnc(
const uint8_t* buffer);
361 #endif // PARSING_UTILITIES_HPP uint32_t getTow(const uint8_t *buffer)
Get the time of week in ms of the SBF message.
TF2SIMD_FORCE_INLINE tf2Scalar angle(const Quaternion &q1, const Quaternion &q2)
uint16_t getCrc(const uint8_t *buffer)
Get the CRC of the SBF message.
float parseFloat(const uint8_t *buffer)
Converts a 4-byte-buffer into a float.
double convertUTCDoubleToSeconds(double utc_double)
Converts UTC time from the without-colon-delimiter format to the number-of-seconds-since-midnight for...
double wrapAngle180to180(double angle)
Wraps an angle between -180 and 180 degrees.
std::string convertUserPeriodToRxCommand(uint32_t period_user)
Transforms the input polling period [milliseconds] into a std::string number that can be appended to ...
Eigen::Matrix3d rpyToRot(double roll, double pitch, double yaw)
uint16_t getLength(const uint8_t *buffer)
Get the length of the SBF message.
uint16_t getWnc(const uint8_t *buffer)
Get the GPS week counter of the SBF message.
uint16_t parseUInt16(const uint8_t *buffer)
Converts a 2-byte-buffer into an unsigned 16-bit integer.
uint32_t parseUInt32(const uint8_t *buffer)
Converts a 4-byte-buffer into an unsigned 32-bit integer.
double convertDMSToDegrees(double dms)
Converts latitude or longitude from the DMS notation (in the without-colon-delimiter format)...
geometry_msgs::Quaternion QuaternionMsg
QuaternionMsg convertEulerToQuaternion(double yaw, double pitch, double roll)
Transforms Euler angles to a quaternion.
std::time_t convertUTCtoUnix(double utc_double)
Converts UTC time from the without-colon-delimiter format to Unix Epoch time (a number-of-seconds-sin...
double parseDouble(const uint8_t *buffer)
Converts an 8-byte-buffer into a double.
int16_t parseInt16(const uint8_t *buffer)
Converts a 2-byte-buffer into a signed 16-bit integer.
uint16_t getId(const uint8_t *buffer)
Get the ID of the SBF message.
int32_t parseInt32(const uint8_t *buffer)
Converts a 4-byte-buffer into a signed 32-bit integer.
bool parseUInt8(const std::string &string, uint8_t &value, int32_t base=10)
Interprets the contents of "string" as a unsigned integer number of type uint8_t. ...