Comments (1)
I've identified the bug. As part of the quaternion calculations self.acc gets vector normalized. But when calculating position, we need to use the original un-normalized acc; this is no longer stored on self.acc because of python's passing by reference.
If you modify my script above like this:
def test(q_type):
my_sensor = MyOwnSensor(in_data=copy.deepcopy(in_data), q_type=q_type,
calculate_position=True)
# reset the acc as it has now been overwritten by vector normalized acc
my_sensor.acc = imu['gia']
# Use the true quat not the estimated one, to isolate errors to the position calculations
my_sensor.quat = body['quat']
# redo the position calculations with the proper acc and true quat
my_sensor.calc_position()
print(q_type + " pos")
print(my_sensor.pos[-1])
Then you get:
actual pos
[0.873 0.436 0.218]
analytical pos
[0.873 0.436 0.218]
kalman pos
[0.873 0.436 0.218]
madgwick pos
[0.873 0.436 0.218]
mahony pos
[0.873 0.436 0.218]
These are the lines in imus.py that are corrupting the values of self.acc for madgwick and mahony:
Acc = vector.normalize(self.acc)
Mag = vector.normalize(self.mag)
Why kalman is also affected, I don't know.
from scikit-kinematics.
Related Issues (20)
- Denavit-Hartenberg convention HOT 2
- Real motion for test data HOT 1
- Sample rate vs. Sample period HOT 2
- Madgwick and Mahony 6Dof HOT 2
- initialization of orientation calculation for Kalman, Madgwick & Mahony HOT 3
- remove pos calculation from analytical(), make rotating q[0] to reference optional for all 4 orientation functions
- expose Kalman tunable parameters HOT 1
- the Kalman implementation questions HOT 2
- Madgwick and Mahony Update() does not support arrays with shape (N,3) HOT 1
- ImportError: cannot import name 'dist' from 'matplotlib.mlab' HOT 7
- Raspbian Buster installation anomaly
- Enable scikit-kinematics to run without OpenGL HOT 3
- Real time application HOT 3
- [question] IMU position estimate, bias issue?
- How to compute distance from positions? HOT 1
- R_init doesn't work as intended with manual sensors. HOT 2
- assertion failure in tests/test_imus.py HOT 1
- Xens data file doesn't work HOT 9
- Tkinter is a dependency, but not listed anywhere
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scikit-kinematics.