ctu_crs.crs_robot
Classes
Module Contents
- class ctu_crs.crs_robot.CRSRobot(tty_dev='/dev/mars', baudrate=19200, **crs_kwargs)
- Parameters:
tty_dev (str | None)
baudrate (int)
- _mars
- link_lengths
- _deg_to_irc
- _motors_ids = 'ABCDEF'
- _hh_rad
- _hh_irc
- _hh_sequence = []
- q_min
- q_max
- q_home
- _default_speed_irc256_per_ms
- _min_speed_irc256_per_ms
- _max_speed_irc256_per_ms
- _default_acceleration_irc_per_ms
- _min_acceleration_irc_per_ms
- _max_acceleration_irc_per_ms
- gripper
- _REGME = [32000, 32000, 32000, 32000, 32000, 32000]
- _REGP = [10, 12, 70, 35, 45, 100]
- _REGI = [80, 63, 50, 80, 65, 300]
- _REGD = [300, 200, 200, 130, 230, 350]
- _REGCFG = [1489, 1490, 1490, 1481, 1474, 1490]
- _IDLEREL = 1200
- _timeout = 200
- dh_offset
- dh_d
- dh_a
- dh_alpha
- _initialized = False
- _camera: ctu_crs.basler_camera.BaslerCamera | None = None
- _camera_name: str
- grab_image(timeout=10000)
- release()
Release errors and reset control unit.
- reset_motors()
Reset motors of robot.
- close()
Close connection to the robot.
- initialize(home=True)
Initialize communication with robot and set all necessary parameters. This command will perform following settings:
synchronize communication with mars control unitπ
reset motors and wait for them to be ready
set PID control parameters, maximum speed and acceleration
set value for IDLE release
perform hard home and soft home, if @param home is True
- Parameters:
home (bool)
- _joint_values_to_irc(joint_values)
Convert joint values [rad] to IRC.
- Parameters:
joint_values (numpy.typing.ArrayLike)
- Return type:
numpy.ndarray
- _irc_to_joint_values(irc)
Convert IRC to joint values [rad].
- Parameters:
irc (numpy.typing.ArrayLike)
- Return type:
numpy.ndarray
- set_speed(speed_irc256_ms)
Set speed for each motor in IRC*256/msec.
- Parameters:
speed_irc256_ms (numpy.typing.ArrayLike)
- set_speed_relative(fraction)
Set speed for each motor in fraction (0-1) of maximum speed.
- Parameters:
fraction (float)
- set_acceleration(acceleration_irc_ms)
Set acceleration for each motor in IRC/msec.
- Parameters:
acceleration_irc_ms (numpy.typing.ArrayLike)
- set_acceleration_relative(fraction)
Set acceleration for each motor in fraction (0-1) of maximum acceleration.
- Parameters:
fraction (float)
- hard_home()
Perform hard home of the robot s.t. prismatic joint is homed first followed by joint A, B, and D. The speed is reset to default value before homing.
- soft_home()
Move robot to the home position using coordinated movement.
- move_to_q(q)
Move robot to the given joint configuration [rad] using coordinated movement. Initialization has be called before to set up coordinate movements.
- Parameters:
q (numpy.typing.ArrayLike)
- get_q()
Get current joint configuration.
- Return type:
numpy.ndarray
- in_motion()
Return whether the robot is in motion.
- Return type:
bool
- wait_for_motion_stop()
Wait until the robot stops moving.
- in_limits(q)
Return whether the given joint configuration is in joint limits.
- Parameters:
q (numpy.typing.ArrayLike)
- Return type:
bool
- 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_flange_pos(q)
Compute forward kinematics for the given joint configuration @param q. Returns 3D position of the flange w.r.t. base of the robot.
- Parameters:
q (numpy.typing.ArrayLike)
- Return type:
numpy.ndarray
- fk(q)
Compute forward kinematics for the given joint configuration @param q. Returns 4x4 homogeneous transformation matrix (SE3) of the flange w.r.t. base of the robot.
- Parameters:
q (numpy.typing.ArrayLike)
- Return type:
numpy.ndarray
- _ik_flange_pos(flange_pos, singularity_theta1=0)
Solve IK for position of the flange. This implementation supports only the robot configurations that are above the ground.
- Parameters:
flange_pos (numpy.ndarray)
- Return type:
list[numpy.ndarray]
- ik(pose)
Compute inverse kinematics for the given pose. Returns array of joint configurations [rad] which can achieve the given pose. :param pose: 4x4 homogeneous transformation matrix (SE3) of the flange with respect to the base of the robot.
- Parameters:
pose (numpy.ndarray)
- Return type:
list[numpy.ndarray]