Skip to content

align rotation-matrix FFI to row-major convention#186

Merged
Joseph Borodach (JosephBorodach) merged 1 commit into
mainfrom
rotation-convention-fix
Jul 15, 2026
Merged

align rotation-matrix FFI to row-major convention#186
Joseph Borodach (JosephBorodach) merged 1 commit into
mainfrom
rotation-convention-fix

Conversation

@JosephBorodach

@JosephBorodach Joseph Borodach (JosephBorodach) commented Jul 10, 2026

Copy link
Copy Markdown
Member

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

@viambot

viambot commented Jul 10, 2026

Copy link
Copy Markdown
Member

👋 Thanks for requesting a review from the team!

We aim to review PRs within one business day. If this is urgent
or blocking you, please reach out in #team-sdk and
we'll prioritize it.

elements: *const [f64; 9],
) -> *mut Rotation3<f64> {
null_pointer_check!(elements);
let matrix = Matrix3::from_vec(Vec::from(*elements));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@nfranczak Nick Franczak (nfranczak) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@JosephBorodach

Copy link
Copy Markdown
Member Author

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

@njooma Naveed Jooma (njooma) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Releases are done weekly. Sorry to have missed today's release, but if needed we can do a second release today. Or it can wait till next week.

the python -sdk will automatically pick up a new rust-utils when we do a release

@viam-overwatch

Copy link
Copy Markdown

Hey Joseph Borodach (@JosephBorodach) — this PR has been approved and CI has been green for 3+ business days. Ready to merge?

Auto-comment from overwatch. Will not re-nudge for 7 days.

@JosephBorodach

Copy link
Copy Markdown
Member Author

Releases are done weekly. Sorry to have missed today's release, but if needed we can do a second release today. Or it can wait till next week.

the python -sdk will automatically pick up a new rust-utils when we do a release

Synced offline with Naveed Jooma (@njooma), will release Python sdk before rust utils next week to give me time to make the Python sdk fix

@JosephBorodach
Joseph Borodach (JosephBorodach) merged commit afaaab6 into main Jul 15, 2026
6 checks passed
@JosephBorodach
Joseph Borodach (JosephBorodach) deleted the rotation-convention-fix branch July 15, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants