Source code for genericroboticarm.sila_server.generated.robotcontroller.robotcontroller_base
# Generated by sila2.code_generator; sila2.__version__: 0.12.2
from __future__ import annotations
from abc import ABC, abstractmethod
from datetime import timedelta
from typing import TYPE_CHECKING, Optional
from sila2.server import FeatureImplementationBase, MetadataDict, ObservableCommandInstance
from .robotcontroller_types import (
EmergencyStop_Responses,
MovePlate_Responses,
MoveToPosition_Responses,
PickPlate_Responses,
PlacePlate_Responses,
Reinitialize_Responses,
SetAcceleration_Responses,
SetSpeed_Responses,
Site,
)
if TYPE_CHECKING:
from ...server import Server
[docs]
class RobotControllerBase(FeatureImplementationBase, ABC):
parent_server: Server
MoveToPosition_default_lifetime_of_execution: Optional[timedelta]
MovePlate_default_lifetime_of_execution: Optional[timedelta]
def __init__(self, parent_server: Server):
"""
Controlling the robot
"""
super().__init__(parent_server=parent_server)
self.MoveToPosition_default_lifetime_of_execution = None
self.MovePlate_default_lifetime_of_execution = None
[docs]
@abstractmethod
def Reinitialize(self, *, metadata: MetadataDict) -> Reinitialize_Responses:
"""
Reinitialize the connection to to hardware and the state of the hardware.
Clears errors and enables moving.
Does not Move the robot.
:param metadata: The SiLA Client Metadata attached to the call
"""
[docs]
@abstractmethod
def PickPlate(self, Site: Site, *, metadata: MetadataDict) -> PickPlate_Responses:
"""
Pick up a plate from a given site
:param Site: Site to pick plate from
:param metadata: The SiLA Client Metadata attached to the call
"""
[docs]
@abstractmethod
def PlacePlate(self, Site: Site, *, metadata: MetadataDict) -> PlacePlate_Responses:
"""
Place a plate on a given site
:param Site: Site to place the plate on
:param metadata: The SiLA Client Metadata attached to the call
"""
[docs]
@abstractmethod
def SetSpeed(self, Percentage: float, *, metadata: MetadataDict) -> SetSpeed_Responses:
"""
Sets the movement speed of the robots arm.
:param Percentage: Percentage of maximum speed.
:param metadata: The SiLA Client Metadata attached to the call
"""
[docs]
@abstractmethod
def SetAcceleration(self, Percentage: float, *, metadata: MetadataDict) -> SetAcceleration_Responses:
"""
Sets the movement acceleration of the robots arm.
:param Percentage: Percentage of maximum acceleration.
:param metadata: The SiLA Client Metadata attached to the call
"""
[docs]
@abstractmethod
def EmergencyStop(self, *, metadata: MetadataDict) -> EmergencyStop_Responses:
"""
Stops the robotic arm as quick as possible
:param metadata: The SiLA Client Metadata attached to the call
"""
[docs]
@abstractmethod
def MoveToPosition(
self, Position: str, *, metadata: MetadataDict, instance: ObservableCommandInstance
) -> MoveToPosition_Responses:
"""
Move to a given position.
:param Position: Position to move to.
:param metadata: The SiLA Client Metadata attached to the call
:param instance: The command instance, enabling sending status updates to subscribed clients
"""
[docs]
@abstractmethod
def MovePlate(
self, OriginSite: Site, DestinationSite: Site, *, metadata: MetadataDict, instance: ObservableCommandInstance
) -> MovePlate_Responses:
"""
Move a plate between two given sites
:param OriginSite: Site to move the plate from
:param DestinationSite: Site to move the plate to
:param metadata: The SiLA Client Metadata attached to the call
:param instance: The command instance, enabling sending status updates to subscribed clients
"""