[Feature/request] Float precision supports
Hello, I'm Jin.
I'd like to ask whether you have plan to support float on PoseLib or not.
By the cmake config or by using template param. both are fine, but maybe template based one is more flexible to use.
While config based one is a quickable approach.
float may have too many numerical issues but it can be much faster on low-power devices, this is why I am asking about it
Thank you to read it :)
What do you mean by cmake config?
Were you suggesting replacing all instance of double for something like Real? And then use something like this:
#ifdef USE_FLOAT
typedef float Real;
#else
typedef double Real;
#endif
Maybe you can propose a PR :)
Cmake config I meant is like your example. btw, then what do you think about applying template? It's useful, but it can make worse on compiliation time.
From what I understand we would need to template every function and instantiate it with both float and double. I am not a fan of this as it would explode compile times.
Updating the entire code-base to replace double with Real is also not very appealing to me. I am not sure if there are any other alternatives though.
@pablospe @vlarsson Hello, this request opened too long ago. anyway, I am trying to work about it by following the way @pablospe suggested.
prec_t will be first alias at commit, but it can be changed to 'real' as suggested in any chance.
I will open PR after some days later and let you know.
Also I will check performance differences if possible. or just try to make comparisons later on.