Skip to content

Commit

Permalink
Add initialize to the robot interface
Browse files Browse the repository at this point in the history
  • Loading branch information
vetlek committed May 31, 2022
1 parent ef460a9 commit 784c0d5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/robot_interface/models/initialize/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .initialize_params import InitializeParams
10 changes: 10 additions & 0 deletions src/robot_interface/models/initialize/initialize_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from dataclasses import dataclass
from email.policy import default

from alitra import Pose
from pyparsing import Optional


@dataclass
class InitializeParams:
initial_pose: Optional[Pose] = None
22 changes: 22 additions & 0 deletions src/robot_interface/robot_interface.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from abc import ABCMeta, abstractmethod
from typing import Sequence

from robot_interface.models.initialize import InitializeParams
from robot_interface.models.inspection.inspection import Inspection
from robot_interface.models.mission import InspectionStep, Step, StepStatus

Expand Down Expand Up @@ -90,3 +91,24 @@ def get_inspections(self, step: InspectionStep) -> Sequence[Inspection]:
"""
raise NotImplementedError

@abstractmethod
def initialize(self, params: InitializeParams) -> None:
"""Initializes the robot. The initialization needed is robot dependent and the function can
be a simple return statement if no initialization is needed for the robot.
Parameters
----------
kwargs: Any
Returns
-------
None
Raises
------
RobotException
If the initialization failed
"""
raise NotImplementedError

0 comments on commit 784c0d5

Please sign in to comment.