Git Product home page Git Product logo

gram-schmidt-process's Introduction

Gram-Schmidt Process

Given a gravity vector, compute the rotation from the IMU reference coordinate to this vector.

Usage

Given the static acceleration values, one can get rotation matrix from global coordinate to IMU coordinate.
If plot=True, you can get the 3D plot illustrate the relation between global coordinate and IMU coordinate.

from gram_schmidt_tools import *


if __name__ == '__main__':
    # Given the random reasonable values read from accelerometer
    accel = np.array([4.29, 5.34, 7.02])
    rot_g_to_imu = gram_schmidt_process(accel, plot=False)
    print('\nGlobal to IMU:')
    print(rot_g_to_imu.dot([1, 0, 0]))
    print(rot_g_to_imu.dot([0, 1, 0]))
    print(rot_g_to_imu.dot([0, 0, 1]))
Orthonormal basis in IMU coordinate:
X(e2): [ 0.89927159 -0.26480864 -0.34811923]
Y(e3): [-3.48731968e-17  7.95899952e-01 -6.05428168e-01]
Z(e1): [0.43739069 0.54444435 0.71573021]

Global to IMU:
[ 0.89927159 -0.26480864 -0.34811923]
[-3.48731968e-17  7.95899952e-01 -6.05428168e-01]
[0.43739069 0.54444435 0.71573021]

Example

TODO

  • Use cross product method to get the same result.

Reference

Theory

  1. Gram-Schmidt Process - Wiki
  2. Animation Of Gram-Schmidt Process - zhihu

Contact

Welcome to contact me for any further question, below is my gmail address: [email protected]

gram-schmidt-process's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.