rebot_control.cartesian

Cartesian streaming control of the TCP.

Every control cycle (CartesianController.step()):

  1. limits on the desired pose: workspace box (base frame), optional tilt limit (angle between the tool axis and straight down) and yaw limit (heading of the tool x axis), then linear / angular speed limits relative to the previous commanded pose (not the measured one);

  2. lag slow-down: when the arm lags its joint target by more than safety.slow_lag, the speed limits are scaled down linearly (frozen at twice that lag) so that it catches up without stop-and-go;

  3. IK (rebot_control.ik.DiffIK) warm-started from the previous joint command; a failed solution (out of reach, joint limit) is refused and the previous pose is kept (the arm holds);

  4. the joint target goes to rebot_control.arm.Arm.command_joint() (jump guard, rate limit, filter, servo).

The same limits are meant to be applied to recorded demonstrations, so that data and execution agree.

Module Contents

Classes

CartesianLimits

Limits on the commanded TCP pose (base frame, m / rad; tilt and yaw in degrees, None = not limited).

CartesianStatus

What one control cycle did.

CartesianController

Streams TCP pose targets to an Arm at the arm’s control rate.

API

class rebot_control.cartesian.CartesianLimits

Limits on the commanded TCP pose (base frame, m / rad; tilt and yaw in degrees, None = not limited).

x: tuple[float, float] = (0.1, 0.5)
y: tuple[float, float] = ()
z: tuple[float, float] = (0.02, 0.4)
max_speed: float = 0.2
max_ang_speed: float = 1.5
max_tilt_deg: float | None = None
max_yaw_deg: float | None = None
tilt_axis: int = 2
classmethod from_dict(d: dict | None) → rebot_control.cartesian.CartesianLimits
clip_position(p: numpy.ndarray) → numpy.ndarray
clip_orientation(R: numpy.ndarray) → numpy.ndarray
contains(p: numpy.ndarray) → bool
class rebot_control.cartesian.CartesianStatus

What one control cycle did.

pos: numpy.ndarray = None
rot: numpy.ndarray = None
q: numpy.ndarray = None
ik_ok: bool = None
clipped: bool = None
lag_deg: float = None
speed_factor: float = None
info: dict = 'field(...)'
class rebot_control.cartesian.CartesianController(arm: rebot_control.arm.Arm, limits: rebot_control.cartesian.CartesianLimits | None = None, posture: numpy.ndarray | None = None, ik_iters: int = 30)

Streams TCP pose targets to an Arm at the arm’s control rate.

Typical use:

cart = arm.cartesian()           # starts from the measured TCP pose
for t in ...:
    st = cart.step(p_des, R_des)  # R_des=None keeps the current orientation
    arm.sleep()

Initialization

reset() → None

Restart from the measured pose (call after any joint-space move or mode change).

pose() → tuple[numpy.ndarray, numpy.ndarray]

Current commanded TCP pose.

limit(p_des: numpy.ndarray, R_des: numpy.ndarray | None, speed_factor: float = 1.0) → tuple[numpy.ndarray, numpy.ndarray, bool]

Apply the workspace / orientation / speed limits to a desired pose relative to the commanded pose.

step(p_des: numpy.ndarray, R_des: numpy.ndarray | None = None) → rebot_control.cartesian.CartesianStatus

One control cycle towards (p_des, R_des). Call Arm.sleep() between steps.

hold() → rebot_control.cartesian.CartesianStatus

Keep the commanded pose (e.g. while an operator is disengaged).

reachable(p: numpy.ndarray, R: numpy.ndarray | None = None) → bool

IK check only (no motion): can the TCP reach (p, R) from the current command?