ctu_mitsubishi

Submodules

Classes

Rv6s

Rv6sGripper

Package Contents

class ctu_mitsubishi.Rv6s(port='/dev/ttyUSB_Robot', baudrate=38400, debug=False)
_debug = False
_connection
_initialized = False
q_home
q_min
q_max
dh_theta_off
dh_a
dh_d
dh_alpha
_last_q = None
_camera: ctu_mitsubishi.basler_camera.BaslerCamera | None = None
__del__()

Stop robot and close the connection to the robot’s control unit.

grab_image(timeout=10000)
close_connection()

Close the connection to the robot’s control unit.

stop_robot()

Stop the robot and perform a safe shutdown.

_send_and_receive(msg)

Send a message to the robot and return the response.

Parameters:

msg (str)

Return type:

str

initialize()

Performs robot initialization.

get_q()

Get current joint configuration [rad].

Return type:

numpy.ndarray

move_to_q(q)

Move robot to the given joint configuration [rad] using coordinated movement. Initialization has be called before to set up the robot.

Parameters:

q (numpy.typing.ArrayLike)

soft_home()

Move robot to the home position using move to q function.

in_limits(q)

Return whether the given joint configuration is in joint limits.

Parameters:

q (numpy.typing.ArrayLike)

Return type:

bool

static _rx(angle)

Return SE3 transformation that rotates around x-axis.

Parameters:

angle (float)

Return type:

numpy.ndarray

static _ry(angle)

Return SE3 transformation that rotates around x-axis.

Parameters:

angle (float)

Return type:

numpy.ndarray

static _rz(angle)

Return SE3 transformation that rotates around z-axis.

Parameters:

angle (float)

Return type:

numpy.ndarray

static _t(tx=0.0, ty=0.0, tz=0.0)

Return SE3 transformation that translates along x-axis.

Parameters:
  • tx (float)

  • ty (float)

  • tz (float)

Return type:

numpy.ndarray

static dh_to_se3(d, theta, a, alpha)

Compute SE3 matrix from DH parameters.

Parameters:
  • d (float)

  • theta (float)

  • a (float)

  • alpha (float)

Return type:

numpy.ndarray

fk(q)

Compute forward kinematics for the given joint configuration [rad]. Return pose of the end-effector in the base frame. Homogeneous transformation matrix (4x4) is returned. The pose represents the flange pose w.r.t. base of the robot.

Parameters:

q (numpy.typing.ArrayLike)

Return type:

numpy.ndarray

_ik_5th_joint_pos(position)

Compute inverse kinematics for the given position of the 5th joint (flange w.r.t. base) in the base frame. Return list of joint configurations [rad] for the first three joints.

Parameters:

position (numpy.typing.ArrayLike)

Return type:

list[numpy.ndarray]

ik(pose)

Compute inverse kinematics for the given pose of the end-effector (flange w.r.t. base) in the base frame. Homogeneous transformation matrix (4x4) is expected. Only in limits solutions are returned. Return list of joint configurations [rad].

Parameters:

pose (numpy.typing.ArrayLike)

Return type:

list[numpy.ndarray]

static rotation_matrix_to_euler_zyz(R)

Extract Euler angles (ZYZ convention) from a rotation matrix.

Parameters:

R (ndarray) – 3x3 rotation matrix.

Returns:

Euler angles (alpha, beta, gamma) in radians.

Return type:

two solutions, 2 tuples

wait_for_motion_stop(timeout=10, poll_interval=0.1, tol=0.0087)

Wait for the robot to stop moving. :param timeout: Maximum time to wait for the robot to stop moving. :param poll_interval: Time between checking the robot’s state. :param tol: Tolerance for the robot’s joint positions to be considered stopped

[rad].

Returns:

True if the robot has stopped moving in a given time, False otherwise.

Parameters:
  • timeout (float)

  • poll_interval (float)

  • tol (float)

Return type:

bool

class ctu_mitsubishi.Rv6sGripper(dev='/dev/ttyUSB_Quido')
_quido
_open_channel = 2
_close_channel = 1
open(duration=1.0)

Start opening the gripper and stop after duration in seconds.

Parameters:

duration (float)

close(duration=1.0)

Start closing the gripper and stop after duration in seconds.

Parameters:

duration (float)

disconnect()

Stop controlling the gripper.

__del__()