genericroboticarm.robo_APIs.robo_interface module

class genericroboticarm.robo_APIs.robo_interface.RoboInterface(start_simulating: bool = True, **kwargs)[source]

Bases: ABC

_abc_impl = <_abc._abc_data object>
_deferred_failure: BaseException | None
_deferred_tail: Callable[[], None] | None
abstract property current_coordinates: Dict[str, float]

return:

current_position: str | None = None
property currently_gripping_plate: bool

Whether the gripper currently holds a plate. Robots that cannot sense their gripper report False, so the guards against picking with an occupied gripper do not fire for them. Subclasses that can tell override this. :return:

defer(tail_task: Callable[[], None]) None[source]

Registers work that may be executed after the running command has reported success, e.g. storing a lid away once the robot is clear of the device it just served. The robot stays reserved until the tail task is done, so the next command has to wait for it, but the client and the served device are released early. Only one tail task can be pending at a time. :param tail_task: the work to be done once the current command returned :return:

end_connection(**kwargs)[source]

Is executed when the server stops :return:

abstractmethod classmethod get_name() str[source]

The name will be used as parameter in command line startup (-r), as sila server name and to save the position graph. :return: the name

abstractmethod classmethod get_used_cli_args() dict[str, str][source]

Defines the arguments that are forwarded from the command line to the robots constructor. :return: a dictionary of type [constructor parameter name, command line argument name]

graph_dir: Path | None = None
abstractmethod grip_close(**kwargs)[source]
Returns:

abstractmethod grip_open(**kwargs)[source]
Returns:

abstractmethod init_connection(**kwargs)[source]

Sets up the hardware connection :return:

abstract property joint_names: list[str]

Returns a list of names of the individual coordinates used by the robot. For example [x, y, z, roll, pitch, grip] or [j1, j2, j3, j4, j5] :return:

abstractmethod move_relative(movements: List[Tuple[str, float]], **kwargs)[source]
Parameters:

movements

Returns:

move_straight_to_position(identifier: str, offset: Dict[str, float] | None = None)[source]

Moves the robot straight to the specified position, i.e. queries its coordinates, adds the offset and call move_to_coordinates() on the result. :param offset: :param identifier: :return:

abstractmethod move_to_coordinates(coords: Dict[str, float], **kwargs) None[source]
Parameters:

coords

Returns:

move_to_nearest_known_position(offset: Dict[str, float] | None = None)[source]
Returns:

move_to_position(target_position: str, offset: Dict[str, float] | None = None)[source]
Parameters:
  • offset

  • target_position

Returns:

property name: str
next_positions: List[str]
pick_at_position(identifier: str, offset: Dict[str, float] | None = None)[source]

Opens the gripper, moves to a specified location and closes the gripper there :param identifier: Position identifier :param offset: :return:

pick_from_device(device: str, pos: int, offset: Dict[str, float] | None = None)[source]
Parameters:
  • device

  • pos

  • offset

Returns:

place_at_device(device: str, pos: int, offset: Dict[str, float] | None = None, plate_type: str = 'plate_type')[source]
Parameters:
  • plate_type

  • device

  • pos

  • offset

Returns:

place_at_position(identifier: str, offset: Dict[str, float] | None = None)[source]

Opens the gripper, moves to a specified location and opens the gripper there :param identifier: Position identifier :param offset: :return:

pop_deferred() Callable[[], None] | None[source]

Returns the registered tail task, if any, and forgets about it. :return: the tail task or None

report_deferred_failure(error: BaseException)[source]

Remembers that a tail task failed. Since its command has already reported success, the failure can only be handed to the next command touching the robot. :param error: :return:

run_custom_command(cmd: str) str[source]

Runs a custom command on the hardware. The implementation for a specific hardware might look very different and the response must be a string. Be default returns ‘Not Implemented’. Use on your own risk. :param cmd: :return:

set_acceleration(new_acceleration: float, **kwargs)[source]
Parameters:

new_acceleration

Returns:

set_metrik(metrik: Callable[[Dict[str, float], Dict[str, float]], float])[source]

Sets the way :param metrik: :return:

set_speed(new_speed: float)[source]

Set the speed :param new_speed: :return:

site_to_position_identifier(device: str, slot: int) str[source]
stop_moving()[source]

Immediately(Or as quickly as possible) stops all movements :return:

take_deferred_failure() BaseException | None[source]

Returns the failure of the last tail task, if any, and forgets about it. :return: the error or None

genericroboticarm.robo_APIs.robo_interface.finish_successfully(cmd_infos: list[ClientObservableCommandInstance]) bool[source]