1 geometry.frames
geometry.frames
Construct frame-safe Aria/EFM camera axes and coordinate transforms.
This module provides world-up broadcasting, pose-aware look-at axes, rig-to-camera composition, and the CW90 display-yaw transform for PoseTW and CameraTW. It owns LUF/Z-up frame conversion only; sampling policy, camera calibration, and image data remain with callers. Look-at construction aligns camera up with world up to avoid arbitrary roll while preserving the LUF convention (X-left, Y-up, Z-forward).
1.1 Functions
| Name | Description |
|---|---|
| rotate_yaw_cw90 | Rotate a pose by 90° clockwise about its local +Z axis. |
| view_axes_from_points | PoseTW-aware look-at helper for LUF cameras. |
| view_axes_from_poses | Construct roll-free camera poses looking along the segment from→to. |
| world_from_camera | Compute T_world_cam from rig pose and CameraTW extrinsics. |
| world_up_tensor | Return world up vector as tensor. |
1.1.1 rotate_yaw_cw90
geometry.frames.rotate_yaw_cw90(pose_world_cam, undo=False)Rotate a pose by 90° clockwise about its local +Z axis.
1.1.1.1 Important
Despite the historical name, this is a local-frame rotation (right-multiplication) about the pose’s +Z axis. In the Aria LUF convention (+Z = forward), this is a roll/twist that swaps the local +X/+Y axes.
1.1.1.2 Why this exists
- Project Aria tooling/visualisations sometimes apply a fixed 90° twist for display.
- In our candidate generation pipeline we also apply this to the reference pose as a rig-basis correction so that sampling assumptions (LUF: x=left, y=up, z=fwd) match the incoming
t_world_rigbasis (otherwise azimuth/elevation look swapped).
1.1.1.3 Caution
Apply this conversion at most once in any given path; applying it again in plotting will look like an azimuth/elevation swap once roll jitter is enabled.
1.1.2 view_axes_from_points
geometry.frames.view_axes_from_points(
from_pose,
look_at,
world_up=None,
eps=1e-06,
)PoseTW-aware look-at helper for LUF cameras.
1.1.2.1 Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| from_pose | PoseTW | torch.Tensor |
Camera pose (or center tensor) in world coordinates. | required |
| look_at | PoseTW | torch.Tensor |
Target point (or pose whose translation is the target). | required |
| world_up | torch.Tensor | None | Optional world up vector; defaults to +Z. |
None |
| eps | float | Numerical stability term. | 1e-06 |
1.1.2.2 Returns
| Name | Type | Description |
|---|---|---|
| torch.Tensor | Rotation matrices R_world_cam with shape (..., 3, 3) following |
|
| torch.Tensor | the LUF convention (columns = left, up, forward). |
1.1.3 view_axes_from_poses
geometry.frames.view_axes_from_poses(
from_pose,
to_pose,
*,
look_away=True,
eps=1e-06,
)Construct roll-free camera poses looking along the segment from→to.
The resulting pose(s) satisfy the Aria LUF convention (x=left, y=up, z=forward) with zero roll by aligning the up-axis to world_up_tensor.
1.1.3.1 Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| from_pose | PoseTW |
Pose of the reference point (typically the last pose). | required |
| to_pose | PoseTW |
Pose whose translations define the camera centers. | required |
| look_away | bool | If True, cameras look away from from_pose towards to_pose; otherwise they look back. |
True |
| eps | float | Numerical stability guard. | 1e-06 |
1.1.3.2 Returns
| Name | Type | Description |
|---|---|---|
PoseTW |
PoseTW with the same translations as to_pose and rotations derived |
|
PoseTW |
from the line of sight and world-up. |
1.1.4 world_from_camera
geometry.frames.world_from_camera(t_world_rig, cam, frame_idx)Compute T_world_cam from rig pose and CameraTW extrinsics.
1.1.5 world_up_tensor
geometry.frames.world_up_tensor(device=None, dtype=None)Return world up vector as tensor.
In the EFM3D VIO convention gravity points to [0, 0, -1]; world-up is therefore +Z. This helper keeps that logic in one place.