-
Notifications
You must be signed in to change notification settings - Fork 767
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
Pose2::Align #1150
Pose2::Align #1150
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,18 @@ class Pose2: public LieGroup<Pose2, 3> { | |
*this = Expmap(v); | ||
} | ||
|
||
/** | ||
* Create Pose2 by aligning two point pairs | ||
* A pose aTb is estimated between pairs (a_point, b_point) such that | ||
* a_point = aTb * b_point | ||
* Note this allows for noise on the points but in that case the mapping | ||
* will not be exact. | ||
*/ | ||
static boost::optional<Pose2> Align(const Point2Pairs& abPointPairs); | ||
|
||
// Version of Pose2::Align that takes 2 matrices. | ||
static boost::optional<Pose2> Align(const Matrix& a, const Matrix& b); | ||
|
||
/// @} | ||
/// @name Testable | ||
/// @{ | ||
|
@@ -331,12 +343,15 @@ inline Matrix wedge<Pose2>(const Vector& xi) { | |
return Matrix(Pose2::wedge(xi(0),xi(1),xi(2))).eval(); | ||
} | ||
|
||
#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V42 | ||
/** | ||
* @deprecated Use static constructor (with reversed pairs!) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason we've reversed the pairs? This seems API breaking since the new method is semantically exactly the same as the old one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're bringing 2D in line with 3D |
||
* Calculate pose between a vector of 2D point correspondences (p,q) | ||
* where q = Pose2::transformFrom(p) = t + R*p | ||
*/ | ||
typedef std::pair<Point2,Point2> Point2Pair; | ||
GTSAM_EXPORT boost::optional<Pose2> align(const std::vector<Point2Pair>& pairs); | ||
GTSAM_EXPORT boost::optional<Pose2> | ||
GTSAM_DEPRECATED align(const Point2Pairs& pairs); | ||
#endif | ||
|
||
template <> | ||
struct traits<Pose2> : public internal::LieGroup<Pose2> {}; | ||
|
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.
I would go in the other direction, but okay.
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.
aTb corresponds to (a,b) pairs
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.
I meant we compute everything with matrices and use the Pose2Pairs version to call the matrix version.
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.
Oh, I agree with that! Other PR. Will merge now.