util.h
#ifndef VNUTIL_H_INCLUDED
#define VNUTIL_H_INCLUDED
#include <stddef.h>
#include "vn/int.h"
#include "vn/bool.h"
#include "vn/error.h"
#include "vn/math/matrix.h"
#include "vn/math/vector.h"
#include "vn/util/export.h"
#ifdef __cplusplus
extern "C" {
#endif
#define VNAPI_MAJOR 1
#define VNAPI_MINOR 1
#define VNAPI_PATCH 0
#define VNAPI_REVISION 126
int VnApi_major(void);
int VnApi_minor(void);
int VnApi_patch(void);
int VnApi_revision(void);
VnError VnApi_getVersion(char *out, size_t outLength);
uint8_t VnUtil_toUint8FromHexChar(char c);
uint8_t VnUtil_toUint8FromHexStr(char const *str);
uint16_t VnUtil_toUint16FromHexStr(char const *str);
void VnUtil_toHexStrFromUint8(uint8_t toConvert, char *output);
void VnUtil_toHexStrFromUint16(uint16_t toConvert, char *output);
size_t VnUtil_toStrFromUint16(uint16_t toConvert, char *output);
uint8_t DllExport VnUtil_countSetBitsUint8(uint8_t data);
void strFromBool(char *out, bool val);
uint16_t stoh16(uint16_t sensorOrdered);
uint32_t stoh32(uint32_t sensorOrdered);
uint64_t stoh64(uint64_t sensorOrdered);
uint16_t htos16(uint16_t hostOrdered);
uint32_t htos32(uint32_t hostOrdered);
uint64_t htos64(uint64_t hostOrdered);
float htosf4(float hostOrdered);
double htosf8(double hostOrdered);
uint16_t VnUtil_extractUint16(const char* pos);
uint32_t VnUtil_extractUint32(const char* pos);
float VnUtil_extractFloat(const char* pos);
double VnUtil_extractDouble(const char* pos);
/*#if THIS_SHOULD_BE_MOVED_TO_MATH_C_PACK*/
vec3f VnUtil_extractVec3f(const char* pos);
vec4f VnUtil_extractVec4f(const char* pos);
vec3d VnUtil_extractVec3d(const char* pos);
mat3f VnUtil_extractMat3f(const char* pos);
/*#endif*/
/* \} */
#ifdef __cplusplus
}
#endif
#endif
htos16
uint16_t htos16(uint16_t hostOrdered)
Converts a 16-bit integer in host order to sensor order.
htos32
uint32_t htos32(uint32_t hostOrdered)
Converts a 32-bit integer in host order to sensor order.
htosf8
double htosf8(double hostOrdered)
Converts an 8-byte float in host order to sensor order.
stoh16
uint16_t stoh16(uint16_t sensorOrdered)
Converts a 16-bit integer in sensor order to host order.
VnUtil_extractUint16
uint16_t VnUtil_extractUint16(const char *pos)
Extracts a uint16_t with appropriate byte reordering from the binary array received from a VectorNav ...
VnUtil_extractVec3d
vec3d VnUtil_extractVec3d(const char *pos)
Extracts a vec3d with appropriate byte reordering from the binary array received from a VectorNav sen...
VnUtil_extractVec4f
vec4f VnUtil_extractVec4f(const char *pos)
Extracts a vec4f with appropriate byte reordering from the binary array received from a VectorNav sen...
stoh32
uint32_t stoh32(uint32_t sensorOrdered)
Converts a 32-bit integer in sensor order to host order.
VnUtil_extractDouble
double VnUtil_extractDouble(const char *pos)
Extracts a double with appropriate byte reordering from the binary array received from a VectorNav se...
stoh64
uint64_t stoh64(uint64_t sensorOrdered)
Converts a 64-bit integer in sensor order to host order.
vec4f
Represents a 4 component vector with an underlying data type of float.
Definition: vector.h:68
vec3d
Represents a 3 component vector with an underlying data type of double.
Definition: vector.h:41
VnUtil_extractFloat
float VnUtil_extractFloat(const char *pos)
Extracts a float with appropriate byte reordering from the binary array received from a VectorNav sen...
htosf4
float htosf4(float hostOrdered)
Converts a 4-byte float in host order to sensor order.
VnUtil_extractUint32
uint32_t VnUtil_extractUint32(const char *pos)
Extracts a uint32_t with appropriate byte reordering from the binary array received from a VectorNav ...
mat3f
Represents a 3x3 matrix with an underlying data type of float.
Definition: matrix.h:11
VnUtil_extractVec3f
vec3f VnUtil_extractVec3f(const char *pos)
Extracts a vec3f with appropriate byte reordering from the binary array received from a VectorNav sen...
VnUtil_extractMat3f
mat3f VnUtil_extractMat3f(const char *pos)
Extracts a mat3f with appropriate byte reordering from the binary array received from a VectorNav sen...
htos64
uint64_t htos64(uint64_t hostOrdered)
Converts a 64-bit integer in host order to sensor order.
vec3f
Various vector types and operations.
Definition: vector.h:14