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

Add the rotation averager to GLOMAP #113

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

Add the rotation averager to GLOMAP #113

wants to merge 28 commits into from

Conversation

lpanaf
Copy link
Collaborator

@lpanaf lpanaf commented Sep 27, 2024

No description provided.

@lpanaf lpanaf requested a review from ahojnnes September 27, 2024 16:39
glomap/math/gravity.cc Outdated Show resolved Hide resolved
@@ -14,4 +14,7 @@ double RotUpToAngle(const Eigen::Matrix3d& R_up);
// Get the upright rotation matrix from a rotation angle
Eigen::Matrix3d AngleToRotUp(double angle);

// Estimate the average gravity direction from a set of gravity directions
Eigen::Vector3d AverageGravity(std::vector<Eigen::Vector3d>& gravities);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to write a few unit tests for this function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For average gravity? Or for rotation averaging? For average gravity, I think it is simply some SVD. For the rotation averaging, then I would need to design it a bit :)

bool use_stratified = true;
};

class RotationAverager {
Copy link
Contributor

Choose a reason for hiding this comment

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

So, this only solves the gravity aligned rotation averaging problem and is not a general interface for rotation averaging? Why is this a separate, new class? Otherwise, a more specific name would be preferable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, the interface is for both 3DoF RA and 1DoF RA. If gravity direction is not provided, then the original 3DoF will be applied

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for clarifying. It feels odd that this is a class. Why not just make it a function?

lpanaf and others added 2 commits September 29, 2024 23:03
Co-authored-by: Johannes Schönberger <[email protected]>
// If there is no image pairs with gravity or most image pairs are with
// gravity, then just run the 3dof version
bool status = false;
status = status || grav_pairs == 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

first status is always false so the or condition is superfluous.


class RotationAverager {
public:
RotationAverager(const RotationAveragerOptions& options)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
RotationAverager(const RotationAveragerOptions& options)
explicit RotationAverager(const RotationAveragerOptions& options)

lpanaf and others added 2 commits September 30, 2024 16:09
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