rigid_body_motion.ReferenceFrame

class rigid_body_motion.ReferenceFrame(name=None, parent=None, translation=None, rotation=None, timestamps=None, inverse=False, discrete=False)[source]

A three-dimensional reference frame.

__init__(name=None, parent=None, translation=None, rotation=None, timestamps=None, inverse=False, discrete=False)[source]

Constructor.

Parameters
name: str, optional

The name of this reference frame.

parent: str or ReferenceFrame, optional

The parent reference frame. If str, the frame will be looked up in the registry under that name. If not specified, this frame will be a root node of a new reference frame tree.

translation: array_like, optional

The translation of this frame wrt the parent frame. Not applicable if there is no parent frame.

rotation: array_like, optional

The rotation of this frame wrt the parent frame. Not applicable if there is no parent frame.

timestamps: array_like, optional

The timestamps for translation and rotation of this frame. Not applicable if this is a static reference frame.

inverse: bool, default False

If True, invert the transform wrt the parent frame, i.e. the translation and rotation are specified for the parent frame wrt this frame.

discrete: bool, default False

If True, transformations with timestamps are assumed to be events. Instead of interpolating between timestamps, transformations are fixed between their timestamp and the next one.

Methods

__init__([name, parent, translation, …])

Constructor.

deregister()

Remove this frame from the registry.

from_dataset(ds, translation, rotation, …)

Construct a reference frame from a Dataset.

from_rotation_dataarray(da, timestamps, parent)

Construct a reference frame from a rotation DataArray.

from_rotation_matrix(mat, parent[, name, …])

Construct a static reference frame from a rotation matrix.

from_translation_dataarray(da, timestamps, …)

Construct a reference frame from a translation DataArray.

get_transformation(to_frame)

Alias for lookup_transform.

iter_path_reverse()

Iterate up the tree from the current node.

lookup_angular_velocity([reference, …])

Estimate angular velocity of this frame wrt a reference.

lookup_linear_velocity([reference, …])

Estimate linear velocity of this frame wrt a reference.

lookup_transform(to_frame)

Look up the transformation from this frame to another.

lookup_twist([reference, represent_in, …])

Estimate linear and angular velocity of this frame wrt a reference.

register([update])

Register this frame in the registry.

transform_angular_velocity(arr, to_frame[, …])

Transform array of angular velocities from this frame to another.

transform_linear_velocity(arr, to_frame[, …])

Transform array of linear velocities from this frame to another.

transform_points(arr, to_frame[, axis, …])

Transform array of points from this frame to another.

transform_quaternions(arr, to_frame[, axis, …])

Transform array of quaternions from this frame to another.

transform_vectors(arr, to_frame[, axis, …])

Transform array of vectors from this frame to another.

Attributes

ancestors

All parent nodes and their parent nodes.

anchestors

All parent nodes and their parent nodes - see ancestors.

children

All child nodes.

depth

Number of edges to the root Node.

descendants

All child nodes and all their child nodes.

height

Number of edges on the longest path to a leaf Node.

is_leaf

Node has no children (External Node).

is_root

Node is tree root.

leaves

Tuple of all leaf nodes.

parent

Parent Node.

path

Path of this Node.

root

Tree Root Node.

separator

The NodeMixin class extends any Python class to a tree node.

siblings

Tuple of nodes with the same parent.