artivis / manif

A small C++11 header-only library for Lie theory.
https://artivis.github.io/manif
MIT License
1.5k stars 245 forks source link

Support for float type #216

Closed chpohl closed 3 years ago

chpohl commented 3 years ago

I am using manif for some computations in an existing project which is entirely working with fp32 numbers. However when I use they float type with any operations in manif, I more or less randomly (but very frequently) get the exception

terminate called after throwing an instance of 'manif::invalid_argument'
what():  SO3 assigned data not normalized !

This exception stems from the hardcoded eps for the double precision type in constants.h. Is it at all possible for you to support other types than double (e.g. by using std::numeric_limits<_Scalar>::epsilon())?

Best regards and thanks for the great library.

artivis commented 3 years ago

Hi,

Thanks for the feedback. This was reported in #171 already, I guess should take care of it :sweat_smile: .