Samples: Fix quaternion unit label and axis-angle unit-vector check - #233
Closed
yooni1231 wants to merge 1 commit into
Closed
Samples: Fix quaternion unit label and axis-angle unit-vector check#233yooni1231 wants to merge 1 commit into
yooni1231 wants to merge 1 commit into
Conversation
- AxisAngle.__init__ validated the axis by checking norm != 0 instead
of norm != 1, so passing an explicit angle with a valid unit axis
always raised ValueError.
- BasePoseWidget._rotation_label_text compared the RotationFormat
dataclass instance against plain strings ("Quaternion", "Rotation
Matrix"), which is never True, so the (deg)/(rad) suffix was
incorrectly appended to unitless formats like Quaternion.
zividgerman
deleted the
2026-08-13-fix-pose-conversion-quaternion-unit-labels
branch
August 13, 2026 08:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AxisAngle.__init__(pose_conversions.py) validated the axis by checkingnorm(axis) != 0instead of!= 1, so passing an explicitanglewith a valid unit axis always raisedValueError. Currently dead code in this sample (never hit by_main()), but breaks the documented axis+angle constructor usage for any new caller.BasePoseWidget._rotation_label_text(pose_widget.py) compared theRotationFormatdataclass instance against plain strings ("Quaternion","Rotation Matrix"), which is neverTruesince dataclass equality only matches same-type instances. This caused the(deg)/(rad)unit suffix to always be appended to the rotation label, even for unitless formats like Quaternion.Test plan
pose_conversion_gui.pyno longer shows(deg)/(rad)next to the Quaternion/Rotation Matrix rotation labelAxisAngle(unit_axis, angle)no longer raisesValueErrorfor a valid unit axis