Go to the documentation of this file.
34 #ifndef RT_USB_9AXISIMU_H_
35 #define RT_USB_9AXISIMU_H_
39 #include <sys/ioctl.h>
41 #include <sys/types.h>
149 if (firmware_ver == 5)
155 else if (firmware_ver >= 6)
202 fd = open(
port_name_.c_str(), O_RDWR | O_NOCTTY);
208 struct termios settings;
212 cfsetispeed(&settings, B57600);
213 cfmakeraw(&settings);
215 tcsetattr(fd, TCSANOW, &settings);
239 return read(
port_fd_, buf, buf_len);
242 int writeToDevice(
unsigned char* data,
unsigned int data_len)
249 return write(
port_fd_, data, data_len);
260 template <
typename Type>
const double CONVERTOR_D2R
void setImuRawData(ImuData< int16_t > &i)
ImuData< int16_t > imu_raw_data_
void setImuData(ImuData< double > &i)
const double CONVERTOR_G2A
int readFromDevice(unsigned char *buf, unsigned int buf_len)
const double CONVERTOR_RAW2DPS
const double CONVERTOR_RAW2G
const double DEFAULT_MAGNETIC_FIELD_STDDEV
ImuData< double > getImuData()
const double DEFAULT_ANGULAR_VELOCITY_STDDEV
void ChangeConvertor(const int firmware_ver)
SerialPort(const char *port="")
bool openPort(const char *port)
void convertRawDataUnit()
const double CONVERTOR_UT2T
struct termios old_settings_
int writeToDevice(unsigned char *data, unsigned int data_len)
const double DEFAULT_LINEAR_ACCELERATION_STDDEV