Giter VIP home page Giter VIP logo

orientation3d-app's Introduction

Orientation3D

Overview

This app uses data from an accelerometer and a gyroscope to estimate the current orientation using quaternions.

App screenshot

Platform

This application was created using Windows Presentation Foundation (WPF) as part of the .Net framework. Therefore, it only runs on Windows.

Communication

Serial port communication is used to receive data from a device connected with the support of the SerialPort class. The default sample rate that is used for the calculations is 0.015 seconds, as specified on line 27 in MainWindow.xaml.cs.

The device sending the data must use a string format like the one below:
"MPUdata"+ " " + gForceX + " " + gForceY + " " + gForceZ + " " + gyroX + " " + gyroY + " " + gyroZ +"\n"

Where:

  • MPUdata: It's an arbitrary string at the beginning. It can be any other text.
  • gForceX: It's the gravitational force equivalent on X-axis, that causes a perception of weight, with a g-force of 1 g equal to the conventional value of gravitational acceleration on Earth, g, of about 9.8 m/s2.
  • gForceY: It's the gravitational force equivalent on Y-axis.
  • gForceZ: It's the gravitational force equivalent on Z-axis.
  • gyroX: It's the angular velocity on X-axis (rad/second).
  • gyroY: It's the angular velocity on Y-axis (rad/second).
  • gyroZ: It's the angular velocity on Z-axis (rad/second).

Example using Arduino

The Orientation3D was tested successfully using an Arduino and an MPU6050. The sample code below is the one used on an Arduino to send the data using Serial Communication.

void loop()
{ 
  if((elapsedTimeMS=(millis() - startTime)) >= sampleTime)
  {
    startTime = millis();
    recordAccelRegisters();
    recordGyroRegisters();
  
    Serial.println((String) "MPUdata"+ " " + gForceX + " " + gForceY + " " + gForceZ + " " + gyroX + " " + gyroY + " " + gyroZ +"\n");
  }
}

Using Orientation3D

  • To launch the app, run the executable file located in Orientation3D > bin > Debug > net5.0-windows > Orientation3D.exe
  • Or launch the application using Visual Studio + Start with out Debugging (Ctrl + F5)
  • While the application is running, specify the port name (default: COM3)
  • Select the type of filter. (Kalman Filter, Kalman Filter with Bias or Complementary Filter)
  • Select a Baud Rate. (It needs to match the baud rate of the device that is transmitting the data)
  • Click 'Connect'. The orientation of the airplane will change depending on the data coming from the sensors. The quaternion (format: qw, qx, qy, qz) will be displayed on the left-hand side of the app

The library that was used in this app to filter and estimate the orientation in quaternions can be found here.

orientation3d-app's People

Contributors

andreaskel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  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.