-
Notifications
You must be signed in to change notification settings - Fork 695
Fuzzy-matching Trajectory Cache Injectable Traits refactor 🔥🔥 #2941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fuzzy-matching Trajectory Cache Injectable Traits refactor 🔥🔥 #2941
Conversation
91b48e8 to
cc0feb3
Compare
79b7f95 to
e64cad8
Compare
|
Quick question: clang-format/tidy is erroneously editing the template parameters. How do I get around it? Is it acceptable to throw in NOLINT directives? |
77789f3 to
1feb211
Compare
Those ros2_control segfaults in integration tests are unfortunately false alarms in all these tests -- there is an actual assertion failing here: https://github.com/moveit/moveit2/actions/runs/12533008564/job/34958234846?pr=2941#step:11:10051 |
Ah! I see, I think this is an error on my part while writing the tests. Almost to the finish line! Thanks for the prompt reviews 🙇 |
Signed-off-by: methylDragon <[email protected]>
6b19476 to
0c4d4d5
Compare
|
Seems the lingering flaky failures are now based on exit codes. You could consider trying something like this: |
Signed-off-by: methylDragon <[email protected]>
|
Aw man, latest run has a real failure in the test again... |
|
Oh man, let me continue investigating. Sorry for the repeated back and forths.. |
Signed-off-by: methylDragon <[email protected]>
|
d78fd22 is the only thing I can think of, otherwise I will need to const define any trajectories in the test (which will be quite wordy) EDIT: Looks like the CI failure is a different flaky test now (pilz). Unfortunately my local setup makes it difficult to replicate CI, but I did run it a couple times and didn't see the same failure we saw before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine now -- in 5 tries, only got another exit code related failure on a Pilz test, which is for sure not linked to this PR.
Thanks for all the hard work!
Thanks for the in-depth reviews! They helped test stability and fixing some minor bugs in the code. After this is merged the only thing left for this entire feature is the tutorial: Pinging @sjahr for re-approval (from stale review) and merge! |
Note that we've since branched Jazzy off of main and are only landing bug fixes; however, in the tutorials repo the
Sebastian, feel free to merge when/if you approve after the updates. |
Not sure how to do the latter, so I'm just gonna do the former 😬 |
|
I meant more that the maintainers could help do the branching if this will be the jump-off point for the tutorials as well. But I'm still on the fence since this feature is very much at the "leaf" level of MoveIt. |
sjahr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@methylDragon @sea-bass Thanks for your work to bring this over the finish line ❤️
* Implement trajectory cache Signed-off-by: methylDragon <[email protected]> * Add README Signed-off-by: methylDragon <[email protected]> * Move test cpp to test directory Signed-off-by: methylDragon <[email protected]> * Clean up logging and comments Signed-off-by: methylDragon <[email protected]> * Use move_group node for time Signed-off-by: methylDragon <[email protected]> * Add and use logger Signed-off-by: methylDragon <[email protected]> * Use new move_group accessors Signed-off-by: methylDragon <[email protected]> * Coerce variable and method names to style Signed-off-by: methylDragon <[email protected]> * Formatting pass Signed-off-by: methylDragon <[email protected]> * Add docstrings Signed-off-by: methylDragon <[email protected]> * Add ability to sort in descending order Signed-off-by: methylDragon <[email protected]> * Add RFE for custom cost functions Signed-off-by: methylDragon <[email protected]> * Formatting pass Signed-off-by: methylDragon <[email protected]> * Fix build for downstream packages Signed-off-by: methylDragon <[email protected]> * Always get some workspace frame ID Signed-off-by: methylDragon <[email protected]> * Always get some cartesian path request frame ID Signed-off-by: methylDragon <[email protected]> * Fix tests Signed-off-by: methylDragon <[email protected]> * Add const qualifiers as appropriate Signed-off-by: methylDragon <[email protected]> * Add accessors, and support for preserving K plans Signed-off-by: methylDragon <[email protected]> * Edit docs and rename puts to inserts Signed-off-by: methylDragon <[email protected]> * Make clang tidy happy Signed-off-by: methylDragon <[email protected]> * Fix CMakeLists.txt Signed-off-by: methylDragon <[email protected]> * Make getters const Signed-off-by: methylDragon <[email protected]> * Clarify frame ID utils docstrings Signed-off-by: methylDragon <[email protected]> * Elaborate on trajectory cache benefits Signed-off-by: methylDragon <[email protected]> * Fix CHANGELOG, and make library shared Signed-off-by: methylDragon <[email protected]> * Add utils library with test fixtures Signed-off-by: methylDragon <[email protected]> * Add features interface with constant features Signed-off-by: methylDragon <[email protected]> * Add constraint feature extractor utils Signed-off-by: methylDragon <[email protected]> * Add RobotState.joint_state feature extractor utils Signed-off-by: methylDragon <[email protected]> * Add MotionPlanRequest features Signed-off-by: methylDragon <[email protected]> * Add GetCartesianPlanRequest features Signed-off-by: methylDragon <[email protected]> * Use namespace declarations and do cleanups Signed-off-by: methylDragon <[email protected]> * Add CacheInsertPolicyInterface and AlwaysInsertNeverPrunePolicy Signed-off-by: methylDragon <[email protected]> * Add CartesianAlwaysInsertNeverPrunePolicy Signed-off-by: methylDragon <[email protected]> * Init policy features on construction Signed-off-by: methylDragon <[email protected]> * Add execution time extraction util Signed-off-by: methylDragon <[email protected]> * Add BestSeenExecutionTimePolicy and rename methods Signed-off-by: methylDragon <[email protected]> * Add CartesianBestSeenExecutionTimePolicy Signed-off-by: methylDragon <[email protected]> * Return reason string from cache insert policy methods Signed-off-by: methylDragon <[email protected]> * Refactor TrajectoryCache to use the interfaces Signed-off-by: methylDragon <[email protected]> * Move test fixtures to their own directory Signed-off-by: methylDragon <[email protected]> * Fix bugs and build Signed-off-by: methylDragon <[email protected]> * Fix formatting and clang-tidy Signed-off-by: methylDragon <[email protected]> * Update CHANGELOG Signed-off-by: methylDragon <[email protected]> * Make clang-tidy happy Signed-off-by: methylDragon <[email protected]> * Update README Signed-off-by: methylDragon <[email protected]> * Enable unrelated query matching test Signed-off-by: methylDragon <[email protected]> * Make libraries shared Signed-off-by: methylDragon <[email protected]> * Sidestep deprecation warning for computeCartesianPath Signed-off-by: methylDragon <[email protected]> * Fix typo in trajectory cache utils test Signed-off-by: methylDragon <[email protected]> * Exclude test on humble * Add missing header * Use precrement for for loops Signed-off-by: methylDragon <[email protected]> * Use constref in range-based for loops in utils where possible Signed-off-by: methylDragon <[email protected]> * Reserve vectors in getSupportedFeatures Signed-off-by: methylDragon <[email protected]> * Fix README and CHANGELOG Signed-off-by: methylDragon <[email protected]> * Add and use restateInNewFrame util function Signed-off-by: methylDragon <[email protected]> * Attempt to fix policy test Signed-off-by: methylDragon <[email protected]> * Use .hpp instead of .h Signed-off-by: methylDragon <[email protected]> * Undo CHANGELOG changes Signed-off-by: methylDragon <[email protected]> * Use const ref strings for restateInNewFrame Signed-off-by: methylDragon <[email protected]> * Add clarificatory comment to tests and fix formatting Signed-off-by: methylDragon <[email protected]> * Fix compile error * Use constref shared_ptr in restateInNewFrame Signed-off-by: methylDragon <[email protected]> * Mitigate cartesian path tests Signed-off-by: methylDragon <[email protected]> * Mitigate test flakiness Signed-off-by: methylDragon <[email protected]> * Allow -11 for move_group gtest fixture Signed-off-by: methylDragon <[email protected]> * Make execution times in test deterministic Signed-off-by: methylDragon <[email protected]> --------- Signed-off-by: methylDragon <[email protected]> Co-authored-by: Sebastian Jahr <[email protected]> Co-authored-by: Sebastian Jahr <[email protected]> Co-authored-by: Sebastian Castro <[email protected]> (cherry picked from commit a12f327)
…#3408) * Implement trajectory cache Signed-off-by: methylDragon <[email protected]> * Add README Signed-off-by: methylDragon <[email protected]> * Move test cpp to test directory Signed-off-by: methylDragon <[email protected]> * Clean up logging and comments Signed-off-by: methylDragon <[email protected]> * Use move_group node for time Signed-off-by: methylDragon <[email protected]> * Add and use logger Signed-off-by: methylDragon <[email protected]> * Use new move_group accessors Signed-off-by: methylDragon <[email protected]> * Coerce variable and method names to style Signed-off-by: methylDragon <[email protected]> * Formatting pass Signed-off-by: methylDragon <[email protected]> * Add docstrings Signed-off-by: methylDragon <[email protected]> * Add ability to sort in descending order Signed-off-by: methylDragon <[email protected]> * Add RFE for custom cost functions Signed-off-by: methylDragon <[email protected]> * Formatting pass Signed-off-by: methylDragon <[email protected]> * Fix build for downstream packages Signed-off-by: methylDragon <[email protected]> * Always get some workspace frame ID Signed-off-by: methylDragon <[email protected]> * Always get some cartesian path request frame ID Signed-off-by: methylDragon <[email protected]> * Fix tests Signed-off-by: methylDragon <[email protected]> * Add const qualifiers as appropriate Signed-off-by: methylDragon <[email protected]> * Add accessors, and support for preserving K plans Signed-off-by: methylDragon <[email protected]> * Edit docs and rename puts to inserts Signed-off-by: methylDragon <[email protected]> * Make clang tidy happy Signed-off-by: methylDragon <[email protected]> * Fix CMakeLists.txt Signed-off-by: methylDragon <[email protected]> * Make getters const Signed-off-by: methylDragon <[email protected]> * Clarify frame ID utils docstrings Signed-off-by: methylDragon <[email protected]> * Elaborate on trajectory cache benefits Signed-off-by: methylDragon <[email protected]> * Fix CHANGELOG, and make library shared Signed-off-by: methylDragon <[email protected]> * Add utils library with test fixtures Signed-off-by: methylDragon <[email protected]> * Add features interface with constant features Signed-off-by: methylDragon <[email protected]> * Add constraint feature extractor utils Signed-off-by: methylDragon <[email protected]> * Add RobotState.joint_state feature extractor utils Signed-off-by: methylDragon <[email protected]> * Add MotionPlanRequest features Signed-off-by: methylDragon <[email protected]> * Add GetCartesianPlanRequest features Signed-off-by: methylDragon <[email protected]> * Use namespace declarations and do cleanups Signed-off-by: methylDragon <[email protected]> * Add CacheInsertPolicyInterface and AlwaysInsertNeverPrunePolicy Signed-off-by: methylDragon <[email protected]> * Add CartesianAlwaysInsertNeverPrunePolicy Signed-off-by: methylDragon <[email protected]> * Init policy features on construction Signed-off-by: methylDragon <[email protected]> * Add execution time extraction util Signed-off-by: methylDragon <[email protected]> * Add BestSeenExecutionTimePolicy and rename methods Signed-off-by: methylDragon <[email protected]> * Add CartesianBestSeenExecutionTimePolicy Signed-off-by: methylDragon <[email protected]> * Return reason string from cache insert policy methods Signed-off-by: methylDragon <[email protected]> * Refactor TrajectoryCache to use the interfaces Signed-off-by: methylDragon <[email protected]> * Move test fixtures to their own directory Signed-off-by: methylDragon <[email protected]> * Fix bugs and build Signed-off-by: methylDragon <[email protected]> * Fix formatting and clang-tidy Signed-off-by: methylDragon <[email protected]> * Update CHANGELOG Signed-off-by: methylDragon <[email protected]> * Make clang-tidy happy Signed-off-by: methylDragon <[email protected]> * Update README Signed-off-by: methylDragon <[email protected]> * Enable unrelated query matching test Signed-off-by: methylDragon <[email protected]> * Make libraries shared Signed-off-by: methylDragon <[email protected]> * Sidestep deprecation warning for computeCartesianPath Signed-off-by: methylDragon <[email protected]> * Fix typo in trajectory cache utils test Signed-off-by: methylDragon <[email protected]> * Exclude test on humble * Add missing header * Use precrement for for loops Signed-off-by: methylDragon <[email protected]> * Use constref in range-based for loops in utils where possible Signed-off-by: methylDragon <[email protected]> * Reserve vectors in getSupportedFeatures Signed-off-by: methylDragon <[email protected]> * Fix README and CHANGELOG Signed-off-by: methylDragon <[email protected]> * Add and use restateInNewFrame util function Signed-off-by: methylDragon <[email protected]> * Attempt to fix policy test Signed-off-by: methylDragon <[email protected]> * Use .hpp instead of .h Signed-off-by: methylDragon <[email protected]> * Undo CHANGELOG changes Signed-off-by: methylDragon <[email protected]> * Use const ref strings for restateInNewFrame Signed-off-by: methylDragon <[email protected]> * Add clarificatory comment to tests and fix formatting Signed-off-by: methylDragon <[email protected]> * Fix compile error * Use constref shared_ptr in restateInNewFrame Signed-off-by: methylDragon <[email protected]> * Mitigate cartesian path tests Signed-off-by: methylDragon <[email protected]> * Mitigate test flakiness Signed-off-by: methylDragon <[email protected]> * Allow -11 for move_group gtest fixture Signed-off-by: methylDragon <[email protected]> * Make execution times in test deterministic Signed-off-by: methylDragon <[email protected]> --------- Signed-off-by: methylDragon <[email protected]> Co-authored-by: Sebastian Jahr <[email protected]> Co-authored-by: Sebastian Jahr <[email protected]> Co-authored-by: Sebastian Castro <[email protected]> (cherry picked from commit a12f327) Co-authored-by: methylDragon <[email protected]>
…#2941) * Implement trajectory cache Signed-off-by: methylDragon <[email protected]> * Add README Signed-off-by: methylDragon <[email protected]> * Move test cpp to test directory Signed-off-by: methylDragon <[email protected]> * Clean up logging and comments Signed-off-by: methylDragon <[email protected]> * Use move_group node for time Signed-off-by: methylDragon <[email protected]> * Add and use logger Signed-off-by: methylDragon <[email protected]> * Use new move_group accessors Signed-off-by: methylDragon <[email protected]> * Coerce variable and method names to style Signed-off-by: methylDragon <[email protected]> * Formatting pass Signed-off-by: methylDragon <[email protected]> * Add docstrings Signed-off-by: methylDragon <[email protected]> * Add ability to sort in descending order Signed-off-by: methylDragon <[email protected]> * Add RFE for custom cost functions Signed-off-by: methylDragon <[email protected]> * Formatting pass Signed-off-by: methylDragon <[email protected]> * Fix build for downstream packages Signed-off-by: methylDragon <[email protected]> * Always get some workspace frame ID Signed-off-by: methylDragon <[email protected]> * Always get some cartesian path request frame ID Signed-off-by: methylDragon <[email protected]> * Fix tests Signed-off-by: methylDragon <[email protected]> * Add const qualifiers as appropriate Signed-off-by: methylDragon <[email protected]> * Add accessors, and support for preserving K plans Signed-off-by: methylDragon <[email protected]> * Edit docs and rename puts to inserts Signed-off-by: methylDragon <[email protected]> * Make clang tidy happy Signed-off-by: methylDragon <[email protected]> * Fix CMakeLists.txt Signed-off-by: methylDragon <[email protected]> * Make getters const Signed-off-by: methylDragon <[email protected]> * Clarify frame ID utils docstrings Signed-off-by: methylDragon <[email protected]> * Elaborate on trajectory cache benefits Signed-off-by: methylDragon <[email protected]> * Fix CHANGELOG, and make library shared Signed-off-by: methylDragon <[email protected]> * Add utils library with test fixtures Signed-off-by: methylDragon <[email protected]> * Add features interface with constant features Signed-off-by: methylDragon <[email protected]> * Add constraint feature extractor utils Signed-off-by: methylDragon <[email protected]> * Add RobotState.joint_state feature extractor utils Signed-off-by: methylDragon <[email protected]> * Add MotionPlanRequest features Signed-off-by: methylDragon <[email protected]> * Add GetCartesianPlanRequest features Signed-off-by: methylDragon <[email protected]> * Use namespace declarations and do cleanups Signed-off-by: methylDragon <[email protected]> * Add CacheInsertPolicyInterface and AlwaysInsertNeverPrunePolicy Signed-off-by: methylDragon <[email protected]> * Add CartesianAlwaysInsertNeverPrunePolicy Signed-off-by: methylDragon <[email protected]> * Init policy features on construction Signed-off-by: methylDragon <[email protected]> * Add execution time extraction util Signed-off-by: methylDragon <[email protected]> * Add BestSeenExecutionTimePolicy and rename methods Signed-off-by: methylDragon <[email protected]> * Add CartesianBestSeenExecutionTimePolicy Signed-off-by: methylDragon <[email protected]> * Return reason string from cache insert policy methods Signed-off-by: methylDragon <[email protected]> * Refactor TrajectoryCache to use the interfaces Signed-off-by: methylDragon <[email protected]> * Move test fixtures to their own directory Signed-off-by: methylDragon <[email protected]> * Fix bugs and build Signed-off-by: methylDragon <[email protected]> * Fix formatting and clang-tidy Signed-off-by: methylDragon <[email protected]> * Update CHANGELOG Signed-off-by: methylDragon <[email protected]> * Make clang-tidy happy Signed-off-by: methylDragon <[email protected]> * Update README Signed-off-by: methylDragon <[email protected]> * Enable unrelated query matching test Signed-off-by: methylDragon <[email protected]> * Make libraries shared Signed-off-by: methylDragon <[email protected]> * Sidestep deprecation warning for computeCartesianPath Signed-off-by: methylDragon <[email protected]> * Fix typo in trajectory cache utils test Signed-off-by: methylDragon <[email protected]> * Exclude test on humble * Add missing header * Use precrement for for loops Signed-off-by: methylDragon <[email protected]> * Use constref in range-based for loops in utils where possible Signed-off-by: methylDragon <[email protected]> * Reserve vectors in getSupportedFeatures Signed-off-by: methylDragon <[email protected]> * Fix README and CHANGELOG Signed-off-by: methylDragon <[email protected]> * Add and use restateInNewFrame util function Signed-off-by: methylDragon <[email protected]> * Attempt to fix policy test Signed-off-by: methylDragon <[email protected]> * Use .hpp instead of .h Signed-off-by: methylDragon <[email protected]> * Undo CHANGELOG changes Signed-off-by: methylDragon <[email protected]> * Use const ref strings for restateInNewFrame Signed-off-by: methylDragon <[email protected]> * Add clarificatory comment to tests and fix formatting Signed-off-by: methylDragon <[email protected]> * Fix compile error * Use constref shared_ptr in restateInNewFrame Signed-off-by: methylDragon <[email protected]> * Mitigate cartesian path tests Signed-off-by: methylDragon <[email protected]> * Mitigate test flakiness Signed-off-by: methylDragon <[email protected]> * Allow -11 for move_group gtest fixture Signed-off-by: methylDragon <[email protected]> * Make execution times in test deterministic Signed-off-by: methylDragon <[email protected]> --------- Signed-off-by: methylDragon <[email protected]> Co-authored-by: Sebastian Jahr <[email protected]> Co-authored-by: Sebastian Jahr <[email protected]> Co-authored-by: Sebastian Castro <[email protected]>
…#2941) * Implement trajectory cache Signed-off-by: methylDragon <[email protected]> * Add README Signed-off-by: methylDragon <[email protected]> * Move test cpp to test directory Signed-off-by: methylDragon <[email protected]> * Clean up logging and comments Signed-off-by: methylDragon <[email protected]> * Use move_group node for time Signed-off-by: methylDragon <[email protected]> * Add and use logger Signed-off-by: methylDragon <[email protected]> * Use new move_group accessors Signed-off-by: methylDragon <[email protected]> * Coerce variable and method names to style Signed-off-by: methylDragon <[email protected]> * Formatting pass Signed-off-by: methylDragon <[email protected]> * Add docstrings Signed-off-by: methylDragon <[email protected]> * Add ability to sort in descending order Signed-off-by: methylDragon <[email protected]> * Add RFE for custom cost functions Signed-off-by: methylDragon <[email protected]> * Formatting pass Signed-off-by: methylDragon <[email protected]> * Fix build for downstream packages Signed-off-by: methylDragon <[email protected]> * Always get some workspace frame ID Signed-off-by: methylDragon <[email protected]> * Always get some cartesian path request frame ID Signed-off-by: methylDragon <[email protected]> * Fix tests Signed-off-by: methylDragon <[email protected]> * Add const qualifiers as appropriate Signed-off-by: methylDragon <[email protected]> * Add accessors, and support for preserving K plans Signed-off-by: methylDragon <[email protected]> * Edit docs and rename puts to inserts Signed-off-by: methylDragon <[email protected]> * Make clang tidy happy Signed-off-by: methylDragon <[email protected]> * Fix CMakeLists.txt Signed-off-by: methylDragon <[email protected]> * Make getters const Signed-off-by: methylDragon <[email protected]> * Clarify frame ID utils docstrings Signed-off-by: methylDragon <[email protected]> * Elaborate on trajectory cache benefits Signed-off-by: methylDragon <[email protected]> * Fix CHANGELOG, and make library shared Signed-off-by: methylDragon <[email protected]> * Add utils library with test fixtures Signed-off-by: methylDragon <[email protected]> * Add features interface with constant features Signed-off-by: methylDragon <[email protected]> * Add constraint feature extractor utils Signed-off-by: methylDragon <[email protected]> * Add RobotState.joint_state feature extractor utils Signed-off-by: methylDragon <[email protected]> * Add MotionPlanRequest features Signed-off-by: methylDragon <[email protected]> * Add GetCartesianPlanRequest features Signed-off-by: methylDragon <[email protected]> * Use namespace declarations and do cleanups Signed-off-by: methylDragon <[email protected]> * Add CacheInsertPolicyInterface and AlwaysInsertNeverPrunePolicy Signed-off-by: methylDragon <[email protected]> * Add CartesianAlwaysInsertNeverPrunePolicy Signed-off-by: methylDragon <[email protected]> * Init policy features on construction Signed-off-by: methylDragon <[email protected]> * Add execution time extraction util Signed-off-by: methylDragon <[email protected]> * Add BestSeenExecutionTimePolicy and rename methods Signed-off-by: methylDragon <[email protected]> * Add CartesianBestSeenExecutionTimePolicy Signed-off-by: methylDragon <[email protected]> * Return reason string from cache insert policy methods Signed-off-by: methylDragon <[email protected]> * Refactor TrajectoryCache to use the interfaces Signed-off-by: methylDragon <[email protected]> * Move test fixtures to their own directory Signed-off-by: methylDragon <[email protected]> * Fix bugs and build Signed-off-by: methylDragon <[email protected]> * Fix formatting and clang-tidy Signed-off-by: methylDragon <[email protected]> * Update CHANGELOG Signed-off-by: methylDragon <[email protected]> * Make clang-tidy happy Signed-off-by: methylDragon <[email protected]> * Update README Signed-off-by: methylDragon <[email protected]> * Enable unrelated query matching test Signed-off-by: methylDragon <[email protected]> * Make libraries shared Signed-off-by: methylDragon <[email protected]> * Sidestep deprecation warning for computeCartesianPath Signed-off-by: methylDragon <[email protected]> * Fix typo in trajectory cache utils test Signed-off-by: methylDragon <[email protected]> * Exclude test on humble * Add missing header * Use precrement for for loops Signed-off-by: methylDragon <[email protected]> * Use constref in range-based for loops in utils where possible Signed-off-by: methylDragon <[email protected]> * Reserve vectors in getSupportedFeatures Signed-off-by: methylDragon <[email protected]> * Fix README and CHANGELOG Signed-off-by: methylDragon <[email protected]> * Add and use restateInNewFrame util function Signed-off-by: methylDragon <[email protected]> * Attempt to fix policy test Signed-off-by: methylDragon <[email protected]> * Use .hpp instead of .h Signed-off-by: methylDragon <[email protected]> * Undo CHANGELOG changes Signed-off-by: methylDragon <[email protected]> * Use const ref strings for restateInNewFrame Signed-off-by: methylDragon <[email protected]> * Add clarificatory comment to tests and fix formatting Signed-off-by: methylDragon <[email protected]> * Fix compile error * Use constref shared_ptr in restateInNewFrame Signed-off-by: methylDragon <[email protected]> * Mitigate cartesian path tests Signed-off-by: methylDragon <[email protected]> * Mitigate test flakiness Signed-off-by: methylDragon <[email protected]> * Allow -11 for move_group gtest fixture Signed-off-by: methylDragon <[email protected]> * Make execution times in test deterministic Signed-off-by: methylDragon <[email protected]> --------- Signed-off-by: methylDragon <[email protected]> Co-authored-by: Sebastian Jahr <[email protected]> Co-authored-by: Sebastian Jahr <[email protected]> Co-authored-by: Sebastian Castro <[email protected]>
As requested in the original PR, this PR refactors the TrajectoryCache to allow users to inject their own behaviors (which will allow them to cache on and sort by any arbitrary feature, as long as it can be represented as a series of warehouse_ros columns).
Depends on:
Builds on top of:
TODOs:
Preamble
I apologize that this PR is even larger than the one it builds on top of. Most of the added lines are docstrings or tests, and boilerplate to support the behavior injection pattern this refactor is concerned with.
On the other hand, the average file length has decreased, so the code is MUCH more modular and hopefully easy to digest.
I can't split up this PR into multiple smaller ones since technically speaking, in order to preserve cache functionality, all the feature extractors and cache insert policies introduced in this PR will need to go in together.
I would suggest looking at the tests to aid in review (they run the gamut of unit and integration tests).
You can also build and run the example:
PS: If the size is still prohibitive, and we are okay with having partial implementations live in moveit2 while reviews are pending, let me know and I will split up the PR into smaller PRs (though I suspect at that point, that a logical number of splits might end up being somewhere close to 5-10 PRs.)
Navigating This PR
Since this PR is so large, here is a proposed order for comprehending the PR.
features/features_interface.hpp,cache_insert_policies/cache_insert_policy_interface.hppfeatures/,cache_insert_policies/trajectory_cache.hpp,trajectory_cache.cppAdditionally, all docstrings are filled, including file ones, as appropriate. So hopefully any clarificatory questions would have already been pre-empted and answered.
Description
This PR builds on top of the fuzzy-matching Trajectory Cache introduced in:
The implementation in that PR coupled the cache tightly with assumptions about what features to extract and sort by (i.e., a specific set of start/goal constraints, and pruning by execution time.)
This means that users who might want to store different features or a subset of those features, or who might want to fetch and prune on different features (e.g., minimum jerk, path length, etc.) will be unable to.
This PR refactors the cache to allow users to inject their own feature extractors and pruning/insertion logic!
This is done by introducing two new abstract classes that can be injected into the cache methods, acting a lot like class "traits":
FeaturesInterface<>: Governs what query/metadata items to extract and append to the warehouse_ros query.CacheInserterInterface<>: Governs the pruning and insertion logic.For more details on FeaturesInterface, see the Docstrings: https://github.com/moveit/moveit2/blob/cc0feb37cf423076e133523ccdbbf3038b84a01e/moveit_ros/trajectory_cache/include/moveit/trajectory_cache/features/features_interface.hpp
Some notes:
Example
In other words, before. the cache was used like this:
Now the cache is used like this:
See the motion plan request features here: 79b7f95
The Feature Contract
Users may use an instance of FeaturesInterface<> to fetch a cache entry only if it was supported by the CacheInserterInterface<> instance that they used (or on insert, the feature was added in additional_features).
I could not think of a way to create a coupling between uses of the cache inserters and the features. This is the cost of generality and allowing users to inject arbitrary logic into the cache.
As such, users must take care to look at the docs of the cache inserter to see what features can be used with them.
(This can be mitigated by adding helper methods to get "standard" bundles of features and a "standard" CacheInserter.)
Bonus
I added new features to the default feature extractors set and cleaned up some utilities!
There are now
FeaturesInterface<>implementations that can handle path and trajectory constraints!Multiple goal constraints are also handled (at the cost of increased cardinality.)
I also added "atomic" features that wrap the basic ops you can do with warehouse_ros, to allow users to specify their own metadata to tag cache entries with.
Here: cc0feb3
Pre-Existing Support
The package now provides some starter implementations that covers most general cases of motion planning.
For more information, see the implementations of:
FeaturesInterfaceCacheInsertPolicyInterfaceCache Keying Features
The following are features of the plan request and response that you can key the cache on.
These support separately configurable fuzzy lookup on start and goal conditions!
Additionally, these features "canonicalize" the inputs to reduce the cardinality of the cache, increasing the chances of cache hits. (e.g., restating poses relative to the planning frame).
Supported Features:
WorkspaceFeatures: Planning workspaceStartStateJointStateFeatures: Starting robot joint stateMaxSpeedAndAccelerationFeatures: Max velocity, acceleration, and cartesian speed limitsGoalConstraintsFeatures: Planning requestgoal_constraintsPathConstraintsFeatures: Planning requestpath_constraintsTrajectoryConstraintsFeatures: Planning requesttrajectory_constraintsAdditionally, support for user-specified features are provided for query-only or cache metadata tagging constant features.
Similar support exists for the cartesian variants of these.
Cache Insert and Pruning Policies
The following are cache insertion and pruning policies to govern when cache entries are inserted, and how they are (optionally) pruned.
Supported Cache Insert Policies:
BestSeenExecutionTimePolicy: Only insert best seen execution time, optionally prune on best execution time.AlwaysInsertNeverPrunePolicy: Always insert, never pruneCaveat
The increased functionality is now no longer 100% covered. But I tried adding tests where I had time to. I am unfortunately running out of time to iterate on this, so let's be targeted with the improvements!
Build/Test
Precommit with: