s6.schema.coordinate_frames

Coordinate-frame conversions shared by pose import and export paths.

This module centralizes conversions between the repository’s native Sense/OpenCV-style 3D frame, the Three.js basis used by model assets, and the visualizer world frame used for exported telemetry.

Frame conventions

  • Sense/OpenCV camera: +X right, +Y down, +Z forward.

  • Three.js/model-local: +X right, +Y up, +Z toward the viewer.

  • Visualizer world: configured from a known tracking-camera placement.

The Sense/OpenCV <-> Three.js basis change is a fixed 180 degree rotation around +X, represented by diag(1, -1, -1).

s6.schema.coordinate_frames.sense_to_threejs_vector3d(vector: Vector3D) Vector3D

Convert a Sense/OpenCV-space vector into the Three.js basis.

s6.schema.coordinate_frames.threejs_to_sense_vector3d(vector: Vector3D) Vector3D

Convert a Three.js-space vector into the Sense/OpenCV basis.

s6.schema.coordinate_frames.sense_to_threejs_quaternion(rotation: Quaternion) Quaternion

Convert a Sense/OpenCV-space rotation into the Three.js basis.

s6.schema.coordinate_frames.threejs_to_sense_quaternion(rotation: Quaternion) Quaternion

Convert a Three.js-space rotation into the Sense/OpenCV basis.

class s6.schema.coordinate_frames.VisualizerPoseHelper(camera_forward: Vector3D, camera_up: Vector3D, camera_location: Vector3D = <factory>)

Bases: object

Convert tracking-camera poses into the visualizer world basis.

Parameters:
  • camera_forward (Vector3D) – Visualizer-world direction that the tracking camera faces.

  • camera_up (Vector3D) – Visualizer-world direction corresponding to image up for that camera.

  • camera_location (Vector3D) – Camera origin in visualizer-world coordinates, in the same units as the input translations passed to this helper.

camera_forward: Vector3D
camera_up: Vector3D
camera_location: Vector3D
property camera_to_visualizer_basis: Tensor

Return the 3x3 camera-to-visualizer basis-change matrix.

Notes

Camera-local axes are interpreted as +X right, +Y down, +Z forward. The returned matrix maps those basis vectors into the visualizer world frame implied by camera_forward and camera_up.

camera_translation_to_visualizer(translation: Vector3D) Vector3D

Convert a camera-local translation into visualizer-world coordinates.

camera_quaternion_to_visualizer(rotation: Quaternion) Quaternion

Re-express a camera-basis rotation in the visualizer-world basis.

Notes

This is a same-frame basis change for a rotation operator whose input and output vectors both live in camera axes. It is not the correct conversion for an exported model pose recovered against the native Sense/OpenCV model basis.

camera_pose_quaternion_to_visualizer(rotation: Quaternion) Quaternion

Convert a native camera-space model pose into a visualizer quaternion.

Notes

Recovered T1 poses map model points loaded in the native Sense/OpenCV basis into camera-B coordinates. The visualizer renders the original Three.js asset, so the exported quaternion must also convert the model basis from Three.js into Sense/OpenCV before applying the camera-B to visualizer-world placement.

camera_pose_quaternion_xyzw(rotation: Quaternion) list[float]

Convert and serialize a native camera-space model pose for Three.js.

camera_pose_to_visualizer(translation: Vector3D, rotation: Quaternion) tuple[Vector3D, Quaternion]

Convert one camera-local pose into visualizer-world coordinates.