pyrcf.utils.frame_transforms ============================ .. py:module:: pyrcf.utils.frame_transforms .. autoapi-nested-parse:: Utility functions to help with coordinate frame transforms. Attributes ---------- .. autoapisummary:: pyrcf.utils.frame_transforms.QuatType pyrcf.utils.frame_transforms.Vector3D Classes ------- .. autoapisummary:: pyrcf.utils.frame_transforms.PoseTrasfrom Functions --------- .. autoapisummary:: pyrcf.utils.frame_transforms.transform_pose_to_frame pyrcf.utils.frame_transforms.twist_transform pyrcf.utils.frame_transforms.get_relative_pose_between_vectors Module Contents --------------- .. py:data:: QuatType :type: TypeAlias :value: np.ndarray Numpy array representating quaternion in format [x,y,z,w] .. py:data:: Vector3D :type: TypeAlias :value: np.ndarray Numpy array representating 3D cartesian vector in format [x,y,z] .. py:function:: transform_pose_to_frame(pos_in_frame_1: Vector3D, quat_in_frame_1: QuatType, frame_2_pos_in_frame_1: Vector3D, frame_2_quat_in_frame_1: QuatType) -> Tuple[Vector3D, QuatType] Transform a pose from a global frame to a local frame. Both the input pose and the local frame's pose should be described in a common global frame. :param pos_in_frame_1: The position of the input pose object to be transformed in a common global frame. :type pos_in_frame_1: Vector3D :param quat_in_frame_1: The orientation of the input pose object to be transformed in a common global frame (quaternion: [x,y,z,w]). :type quat_in_frame_1: QuatType :param frame_2_pos_in_frame_1: Position of the origin of the target coordinate frame with respect to the common global frame. :type frame_2_pos_in_frame_1: Vector3D :param frame_2_quat_in_frame_1: The orientation of the target frame in the global frame. :type frame_2_quat_in_frame_1: QuatType :returns: Position and orientation of the input pose in the new target frame. :rtype: Tuple[Vector3D, QuatType] .. py:function:: twist_transform(twist_a: numpy.ndarray, frame_b_in_a: numpy.ndarray) -> numpy.ndarray Transform a twist screw (linear velocity & angular velocity) to another coordinate frame. :param twist_a: 6D twist screw (linear x, linear y, linear z, angular x, angular y, angular z) :type twist_a: np.ndarray :param frame_b_in_a: Transformation matrix of the pose of the new frame in the old frame. :type frame_b_in_a: np.ndarray :returns: Twist screw in the new frame (linear x, linear y, linear z, angular x, angular y, angular z). :rtype: np.ndarray .. py:function:: get_relative_pose_between_vectors(pos1: Vector3D, quat1: QuatType, pos2: Vector3D, quat2: QuatType) -> Tuple[Vector3D, QuatType] Given two frame poses in the same coordinate frame, return the pose of the second frame with respect to the first. :param pos1: Position of the first frame in a global frame. :type pos1: Vector3D :param quat1: Orientation quaternion of the first frame. :type quat1: QuatType :param pos2: Position of the second frame in the same global frame. :type pos2: Vector3D :param quat2: Orientation of the second frame. :type quat2: QuatType :returns: Position and orientation of the second frame with respect to the first. :rtype: Tuple[Vector3D, QuatType] .. py:class:: PoseTrasfrom Transform a pose (point and orientation) between PyRCF coordinate frames. .. py:method:: TELEOP_FRAME_POSE_IN_WORLD(base_pos_in_world: Vector3D, base_ori_in_world: QuatType) -> Tuple[Vector3D, QuatType] :staticmethod: This is the definition of the teleop frame. .. py:method:: BASE_FRAME_POSE_IN_TELEOP(base_pos_in_world: Vector3D, base_ori_in_world: QuatType) -> Tuple[Vector3D, QuatType] :staticmethod: This is the definition of the teleop frame. .. py:method:: teleop2base(p_in_teleop: Vector3D, q_in_teleop: QuatType, base_pos_in_world: Vector3D, base_ori_in_world: QuatType) -> Tuple[Vector3D, QuatType] :staticmethod: Transform a pose in teleop frame to base frame. .. py:method:: base2teleop(p_in_base: Vector3D, q_in_base: QuatType, base_pos_in_world: Vector3D, base_ori_in_world: QuatType) -> Tuple[Vector3D, QuatType] :staticmethod: Transform a pose in base frame to teleop frame. .. py:method:: teleop2world(p_in_teleop: Vector3D, q_in_teleop: QuatType, base_pos_in_world: Vector3D, base_ori_in_world: QuatType) -> Tuple[Vector3D, QuatType] :staticmethod: Transform a pose in teleop frame to world frame. .. py:method:: world2teleop(p_in_world: Vector3D, q_in_world: QuatType, base_pos_in_world: Vector3D, base_ori_in_world: QuatType) -> Tuple[Vector3D, QuatType] :staticmethod: Transform a pose in world frame to teleop frame.