-
Notifications
You must be signed in to change notification settings - Fork 115
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
base: main
Are you sure you want to change the base?
Conversation
glomap/math/gravity.h
Outdated
@@ -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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
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; |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RotationAverager(const RotationAveragerOptions& options) | |
explicit RotationAverager(const RotationAveragerOptions& options) |
Co-authored-by: Johannes Schönberger <[email protected]>
Co-authored-by: Johannes Schönberger <[email protected]>
No description provided.