-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
138 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import logging | ||
from typing import List | ||
|
||
from injector import inject | ||
|
||
from isar.apis.models.models import ( | ||
RobotInfoResponse, | ||
TaskResponse, | ||
) | ||
from isar.config.settings import robot_settings, settings | ||
from isar.services.utilities.robot_utilities import RobotUtilities | ||
from robot_interface.models.mission.task import Task | ||
|
||
|
||
class RobotController: | ||
@inject | ||
def __init__( | ||
self, | ||
robot_utilities: RobotUtilities, | ||
): | ||
self.robot_utilities: RobotUtilities = robot_utilities | ||
self.logger = logging.getLogger("api") | ||
|
||
def generate_media_config(self): | ||
return self.robot_utilities.generate_media_config() | ||
|
||
def get_info(self): | ||
return RobotInfoResponse( | ||
robot_package=settings.ROBOT_PACKAGE, | ||
isar_id=settings.ISAR_ID, | ||
robot_name=settings.ROBOT_NAME, | ||
robot_capabilities=robot_settings.CAPABILITIES, | ||
robot_map_name=settings.DEFAULT_MAP, | ||
plant_short_name=settings.PLANT_SHORT_NAME, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import logging | ||
|
||
from injector import inject | ||
|
||
from isar.apis.models.models import MediaConfig | ||
from robot_interface.robot_interface import RobotInterface | ||
|
||
|
||
class RobotUtilities: | ||
""" | ||
Contains utility functions for getting robot information from the API. | ||
""" | ||
|
||
@inject | ||
def __init__( | ||
self, | ||
robot: RobotInterface, | ||
): | ||
self.robot: RobotInterface = robot | ||
self.logger = logging.getLogger("api") | ||
|
||
def generate_media_config(self) -> MediaConfig: | ||
return self.robot.generate_media_config() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters