Skip to content
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

Select mixin components at runtime #126

Merged
merged 28 commits into from
Mar 14, 2023
Merged

Conversation

nahueespinosa
Copy link
Member

@nahueespinosa nahueespinosa commented Mar 3, 2023

Closes #118.

Summary

This solves the runtime component selection problem using static dispatch and variants. There were several yaks I had to shave in the process:

  • Cleanup external interface using type erased views.
  • Remove the likelihood field publisher.
  • Rename internal mixin methods.
  • Separate storage functionality in its own mixin type.
  • Re-add an estimation mixin.
  • Update ciabatta to simplify mixin definition.

Checklist

  • Read the contributing guidelines.
  • Configured pre-commit and ran colcon test locally.
  • Signed all commits for DCO.
  • Added tests (regression tests for bugs, coverage of new code for features).
  • Updated documentation (as needed).
  • Checked that CI is passing.

@nahueespinosa nahueespinosa added enhancement New feature or request cpp Related to C++ code labels Mar 3, 2023
@nahueespinosa nahueespinosa self-assigned this Mar 3, 2023
@nahueespinosa
Copy link
Member Author

@ivanpauno @glpuga @hidmic If you have time to review, let me know what you think.

Documentation and testing is left for after the rest is approved.
The idea would be to merge everything that's in the works and rebase this on top of the latest version.
It would also be interesting to profile this and compare with current main.

Copy link
Collaborator

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool work!!

I have left some minor comments/questions/suggestions.
Tests and docstrings need to be updated, when that's ready I think this is looking good!

beluga/include/beluga/algorithm/sampling.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/algorithm/sampling.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/algorithm/sampling.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/algorithm/sampling.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/algorithm/particle_filter.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/motion/differential_drive_model.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/localization.hpp Outdated Show resolved Hide resolved
beluga_amcl/src/amcl_node.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once tests are readded, documentation is completed this looks ready to go to me.
This is looking great!

@ivanpauno
Copy link
Collaborator

It would also be interesting to profile this and compare with current main.

+1, I think we should do that before merging.
I can help with that if you want, as I already have the results for main from my computer.

Copy link
Collaborator

@hidmic hidmic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments. Just pestering a bit. Great work @nahueespinosa.

beluga/include/beluga/localization.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/sensor/likelihood_field_model.hpp Outdated Show resolved Hide resolved
beluga_amcl/src/amcl_node.cpp Outdated Show resolved Hide resolved
beluga_amcl/src/amcl_node.cpp Outdated Show resolved Hide resolved
beluga/include/beluga/localization.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/mixin.hpp Outdated Show resolved Hide resolved
beluga_amcl/src/amcl_node.cpp Outdated Show resolved Hide resolved
@nahueespinosa nahueespinosa force-pushed the nahuel/rehash-mixin-tags branch 3 times, most recently from f3f7a6b to 1ad5051 Compare March 6, 2023 22:56
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Copy link
Collaborator

@hidmic hidmic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll review tests tomorrow (not enough brain right now). Super clean code @nahueespinosa 🚀

beluga_amcl/src/amcl_node.cpp Outdated Show resolved Hide resolved
beluga_amcl/src/amcl_node.cpp Outdated Show resolved Hide resolved
beluga_amcl/src/amcl_node.cpp Outdated Show resolved Hide resolved
beluga/include/beluga/localization.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/localization.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/mixin/descriptor.hpp Show resolved Hide resolved
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
`gcc` and `clang` compile them, but are technically not valid C++.

Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Also, take an rvalue reference.

Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Copy link
Collaborator

@glpuga glpuga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great work!

@ivanpauno
Copy link
Collaborator

Performance comparison:

  • Red -> this PR
  • Blue -> last recording

image

Which looks like nothing significant changed 😃 🎉

Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
@nahueespinosa
Copy link
Member Author

@ivanpauno @hidmic @glpuga Documentation and tests were updated! PTAL when you can.

Copy link
Collaborator

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some minor comments, LGTM!

beluga/include/beluga/algorithm/particle_filter.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/algorithm/particle_filter.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/algorithm/particle_filter.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/motion/differential_drive_model.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/motion/stationary_model.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/sensor/likelihood_field_model.hpp Outdated Show resolved Hide resolved
beluga_amcl/src/amcl_node.cpp Show resolved Hide resolved
beluga_example/config/params.yaml Show resolved Hide resolved
nahueespinosa and others added 3 commits March 13, 2023 18:37
Co-authored-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Copy link
Collaborator

@glpuga glpuga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, but LGTM!

beluga/include/beluga/algorithm/estimation.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/algorithm/estimation.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/algorithm/particle_filter.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/algorithm/sampling.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/mixin/descriptor.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/mixin/utility.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/mixin/utility.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/motion.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/motion.hpp Outdated Show resolved Hide resolved
beluga/include/beluga/motion.hpp Outdated Show resolved Hide resolved
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Copy link
Collaborator

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
@nahueespinosa nahueespinosa merged commit f50cc62 into main Mar 14, 2023
@nahueespinosa nahueespinosa deleted the nahuel/rehash-mixin-tags branch March 14, 2023 17:34
@nahueespinosa nahueespinosa mentioned this pull request Mar 16, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cpp Related to C++ code enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Select particle filter components at runtime
4 participants