Giter VIP home page Giter VIP logo

mviswanathan24 / sensorfusionws Goto Github PK

View Code? Open in Web Editor NEW

This project forked from karry3775/sensorfusionws

0.0 0.0 0.0 14.14 MB

A ROS-based open-source software for fusing mobile sensor data and visualizing SmartPhone Orientation

License: GNU General Public License v3.0

CMake 14.64% C 0.98% C++ 2.06% Makefile 22.64% Python 10.54% Shell 0.87% Common Lisp 0.95% JavaScript 0.32% Jupyter Notebook 46.98%

sensorfusionws's Introduction

SensorFusionWS

A ROS-based open-source software for fusing mobile sensor data and visualizing SmartPhone Orientation

System and software used:

  • Python
  • ROS melodic
  • Ubuntu 18.04 LTS
  • Gazebo 9 simulator

Connecting the Phone through PhonePi App

  • Connect your phone and computer to the same network (Hotspot can be used)
  • Enter <ip address>:5000 to the URL field in PhonePi app
  • ip addess could be find using ifconfig command on linux terminal and ipconfig on windows cmd prompt.

Visualize Phone Orientation (Just from Accelerometer and Magnetometer data)

$ roscore
$ rosrun sensor_fusion_pkg sensor_streamer.py
$ rosrun sensor_fusion_pkg test_node_for_accel_mag.py
$ roslaunch phone_description phone_spawn.launch
$ roslaunch phone_description phone_rviz.launch

Visualize Phone Orientation (Just from Gyroscope data) [transform broadcaster needs to be enabled]

$ roscore
$ rosrun sensor_fusion_pkg sensor_streamer.py
$ rosrun sensor_fusion_pkg gyro_only_orientation.py
$ roslaunch phone_description phone_spawn.launch
$ roslaunch phone_description phone_rviz.launch

Visualize Phone Orientation (Fused orientation from Gyro, Accelerometer and Magnetometer using Complementary Filter)

[transform broadcaster needs to be enabled]

$ roscore
$ rosrun sensor_fusion_pkg sensor_streamer.py
$ rosrun sensor_fusion_pkg complimentary_filter.py
$ roslaunch phone_description phone_spawn.launch
$ roslaunch phone_description phone_rviz.launch

Equations used for Complementary Filter

Accelerometer

roll_accel

pitch_accel

Magnetometer

M_x

M_y

m_yaw

Gyroscope

roll_g

pitch_g

yaw_g

Real Time Visualization

Complimentary Filter

Kalman Filter Estimates

Kalman Filter

Complementary Filter Estimates

Complementary Filter

Visualize Phone Orientation (Fused orientation from Gyro, Accelerometer and Magnetometer using Kalman Filter)

[transform broadcaster needs to be enabled]

$ roscore
$ rosrun sensor_fusion_pkg sensor_streamer.py
$ rosrun sensor_fusion_pkg kalman_filter.py
$ roslaunch phone_description phone_spawn.launch
$ roslaunch phone_description phone_rviz.launch

Equations used for Kalman Filter

Prediction

kf_prediction

kf_prediction_cov

Kalman Gain

kgain_1

kgain_2

Correction

kf_correction_state

kf_correction_cov

Comparison between fused and gyro only estimates (RPYCF - complementary filter, RPYG - gyro only, RPYKF - kalman filter)

Body Yaw

Body Yaw

Body Pitch

Body Yaw

Body Roll

Body Yaw

Comparison with accurate Angular Benchmark

$ roscore
$ rosrun sensor_fusion_pkg sensor_streamer.py
$ rosrun sensor_fusion_pkg ground_truth_comparison.py
$ rosrun sensor_fusion_pkg kalman_filter.py
$ rosrun sensor_fusion_pkg complimentary_filter.py
$ rosrun sensor_fusion_pkg gyro_only_orientation.py
Note : The phone needs to be aligned with the angular benchmark in such a way that 0 degree yaw corresponds with 0 degrees. Successive positioning of the phones heading on the benchmark is carried out.

benchmark compare

Benchmark using ground truth obtained using articulated robotic arm (ABB4600)

$ roscore
$ download bagfiles from google drive (square_traj_01.bag and rot_180_01.bag) and place in random folder
$ open new terminal and type "rqt_bag" and navigate to one of the bagfiles
$ right click on the topics "Accel_topic_stamped", "Gyro_topic_stamped", "Magno_topic_stamped" and "ee_rotation_stamped" and click "publish" to publish these topics
$ "rosrun sensor_fusion_pkg kalman_filter_robot.py" in separate terminal
$ Click the play button to publish topics.  You should see text being printed in executable terminal
$ Stop publishing at any time and press ctrl+c in terminal.  Plot will be generated

robot

The graphic above is output by following the above procedure. The red line is the ground truth orientation data collected form the robotic manipulator using forward kinematics. The blue line is the kalman filter's estimate of the phone orientation during execution of the trajectory.

sensorfusionws's People

Contributors

karry3775 avatar danielj195 avatar mviswanathan24 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.