psmoveservice / PSMoveService

A background service that communicates with the psmove and stores pose and button data.
Apache License 2.0
590 stars 149 forks source link

fusion #303

Closed liuping001 closed 7 years ago

liuping001 commented 7 years ago

Where I can find magnetometer,gyroscope,accelerometer fusion algorithm of psmovecontroller

cboulay commented 7 years ago

There are at least 2 different algorithms implemented. Here is 1 of them:

https://github.com/cboulay/PSMoveService/blob/master/src/psmoveservice/Filter/KalmanPoseFilter.cpp

This isn't really an "issue". Please post general questions to the google group: https://groups.google.com/forum/#!forum/psmoveservice

HipsterSloth commented 7 years ago

As Chad mentioned there are a few different position and orientation filter algorithms. The orientation filters handle the magnetometer, gyroscope, and accelerometer sensor fusion.

This file has the Kalman Orientation filter for the PSMove and DualShock 4 controllers: https://github.com/cboulay/PSMoveService/blob/master/src/psmoveservice/Filter/KalmanOrientationFilter.cpp

This file has 4 different orientation filters: https://github.com/cboulay/PSMoveService/blob/master/src/psmoveservice/Filter/OrientationFilter.cpp

Finally there is the KalmanPose filter Chad linked to. This is based off of a full pose (orientation+position) kalman filter Chad originally wrote in MatLab. I tried to port it to C++ but never got it working correctly. I wouldn't use that for anything at the moment (except maybe for reference).

Let me know if you have any questions about any of these filters

EDIT: Here is Madgwick's paper that is the basis for all of the Madgwick orientation filters: https://www.samba.org/tridge/UAV/madgwick_internal_report.pdf

HipsterSloth commented 7 years ago

Also if you are looking for a more drop in implementation of a Madgwick orientation filter there is a standalone implementation here of the MARG and ARG filters: http://x-io.co.uk/open-source-imu-and-ahrs-algorithms/

A few things to note about that implementation: