Ejemplo n.º 1
0
    def add_dialog(self,
                   title: str,
                   content: str,
                   options: List[str],
                   *,
                   an: Optional[str] = None) -> str:
        """Creates dialog, block until operator selects one of the options.

        :param title: Dialog title
        :param content: Dialog content
        :param options: Dialog options.
        :return:
        """

        return rest.call(
            rest.Method.PUT,
            f"{self.settings.url}/dialogs",
            return_type=str,
            params={
                "title": title,
                "content": content
            },
            body=options,
            timeout=rest.Timeout(read=8 * 60 * 60),
        )
Ejemplo n.º 2
0
def calibrate_robot(args: CalibrateRobotArgs, depth_image: Image) -> Pose:

    with BytesIO() as buff:
        depth_image.save(buff, format="PNG")

        return rest.call(
            rest.Method.PUT,
            f"{CALIBRATION_URL}/calibrate/robot",
            return_type=Pose,
            files={"image": buff.getvalue(), "args": args.to_json()},
            timeout=rest.Timeout(3.05, 240),
        )
Ejemplo n.º 3
0
    def __init__(self, obj_id: str, name: str, pose: Pose,
                 settings: Settings) -> None:
        super(AbstractRobot, self).__init__(obj_id, name, pose, settings)
        rest.call(
            rest.Method.PUT,
            f"{self.settings.url}/system/set",
            body=pose,
            params={
                "configId": self.settings.configuration_id,
                "id": self.id
            },
        )

        self.move_timeout = rest.Timeout(read=5 * 60)