Search the Community
Showing results for tags 'orientation'.
-
I'm using the 9150 and the axes for how how it's mounted on my PCB are different from the default Invensense mounting. The documentation says to use the orientation matrix (or Axis Transformation Matrix) to perform this transformation. My problem is that making any changes at all to the gyro_pdata.orientation matrix introduces significant drift. If the matrix is left as the default orientation it works fine, there is almost no drift in my 3D model. static struct platform_data_s gyro_pdata = { .orientation = { 1, 0, 0, 0, 1, 0, 0, 0, 1} }; But say if I want to swap and negate x and y, my 3D model will start to drift significantly. static struct platform_data_s gyro_pdata = { .orientation = { 0, -1, 0, -1, 0, 0, 0, 0, 1} }; The gyro_pdata.orientation matrix is set as the orientation for both the accelerometer and gyro. The DMP documentation says that the orientation matrix is the only thing that needs to be changed when changing the chip mounting orientation. I was wondering if anyone else has experience this issue and how they fixed it? Thanks.
-
- dmp
- orientation
-
(and 3 more)
Tagged with:
-
Hello! I have installed Jeff Rowberg's i2cdevlib library which I can use for my MPU-6050 to make it interact with Arduino. However, I have an odd problem with one of its functions. It's got a function to turn the accelerometer & gyroscope readings into linear acceleration. This is the definition of the function: uint8_t MPU6050::dmpGetLinearAccel(VectorInt16 *v, VectorInt16 *vRaw, VectorFloat *gravity) { // get rid of the gravity component (+1g = +8192 in standard DMP FIFO packet, sensitivity is 2g) v -> x = vRaw -> x - gravity -> x*8192; v -> y = vRaw -> y - gravity -> y*8192; v -> z = vRaw -> z - gravity -> z*8192; return 0; } However, whenever the function is called in the example code: // display real acceleration, adjusted to remove gravity mpu.dmpGetQuaternion(&q, fifoBuffer); mpu.dmpGetAccel(&aa, fifoBuffer); mpu.dmpGetGravity(&gravity, &q); mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity); Serial.print("areal\t"); Serial.print(aaReal.x); Serial.print("\t"); Serial.print(aaReal.y); Serial.print("\t"); Serial.println(aaReal.z); I get values way off, when I'm not even moving my MPU-6050! These are a few of the values I get: areal -473 423 -425 areal -460 400 -450 areal -471 522 -458 areal -322 276 -582 Do you know how I can fix this? Thanks! -George
- 2 replies
-
- linear acceleration
- mpu-6050
- (and 8 more)
-
Hi, I've been using the code found at https://github.com/sparkfun/MPU-9150_Breakout. I need to get the quaternions, but the problem is the orientation. The current orientation doesn't fit my application because I need it to control the movements of an industrial robot which has the axis as shown in the attached photo. I'm guessing that I could change the orientation of the given quaternions from the arduino code but I can't figure out how. As soon as I start the program, the robot orients itself upward and I'm guessing this is because the orientation from the Arduino code is set for aircraft control which needs Z axis to be facing in this manner. I've attached a photo of how the robot is being oriented with the given quaternions. In my case I would need the +z axis to be facing forward, the +x to be facing towards earth and +y can be seen in the picture (green). The robot axis are highlighted and color coded for easy identification. If you could help, that would be awesome. This is the code: https://github.com/sparkfun/MPU-9150_Breakout/blob/master/firmware/MPU6050/Examples/MPU9150_AHRS.ino I've only taken out the display part because I don't have one.
-
- quaternion
- orientation
-
(and 5 more)
Tagged with: