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

Enum to categorize HybridFactor #1832

Merged
merged 7 commits into from
Sep 18, 2024
Merged

Enum to categorize HybridFactor #1832

merged 7 commits into from
Sep 18, 2024

Conversation

varunagrawal
Copy link
Collaborator

Replaced the previous boolean based checks for whether a HybridFactor is Discrete, Continuous or Hybrid with an enum.
This would prevent a HybridFactor from having multiple flags true accidentally.

@varunagrawal varunagrawal self-assigned this Sep 15, 2024
@@ -41,6 +41,9 @@ KeyVector CollectKeys(const KeyVector &keys1, const KeyVector &keys2);
DiscreteKeys CollectDiscreteKeys(const DiscreteKeys &key1,
const DiscreteKeys &key2);

/// Enum to help with categorizing hybrid factors.
enum class HybridCategory { None, Discrete, Continuous, Hybrid };
Copy link
Member

Choose a reason for hiding this comment

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

I like this a lot, but could we just make it an inner inside the HF class?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. I renamed it to Category so it reads nicer as HybridFactor::Category.

Copy link
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

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

LGTM, why not target develop? Prefer smaller PRs into develop than having to see this code again in another review…

@varunagrawal
Copy link
Collaborator Author

I was trying to avoid major merge conflicts. I guarantee you won't see this code in another review. :)

Base automatically changed from hybrid-error-scalars to develop September 18, 2024 20:17
@varunagrawal varunagrawal merged commit 2c140df into develop Sep 18, 2024
33 checks passed
@varunagrawal varunagrawal deleted the hybrid-enum branch September 18, 2024 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants