align rotation-matrix FFI to row-major convention#186
align rotation-matrix FFI to row-major convention#186Joseph Borodach (JosephBorodach) wants to merge 1 commit into
Conversation
|
👋 Thanks for requesting a review from the team! We aim to review PRs within one business day. If this is urgent |
| elements: *const [f64; 9], | ||
| ) -> *mut Rotation3<f64> { | ||
| null_pointer_check!(elements); | ||
| let matrix = Matrix3::from_vec(Vec::from(*elements)); |
There was a problem hiding this comment.
https://docs.rs/nalgebra/latest/nalgebra/base/struct.Matrix.html#method.from_vec states
Creates a matrix with its elements filled with the components provided by a slice in column-major order
Nick Franczak (nfranczak)
left a comment
There was a problem hiding this comment.
math checks out.
i defer approval to the sdk team.
please make sure that universal-robots still remains working as it uses rust-utils through FFI
Yep already noted this in the rdk pr audit - universal-robots rust_utils.h only imports OV/Quaternion/Euler/AxisAngle FFI symbols, zero rotation-matrix functions. This PR only touches rotation-matrix symbols so its imports are untouched |
Applying the analogous fix to what shipped in rdk#6193 (viamrobotics/rdk#6193).
Two motivations:
The behavior change to both rust_utils and the python sdk are safe bc we have no users of these APIs yet. Best to fix it before we do.
Question for rust-utils maintainers: what's the release cadence here? viam-python-sdk's postinstall.sh pulls rust-utils/releases/latest, so I'll need to know when this ships as a release to time the Python SDK follow-up