py3dframe.Frame.load_from_dict#

classmethod Frame.load_from_dict(data: Dict[str, Any]) Frame[source]#

Load the Frame object from a dictionary.

The dictionary has the following structure:

{
    "translation": [float, float, float],
    "quaternion": [float, float, float, float],
    "rotation_vector": [float, float, float],
    "rotation_matrix": [[float, float, float], [float, float, float], [float, float, float]],
    "euler_angles": [float, float, float],
    "convention": int
    "parent": None
}
  • The quaternion is given in WXYZ format (scalar first).

  • The rotation vector is given in radians.

  • The Euler angles are given in radians and the axes are “xyz”.

  • The rotation is given in the convention of the frame.

  • The translation vector is given in the convention of the frame.

See also

Note

Only one of the rotation keys is needed to reconstruct the frame. The reader chooses the key to use in the following order of preference if several are given:

  • quaternion

  • rotation_vector

  • rotation_matrix

  • euler_angles

Warning

euler_angles can raise a this warning :

  • UserWarning: Gimbal lock detected. Setting third angle to zero since it is not possible to uniquely determine all angles.

I recommand to not use it.

Parameters:

data (Dict[str, Any]) – The dictionary containing the Frame object.

Returns:

The Frame object.

Return type:

Frame