skbot.transform.CustomLink¶
- class skbot.transform.CustomLink(parent_dim, child_dim, transformation)[source]¶
A link representing a custom transformation.
Initialize a new link from the callable
transformation
that transforms a vector from the parent frame to the child frame. This link can represent arbitrary transformations between two frames.- Parameters
- parentFrame
The frame in which vectors are specified.
- childFrame
The frame into which this link transforms vectors.
- transfomrationCallable[[ArrayLike], np.ndarray]
A callable that takes a vector - in the parent frame - as input and returns the vector in the child frame.
Notes
This function does not implement
Link.__inverse_transform__()
.Method Summary
__call__
(parent[, child, add_inverse])Add this link to the parent frame.
invert
()Returns a new link that is the inverse of this link.
transform
(x)Expresses the vector x (assumed to be given in the parent's frame) in the child's frame.
Transform x (given in the child frame) into the parent frame.
Methods
- __call__(parent, child=None, *, add_inverse=True)¶
Add this link to the parent frame.
- Parameters
- parentFrame
The Frame from which vectors originate.
- childFrame
The Frame in which vectors are expressed after they were mapped by this link’s transform. If None, a new child will be created.
- add_inversebool
Also add the inverse link to the child if this Link is invertible. Defaults to
True
.
- Returns
- childFrame
The Frame in which vectors are expressed after they were mapped by this link’s transform.
- Return type
- invert()¶
Returns a new link that is the inverse of this link.
The links share parameters, i.e., if the transform of a link changes, the transform of its inverse does also.
- Return type
- transform(x)[source]¶
Expresses the vector x (assumed to be given in the parent’s frame) in the child’s frame.
- Parameters
- xArrayLike
The vector expressed in the parent’s frame
- Returns
- yArrayLike
The vector expressed in the child’s frame
- Return type
ndarray
- __inverse_transform__(x)¶
Transform x (given in the child frame) into the parent frame.
- Parameters
- xArrayLike
The vector expressed in the childs’s frame
- Returns
- yArrayLike
The vector expressed in the parents’s frame
- Return type
ndarray