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

Various Improvements #1943

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open

Various Improvements #1943

wants to merge 6 commits into from

Conversation

varunagrawal
Copy link
Collaborator

@varunagrawal varunagrawal commented Dec 23, 2024

  1. Suppress maybe-uninitialized warnings from Eigen for Release build. We only see this warning in Eigen, and since this is a vendored version, the assumption is that the original developers have already accounted for this to not be a problem.
  2. Fix some docstrings.
  3. Use resetIntegration to initialize the ImuFactor and CombinedImuFactor classes.
  4. Wrap ImuFactor2.
  5. Added a new macro GTSAM_COUT which is for classes/types that don't have a .print() defined or have the << operator overloaded. An example usage is below:
Rot3 wRb = Rot3();
GTSAM_COUT(wRb);

which prints

wRB: 1, 0, 0  // Note that it also prints the variable name similar to GTSAM_PRINT.
0, 1, 0
0, 0, 1

Interestingly, there is no CombinedImuFactor2 which works on NavStates. This should be a TODO for us given the recent importance of NavState.

@varunagrawal varunagrawal self-assigned this Dec 23, 2024
@varunagrawal
Copy link
Collaborator Author

@dellaert reminder

@varunagrawal varunagrawal requested a review from dellaert January 6, 2025 17:36
@@ -41,6 +41,7 @@
#include <string>

#define GTSAM_PRINT(x)((x).print(#x))
#define GTSAM_COUT(x) (std::cout << #x ": " << x << std::endl)
Copy link
Member

Choose a reason for hiding this comment

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

But print already assumes cout

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is more for types that don't support .print(). I can use this to print doubles, strings etc.

Copy link
Member

Choose a reason for hiding this comment

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

Then just use std::cout, please.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wouldn't it be convenient to do GTSAM_COUT(x) instead of std::cout << "x: " << x << std::endl;?

Copy link
Member

Choose a reason for hiding this comment

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

Not a GTSAM thing

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