-
Notifications
You must be signed in to change notification settings - Fork 92
compute mean of a set of rotations #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compute mean of a set of rotations #160
Conversation
Need to make log() method handle a multi-value quaternion.
…ued quaternion object.
… a vector, v is an array.
…ase when vector part is zero.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See inline comments.
spatialmath/pose3d.py
Outdated
eta = tol * np.finfo(float).eps | ||
R_mean = self[0] # initial guess | ||
while True: | ||
r = np.dstack((self.inv() * self).log()).mean(axis=2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unclear to me what section of the reference paper outlines this algorithm (admittedly, I did not thoroughly read it) . Would you mind pointing it out to me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've clarified that.
…for a quaternion implementation, rather than converting to/from SO(3) matrices.
Ok, fixed some bugs, tests pass. There is a randomised test but it is reproducible, using a seeded random number generator. I've commented out, for now, the quaternion mean. Naively applying the SO(3) algorithms for quaternions didn't work, and I need to do more reading. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
New method
mean()
for each ofSO3
andUnitQuaternion
, computes the Karcher (rotational) mean.Relatively straightforward for
SO3
butUnitQuaternion
required a bunch of changes to allow more methods to handle multi-valuedUnitQuaternion
objects. Fixed forRPY()
,Eul()
,UnitQuaternion()
constructor,log()
andexp()
. Also had to fix edge case forlog()
andexp()
for the unit quaternions case.Tests and doco updated.
The result is a lot of changes, but generally improved functionality for the
UnitQuaternion
class.