Comments (2)
Maybe from_DCM could be :
@staticmethod
def from_DCM(mat):
""" Returns the quaternion corresponding to the unitary DCM matrix. """
mat = np.array(mat)
tr = np.trace(mat)
d = 1 + 2 * mat.diagonal() - tr
qsquare = 1 / 4 * np.array([1 + tr, d[0], d[1], d[2]])
qsquare = qsquare.clip(0, None) # avoid numerical errors
# compute signs matrix
signs = np.sign([mat[1, 2] - mat[2, 1], mat[2, 0] - mat[0, 2], mat[0, 1] - mat[1, 0],
mat[0, 1] + mat[1, 0], mat[2, 0] + mat[0, 2], mat[1, 2] + mat[2, 1]])
signs_m = np.zeros((4, 4))
signs_m[np.triu_indices(4, 1)] = signs
signs_m += signs_m.T
signs_m[np.diag_indices(4)] = 1.
# choose appropriate signs
max_idx = qsquare.argmax()
coords = np.sqrt(qsquare) * signs_m[max_idx]
return Quaternion(*coords)
from ahrs.
I have the impression to_DCM is giving the Transpose of what DCM should be.
from ahrs.
Related Issues (20)
- Bug in Madgwick filter _compute_all() HOT 2
- Error when intializing FAMC filter without acc or mag samples.
- Math errors in AQUA filter
- Installing from setup.py is deprecated
- performance: probably unnecessary array copies in `_compute_all` method from `EKF` class HOT 1
- Madgwick with asynchronous sensors HOT 2
- Incomplete Implementation HOT 1
- Bug in `rpy2q` function
- Mistake in Attitude From Tilt documentation
- Gyro data is not reflected
- Need pre-recorded data to test the AHRS library's Extended Kalman Filter HOT 1
- EKF, Madgwick possible for acc, gyr [mag] data from different timestamps? HOT 2
- Is the `meridian_curvature_radius` formula correct? HOT 4
- Please add ahrs.__version__ HOT 4
- Is the platform assumed to be stationary (acceleration =0) for the EKF ? HOT 2
- Isn't it required to normalize quaternion estimation in EKF? HOT 2
- EKF update Qt HOT 1
- EKF H matrix HOT 6
- Madgwick Reference Frame HOT 2
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 ahrs.