What I've done will now:
I'm using an IMU (MPU6000) to calculate the Euler angles of an object and for this, I'm using Madgwick AHRS algorithm. The MPU gives acceleration due to gravity (a) about the axis and angular velocity (g) about the axis and I feed these values to calculate the quaternions which are converted to Euler angles using this function found on Wikipedia.
So what's going wrong:
I'm getting the Euler angles to be yaw-pitch-roll: 0.001518, 0.001626, 0.003990. This isn't in degrees or radiance. Whats the dimension here?
I'm feeding in, the accelerometer reading about each axis (so its m/s^2) and after calculating the angle of rotation from the gyro, the theta value (in degrees) about each axis.
MadgwickAHRSupdateIMU((float)tx, (float)ty, (float)tz,(float)ax, (float)ay, (float)az);
where tx,ty,tz are the angle and ax,ay,az are in G.
tx = gx * timestep;where gx is the raw gyroscope reading. And timestep is the time between gyro readings.