tesseract icon indicating copy to clipboard operation
tesseract copied to clipboard

The ContactResultsMap results in a significant amount of heap allocations during motion planning.

Open Levi-Armstrong opened this issue 1 year ago • 3 comments

This data structure should be updated to leverage Pool library to avoid this. Links to documentation of available options:

Boost Pool Library Boost Pool Library Examples

Levi-Armstrong avatar Mar 14 '23 18:03 Levi-Armstrong

It looks like std has adopted some of these into c++17

https://www.rkaiser.de/wp-content/uploads/2021/03/embo2021-pmr-STL-for-Embedded-Applications-en.pdf

Levi-Armstrong avatar Mar 14 '23 21:03 Levi-Armstrong

Here is PR #864 where I started leveraging std::pmr but not sure if it is being used correctly and needs further testing.

Levi-Armstrong avatar Mar 15 '23 15:03 Levi-Armstrong

After watching a few cppcon presentation on this functionality it is more involved that I thought when using std::pmr if you are storing a custom class/struct. Each of the structs data members would need to use pmr types like string and std::array. On the final slide of one of the presentation they stated that usually an object pool or custom struct would be sufficient without the complexity of std::pmr. I agree and think a custom class can be created to store an internal map and control how things are cleared to reduce multiple allocations during collision checking.

Levi-Armstrong avatar Mar 18 '23 19:03 Levi-Armstrong