rebot_control.pose

Pose helpers (pure numpy).

A pose is (p, R): position (3,) in m and rotation matrix (3, 3) whose columns are the frame’s axes expressed in the parent frame (the robot base frame unless stated otherwise). Rotation increments are rotation vectors (axis * angle, rad).

pose_delta() / apply_delta() express a motion in the frame of its start pose, which does not depend on the world frame (useful for learning from data recorded in other frames, e.g. a handheld tool tracked by a phone).

Module Contents

Functions

skew

rotvec_to_matrix

Rotation vector (axis * angle) -> rotation matrix (Rodrigues).

matrix_to_rotvec

Rotation matrix -> rotation vector (axis * angle), angle in [0, pi].

rotation_error

Rotation vector (world frame) that turns R into R_target.

rpy_to_matrix

URDF fixed-axis roll / pitch / yaw (rad) -> rotation matrix Rz(yaw) @ Ry(pitch) @ Rx(roll).

matrix_to_rpy

Inverse of rpy_to_matrix() (pitch in [-pi/2, pi/2]).

pose_delta

Motion from pose 0 to pose 1 expressed in the frame of pose 0: [dp (3), drot (3)].

apply_delta

Inverse of pose_delta(): pose 0 moved by delta (expressed in the frame of pose 0).

tilt_angle

Angle (rad) between the tool axis axis (default z, the approach axis) and straight down.

yaw_of

Heading (rad) of the tool x axis projected on the horizontal plane.

rot_z

limit_tilt

Rotate R about a horizontal axis so that its tool axis is at most max_tilt from straight down.

to_rot6d

Continuous 6-D rotation representation: the first two columns of R (Zhou et al., CVPR 2019).

from_rot6d

Inverse of to_rot6d() (Gram-Schmidt, tolerant to non-orthonormal inputs).

Data

API

rebot_control.pose.WORLD_DOWN = 'array(...)'
rebot_control.pose.skew(v: numpy.ndarray) → numpy.ndarray
rebot_control.pose.rotvec_to_matrix(r: numpy.ndarray) → numpy.ndarray

Rotation vector (axis * angle) -> rotation matrix (Rodrigues).

rebot_control.pose.matrix_to_rotvec(R: numpy.ndarray) → numpy.ndarray

Rotation matrix -> rotation vector (axis * angle), angle in [0, pi].

rebot_control.pose.rotation_error(R: numpy.ndarray, R_target: numpy.ndarray) → numpy.ndarray

Rotation vector (world frame) that turns R into R_target.

rebot_control.pose.rpy_to_matrix(rpy: numpy.ndarray) → numpy.ndarray

URDF fixed-axis roll / pitch / yaw (rad) -> rotation matrix Rz(yaw) @ Ry(pitch) @ Rx(roll).

rebot_control.pose.matrix_to_rpy(R: numpy.ndarray) → numpy.ndarray

Inverse of rpy_to_matrix() (pitch in [-pi/2, pi/2]).

rebot_control.pose.pose_delta(p0: numpy.ndarray, R0: numpy.ndarray, p1: numpy.ndarray, R1: numpy.ndarray) → numpy.ndarray

Motion from pose 0 to pose 1 expressed in the frame of pose 0: [dp (3), drot (3)].

rebot_control.pose.apply_delta(p0: numpy.ndarray, R0: numpy.ndarray, delta: numpy.ndarray) → tuple[numpy.ndarray, numpy.ndarray]

Inverse of pose_delta(): pose 0 moved by delta (expressed in the frame of pose 0).

rebot_control.pose.tilt_angle(R: numpy.ndarray, axis: int = 2) → float

Angle (rad) between the tool axis axis (default z, the approach axis) and straight down.

rebot_control.pose.yaw_of(R: numpy.ndarray) → float

Heading (rad) of the tool x axis projected on the horizontal plane.

rebot_control.pose.rot_z(a: float) → numpy.ndarray
rebot_control.pose.limit_tilt(R: numpy.ndarray, max_tilt: float, axis: int = 2) → numpy.ndarray

Rotate R about a horizontal axis so that its tool axis is at most max_tilt from straight down.

rebot_control.pose.to_rot6d(R: numpy.ndarray) → numpy.ndarray

Continuous 6-D rotation representation: the first two columns of R (Zhou et al., CVPR 2019).

rebot_control.pose.from_rot6d(r: numpy.ndarray) → numpy.ndarray

Inverse of to_rot6d() (Gram-Schmidt, tolerant to non-orthonormal inputs).