#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <termios.h>
#include <unistd.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <sys/time.h>
#include "microstrain_3dmgx2_imu/3dmgx2.h"
#include "poll.h"
Go to the source code of this file.
|
static unsigned short | bswap_16 (unsigned short x) |
| Code to swap bytes since IMU is big endian. More...
|
|
static unsigned int | bswap_32 (unsigned int x) |
| Code to swap bytes since IMU is big endian. More...
|
|
static float | extract_float (uint8_t *addr) |
| Code to extract a floating point number from the IMU. More...
|
|
static int | read_with_timeout (int fd, void *buff, size_t count, int timeout) |
|
static unsigned long long | time_helper () |
| Helper function to get system time in nanoseconds. More...
|
|
#define CMD_ACCEL_ANGRATE_MAG_ORIENT_REP_LEN 79 |
#define CMD_RAW_ACCEL_ANGRATE_LEN 31 |
#define IMU_EXCEPT |
( |
|
except, |
|
|
|
msg, |
|
|
|
... |
|
) |
| |
Value:{ \
char buf[1000]; \
snprintf(buf, 1000, msg" (in microstrain_3dmgx2_imu::IMU:%s)", ##__VA_ARGS__, __FUNCTION__); \
throw except(buf); \
}
Macro for throwing an exception with a message.
Definition at line 43 of file 3dmgx2.cc.
static unsigned short bswap_16 |
( |
unsigned short |
x | ) |
|
|
inlinestatic |
Code to swap bytes since IMU is big endian.
Definition at line 57 of file 3dmgx2.cc.
static unsigned int bswap_32 |
( |
unsigned int |
x | ) |
|
|
inlinestatic |
Code to swap bytes since IMU is big endian.
Definition at line 62 of file 3dmgx2.cc.
static float extract_float |
( |
uint8_t * |
addr | ) |
|
|
static |
Code to extract a floating point number from the IMU.
Definition at line 68 of file 3dmgx2.cc.
static int read_with_timeout |
( |
int |
fd, |
|
|
void * |
buff, |
|
|
size_t |
count, |
|
|
int |
timeout |
|
) |
| |
|
static |
static unsigned long long time_helper |
( |
| ) |
|
|
static |
Helper function to get system time in nanoseconds.
Definition at line 82 of file 3dmgx2.cc.