PoseLib icon indicating copy to clipboard operation
PoseLib copied to clipboard

Adding precision selection

Open seoj135 opened this issue 11 months ago • 7 comments

This forked branch and PR purpose to add precision selection on PoseLib. i.e, it allowes to use float precision instead of double.

Trivially, it has to tune parameters and make bigger thresholds/tolerances.

If you enabled WITH_FLOAT option on build, then you can use PoseLib float only. And the results file will have midfix f image or PoseLibfd.lib on debug case

Also, this PR includes some improvements in benchmark, since there are overflow on runtime accumulation in debug builds. And I'd like to save results automatically.

Good to check file lists:

  • CMakeLists.txt
  • real_t.h
  • SetEnv.cmake

MSVC Benchmark Results

benchmark_results_double_0.000001.csv

benchmark_results_float_0.000001.csv

benchmark_results_float_0.001000.csv

Clang Benchmark Results

benchmark_results_double_0.000001.csv

benchmark_results_float_0.000001.csv

benchmark_results_float_0.001000.csv


Fixes #101


Just minor askment, cmake version 3.10 seems too old, no :)?

seoj135 avatar Jan 07 '25 12:01 seoj135

Just minor askment, cmake version 3.10 seems too old, no :)?

Do you mean for this:

cmake_minimum_required(VERSION 3.10)

This is minimum requirement; newer versions can be used.

pablospe avatar Jan 07 '25 22:01 pablospe

@pablospe I'd think 3.14 seems good to use as minimum, since it supports better generator expression syntax. image Surely if you guys accept it.

seoj135 avatar Jan 08 '25 07:01 seoj135

Note,

  • applied suggestions from @pablospe , but real instead of Real. Since real is primitive, I think lower-case name makes sense for it.
  • separated type header to real.h and to real_matrix.h to improve build speed.
  • Due to poor feature of cmake, my suggestion regarding cmake is abandoned.

seoj135 avatar Jan 16 '25 11:01 seoj135

Due to poor feature of cmake, my suggestion regarding cmake is abandoned.

Could you expand on this? Not sure to understand about the poor feature of cmake. What did you want to achieve?

  • applied suggestions from @pablospe , but real instead of Real. Since real is primitive, I think lower-case name makes sense for it.

I feel using Real instead of real is a better option, for the following:

  • Consistency with Type Naming Conventions:

    • It is a common convention to capitalize type names to distinguish them from primitive types and variables. This improves code readability and maintainability. See types.h and we are using all as VectorYYY, MatrixZZZ, etc.
    • Using Real aligns with this convention, making it clear that it is a custom type.
  • Readability and Maintainability:

    • Capitalizing type names makes it easier to quickly identify and understand the code. It reduces cognitive load and helps in maintaining a consistent coding style.
  • Industry Standards and Best Practices:

    • Refer to industry standards and best practices that recommend capitalizing type names. This can provide authoritative support for the change. For example, the Google C++ Style Guide recommends using capitalized names for types. And we might change to strictly follow Google C++ Style, see this PR

I would recommend changing it to Real (preferrable) or leaving it as real_t.

pablospe avatar Jan 21 '25 21:01 pablospe

Due to poor feature of cmake, my suggestion regarding cmake is abandoned.

Could you expand on this? Not sure to understand about the poor feature of cmake. What did you want to achieve?

Sorry for no defail about it. Since cmake's generator expression doesn't work with set() command of cmake, i.e. only work with partial commands like if(). It may need to increase cmake version too many. But I thought ppl prefer to keep lowest version of utilities, so I'd drop the change.

seoj135 avatar Jan 30 '25 04:01 seoj135

It may need to increase cmake version too many. But I thought ppl prefer to keep lowest version of utilities, so I'd drop the change.

It would be ok to increase the cmake version, it is fine.

pablospe avatar Jan 31 '25 19:01 pablospe

There are some misunderstanding regarding cmake from me. anyway cmake script is simplified.

seoj135 avatar Feb 02 '25 02:02 seoj135