ctu_crs.crs_robot ================= .. py:module:: ctu_crs.crs_robot Classes ------- .. autoapisummary:: ctu_crs.crs_robot.CRSRobot Module Contents --------------- .. py:class:: CRSRobot(tty_dev = '/dev/mars', baudrate = 19200, **crs_kwargs) .. py:attribute:: _mars .. py:attribute:: link_lengths .. py:attribute:: _deg_to_irc .. py:attribute:: _motors_ids :value: 'ABCDEF' .. py:attribute:: _hh_rad .. py:attribute:: _hh_irc .. py:attribute:: _hh_sequence :value: [] .. py:attribute:: q_min .. py:attribute:: q_max .. py:attribute:: q_home .. py:attribute:: _default_speed_irc256_per_ms .. py:attribute:: _min_speed_irc256_per_ms .. py:attribute:: _max_speed_irc256_per_ms .. py:attribute:: _default_acceleration_irc_per_ms .. py:attribute:: _min_acceleration_irc_per_ms .. py:attribute:: _max_acceleration_irc_per_ms .. py:attribute:: gripper .. py:attribute:: _REGME :value: [32000, 32000, 32000, 32000, 32000, 32000] .. py:attribute:: _REGP :value: [10, 12, 70, 35, 45, 100] .. py:attribute:: _REGI :value: [80, 63, 50, 80, 65, 300] .. py:attribute:: _REGD :value: [300, 200, 200, 130, 230, 350] .. py:attribute:: _REGCFG :value: [1489, 1490, 1490, 1481, 1474, 1490] .. py:attribute:: _IDLEREL :value: 1200 .. py:attribute:: _timeout :value: 200 .. py:attribute:: dh_offset .. py:attribute:: dh_d .. py:attribute:: dh_a .. py:attribute:: dh_alpha .. py:attribute:: _initialized :value: False .. py:attribute:: _camera :type: ctu_crs.basler_camera.BaslerCamera | None :value: None .. py:attribute:: _camera_name :type: str .. py:method:: grab_image(timeout=10000) .. py:method:: release() Release errors and reset control unit. .. py:method:: reset_motors() Reset motors of robot. .. py:method:: close() Close connection to the robot. .. py:method:: 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 .. py:method:: _joint_values_to_irc(joint_values) Convert joint values [rad] to IRC. .. py:method:: _irc_to_joint_values(irc) Convert IRC to joint values [rad]. .. py:method:: set_speed(speed_irc256_ms) Set speed for each motor in IRC*256/msec. .. py:method:: set_speed_relative(fraction) Set speed for each motor in fraction (0-1) of maximum speed. .. py:method:: set_acceleration(acceleration_irc_ms) Set acceleration for each motor in IRC/msec. .. py:method:: set_acceleration_relative(fraction) Set acceleration for each motor in fraction (0-1) of maximum acceleration. .. py:method:: 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. .. py:method:: soft_home() Move robot to the home position using coordinated movement. .. py:method:: 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. .. py:method:: get_q() Get current joint configuration. .. py:method:: in_motion() Return whether the robot is in motion. .. py:method:: wait_for_motion_stop() Wait until the robot stops moving. .. py:method:: in_limits(q) Return whether the given joint configuration is in joint limits. .. py:method:: dh_to_se3(d, theta, a, alpha) :staticmethod: Compute SE3 matrix from DH parameters. .. py:method:: 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. .. py:method:: 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. .. py:method:: _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. .. py:method:: 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.