Skip to content

Samples: Fix quaternion unit label and axis-angle unit-vector check - #233

Closed
yooni1231 wants to merge 1 commit into
masterfrom
2026-08-13-fix-pose-conversion-quaternion-unit-labels
Closed

Samples: Fix quaternion unit label and axis-angle unit-vector check#233
yooni1231 wants to merge 1 commit into
masterfrom
2026-08-13-fix-pose-conversion-quaternion-unit-labels

Conversation

@yooni1231

Copy link
Copy Markdown

Summary

  • AxisAngle.__init__ (pose_conversions.py) validated the axis by checking norm(axis) != 0 instead of != 1, so passing an explicit angle with a valid unit axis always raised ValueError. 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 the RotationFormat dataclass instance against plain strings ("Quaternion", "Rotation Matrix"), which is never True since 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

  • Verify pose_conversion_gui.py no longer shows (deg)/(rad) next to the Quaternion/Rotation Matrix rotation label
  • Verify AxisAngle(unit_axis, angle) no longer raises ValueError for a valid unit axis

- 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.
@yooni1231
yooni1231 requested a review from a team August 13, 2026 06:24
@yooni1231 yooni1231 closed this Aug 13, 2026
@zividgerman
zividgerman deleted the 2026-08-13-fix-pose-conversion-quaternion-unit-labels branch August 13, 2026 08:20
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.

1 participant