bdaiinstitute / spatialmath-python

Create, manipulate and convert representations of position and orientation in 2D or 3D using Python
MIT License
497 stars 82 forks source link

Fixed domain errors in acos near identity #86

Closed bokorn-bdaii closed 10 months ago

bokorn-bdaii commented 10 months ago

Found an error when using the log map on near identy rotations. This was cause by slight inaccuracies in the conversion resulting in a trace of 3 + eps, which results in a value > 1 being passed to acos in the log map function. Added a min between the value and 1 to fix this as well as unit tests.

`` from spatialmath import SO3 R = SO3.Rand() R_test = (R.inv() R) print((R.inv() R).eulervec())

``