Add mh_amcl demo - #13
Conversation
4166265 to
2126971
Compare
71ff748 to
518e47b
Compare
Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> Finish adding comments to the code, other minimal changes, still same error Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> Code is compiling, still needs to be tested Add missing nodes to launch file, bond for lifecycle manager, solve minor errors Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> Added message filter for laser messages, refactor a bit of the code Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> Improved a bit the performance, first simulation tests Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com>
518e47b to
6e821fd
Compare
…fload computation Signed-off-by: JesusSilvaUtrera <jesus.silva@ekumenlabs.com> debugging, get_error_distance_to_obstacle returning inf always so quality is 0 Signed-off-by: JesusSilvaUtrera <jesus.silva@ekumenlabs.com>
Signed-off-by: JesusSilvaUtrera <jesus.silva@ekumenlabs.com>
Signed-off-by: JesusSilvaUtrera <jesus.silva@ekumenlabs.com>
|
State update now: multi-hypotheses working, tried different configurations of parameters and the localization looks less flaky (still some unwanted jumps, but end up recovering): testing_mh_amcl.mp4 |
There was a problem hiding this comment.
@JesusSilvaUtrera hmm, video looks great 💪 (though that's a scary jump) but I must say that I fail to see where we use Beluga APIs in this patch.
| // It is necessary to speicify how to use Beluga's particle traits with my new | ||
| // defined type of Particle, to be able to obtain the state and weight of the particles |
There was a problem hiding this comment.
@JesusSilvaUtrera is it? beluga/primitives.hpp are sophisticated enough to pick up well-known members in custom particle types.
There was a problem hiding this comment.
Mmm, okay I will try again, but I remember having problems compiling because the traits couldn't be found, maybe I was just doing it wrong somewhere else.
| * Instantiates a list of 'ParticlesDistribution', each element representing a | ||
| * set of particles (hypothesis), and the map matcher. | ||
| */ | ||
| class MH_AMCL_Node : public rclcpp_lifecycle::LifecycleNode { |
There was a problem hiding this comment.
@JesusSilvaUtrera meta: using lifecycle nodes for a demo seems a bit overboard. It makes for a more complex codebase.
There was a problem hiding this comment.
So you suggest to go back to a simple node? I thought a lifecycle node was appropiate since I am using a bond and it helps setting up the timers and rest of necessary elements.
| @@ -0,0 +1,305 @@ | |||
| // Copyright 2025 Ekumen, Inc. | |||
There was a problem hiding this comment.
@JesusSilvaUtrera meta: a lot of these things beluga already has. See beluga/algorithm/estimation.hpp and beluga_ros/occupancy_grid.hpp for example.
There was a problem hiding this comment.
The Occupancy grid I am already using it in the code, but I was having problems with some of these utilities, so I decided to make my own implementation. Maybe I was messing up some of its methods or the type of the arguments weren't adequate, I will check
@hidmic That is indeed a scary jump jajaja. About using Beluga API, what else did you have in mind, apart from the comments you left? I think I am missing some context about Beluga's API, so I am not sure what else to add (I already added the occupancy grid, and the particle cloud, apart from using the particle traits (which I will review and remove if they are actually not necessary)). |
|
@JesusSilvaUtrera give https://github.com/Ekumen-OS/beluga-demos/blob/main/localization/beluga_demo_fiducial_localization/src/beluga_lmcl_demo.cpp a look. Mainly the general structure of the filter class. You can't implement MH-AMCL with just that for sure, but I would expect it to build on top of core APIs at least. |
b344a9e to
ce58484
Compare
|
After the content seen on Beluga's technical sessions, I have included Beluga's API into the "init", "predict" and "correct" steps, and also for the estimations, deprecating some utilities. For the "reseed" step, I would have liked to use Beluga's API more, but I couldn't find a better way to rewrite the custom logic with it. Some other changes regarding formatting, typos and improving the hypotheses management were added, and now the code seems more robust, but it still gets stuck sometimes (the complexity here is that it doesn't happen all times, it happens at punctual scenarios, so I am not sure yet what is causing this). There are still more changes that can possibly be done to use more of Beluga's API. |
…ose and covariance Signed-off-by: JesusSilvaUtrera <jesus.silva@ekumenlabs.com> Implemented custom action for correcting weights and hits Signed-off-by: JesusSilvaUtrera <jesus.silva@ekumenlabs.com> Improvements to code readability and performance Signed-off-by: JesusSilvaUtrera <jesus.silva@ekumenlabs.com> Final improvements for now to code performance and structure Signed-off-by: JesusSilvaUtrera <jesus.silva@ekumenlabs.com>
ce58484 to
ef2299d
Compare
|
I have reviewed deeply the current implementation and all the steps, trying to make the code more performant (it is now) and also spotting some places where Beluga's API or way of work might come handy:
This is all I could get right now without modifying the behavior or worsening the performance, @hidmic if you can give it a look and provide some feedback about what else would you include or any suggestion you might have. I want to give this a push and, if possible, finally close the Frodo before ending this month (or maybe October, depending on what's left). We can have a short meeting next week as well for discussing the scope, because I fell like there is room for many experiments and tests here, but I need to scope it because I don't want to keep this for long still (but I also want it to provide some value, or at least serve as first implementation for someone to continue). |
|
@hidmic I addressed some of the things we discussed yesterday and moved the demo to a new 'experimental' directory. I left a couple of minor TODOs for the future (not addressing them now given the structure will change a lot in the future, so they are just informative). It should be ready now for a final review and, if everything is okay, approval for merging. Thank you in advance! EDIT: I will add a README with the paper and some information now, JIC. |
Signed-off-by: JesusSilvaUtrera <jesus.silva@ekumenlabs.com> Add README for future information Signed-off-by: JesusSilvaUtrera <jesus.silva@ekumenlabs.com>
cefbc76 to
95f042f
Compare
hidmic
left a comment
There was a problem hiding this comment.
As discussed f2f, this is a very good starting point to think about proper integration with Beluga. I'll draft some tickets on the core so we can get to work on this.
For the time being, and for this PoC, I'm satisfied.
aec53c6 to
d65b903
Compare
Signed-off-by: JesusSilvaUtrera <jesus.silva@ekumenlabs.com>
d65b903 to
d013ff7
Compare
Demo using the multi-hypotheses AMCL with Beluga, based on the paper, an example implementation