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

Auto 2257 fix double construction kiss icp cpp #294

Merged
merged 7 commits into from
Mar 18, 2024

Conversation

nachovizzo
Copy link
Collaborator

@nachovizzo nachovizzo commented Mar 11, 2024

NOTE: I sneaked some small changes alongside this PR to avoid stacking 20 other PRs. I tried to be more verbose commit-wise (don't just review the full diff) and also provided a description here

Testing #252 I realized that there was a small buggy problem in the construction of the C++ pipeline:

Since we were using a stack KISS-ICP pipeline, we were constructing twice, once at compile time with default parameters and 2nd at runtime with the runtime ROS params

Besides this being ugly led to a horrible bug, that luckily I captured early, which was the fact that I couldn’t control the number of threads (static const g) since it was default constructed to multithreaded and ignored at runtime 🤦‍♂️

Changes

  • Delete kiss_icp::pipeline::KissICP default constructor 15e20a2. Python system is not affected, nothing is affected
  • Update the only consumer, the ROS wrapper: 20c2d74
  • Rename odometry_ way too generic 8c38132

Minor changes

Since I was forced to review the horror I wrote last year, I also:

  • Remove a duplicated code 3fed3a6
  • Removed config_ to be an unnecessary class member of the odometry server 250708a, and update the utils accordingly at 533047c

Since we can't guarantee how the pipeline is going to be constructed at
runtime is better to force the user to wrap it in a pointer type to
avoid having a default-constructed object that "should" be modified
later on
This way we guarantee that it's constructed once the `config_` has been
properly populated
Copy link
Member

@benemer benemer left a comment

Choose a reason for hiding this comment

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

Good catch, looks good from my side!

Copy link
Collaborator

@tizianoGuadagnino tizianoGuadagnino left a comment

Choose a reason for hiding this comment

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

I love this one, awesome bruda ;)

@nachovizzo nachovizzo merged commit 780fddc into main Mar 18, 2024
17 checks passed
@nachovizzo nachovizzo deleted the AUTO-2257_fix_double_construction_kiss_icp_cpp branch March 18, 2024 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants