Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,11 @@ Simply wrap the `Register` in a ROS node, subscribing to pose updates and publis
- `source venv/bin/activate` (Linux/Mac) or `venv\Scripts\activate` (Windows)
- Install package with dev and test dependencies
- `pip install -e '.[dev,test]'`

# Implementation Details

- Transforms are stored as a tree starting from the world frame (provided at `Registry` initialization).
- To optimize run-time performance, the paths between all pairs of frames are eagerly precomputed and stored when a frame is added.
- Therefore, the runtime complexity on request is proportional to the shortest path, instead of all frames in the case of a full graph search.
- Transitive transforms themselves are only computed on-demand because an intermediate transform can change.
- This is preferred because poses often change more often than they are requested.
8 changes: 4 additions & 4 deletions frame_transforms/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __matmul__(self, other: TransformTarget_t) -> TransformTarget_t:
or a 4x4 homogeneous transformation matrix.
"""
if isinstance(other, Transform):
# Correct transformation composition: rotate other's translation, then add this translation
# Rotate other's translation, then add this translation
new_translation = self._translation + self._rotation.apply(
other.translation
)
Expand All @@ -95,7 +95,7 @@ def __matmul__(self, other: TransformTarget_t) -> TransformTarget_t:
case (4, 4):
return self.as_matrix() @ other
case (3,):
# Correct vector transformation: rotate first, then translate
# Rotate first, then translate
return np.array(self._rotation.apply(other) + self._translation) # type: ignore[return-value]
case _:
raise ValueError(
Expand Down Expand Up @@ -181,8 +181,8 @@ class Registry(Generic[FrameID_T]):
"""
Registry of coordinate frames and corresponding transforms.

Automatically computes transitive tramsforms between frames if possible by
maintaining a directed acyclic graph (DAG) of relationships.
Automatically computes transitive transforms between frames if possible by
maintaining a tree of relationships.

Made for use with 4x4 3D transformation matrices.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "frame-transforms"
version = "0.3.0"
version = "0.3.1"
readme = "README.md"
python = "^3.10"

Expand Down
Loading