-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adds Vector3, Matrix3, Quaternion, RollPitchYaw and api::Rotation bindings #43
Conversation
Signed-off-by: Franco Cipollone <[email protected]>
Signed-off-by: Franco Cipollone <[email protected]>
Signed-off-by: Franco Cipollone <[email protected]>
Signed-off-by: Franco Cipollone <[email protected]>
Signed-off-by: Franco Cipollone <[email protected]>
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.
Checkpoint, but it's looking good!
std::unique_ptr<Matrix3> Matrix3_new(double m00, double m01, double m02, | ||
double m10, double m11, double m12, | ||
double m20, double m21, double m22) { | ||
return std::make_unique<Matrix3>(std::initializer_list<double>{m00, m01, m02, m10, m11, m12, m20, m21, m22}); |
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.
Should add
#include <initializer_list>
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.
Done.
rust::String Quaternion_to_str(const Quaternion& self) { | ||
std::stringstream ss; | ||
ss << self; | ||
return {ss.str()}; |
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.
We may want to add to_str() method to the Quaternion class.
maliput-sys/tests/math_test.rs
Outdated
let m = Matrix3_new(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); | ||
let t = Matrix3_transpose(&m); | ||
assert_eq!(Matrix3_row(&m, 1).z(), Matrix3_row(&t, 2).y()); |
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.
let m = Matrix3_new(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); | |
let t = Matrix3_transpose(&m); | |
assert_eq!(Matrix3_row(&m, 1).z(), Matrix3_row(&t, 2).y()); | |
let m = Matrix3_new(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); | |
let t = Matrix3_transpose(&m); | |
let n = Matrix3_new(1.0, 4.0, 7.0, 2.0, 5.0, 8.0, 3.0, 6.0, 9.0); | |
assert_eq!(Matrix3_equals(&t, &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.
Thanks. Done
Signed-off-by: Franco Cipollone <[email protected]>
I accidentaly merged #44 which uses this PR's branch as target. So I will continue as this is. |
Signed-off-by: Franco Cipollone <[email protected]>
Signed-off-by: Franco Cipollone <[email protected]>
I will go ahead and merge this PR to unblock future PRs. Feel free to drop a review and we can work on a follow-up PR. |
🎉 New feature
Related to #11 #14
Summary
FFI Bindings for:
Rust API for:
Adds RollPitchYaw and Rotation bindings and Rust API #44 was merged into this branch/PR
Checklist