ctu_bosch_sr450

Submodules

Classes

RobotBosch

RobotBosch is a class representing the Bosch SR450 robot. It has access to the

Package Contents

class ctu_bosch_sr450.RobotBosch(tty_dev='/dev/mars', baudrate=19200)

RobotBosch is a class representing the Bosch SR450 robot. It has access to the robot’s control unit and basic kinematics functions.

Parameters:
  • tty_dev (str | None)

  • baudrate (int)

_mars
_z_offset = 0.5
_motors_ids = 'ABCD'
_REGPWRON = 1
_REGPWRFLG = 5
_REGCFG = [1498, 1498, 1370, 1498]
_REGME = [30000, 16000, 16000, 16000]
_REGP = [50, 50, 50, 50]
_REGI = [5, 5, 5, 5]
_REGD = [50, 50, 50, 50]
_IDLEREL = 0
_q_to_q_irc
q_min
q_max
q_home
_min_speed_irc256_per_ms
_max_speed_irc256_per_ms
_default_speed_irc256_per_ms
_min_acceleration_irc_per_ms
_max_acceleration_irc_per_ms
_default_acceleration_irc_per_ms
_initialized = False
_camera: ctu_bosch_sr450.basler_camera.BaslerCamera | None = None
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

  • send command to power motors, wait for user to power them

  • 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,m] to IRC.

Parameters:

joint_values (numpy.typing.ArrayLike)

Return type:

numpy.ndarray

_irc_to_joint_values(irc)

Convert IRC to joint values [rad,m].

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 using coordinated movement. The soft_home needs to 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

fk(q)

Compute forward kinematics for the given joint configuration @param q. The output is (x,y,z,phi) where x,y,z are position of the end-effector w.r.t. the base frame and phi is the orientation around z-axis of the end-effector w.r.t. the base.

Parameters:

q (numpy.typing.ArrayLike)

Return type:

tuple[float, float, float, float]

ik_xyz(x, y, z=0, q3=0)

Compute IK s.t. the end-effector is at the given position w.r.t. the reference frame. The last joint value is set to the given fixed value. It does not influence solution of IK, it is just passed to the output. Internally, :param x and :param y are used to compute first and second (revolute) joint values. The :param z is used to compute third (prismatic) joint value. Return all solutions that are in joint limits.

Parameters:
  • x (float)

  • y (float)

  • z (float)

  • q3 (float)

Return type:

list[numpy.ndarray]

ik(x, y, z=0.0, phi=0)

Compute IK s.t. the end-effector is at the given position w.r.t. the reference frame. Internally xyz is computed by ik_xyz function for all possible tool orientation (phi). Return all solutions that are in joint limits. If no solution exists, return empty list.

Parameters:
  • x (float)

  • y (float)

  • z (float)

  • phi (float)

Return type:

list[numpy.ndarray]