9 Axis IMU Tinyshield Gravity in Acceleration?

jeejoyi

  • Newbie
  • *
    • Posts: 4
    • View Profile
Hi, I have a 9 Axis Tinyshield IMU and whenever I use it doesn't seem to be calibrated. When idle, the values always add up to 1 (i.e. 0,0,1; 1,0,0 etc.) It seems that instead of being all 0's one has a value of 1 and is not calibrated. Is there a way to fix this? Also, is there a way to add acceleration due to gravity in the readings? Thus at idle it would be something like (0,0,9.8) instead of just all zeroes. I cannot find out a way to do this in the example code. I can't find a configuration or anything like that.

Help please!


Ben Rose

  • Administrator
  • Hero Member
  • *****
    • Posts: 342
    • View Profile
Hi,

Can you tell me exactly what code you're using? Our codebender example has a default output that looks more like 'Pose: x:7.41 y:4.76 z:-89.00'

Thanks,
Ben


jeejoyi

  • Newbie
  • *
    • Posts: 4
    • View Profile
I'm using the codebender code still but instead of using the pose output I am using the commented out RTMath::display("Accel:", (RTVector3&)imu->getAccel());


Ben Rose

  • Administrator
  • Hero Member
  • *****
    • Posts: 342
    • View Profile
Alright- looking at the accelerometer output, it seems like what you want- just presented in units of gravitational force, rather than in m/s^2. You could scale it by multiplying by the gravitational constant, or use the unit vector as is. I definitely see ~0.69 in two axis when the board is at a 45 degree angle, ie a bit below(sensor error plus board not being perfectly flat in third axis) sin/cos of 45 degrees. Let me know if this doesn't check out.



 

SMF spam blocked by CleanTalk