Go to the documentation of this file.
42 #include <boost/math/constants/constants.hpp>
54 constexpr
double pi_half = boost::math::constants::pi<double>() / 2.0;
71 return deg * boost::math::constants::degree<T>();
80 return deg * boost::math::constants::degree<T>() *
81 boost::math::constants::degree<T>();
90 return rad * boost::math::constants::radian<T>();
96 [[nodiscard]]
inline Eigen::Matrix3d
rpyToRot(
double roll,
double pitch,
double yaw)
99 double sa, ca, sb, cb, sc, cc;
102 sb = std::sin(pitch);
103 cb = std::cos(pitch);
107 M << cb * cc, -ca * sc + sa * sb * cc, sc * sa + ca * sb * cc, cb * sc,
108 ca * cc + sa * sb * sc, -sa * cc + ca * sb * sc, -sb, sa * cb, ca * cb;
123 [[nodiscard]]
double parseDouble(
const uint8_t* buffer);
137 [[nodiscard]]
bool parseDouble(
const std::string&
string,
double& value);
144 [[nodiscard]]
float parseFloat(
const uint8_t* buffer);
158 [[nodiscard]]
bool parseFloat(
const std::string&
string,
float& value);
165 [[nodiscard]] int16_t
parseInt16(
const uint8_t* buffer);
181 [[nodiscard]]
bool parseInt16(
const std::string&
string, int16_t& value, int32_t base = 10);
188 [[nodiscard]] int32_t
parseInt32(
const uint8_t* buffer);
204 [[nodiscard]]
bool parseInt32(
const std::string&
string, int32_t& value, int32_t base = 10);
220 [[nodiscard]]
bool parseUInt8(
const std::string&
string, uint8_t& value, int32_t base = 10);
227 [[nodiscard]] uint16_t
parseUInt16(
const uint8_t* buffer);
243 [[nodiscard]]
bool parseUInt16(
const std::string&
string, uint16_t& value, int32_t base = 10);
250 [[nodiscard]] uint32_t
parseUInt32(
const uint8_t* buffer);
266 [[nodiscard]]
bool parseUInt32(
const std::string&
string, uint32_t& value, int32_t base = 10);
332 [[nodiscard]] Eigen::Quaterniond
q_enu_ecef(
double lat,
double lon);
340 [[nodiscard]] Eigen::Quaterniond
q_ned_ecef(
double lat,
double lon);
348 [[nodiscard]] Eigen::Matrix3d
R_enu_ecef(
double lat,
double lon);
356 [[nodiscard]] Eigen::Matrix3d
R_ned_ecef(
double lat,
double lon);
374 [[nodiscard]] uint16_t
getCrc(
const std::vector<uint8_t>& message);
382 [[nodiscard]] uint16_t
getId(
const std::vector<uint8_t>& message);
390 [[nodiscard]] uint16_t
getLength(
const std::vector<uint8_t>& message);
398 [[nodiscard]] uint32_t
getTow(
const std::vector<uint8_t>& message);
406 [[nodiscard]] uint16_t
getWnc(
const std::vector<uint8_t>& message);
QuaternionMsg quaternionToQuaternionMsg(const Eigen::Quaterniond &q)
Convert Eigen quaternion to a QuaternionMsg.
uint32_t getTow(const std::vector< uint8_t > &message)
Get the time of week in ms of the SBF message.
double wrapAngle180to180(double angle)
Wraps an angle between -180 and 180 degrees.
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...
std::string convertUserPeriodToRxCommand(uint32_t period_user)
Transforms the input polling period [milliseconds] into a std::string number that can be appended to ...
uint16_t getWnc(const std::vector< uint8_t > &message)
Get the GPS week counter of the SBF message.
int32_t parseInt32(const uint8_t *buffer)
Converts a 4-byte-buffer into a signed 32-bit integer.
float parseFloat(const uint8_t *buffer)
Converts a 4-byte-buffer into a float.
Eigen::Matrix3d R_enu_ecef(double lat, double lon)
Generates the matrix to rotate from local ENU to ECEF.
Eigen::Quaterniond convertEulerToQuaternion(double roll, double pitch, double yaw)
Transforms Euler angles to a quaternion.
uint16_t getLength(const std::vector< uint8_t > &message)
Get the length of the SBF message.
double convertUTCDoubleToSeconds(double utc_double)
Converts UTC time from the without-colon-delimiter format to the number-of-seconds-since-midnight for...
uint16_t getCrc(const std::vector< uint8_t > &message)
Get the CRC of the SBF message.
uint32_t parseUInt32(const uint8_t *buffer)
Converts a 4-byte-buffer into an unsigned 32-bit integer.
uint16_t parseUInt16(const uint8_t *buffer)
Converts a 2-byte-buffer into an unsigned 16-bit integer.
QuaternionMsg convertEulerToQuaternionMsg(double roll, double pitch, double yaw)
Transforms Euler angles to a QuaternionMsg.
Eigen::Matrix3d R_ned_ecef(double lat, double lon)
Generates the matrix to rotate from local NED to ECEF.
uint16_t getId(const std::vector< uint8_t > &message)
Get the ID of the SBF message.
double convertDMSToDegrees(double dms)
Converts latitude or longitude from the DMS notation (in the without-colon-delimiter format),...
Eigen::Matrix3d rpyToRot(double roll, double pitch, double yaw)
Eigen::Quaterniond q_ned_ecef(double lat, double lon)
Generates the quaternion to rotate from local NED to ECEF.
Eigen::Quaterniond q_enu_ecef(double lat, double lon)
Generates the quaternion to rotate from local ENU to ECEF.
geometry_msgs::Quaternion QuaternionMsg
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.
int16_t parseInt16(const uint8_t *buffer)
Converts a 2-byte-buffer into a signed 16-bit integer.
double parseDouble(const uint8_t *buffer)
Converts an 8-byte-buffer into a double.