You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a quick question regarding using the basic orientation update (so ignoring the correction terms).
I've been working on an inertial navigation system as a pet project (so tracking both the changes in orientation and changes from the original position).
I've been using the euler angle to quaternion algorithm for updating the orientation, but I like that the technique you present in your paper didn't require using any trig functions to construct the quaternion. However in practice I can't get the updated quaternion to work the way the other one did, and am not sure if it has to be used in a different way.
So ignoring the correction terms, this is how the general orientation update should work
// From here I can rotate the acceleration data, and use it to update the velocity and position fields
// accelVec = (orientation * accelVec) * inverse(orientation);
}
`
The problem is that when I use the orientation quaternion to rotate the accelerometer values, it's not giving me the correct values.
As a basic proof of concept, I tested the method by using having it rotate vector (0,1,0) by 180 degrees, by setting a gyroscope vector to (0,0,PI), with deltaTime = 1
`
orientation = buildQuaternion(1,0,0,0);
vector = buildQuaternionFromVector(0,1,0);
deltaTime = 1;
orientation = madgwickOrientationUpdate(orientation, gyroData) // just have it do the same code i showed above in the loop method
// rotate the vector using the new orientation quaternion
vector = rotateVectorByQuaternion(orientation, vector);
`
Assuming I haven't looked over something horribly simple, the updated vector should be (0, -1, 0), which is what I also get
when I tested this out on the euler angle to quaternion method, however the madgwickQuaternionUpdate instead gives (-0.9715, 0.2368, 0)
So does the quaternion the Madgwick code builds not work in this way, or is there another way we're suppose to use it to rotate vectors?
Appreciate any help anyone can provide.
The text was updated successfully, but these errors were encountered:
I have a quick question regarding using the basic orientation update (so ignoring the correction terms).
I've been working on an inertial navigation system as a pet project (so tracking both the changes in orientation and changes from the original position).
I've been using the euler angle to quaternion algorithm for updating the orientation, but I like that the technique you present in your paper didn't require using any trig functions to construct the quaternion. However in practice I can't get the updated quaternion to work the way the other one did, and am not sure if it has to be used in a different way.
So ignoring the correction terms, this is how the general orientation update should work
`
initial(){
orientation = buildQuaternion(1,0,0,0);
}
loop(){
deltaQuat = buildQuaternion(0, Yaw, Pitch, Roll);
deltaQuat = mult(orientation, deltaQuat) * (0.5 * deltaTime);
orientation += deltaQuat
orientation = normalize(orientation);
}
`
The problem is that when I use the orientation quaternion to rotate the accelerometer values, it's not giving me the correct values.
As a basic proof of concept, I tested the method by using having it rotate vector (0,1,0) by 180 degrees, by setting a gyroscope vector to (0,0,PI), with deltaTime = 1
`
orientation = buildQuaternion(1,0,0,0);
vector = buildQuaternionFromVector(0,1,0);
deltaTime = 1;
orientation = madgwickOrientationUpdate(orientation, gyroData) // just have it do the same code i showed above in the loop method
// rotate the vector using the new orientation quaternion
vector = rotateVectorByQuaternion(orientation, vector);
`
Assuming I haven't looked over something horribly simple, the updated vector should be (0, -1, 0), which is what I also get
when I tested this out on the euler angle to quaternion method, however the madgwickQuaternionUpdate instead gives (-0.9715, 0.2368, 0)
So does the quaternion the Madgwick code builds not work in this way, or is there another way we're suppose to use it to rotate vectors?
Appreciate any help anyone can provide.
The text was updated successfully, but these errors were encountered: