Classes | Macros | Functions
imu.cpp File Reference
#include "thormang3_imu_3dm_gx4/imu.hpp"
#include <chrono>
#include <locale>
#include <tuple>
#include <algorithm>
#include <iostream>
#include <string>
#include <sstream>
#include <stdexcept>
#include <boost/assert.hpp>
#include <fcntl.h>
#include <getopt.h>
#include <poll.h>
#include <time.h>
#include <errno.h>
#include <termios.h>
#include <sys/ioctl.h>
#include <assert.h>
#include <unistd.h>
#include <string.h>
Include dependency graph for imu.cpp:

Go to the source code of this file.

Classes

class  PacketDecoder
 Tool for decoding packets by iterating through fields. More...
 
class  PacketEncoder
 Tool for encoding packets more easily by simply appending fields. More...
 

Macros

#define add_byte(x)
 
#define COMAMND_FILTER_MESSAGE_FORMAT   u8(0x0A)
 
#define COMMAND_CLASS_3DM   u8(0x0C)
 
#define COMMAND_CLASS_BASE   u8(0x01)
 
#define COMMAND_CLASS_FILTER   u8(0x0D)
 
#define COMMAND_DEVICE_STATUS   u8(0x64)
 
#define COMMAND_ENABLE_DATA_STREAM   u8(0x11)
 
#define COMMAND_ENABLE_MEASUREMENTS   u8(0x41)
 
#define COMMAND_FILTER_CONTROL_FLAGS   u8(0x14)
 
#define COMMAND_GET_DEVICE_INFO   u8(0x03)
 
#define COMMAND_GET_FILTER_BASE_RATE   u8(0x0B)
 
#define COMMAND_GET_IMU_BASE_RATE   u8(0x06)
 
#define COMMAND_IMU_MESSAGE_FORMAT   u8(0x08)
 
#define COMMAND_SET_HARD_IRON   u8(0x3A)
 
#define COMMAND_SET_SOFT_IRON   u8(0x3B)
 
#define COMMAND_UART_BAUD_RATE   u8(0x40)
 
#define DATA_CLASS_FILTER   u8(0x82)
 
#define DATA_CLASS_IMU   u8(0x80)
 
#define DEVICE_IDLE   u8(0x02)
 
#define DEVICE_PING   u8(0x01)
 
#define DEVICE_RESUME   u8(0x06)
 
#define FIELD_ACCELEROMETER   u8(0x04)
 
#define FIELD_ACK_OR_NACK   u8(0xF1)
 
#define FIELD_ANGLE_UNCERTAINTY   u8(0x0A)
 
#define FIELD_BAROMETER   u8(0x17)
 
#define FIELD_BIAS_UNCERTAINTY   u8(0x0B)
 
#define FIELD_DEVICE_INFO   u8(0x81)
 
#define FIELD_FILTER_BASERATE   u8(0x8A)
 
#define FIELD_GYRO_BIAS   u8(0x06)
 
#define FIELD_GYROSCOPE   u8(0x05)
 
#define FIELD_IMU_BASERATE   u8(0x83)
 
#define FIELD_MAGNETOMETER   u8(0x06)
 
#define FIELD_QUATERNION   u8(0x03)
 
#define FIELD_STATUS_REPORT   u8(0x90)
 
#define FUNCTION_APPLY   u8(0x01)
 
#define kBufferSize   (10)
 
#define kDefaultTimeout   (300)
 
#define SELECTOR_FILTER   u8(0x03)
 
#define SELECTOR_IMU   u8(0x01)
 
#define u8(x)   static_cast<uint8_t>((x))
 

Functions

template<typename T >
void decode (const uint8_t *buffer, size_t count, T *output)
 
template<typename T >
size_t encode (uint8_t *buffer, const T &t)
 
template<typename T , typename... Ts>
size_t encode (uint8_t *buffer, const T &t, const Ts &...ts)
 
static std::string ltrim (std::string s)
 
template<size_t sz>
void to_device_order (uint8_t buffer[sz])
 
template<>
void to_device_order< 1 > (uint8_t buffer[1])
 

Macro Definition Documentation

#define add_byte (   x)
Value:
byte1 += (x); \
byte2 += byte1;
#define COMAMND_FILTER_MESSAGE_FORMAT   u8(0x0A)

Definition at line 64 of file imu.cpp.

#define COMMAND_CLASS_3DM   u8(0x0C)

Definition at line 43 of file imu.cpp.

#define COMMAND_CLASS_BASE   u8(0x01)

Definition at line 42 of file imu.cpp.

#define COMMAND_CLASS_FILTER   u8(0x0D)

Definition at line 44 of file imu.cpp.

#define COMMAND_DEVICE_STATUS   u8(0x64)

Definition at line 71 of file imu.cpp.

#define COMMAND_ENABLE_DATA_STREAM   u8(0x11)

Definition at line 65 of file imu.cpp.

#define COMMAND_ENABLE_MEASUREMENTS   u8(0x41)

Definition at line 70 of file imu.cpp.

#define COMMAND_FILTER_CONTROL_FLAGS   u8(0x14)

Definition at line 66 of file imu.cpp.

#define COMMAND_GET_DEVICE_INFO   u8(0x03)

Definition at line 60 of file imu.cpp.

#define COMMAND_GET_FILTER_BASE_RATE   u8(0x0B)

Definition at line 62 of file imu.cpp.

#define COMMAND_GET_IMU_BASE_RATE   u8(0x06)

Definition at line 61 of file imu.cpp.

#define COMMAND_IMU_MESSAGE_FORMAT   u8(0x08)

Definition at line 63 of file imu.cpp.

#define COMMAND_SET_HARD_IRON   u8(0x3A)

Definition at line 68 of file imu.cpp.

#define COMMAND_SET_SOFT_IRON   u8(0x3B)

Definition at line 69 of file imu.cpp.

#define COMMAND_UART_BAUD_RATE   u8(0x40)

Definition at line 67 of file imu.cpp.

#define DATA_CLASS_FILTER   u8(0x82)

Definition at line 47 of file imu.cpp.

#define DATA_CLASS_IMU   u8(0x80)

Definition at line 46 of file imu.cpp.

#define DEVICE_IDLE   u8(0x02)

Definition at line 56 of file imu.cpp.

#define DEVICE_PING   u8(0x01)

Definition at line 55 of file imu.cpp.

#define DEVICE_RESUME   u8(0x06)

Definition at line 57 of file imu.cpp.

#define FIELD_ACCELEROMETER   u8(0x04)

Definition at line 75 of file imu.cpp.

#define FIELD_ACK_OR_NACK   u8(0xF1)

Definition at line 86 of file imu.cpp.

#define FIELD_ANGLE_UNCERTAINTY   u8(0x0A)

Definition at line 79 of file imu.cpp.

#define FIELD_BAROMETER   u8(0x17)

Definition at line 81 of file imu.cpp.

#define FIELD_BIAS_UNCERTAINTY   u8(0x0B)

Definition at line 80 of file imu.cpp.

#define FIELD_DEVICE_INFO   u8(0x81)

Definition at line 82 of file imu.cpp.

#define FIELD_FILTER_BASERATE   u8(0x8A)

Definition at line 84 of file imu.cpp.

#define FIELD_GYRO_BIAS   u8(0x06)

Definition at line 77 of file imu.cpp.

#define FIELD_GYROSCOPE   u8(0x05)

Definition at line 76 of file imu.cpp.

#define FIELD_IMU_BASERATE   u8(0x83)

Definition at line 83 of file imu.cpp.

#define FIELD_MAGNETOMETER   u8(0x06)

Definition at line 78 of file imu.cpp.

#define FIELD_QUATERNION   u8(0x03)

Definition at line 74 of file imu.cpp.

#define FIELD_STATUS_REPORT   u8(0x90)

Definition at line 85 of file imu.cpp.

#define FUNCTION_APPLY   u8(0x01)

Definition at line 49 of file imu.cpp.

#define kBufferSize   (10)

Definition at line 38 of file imu.cpp.

#define kDefaultTimeout   (300)

Definition at line 37 of file imu.cpp.

#define SELECTOR_FILTER   u8(0x03)

Definition at line 52 of file imu.cpp.

#define SELECTOR_IMU   u8(0x01)

Definition at line 51 of file imu.cpp.

#define u8 (   x)    static_cast<uint8_t>((x))

Definition at line 40 of file imu.cpp.

Function Documentation

template<typename T >
void decode ( const uint8_t *  buffer,
size_t  count,
T *  output 
)

Definition at line 137 of file imu.cpp.

template<typename T >
size_t encode ( uint8_t *  buffer,
const T &  t 
)

Definition at line 109 of file imu.cpp.

template<typename T , typename... Ts>
size_t encode ( uint8_t *  buffer,
const T &  t,
const Ts &...  ts 
)

Definition at line 131 of file imu.cpp.

static std::string ltrim ( std::string  s)
inlinestatic

Definition at line 91 of file imu.cpp.

template<size_t sz>
void to_device_order ( uint8_t  buffer[sz])

Definition at line 99 of file imu.cpp.

template<>
void to_device_order< 1 > ( uint8_t  buffer[1])

Definition at line 107 of file imu.cpp.



thormang3_imu_3dm_gx4
Author(s): Gareth Cross, SCH
autogenerated on Mon Jun 10 2019 15:26:53