Modules-old/Microstrain/Microstrain.cpp
////////////////////////////////////////////////////////////////////////////////
// Receive RAW message
// (copy of receive accel angrate but with raw cmd)
Receive RAW message
(copy of receive accel angrate but with raw cmd)
Receive RAW message ( copy of receive accel angrate but with raw cmd )
void
Microstrain::receiveRawAccelAngrate(uint64_t *time, double accel[3], double angrate[3])
{
  int i, k;
  uint8_t rep[CMD_RAW_ACCEL_ANGRATE_LEN];
  uint64_t sys_time;
  uint64_t imu_time;
  receive(Microstrain::CMD_RAW, rep, sizeof(rep), 1000, &sys_time);
  k = 1;
  for (i = 0; i < 3; i++)
  {
    accel[i] = extract_float(rep + k);
    k += 4;
  }
  k = 13;
  for (i = 0; i < 3; i++)
  {
    angrate[i] = extract_float(rep + k);
    k += 4;
  }
  imu_time = extractTime(rep+25);
  *time = filterTime(imu_time, sys_time);
}
void Microstrain :: receiveRawAccelAngrate ( uint64_t * time , double accel [ 3 ] , double angrate [ 3 ] ) { int i , k ; uint8_t rep [ CMD_RAW_ACCEL_ANGRATE_LEN ] ; uint64_t sys_time ; uint64_t imu_time ; receive ( Microstrain :: CMD_RAW , rep , sizeof ( rep ) , 1000 , & sys_time ) ; k = 1 ; for ( i = 0 ; i < 3 ; i ++ ) { accel [ i ] = extract_float ( rep + k ) ; k += 4 ; } k = 13 ; for ( i = 0 ; i < 3 ; i ++ ) { angrate [ i ] = extract_float ( rep + k ) ; k += 4 ; } imu_time = extractTime ( rep + 25 ) ; * time = filterTime ( imu_time , sys_time ) ; }
Receive RAW message
(copy of receive accel angrate but with raw cmd)
Receive RAW message ( copy of receive accel angrate but with raw cmd )
// Read the accelerator AD register values 0 - 65535 given as float // Read the angular rates AD registor values 0 - 65535 (given as float