Skip to content

A repository explaining how to find the average quaternion given several weighted quaternions.

License

Notifications You must be signed in to change notification settings

BobMcFry/averaging_weighted_quaternions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Averaging Weighted Quaternions

A repository explaining how to find the average quaternion given several weighted quaternions. As I had trouble finding example code that solves this problem, I think that this will be helpful to others. I worked on that problem in a robot related project, therefore I used datatypes like tf::Quaternion or tf::Point which are taken from the tf package associated with ROS (Robot Operating System). I am pretty sure you can easily replace them with the respective Eigen-versions. Also I am not sure whether I added all necessary includes, so bear with me. Nevertheless, I hope this will help people with the same problem!

Credits go to this answer on SO which basically sums up steps given in this paper. Also there is a python implementation that is doing the same.

The Algorithm in short with bad mathematic notation

Given a list of equation quaternions equation with corresponding weights equation we want to find a single quaternion equation that represents their weighted average.

First we construct a matrix equation which contains the weighted quaternions (represented as column vectors) as outlined below:

equation

Then we multiply this matrix with its transposed version resulting in a equation Matrix equation. Then we have to find the largest Eigenvalue of equation and take the corresponding Eigenvector: equation

Then our averaged quaternion is simply:

equation

About

A repository explaining how to find the average quaternion given several weighted quaternions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages