-
Notifications
You must be signed in to change notification settings - Fork 765
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
Pose3 improvements #1148
Pose3 improvements #1148
Conversation
dellaert
commented
Mar 26, 2022
- add Matrix versions of transformTo/From
- Align, matrix version
- expose Align in wrapper
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.
Maybe use GEMM?
Used Eigen broadcasting: https://eigen.tuxfamily.org/dox/group__TutorialReductionsVisitorsBroadcasting.html#title7 |
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.
After the Eigen broadcasting everything looks good with me.
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.
One docstring needs updating but LGTM
@@ -354,6 +354,14 @@ Point3 Pose3::transformFrom(const Point3& point, OptionalJacobian<3, 6> Hself, | |||
return R_ * point + t_; | |||
} | |||
|
|||
Matrix Pose3::transformFrom(const Matrix& points) const { | |||
if (points.rows() != 3) { | |||
throw std::invalid_argument("Pose3:transformFrom expects 3*N matrix."); |
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 the PR, Frank. I personally would find it more intuitive to have (N,3) as input, rather than (3,N).
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 respect that, and realize many will feel that way as it's the numpy way. I don't understand why. Points are column vectors in all texts I know of, and replicating columns is much more natural, e.g., to multiply with matrices as the code above shows. It is also used the convention elsewhere in GTSAM (unless it slipped in somewhere, in which case I'd like to deprecate it).