Clarifications regarding Uart_imu code?

For the first prototype of a quadruped, I used the same IMU as given in ODRI. At that time I was using the master board to get IMU data.

Now For a second prototype, I am planning to use the same IMU with my one STM 32 code[Champ, CAN, LWIP and other stacks running]. I was hoping to take a reference from Master Board firmware. I require some information regarding some variables.

This is the Uart_imu code, I am refering.

  1. I would like to know what is DQ16N and where it is used?
  2. I also would like to know what each member in the stuck represents?
struct strcut_imu_data
{
  union float_int acc_x;
  union float_int acc_y;
  union float_int acc_z;
  union float_int gyr_x;
  union float_int gyr_y;
  union float_int gyr_z;
  union float_int roll;
  union float_int pitch;
  union float_int yaw;
  union float_int linacc_x;
  union float_int linacc_y;
  union float_int linacc_z;
};

Okay, Understood first half deals with raw IMU data and second half deals with IMU’s EKF data.

Hi,

You are right for the fields, the first 6 correspond to raw accelerometer and gyro data, then comes the attitude estimate and finally the classical acceleration (without gravity).

DQ16N stand for a fixed point signed 16 bits representation of the float data. For communication, we use fixed point data representation almost everywhere, but you don’t necessarily have to do the same with your STM32 setup. The data representation is documented here: master-board/masterboard_communication.md at master · open-dynamic-robot-initiative/master-board · GitHub

I hope this help,
Best, Thomas.

1 Like