standardbots 2.20240723.13__tar.gz → 2.20240924.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of standardbots might be problematic. Click here for more details.
- {standardbots-2.20240723.13 → standardbots-2.20240924.1}/PKG-INFO +1 -1
- {standardbots-2.20240723.13 → standardbots-2.20240924.1}/setup.py +1 -1
- {standardbots-2.20240723.13 → standardbots-2.20240924.1}/standardbots/auto_generated/__init__.py +1 -0
- {standardbots-2.20240723.13 → standardbots-2.20240924.1}/standardbots/auto_generated/apis.py +58 -88
- {standardbots-2.20240723.13 → standardbots-2.20240924.1}/standardbots/auto_generated/models.py +366 -116
- {standardbots-2.20240723.13 → standardbots-2.20240924.1}/standardbots.egg-info/PKG-INFO +1 -1
- {standardbots-2.20240723.13 → standardbots-2.20240924.1}/setup.cfg +0 -0
- {standardbots-2.20240723.13 → standardbots-2.20240924.1}/standardbots/__init__.py +0 -0
- {standardbots-2.20240723.13 → standardbots-2.20240924.1}/standardbots.egg-info/SOURCES.txt +0 -0
- {standardbots-2.20240723.13 → standardbots-2.20240924.1}/standardbots.egg-info/dependency_links.txt +0 -0
- {standardbots-2.20240723.13 → standardbots-2.20240924.1}/standardbots.egg-info/requires.txt +0 -0
- {standardbots-2.20240723.13 → standardbots-2.20240924.1}/standardbots.egg-info/top_level.txt +0 -0
{standardbots-2.20240723.13 → standardbots-2.20240924.1}/standardbots/auto_generated/apis.py
RENAMED
|
@@ -663,11 +663,12 @@ class Camera:
|
|
|
663
663
|
"""
|
|
664
664
|
Retrieve the latest RGB frame from the camera.
|
|
665
665
|
"""
|
|
666
|
-
path = "/api/v1/camera/stream"
|
|
666
|
+
path = "/api/v1/camera/stream/rgb"
|
|
667
667
|
response = self._request_manager.request(
|
|
668
668
|
"GET",
|
|
669
669
|
path,
|
|
670
670
|
headers=self._request_manager.json_headers(),
|
|
671
|
+
preload_content=False,
|
|
671
672
|
)
|
|
672
673
|
parsed = None
|
|
673
674
|
|
|
@@ -725,6 +726,56 @@ class Camera:
|
|
|
725
726
|
self.data = Camera.Data(request_manager)
|
|
726
727
|
self.settings = Camera.Settings(request_manager)
|
|
727
728
|
|
|
729
|
+
class Faults:
|
|
730
|
+
_request_manager: RequestManager
|
|
731
|
+
class UserFaults:
|
|
732
|
+
def __init__(self, request_manager: RequestManager):
|
|
733
|
+
self._request_manager = request_manager
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
def trigger_user_fault(
|
|
737
|
+
self,
|
|
738
|
+
body: models.TriggerFaultRequest,
|
|
739
|
+
) -> Response[
|
|
740
|
+
Union[
|
|
741
|
+
models.ErrorResponse,
|
|
742
|
+
models.ErrorResponse,
|
|
743
|
+
None
|
|
744
|
+
],
|
|
745
|
+
None
|
|
746
|
+
]:
|
|
747
|
+
"""
|
|
748
|
+
Trigger user faults for routine
|
|
749
|
+
|
|
750
|
+
"""
|
|
751
|
+
path = "/api/v1/faults/user-fault"
|
|
752
|
+
response = self._request_manager.request(
|
|
753
|
+
"POST",
|
|
754
|
+
path,
|
|
755
|
+
headers=self._request_manager.json_headers(),
|
|
756
|
+
body=json.dumps(models.serialize_trigger_fault_request(body)),
|
|
757
|
+
)
|
|
758
|
+
parsed = None
|
|
759
|
+
if response.status == 400:
|
|
760
|
+
parsed = models.parse_error_response(json.loads(response.data))
|
|
761
|
+
|
|
762
|
+
is_user_error = response.status >= 400 and response.status < 500
|
|
763
|
+
is_unavailable = response.status == 503
|
|
764
|
+
if parsed is None and (is_user_error or is_unavailable):
|
|
765
|
+
parsed = models.parse_error_response(json.loads(response.data))
|
|
766
|
+
|
|
767
|
+
return Response(
|
|
768
|
+
parsed,
|
|
769
|
+
response.status,
|
|
770
|
+
response
|
|
771
|
+
)
|
|
772
|
+
|
|
773
|
+
user_faults: UserFaults
|
|
774
|
+
|
|
775
|
+
def __init__(self, request_manager: RequestManager):
|
|
776
|
+
self._request_manager = request_manager
|
|
777
|
+
self.user_faults = Faults.UserFaults(request_manager)
|
|
778
|
+
|
|
728
779
|
class ChatGPT:
|
|
729
780
|
_request_manager: RequestManager
|
|
730
781
|
class Data:
|
|
@@ -949,11 +1000,12 @@ class Recovery:
|
|
|
949
1000
|
self,
|
|
950
1001
|
) -> Response[
|
|
951
1002
|
Union[
|
|
1003
|
+
models.RecoveryStatusResponse,
|
|
952
1004
|
models.ErrorResponse,
|
|
953
1005
|
models.ErrorResponse,
|
|
954
1006
|
None
|
|
955
1007
|
],
|
|
956
|
-
|
|
1008
|
+
models.RecoveryStatusResponse
|
|
957
1009
|
]:
|
|
958
1010
|
"""
|
|
959
1011
|
Recovers the robot from a fault state.
|
|
@@ -966,6 +1018,8 @@ class Recovery:
|
|
|
966
1018
|
headers=self._request_manager.json_headers(),
|
|
967
1019
|
)
|
|
968
1020
|
parsed = None
|
|
1021
|
+
if response.status == 200:
|
|
1022
|
+
parsed = models.parse_recovery_status_response(json.loads(response.data))
|
|
969
1023
|
if response.status == 400:
|
|
970
1024
|
parsed = models.parse_error_response(json.loads(response.data))
|
|
971
1025
|
|
|
@@ -1460,90 +1514,6 @@ class Status:
|
|
|
1460
1514
|
self.control = Status.Control(request_manager)
|
|
1461
1515
|
self.health = Status.Health(request_manager)
|
|
1462
1516
|
|
|
1463
|
-
class Teleoperation:
|
|
1464
|
-
_request_manager: RequestManager
|
|
1465
|
-
class Control:
|
|
1466
|
-
def __init__(self, request_manager: RequestManager):
|
|
1467
|
-
self._request_manager = request_manager
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
def update_teleop_state(
|
|
1471
|
-
self,
|
|
1472
|
-
body: models.TeleopStateUpdateRequest,
|
|
1473
|
-
) -> Response[
|
|
1474
|
-
Union[
|
|
1475
|
-
models.TeleopStateResponse,
|
|
1476
|
-
models.ErrorResponse,
|
|
1477
|
-
None
|
|
1478
|
-
],
|
|
1479
|
-
models.TeleopStateResponse
|
|
1480
|
-
]:
|
|
1481
|
-
"""
|
|
1482
|
-
Updates the state of teleoperation based on the provided action ('start' or 'stop').
|
|
1483
|
-
"""
|
|
1484
|
-
path = "/api/v1/movement/teleop/state"
|
|
1485
|
-
response = self._request_manager.request(
|
|
1486
|
-
"POST",
|
|
1487
|
-
path,
|
|
1488
|
-
headers=self._request_manager.json_headers(),
|
|
1489
|
-
body=json.dumps(models.serialize_teleop_state_update_request(body)),
|
|
1490
|
-
)
|
|
1491
|
-
parsed = None
|
|
1492
|
-
if response.status == 200:
|
|
1493
|
-
parsed = models.parse_teleop_state_response(json.loads(response.data))
|
|
1494
|
-
|
|
1495
|
-
is_user_error = response.status >= 400 and response.status < 500
|
|
1496
|
-
is_unavailable = response.status == 503
|
|
1497
|
-
if parsed is None and (is_user_error or is_unavailable):
|
|
1498
|
-
parsed = models.parse_error_response(json.loads(response.data))
|
|
1499
|
-
|
|
1500
|
-
return Response(
|
|
1501
|
-
parsed,
|
|
1502
|
-
response.status,
|
|
1503
|
-
response
|
|
1504
|
-
)
|
|
1505
|
-
|
|
1506
|
-
class Status:
|
|
1507
|
-
def __init__(self, request_manager: RequestManager):
|
|
1508
|
-
self._request_manager = request_manager
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
def get_teleop_state(
|
|
1512
|
-
self,
|
|
1513
|
-
) -> Response[
|
|
1514
|
-
None,
|
|
1515
|
-
None
|
|
1516
|
-
]:
|
|
1517
|
-
"""
|
|
1518
|
-
Retrieves the current state of teleoperation.
|
|
1519
|
-
"""
|
|
1520
|
-
path = "/api/v1/movement/teleop/state"
|
|
1521
|
-
response = self._request_manager.request(
|
|
1522
|
-
"GET",
|
|
1523
|
-
path,
|
|
1524
|
-
headers=self._request_manager.json_headers(),
|
|
1525
|
-
)
|
|
1526
|
-
parsed = None
|
|
1527
|
-
|
|
1528
|
-
is_user_error = response.status >= 400 and response.status < 500
|
|
1529
|
-
is_unavailable = response.status == 503
|
|
1530
|
-
if parsed is None and (is_user_error or is_unavailable):
|
|
1531
|
-
parsed = models.parse_error_response(json.loads(response.data))
|
|
1532
|
-
|
|
1533
|
-
return Response(
|
|
1534
|
-
parsed,
|
|
1535
|
-
response.status,
|
|
1536
|
-
response
|
|
1537
|
-
)
|
|
1538
|
-
|
|
1539
|
-
control: Control
|
|
1540
|
-
status: Status
|
|
1541
|
-
|
|
1542
|
-
def __init__(self, request_manager: RequestManager):
|
|
1543
|
-
self._request_manager = request_manager
|
|
1544
|
-
self.control = Teleoperation.Control(request_manager)
|
|
1545
|
-
self.status = Teleoperation.Status(request_manager)
|
|
1546
|
-
|
|
1547
1517
|
|
|
1548
1518
|
|
|
1549
1519
|
|
|
@@ -1552,6 +1522,7 @@ class StandardBotsRobot(Default):
|
|
|
1552
1522
|
|
|
1553
1523
|
movement: Movement
|
|
1554
1524
|
camera: Camera
|
|
1525
|
+
faults: Faults
|
|
1555
1526
|
chat_gpt: ChatGPT
|
|
1556
1527
|
io: IO
|
|
1557
1528
|
general: General
|
|
@@ -1559,7 +1530,6 @@ class StandardBotsRobot(Default):
|
|
|
1559
1530
|
ros: ROS
|
|
1560
1531
|
routine_editor: RoutineEditor
|
|
1561
1532
|
status: Status
|
|
1562
|
-
teleoperation: Teleoperation
|
|
1563
1533
|
def __init__(
|
|
1564
1534
|
self,
|
|
1565
1535
|
url: str,
|
|
@@ -1575,6 +1545,7 @@ class StandardBotsRobot(Default):
|
|
|
1575
1545
|
))
|
|
1576
1546
|
self.movement = Movement(self._request_manager)
|
|
1577
1547
|
self.camera = Camera(self._request_manager)
|
|
1548
|
+
self.faults = Faults(self._request_manager)
|
|
1578
1549
|
self.chat_gpt = ChatGPT(self._request_manager)
|
|
1579
1550
|
self.io = IO(self._request_manager)
|
|
1580
1551
|
self.general = General(self._request_manager)
|
|
@@ -1582,7 +1553,6 @@ class StandardBotsRobot(Default):
|
|
|
1582
1553
|
self.ros = ROS(self._request_manager)
|
|
1583
1554
|
self.routine_editor = RoutineEditor(self._request_manager)
|
|
1584
1555
|
self.status = Status(self._request_manager)
|
|
1585
|
-
self.teleoperation = Teleoperation(self._request_manager)
|
|
1586
1556
|
|
|
1587
1557
|
@contextmanager
|
|
1588
1558
|
def connection(self):
|
{standardbots-2.20240723.13 → standardbots-2.20240924.1}/standardbots/auto_generated/models.py
RENAMED
|
@@ -911,6 +911,8 @@ def serialize_force_unit_kind(data: Union[ForceUnitKind, str]) -> object:
|
|
|
911
911
|
class GripperKindEnum(Enum):
|
|
912
912
|
Onrobot2Fg7 = "onrobot_2fg7"
|
|
913
913
|
"""An OnRobot 2FG7 Gripper is connected"""
|
|
914
|
+
Onrobot2Fg14 = "onrobot_2fg14"
|
|
915
|
+
"""An OnRobot 2FG14 Gripper is connected"""
|
|
914
916
|
Onrobot3Fg15 = "onrobot_3fg15"
|
|
915
917
|
"""An OnRobot 3FG15 Gripper is connected"""
|
|
916
918
|
DhAg = "dh_ag"
|
|
@@ -919,6 +921,8 @@ class GripperKindEnum(Enum):
|
|
|
919
921
|
"""A DH PGC Gripper is connected"""
|
|
920
922
|
DhCgi = "dh_cgi"
|
|
921
923
|
"""A DH CGI Gripper is connected"""
|
|
924
|
+
SchunkEgx = "schunk_egx"
|
|
925
|
+
"""A Schunk EGU / EGK Gripper is connected"""
|
|
922
926
|
NoneConnected = "none_connected"
|
|
923
927
|
"""No gripper is connected"""
|
|
924
928
|
|
|
@@ -928,64 +932,16 @@ def parse_gripper_kind_enum(data: object) -> GripperKindEnum:
|
|
|
928
932
|
def serialize_gripper_kind_enum(data: Union[GripperKindEnum, str]) -> object:
|
|
929
933
|
return GripperKindEnum(data).value
|
|
930
934
|
|
|
931
|
-
|
|
932
|
-
class IOStateResponse:
|
|
933
|
-
"""Response to a query for the current state of I/O."""
|
|
934
|
-
state: Union[str, None] = None
|
|
935
|
-
|
|
936
|
-
def validate_state(self, value: str) -> Tuple[bool, str]:
|
|
937
|
-
if value is None:
|
|
938
|
-
return [True, ""]
|
|
939
|
-
|
|
940
|
-
if not isinstance(value, str):
|
|
941
|
-
return [False, "state must be of type str for IOStateResponse, got " + type(value).__name__]
|
|
942
|
-
|
|
943
|
-
return [True, ""]
|
|
944
|
-
|
|
945
|
-
def __post_init__(self):
|
|
946
|
-
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
947
|
-
is_valid, error_str = self.validate_state(self.state)
|
|
948
|
-
if not is_valid:
|
|
949
|
-
raise TypeError(error_str)
|
|
950
|
-
|
|
951
|
-
def parse_io_state_response(data: object):
|
|
952
|
-
return IOStateResponse(
|
|
953
|
-
state=parse_str(data["state"]) if "state" in data else None,
|
|
954
|
-
)
|
|
935
|
+
IOStateMap = Dict[str, str]
|
|
955
936
|
|
|
956
|
-
def
|
|
937
|
+
def parse_io_state_map(data: object) -> IOStateMap:
|
|
957
938
|
return {
|
|
958
|
-
|
|
939
|
+
parse_str(key): parse_str(value) for key, value in data.items()
|
|
959
940
|
}
|
|
960
941
|
|
|
961
|
-
|
|
962
|
-
class IOStateUpdateRequest:
|
|
963
|
-
"""Request to update the state of I/O to either start or stop."""
|
|
964
|
-
state: Union[str, None] = None
|
|
965
|
-
|
|
966
|
-
def validate_state(self, value: str) -> Tuple[bool, str]:
|
|
967
|
-
if value is None:
|
|
968
|
-
return [True, ""]
|
|
969
|
-
|
|
970
|
-
if not isinstance(value, str):
|
|
971
|
-
return [False, "state must be of type str for IOStateUpdateRequest, got " + type(value).__name__]
|
|
972
|
-
|
|
973
|
-
return [True, ""]
|
|
974
|
-
|
|
975
|
-
def __post_init__(self):
|
|
976
|
-
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
977
|
-
is_valid, error_str = self.validate_state(self.state)
|
|
978
|
-
if not is_valid:
|
|
979
|
-
raise TypeError(error_str)
|
|
980
|
-
|
|
981
|
-
def parse_io_state_update_request(data: object):
|
|
982
|
-
return IOStateUpdateRequest(
|
|
983
|
-
state=parse_str(data["state"]) if "state" in data else None,
|
|
984
|
-
)
|
|
985
|
-
|
|
986
|
-
def serialize_io_state_update_request(data: IOStateUpdateRequest) -> object:
|
|
942
|
+
def serialize_io_state_map(data: IOStateMap) -> object:
|
|
987
943
|
return {
|
|
988
|
-
|
|
944
|
+
serialize_str(key): serialize_str(value) for key, value in data.items()
|
|
989
945
|
}
|
|
990
946
|
|
|
991
947
|
JointRotations = Tuple[float,float,float,float,float,float,]
|
|
@@ -1026,6 +982,18 @@ def parse_linear_unit_kind(data: object) -> LinearUnitKind:
|
|
|
1026
982
|
def serialize_linear_unit_kind(data: Union[LinearUnitKind, str]) -> object:
|
|
1027
983
|
return LinearUnitKind(data).value
|
|
1028
984
|
|
|
985
|
+
class OnRobot2FG14ControlKindEnum(Enum):
|
|
986
|
+
Move = "move"
|
|
987
|
+
"""Move gripper to target grip width"""
|
|
988
|
+
ForceGrip = "force_grip"
|
|
989
|
+
"""Grip with target force"""
|
|
990
|
+
|
|
991
|
+
def parse_on_robot_2_fg_14_control_kind_enum(data: object) -> OnRobot2FG14ControlKindEnum:
|
|
992
|
+
return OnRobot2FG14ControlKindEnum(data)
|
|
993
|
+
|
|
994
|
+
def serialize_on_robot_2_fg_14_control_kind_enum(data: Union[OnRobot2FG14ControlKindEnum, str]) -> object:
|
|
995
|
+
return OnRobot2FG14ControlKindEnum(data).value
|
|
996
|
+
|
|
1029
997
|
class OnRobot2FG7ControlKindEnum(Enum):
|
|
1030
998
|
Move = "move"
|
|
1031
999
|
"""Move gripper to target grip width"""
|
|
@@ -1242,6 +1210,70 @@ def serialize_quaternion(data: Quaternion) -> object:
|
|
|
1242
1210
|
"w": None if data.w is None else serialize_f_64(data.w),
|
|
1243
1211
|
}
|
|
1244
1212
|
|
|
1213
|
+
class RecoveryStateEnum(Enum):
|
|
1214
|
+
Success = "Success"
|
|
1215
|
+
"""Enum Success = `Success`"""
|
|
1216
|
+
Interrupted = "Interrupted"
|
|
1217
|
+
"""Enum Interrupted = `Interrupted`"""
|
|
1218
|
+
NonIdle = "NonIdle"
|
|
1219
|
+
"""Enum NonIdle = `NonIdle`"""
|
|
1220
|
+
Braked = "Braked"
|
|
1221
|
+
"""Enum Braked = `Braked`"""
|
|
1222
|
+
PlanningFailure = "PlanningFailure"
|
|
1223
|
+
"""Enum PlanningFailure = `PlanningFailure`"""
|
|
1224
|
+
ExecutionFailure = "ExecutionFailure"
|
|
1225
|
+
"""Enum ExecutionFailure = `ExecutionFailure`"""
|
|
1226
|
+
ControlSystemFailure = "ControlSystemFailure"
|
|
1227
|
+
"""Enum ControlSystemFailure = `ControlSystemFailure`"""
|
|
1228
|
+
EStopTriggered = "EStopTriggered"
|
|
1229
|
+
"""Enum EStopTriggered = `EStopTriggered`"""
|
|
1230
|
+
GripperFailure = "GripperFailure"
|
|
1231
|
+
"""Enum GripperFailure = `GripperFailure`"""
|
|
1232
|
+
OutOfJointLimitsFailure = "OutOfJointLimitsFailure"
|
|
1233
|
+
"""Enum OutOfJointLimitsFailure = `OutOfJointLimitsFailure`"""
|
|
1234
|
+
CollisionFailure = "CollisionFailure"
|
|
1235
|
+
"""Enum CollisionFailure = `CollisionFailure`"""
|
|
1236
|
+
TorqueCollisionFailure = "TorqueCollisionFailure"
|
|
1237
|
+
"""Enum TorqueCollisionFailure = `TorqueCollisionFailure`"""
|
|
1238
|
+
InBoxingPositionFailure = "InBoxingPositionFailure"
|
|
1239
|
+
"""Enum InBoxingPositionFailure = `InBoxingPositionFailure`"""
|
|
1240
|
+
PowerBoardCheckFailure = "PowerBoardCheckFailure"
|
|
1241
|
+
"""Enum PowerBoardCheckFailure = `PowerBoardCheckFailure`"""
|
|
1242
|
+
MotionPlannerFailure = "MotionPlannerFailure"
|
|
1243
|
+
"""Enum MotionPlannerFailure = `MotionPlannerFailure`"""
|
|
1244
|
+
MotionPlannerFailureStartPositionCollision = "MotionPlannerFailureStartPositionCollision"
|
|
1245
|
+
"""Enum MotionPlannerFailureStartPositionCollision = `MotionPlannerFailureStartPositionCollision`"""
|
|
1246
|
+
IOFailure = "IOFailure"
|
|
1247
|
+
"""Enum IOFailure = `IOFailure`"""
|
|
1248
|
+
InvalidRoutineLoadedFailure = "InvalidRoutineLoadedFailure"
|
|
1249
|
+
"""Enum InvalidRoutineLoadedFailure = `InvalidRoutineLoadedFailure`"""
|
|
1250
|
+
InferenceFailure = "InferenceFailure"
|
|
1251
|
+
"""Enum InferenceFailure = `InferenceFailure`"""
|
|
1252
|
+
CameraFailure = "CameraFailure"
|
|
1253
|
+
"""Enum CameraFailure = `CameraFailure`"""
|
|
1254
|
+
HaasFailure = "HaasFailure"
|
|
1255
|
+
"""Enum HaasFailure = `HaasFailure`"""
|
|
1256
|
+
BotmanHeartbeatLost = "BotmanHeartbeatLost"
|
|
1257
|
+
"""Enum BotmanHeartbeatLost = `BotmanHeartbeatLost`"""
|
|
1258
|
+
InternalFailure = "InternalFailure"
|
|
1259
|
+
"""Enum InternalFailure = `InternalFailure`"""
|
|
1260
|
+
TorqueLimitExceeded = "TorqueLimitExceeded"
|
|
1261
|
+
"""Enum TorqueLimitExceeded = `TorqueLimitExceeded`"""
|
|
1262
|
+
StepPlayFailure = "StepPlayFailure"
|
|
1263
|
+
"""Enum StepPlayFailure = `StepPlayFailure`"""
|
|
1264
|
+
UnbrakeFailure = "UnbrakeFailure"
|
|
1265
|
+
"""Enum UnbrakeFailure = `UnbrakeFailure`"""
|
|
1266
|
+
WeldFailure = "WeldFailure"
|
|
1267
|
+
"""Enum WeldFailure = `WeldFailure`"""
|
|
1268
|
+
TriggerFaultFailure = "TriggerFaultFailure"
|
|
1269
|
+
"""Enum TriggerFaultFailure = `TriggerFaultFailure`"""
|
|
1270
|
+
|
|
1271
|
+
def parse_recovery_state_enum(data: object) -> RecoveryStateEnum:
|
|
1272
|
+
return RecoveryStateEnum(data)
|
|
1273
|
+
|
|
1274
|
+
def serialize_recovery_state_enum(data: Union[RecoveryStateEnum, str]) -> object:
|
|
1275
|
+
return RecoveryStateEnum(data).value
|
|
1276
|
+
|
|
1245
1277
|
class RobotControlModeEnum(Enum):
|
|
1246
1278
|
Api = "api"
|
|
1247
1279
|
"""The robot is controlled via the Standard Bots Robot API (this API)"""
|
|
@@ -1308,6 +1340,16 @@ def serialize_runtime_variable(data: RuntimeVariable) -> object:
|
|
|
1308
1340
|
"value": None if data.value is None else serialize_str(data.value),
|
|
1309
1341
|
}
|
|
1310
1342
|
|
|
1343
|
+
class SchunkEGxControlKindEnum(Enum):
|
|
1344
|
+
Move = "move"
|
|
1345
|
+
"""Move gripper to target grip diameter"""
|
|
1346
|
+
|
|
1347
|
+
def parse_schunk_e_gx_control_kind_enum(data: object) -> SchunkEGxControlKindEnum:
|
|
1348
|
+
return SchunkEGxControlKindEnum(data)
|
|
1349
|
+
|
|
1350
|
+
def serialize_schunk_e_gx_control_kind_enum(data: Union[SchunkEGxControlKindEnum, str]) -> object:
|
|
1351
|
+
return SchunkEGxControlKindEnum(data).value
|
|
1352
|
+
|
|
1311
1353
|
SkillsList = List[str]
|
|
1312
1354
|
|
|
1313
1355
|
def parse_skills_list(data: object) -> SkillsList:
|
|
@@ -1405,54 +1447,50 @@ def serialize_status_version_data(data: StatusVersionData) -> object:
|
|
|
1405
1447
|
"name": None if data.name is None else serialize_str(data.name),
|
|
1406
1448
|
}
|
|
1407
1449
|
|
|
1408
|
-
class TeleopStateEnum(Enum):
|
|
1409
|
-
WaitForTeleop = "wait_for_teleop"
|
|
1410
|
-
"""The system is waiting to start teleoperation."""
|
|
1411
|
-
Teleop = "teleop"
|
|
1412
|
-
"""Teleoperation is active, and the robot is being controlled remotely."""
|
|
1413
|
-
Stopping = "stopping"
|
|
1414
|
-
"""The robot is stopping."""
|
|
1415
|
-
Stopped = "stopped"
|
|
1416
|
-
"""Teleoperation is stopped, and the robot is not moving."""
|
|
1417
|
-
Moving = "moving"
|
|
1418
|
-
"""The robot is moving but not under teleoperation."""
|
|
1419
|
-
Unfrozen = "unfrozen"
|
|
1420
|
-
"""The mini-arm is unfrozen."""
|
|
1421
|
-
|
|
1422
|
-
def parse_teleop_state_enum(data: object) -> TeleopStateEnum:
|
|
1423
|
-
return TeleopStateEnum(data)
|
|
1424
|
-
|
|
1425
|
-
def serialize_teleop_state_enum(data: Union[TeleopStateEnum, str]) -> object:
|
|
1426
|
-
return TeleopStateEnum(data).value
|
|
1427
|
-
|
|
1428
1450
|
@dataclass
|
|
1429
|
-
class
|
|
1430
|
-
"""Request to
|
|
1431
|
-
|
|
1451
|
+
class TriggerFaultRequest:
|
|
1452
|
+
"""Request to trigger an user fault for routine.
|
|
1453
|
+
"""
|
|
1454
|
+
message: Union[str, None] = None
|
|
1455
|
+
isRecoverable: Union[bool, None] = None
|
|
1432
1456
|
|
|
1433
|
-
def
|
|
1457
|
+
def validate_message(self, value: str) -> Tuple[bool, str]:
|
|
1434
1458
|
if value is None:
|
|
1435
1459
|
return [True, ""]
|
|
1436
1460
|
|
|
1437
1461
|
if not isinstance(value, str):
|
|
1438
|
-
return [False, "
|
|
1462
|
+
return [False, "message must be of type str for TriggerFaultRequest, got " + type(value).__name__]
|
|
1463
|
+
|
|
1464
|
+
return [True, ""]
|
|
1465
|
+
|
|
1466
|
+
def validate_isRecoverable(self, value: bool) -> Tuple[bool, str]:
|
|
1467
|
+
if value is None:
|
|
1468
|
+
return [True, ""]
|
|
1469
|
+
|
|
1470
|
+
if not isinstance(value, bool):
|
|
1471
|
+
return [False, "isRecoverable must be of type bool for TriggerFaultRequest, got " + type(value).__name__]
|
|
1439
1472
|
|
|
1440
1473
|
return [True, ""]
|
|
1441
1474
|
|
|
1442
1475
|
def __post_init__(self):
|
|
1443
1476
|
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1444
|
-
is_valid, error_str = self.
|
|
1477
|
+
is_valid, error_str = self.validate_message(self.message)
|
|
1478
|
+
if not is_valid:
|
|
1479
|
+
raise TypeError(error_str)
|
|
1480
|
+
is_valid, error_str = self.validate_isRecoverable(self.isRecoverable)
|
|
1445
1481
|
if not is_valid:
|
|
1446
1482
|
raise TypeError(error_str)
|
|
1447
1483
|
|
|
1448
|
-
def
|
|
1449
|
-
return
|
|
1450
|
-
|
|
1484
|
+
def parse_trigger_fault_request(data: object):
|
|
1485
|
+
return TriggerFaultRequest(
|
|
1486
|
+
message=parse_str(data["message"]) if "message" in data else None,
|
|
1487
|
+
isRecoverable=parse_bool(data["isRecoverable"]) if "isRecoverable" in data else None,
|
|
1451
1488
|
)
|
|
1452
1489
|
|
|
1453
|
-
def
|
|
1490
|
+
def serialize_trigger_fault_request(data: TriggerFaultRequest) -> object:
|
|
1454
1491
|
return {
|
|
1455
|
-
"
|
|
1492
|
+
"message": None if data.message is None else serialize_str(data.message),
|
|
1493
|
+
"isRecoverable": None if data.isRecoverable is None else serialize_bool(data.isRecoverable),
|
|
1456
1494
|
}
|
|
1457
1495
|
|
|
1458
1496
|
@dataclass
|
|
@@ -1800,7 +1838,7 @@ class GripperConfiguration:
|
|
|
1800
1838
|
if value is None:
|
|
1801
1839
|
return [False, "kind is required for GripperConfiguration"]
|
|
1802
1840
|
|
|
1803
|
-
if not ((isinstance(value, str) and GripperKindEnum in ['onrobot_2fg7', 'onrobot_3fg15', 'dh_ag', 'dh_pgc', 'dh_cgi', 'none_connected']) or isinstance(value, GripperKindEnum)):
|
|
1841
|
+
if not ((isinstance(value, str) and GripperKindEnum in ['onrobot_2fg7', 'onrobot_2fg14', 'onrobot_3fg15', 'dh_ag', 'dh_pgc', 'dh_cgi', 'schunk_egx', 'none_connected']) or isinstance(value, GripperKindEnum)):
|
|
1804
1842
|
return [False, "kind must be of type GripperKindEnum for GripperConfiguration, got " + type(value).__name__]
|
|
1805
1843
|
|
|
1806
1844
|
return [True, ""]
|
|
@@ -1863,6 +1901,66 @@ def serialize_gripper_configuration(data: GripperConfiguration) -> object:
|
|
|
1863
1901
|
"dh_cgi": None if data.dh_cgi is None else serialize_dhcgi_gripper_configuration(data.dh_cgi),
|
|
1864
1902
|
}
|
|
1865
1903
|
|
|
1904
|
+
@dataclass
|
|
1905
|
+
class IOStateResponse:
|
|
1906
|
+
"""Response to a query for the current state of I/O."""
|
|
1907
|
+
state: Union[IOStateMap, None] = None
|
|
1908
|
+
|
|
1909
|
+
def validate_state(self, value: IOStateMap) -> Tuple[bool, str]:
|
|
1910
|
+
if value is None:
|
|
1911
|
+
return [True, ""]
|
|
1912
|
+
|
|
1913
|
+
if not (isinstance(value, dict) and all((isinstance(k, str) and isinstance(val, str)) for k, val in value.items())):
|
|
1914
|
+
return [False, "state must be of type IOStateMap for IOStateResponse, got " + type(value).__name__]
|
|
1915
|
+
|
|
1916
|
+
return [True, ""]
|
|
1917
|
+
|
|
1918
|
+
def __post_init__(self):
|
|
1919
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1920
|
+
is_valid, error_str = self.validate_state(self.state)
|
|
1921
|
+
if not is_valid:
|
|
1922
|
+
raise TypeError(error_str)
|
|
1923
|
+
|
|
1924
|
+
def parse_io_state_response(data: object):
|
|
1925
|
+
return IOStateResponse(
|
|
1926
|
+
state=parse_io_state_map(data["state"]) if "state" in data else None,
|
|
1927
|
+
)
|
|
1928
|
+
|
|
1929
|
+
def serialize_io_state_response(data: IOStateResponse) -> object:
|
|
1930
|
+
return {
|
|
1931
|
+
"state": None if data.state is None else serialize_io_state_map(data.state),
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
@dataclass
|
|
1935
|
+
class IOStateUpdateRequest:
|
|
1936
|
+
"""Request to update the state of I/O for multiple ports."""
|
|
1937
|
+
state: Union[IOStateMap, None] = None
|
|
1938
|
+
|
|
1939
|
+
def validate_state(self, value: IOStateMap) -> Tuple[bool, str]:
|
|
1940
|
+
if value is None:
|
|
1941
|
+
return [True, ""]
|
|
1942
|
+
|
|
1943
|
+
if not (isinstance(value, dict) and all((isinstance(k, str) and isinstance(val, str)) for k, val in value.items())):
|
|
1944
|
+
return [False, "state must be of type IOStateMap for IOStateUpdateRequest, got " + type(value).__name__]
|
|
1945
|
+
|
|
1946
|
+
return [True, ""]
|
|
1947
|
+
|
|
1948
|
+
def __post_init__(self):
|
|
1949
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1950
|
+
is_valid, error_str = self.validate_state(self.state)
|
|
1951
|
+
if not is_valid:
|
|
1952
|
+
raise TypeError(error_str)
|
|
1953
|
+
|
|
1954
|
+
def parse_io_state_update_request(data: object):
|
|
1955
|
+
return IOStateUpdateRequest(
|
|
1956
|
+
state=parse_io_state_map(data["state"]) if "state" in data else None,
|
|
1957
|
+
)
|
|
1958
|
+
|
|
1959
|
+
def serialize_io_state_update_request(data: IOStateUpdateRequest) -> object:
|
|
1960
|
+
return {
|
|
1961
|
+
"state": None if data.state is None else serialize_io_state_map(data.state),
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1866
1964
|
@dataclass
|
|
1867
1965
|
class ArmJointRotations:
|
|
1868
1966
|
"""Rotational positions of arm joints"""
|
|
@@ -2067,6 +2165,36 @@ def serialize_orientation(data: Orientation) -> object:
|
|
|
2067
2165
|
"quaternion": None if data.quaternion is None else serialize_quaternion(data.quaternion),
|
|
2068
2166
|
}
|
|
2069
2167
|
|
|
2168
|
+
@dataclass
|
|
2169
|
+
class RecoveryStatusResponse:
|
|
2170
|
+
"""Recovery status response"""
|
|
2171
|
+
state: Union[RecoveryStateEnum, None] = None
|
|
2172
|
+
|
|
2173
|
+
def validate_state(self, value: RecoveryStateEnum) -> Tuple[bool, str]:
|
|
2174
|
+
if value is None:
|
|
2175
|
+
return [True, ""]
|
|
2176
|
+
|
|
2177
|
+
if not ((isinstance(value, str) and RecoveryStateEnum in ['Success', 'Interrupted', 'NonIdle', 'Braked', 'PlanningFailure', 'ExecutionFailure', 'ControlSystemFailure', 'EStopTriggered', 'GripperFailure', 'OutOfJointLimitsFailure', 'CollisionFailure', 'TorqueCollisionFailure', 'InBoxingPositionFailure', 'PowerBoardCheckFailure', 'MotionPlannerFailure', 'MotionPlannerFailureStartPositionCollision', 'IOFailure', 'InvalidRoutineLoadedFailure', 'InferenceFailure', 'CameraFailure', 'HaasFailure', 'BotmanHeartbeatLost', 'InternalFailure', 'TorqueLimitExceeded', 'StepPlayFailure', 'UnbrakeFailure', 'WeldFailure', 'TriggerFaultFailure']) or isinstance(value, RecoveryStateEnum)):
|
|
2178
|
+
return [False, "state must be of type RecoveryStateEnum for RecoveryStatusResponse, got " + type(value).__name__]
|
|
2179
|
+
|
|
2180
|
+
return [True, ""]
|
|
2181
|
+
|
|
2182
|
+
def __post_init__(self):
|
|
2183
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2184
|
+
is_valid, error_str = self.validate_state(self.state)
|
|
2185
|
+
if not is_valid:
|
|
2186
|
+
raise TypeError(error_str)
|
|
2187
|
+
|
|
2188
|
+
def parse_recovery_status_response(data: object):
|
|
2189
|
+
return RecoveryStatusResponse(
|
|
2190
|
+
state=parse_recovery_state_enum(data["state"]) if "state" in data else None,
|
|
2191
|
+
)
|
|
2192
|
+
|
|
2193
|
+
def serialize_recovery_status_response(data: RecoveryStatusResponse) -> object:
|
|
2194
|
+
return {
|
|
2195
|
+
"state": None if data.state is None else serialize_recovery_state_enum(data.state),
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2070
2198
|
@dataclass
|
|
2071
2199
|
class RobotControlMode:
|
|
2072
2200
|
"""Definition of Robot Control State, which tells you which service or system is controlling the Robot"""
|
|
@@ -2277,36 +2405,6 @@ def serialize_status_health_response(data: StatusHealthResponse) -> object:
|
|
|
2277
2405
|
"build": None if data.build is None else serialize_status_version_data(data.build),
|
|
2278
2406
|
}
|
|
2279
2407
|
|
|
2280
|
-
@dataclass
|
|
2281
|
-
class TeleopStateResponse:
|
|
2282
|
-
"""Response to a query for the current state of teleoperation."""
|
|
2283
|
-
state: Union[TeleopStateEnum, None] = None
|
|
2284
|
-
|
|
2285
|
-
def validate_state(self, value: TeleopStateEnum) -> Tuple[bool, str]:
|
|
2286
|
-
if value is None:
|
|
2287
|
-
return [True, ""]
|
|
2288
|
-
|
|
2289
|
-
if not ((isinstance(value, str) and TeleopStateEnum in ['wait_for_teleop', 'teleop', 'stopping', 'stopped', 'moving', 'unfrozen']) or isinstance(value, TeleopStateEnum)):
|
|
2290
|
-
return [False, "state must be of type TeleopStateEnum for TeleopStateResponse, got " + type(value).__name__]
|
|
2291
|
-
|
|
2292
|
-
return [True, ""]
|
|
2293
|
-
|
|
2294
|
-
def __post_init__(self):
|
|
2295
|
-
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2296
|
-
is_valid, error_str = self.validate_state(self.state)
|
|
2297
|
-
if not is_valid:
|
|
2298
|
-
raise TypeError(error_str)
|
|
2299
|
-
|
|
2300
|
-
def parse_teleop_state_response(data: object):
|
|
2301
|
-
return TeleopStateResponse(
|
|
2302
|
-
state=parse_teleop_state_enum(data["state"]) if "state" in data else None,
|
|
2303
|
-
)
|
|
2304
|
-
|
|
2305
|
-
def serialize_teleop_state_response(data: TeleopStateResponse) -> object:
|
|
2306
|
-
return {
|
|
2307
|
-
"state": None if data.state is None else serialize_teleop_state_enum(data.state),
|
|
2308
|
-
}
|
|
2309
|
-
|
|
2310
2408
|
@dataclass
|
|
2311
2409
|
class ArmPositionUpdateRequestResponseEventStreamDetails:
|
|
2312
2410
|
"""Specify how the response should be sent
|
|
@@ -2511,6 +2609,82 @@ def parse_arm_joint_rotations_list(data: object) -> ArmJointRotationsList:
|
|
|
2511
2609
|
def serialize_arm_joint_rotations_list(data: ArmJointRotationsList) -> List[object]:
|
|
2512
2610
|
return [serialize_arm_joint_rotations(item) for item in data]
|
|
2513
2611
|
|
|
2612
|
+
@dataclass
|
|
2613
|
+
class OnRobot2FG14GripperCommandRequest:
|
|
2614
|
+
"""Control the OnRobot 2FG14 gripper (end effector) of the robot
|
|
2615
|
+
"""
|
|
2616
|
+
grip_direction: Union[LinearGripDirectionEnum, None] = None
|
|
2617
|
+
target_force: Union[ForceUnit, None] = None
|
|
2618
|
+
target_grip_width: Union[LinearUnit, None] = None
|
|
2619
|
+
control_kind: Union[OnRobot2FG14ControlKindEnum, None] = None
|
|
2620
|
+
|
|
2621
|
+
def validate_grip_direction(self, value: LinearGripDirectionEnum) -> Tuple[bool, str]:
|
|
2622
|
+
if value is None:
|
|
2623
|
+
return [False, "grip_direction is required for OnRobot2FG14GripperCommandRequest"]
|
|
2624
|
+
|
|
2625
|
+
if not ((isinstance(value, str) and LinearGripDirectionEnum in ['inward', 'outward']) or isinstance(value, LinearGripDirectionEnum)):
|
|
2626
|
+
return [False, "grip_direction must be of type LinearGripDirectionEnum for OnRobot2FG14GripperCommandRequest, got " + type(value).__name__]
|
|
2627
|
+
|
|
2628
|
+
return [True, ""]
|
|
2629
|
+
|
|
2630
|
+
def validate_target_force(self, value: ForceUnit) -> Tuple[bool, str]:
|
|
2631
|
+
if value is None:
|
|
2632
|
+
return [True, ""]
|
|
2633
|
+
|
|
2634
|
+
if not isinstance(value, ForceUnit):
|
|
2635
|
+
return [False, "target_force must be of type ForceUnit for OnRobot2FG14GripperCommandRequest, got " + type(value).__name__]
|
|
2636
|
+
|
|
2637
|
+
return [True, ""]
|
|
2638
|
+
|
|
2639
|
+
def validate_target_grip_width(self, value: LinearUnit) -> Tuple[bool, str]:
|
|
2640
|
+
if value is None:
|
|
2641
|
+
return [True, ""]
|
|
2642
|
+
|
|
2643
|
+
if not isinstance(value, LinearUnit):
|
|
2644
|
+
return [False, "target_grip_width must be of type LinearUnit for OnRobot2FG14GripperCommandRequest, got " + type(value).__name__]
|
|
2645
|
+
|
|
2646
|
+
return [True, ""]
|
|
2647
|
+
|
|
2648
|
+
def validate_control_kind(self, value: OnRobot2FG14ControlKindEnum) -> Tuple[bool, str]:
|
|
2649
|
+
if value is None:
|
|
2650
|
+
return [False, "control_kind is required for OnRobot2FG14GripperCommandRequest"]
|
|
2651
|
+
|
|
2652
|
+
if not ((isinstance(value, str) and OnRobot2FG14ControlKindEnum in ['move', 'force_grip']) or isinstance(value, OnRobot2FG14ControlKindEnum)):
|
|
2653
|
+
return [False, "control_kind must be of type OnRobot2FG14ControlKindEnum for OnRobot2FG14GripperCommandRequest, got " + type(value).__name__]
|
|
2654
|
+
|
|
2655
|
+
return [True, ""]
|
|
2656
|
+
|
|
2657
|
+
def __post_init__(self):
|
|
2658
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2659
|
+
is_valid, error_str = self.validate_grip_direction(self.grip_direction)
|
|
2660
|
+
if not is_valid:
|
|
2661
|
+
raise TypeError(error_str)
|
|
2662
|
+
is_valid, error_str = self.validate_target_force(self.target_force)
|
|
2663
|
+
if not is_valid:
|
|
2664
|
+
raise TypeError(error_str)
|
|
2665
|
+
is_valid, error_str = self.validate_target_grip_width(self.target_grip_width)
|
|
2666
|
+
if not is_valid:
|
|
2667
|
+
raise TypeError(error_str)
|
|
2668
|
+
is_valid, error_str = self.validate_control_kind(self.control_kind)
|
|
2669
|
+
if not is_valid:
|
|
2670
|
+
raise TypeError(error_str)
|
|
2671
|
+
|
|
2672
|
+
def parse_on_robot_2_fg_14_gripper_command_request(data: object):
|
|
2673
|
+
return OnRobot2FG14GripperCommandRequest(
|
|
2674
|
+
grip_direction=parse_linear_grip_direction_enum(data["grip_direction"]) if "grip_direction" in data else None,
|
|
2675
|
+
target_force=parse_force_unit(data["target_force"]) if "target_force" in data else None,
|
|
2676
|
+
target_grip_width=parse_linear_unit(data["target_grip_width"]) if "target_grip_width" in data else None,
|
|
2677
|
+
control_kind=parse_on_robot_2_fg_14_control_kind_enum(data["control_kind"]) if "control_kind" in data else None,
|
|
2678
|
+
)
|
|
2679
|
+
|
|
2680
|
+
def serialize_on_robot_2_fg_14_gripper_command_request(data: OnRobot2FG14GripperCommandRequest) -> object:
|
|
2681
|
+
return {
|
|
2682
|
+
"grip_direction": serialize_linear_grip_direction_enum(data.grip_direction),
|
|
2683
|
+
"target_force": None if data.target_force is None else serialize_force_unit(data.target_force),
|
|
2684
|
+
"target_grip_width": None if data.target_grip_width is None else serialize_linear_unit(data.target_grip_width),
|
|
2685
|
+
"control_kind": serialize_on_robot_2_fg_14_control_kind_enum(data.control_kind),
|
|
2686
|
+
}
|
|
2687
|
+
|
|
2514
2688
|
@dataclass
|
|
2515
2689
|
class OnRobot2FG7GripperCommandRequest:
|
|
2516
2690
|
"""Control the OnRobot 2FG7 gripper (end effector) of the robot
|
|
@@ -2663,6 +2837,52 @@ def serialize_on_robot_3_fg_15_gripper_command_request(data: OnRobot3FG15Gripper
|
|
|
2663
2837
|
"control_kind": serialize_on_robot_3_fg_15_control_kind_enum(data.control_kind),
|
|
2664
2838
|
}
|
|
2665
2839
|
|
|
2840
|
+
@dataclass
|
|
2841
|
+
class SchunkEGxGripperCommandRequest:
|
|
2842
|
+
"""Control the Schunk EGU / EGK gripper (end effector) of the robot
|
|
2843
|
+
"""
|
|
2844
|
+
target_grip_width: Union[LinearUnit, None] = None
|
|
2845
|
+
control_kind: Union[SchunkEGxControlKindEnum, None] = None
|
|
2846
|
+
|
|
2847
|
+
def validate_target_grip_width(self, value: LinearUnit) -> Tuple[bool, str]:
|
|
2848
|
+
if value is None:
|
|
2849
|
+
return [True, ""]
|
|
2850
|
+
|
|
2851
|
+
if not isinstance(value, LinearUnit):
|
|
2852
|
+
return [False, "target_grip_width must be of type LinearUnit for SchunkEGxGripperCommandRequest, got " + type(value).__name__]
|
|
2853
|
+
|
|
2854
|
+
return [True, ""]
|
|
2855
|
+
|
|
2856
|
+
def validate_control_kind(self, value: SchunkEGxControlKindEnum) -> Tuple[bool, str]:
|
|
2857
|
+
if value is None:
|
|
2858
|
+
return [False, "control_kind is required for SchunkEGxGripperCommandRequest"]
|
|
2859
|
+
|
|
2860
|
+
if not ((isinstance(value, str) and SchunkEGxControlKindEnum in ['move']) or isinstance(value, SchunkEGxControlKindEnum)):
|
|
2861
|
+
return [False, "control_kind must be of type SchunkEGxControlKindEnum for SchunkEGxGripperCommandRequest, got " + type(value).__name__]
|
|
2862
|
+
|
|
2863
|
+
return [True, ""]
|
|
2864
|
+
|
|
2865
|
+
def __post_init__(self):
|
|
2866
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2867
|
+
is_valid, error_str = self.validate_target_grip_width(self.target_grip_width)
|
|
2868
|
+
if not is_valid:
|
|
2869
|
+
raise TypeError(error_str)
|
|
2870
|
+
is_valid, error_str = self.validate_control_kind(self.control_kind)
|
|
2871
|
+
if not is_valid:
|
|
2872
|
+
raise TypeError(error_str)
|
|
2873
|
+
|
|
2874
|
+
def parse_schunk_e_gx_gripper_command_request(data: object):
|
|
2875
|
+
return SchunkEGxGripperCommandRequest(
|
|
2876
|
+
target_grip_width=parse_linear_unit(data["target_grip_width"]) if "target_grip_width" in data else None,
|
|
2877
|
+
control_kind=parse_schunk_e_gx_control_kind_enum(data["control_kind"]) if "control_kind" in data else None,
|
|
2878
|
+
)
|
|
2879
|
+
|
|
2880
|
+
def serialize_schunk_e_gx_gripper_command_request(data: SchunkEGxGripperCommandRequest) -> object:
|
|
2881
|
+
return {
|
|
2882
|
+
"target_grip_width": None if data.target_grip_width is None else serialize_linear_unit(data.target_grip_width),
|
|
2883
|
+
"control_kind": serialize_schunk_e_gx_control_kind_enum(data.control_kind),
|
|
2884
|
+
}
|
|
2885
|
+
|
|
2666
2886
|
@dataclass
|
|
2667
2887
|
class PlanesPaginatedResponse:
|
|
2668
2888
|
"""Paginated response containing plane data"""
|
|
@@ -2843,16 +3063,18 @@ class GripperCommandRequest:
|
|
|
2843
3063
|
"""
|
|
2844
3064
|
kind: Union[GripperKindEnum, None] = None
|
|
2845
3065
|
onrobot_2fg7: Union[OnRobot2FG7GripperCommandRequest, None] = None
|
|
3066
|
+
onrobot_2fg14: Union[OnRobot2FG14GripperCommandRequest, None] = None
|
|
2846
3067
|
onrobot_3fg15: Union[OnRobot3FG15GripperCommandRequest, None] = None
|
|
2847
3068
|
dh_ag: Union[DHAGGripperCommandRequest, None] = None
|
|
2848
3069
|
dh_pgc: Union[DHPGCGripperCommandRequest, None] = None
|
|
2849
3070
|
dh_cgi: Union[DHCGIGripperCommandRequest, None] = None
|
|
3071
|
+
schunk_egx: Union[SchunkEGxGripperCommandRequest, None] = None
|
|
2850
3072
|
|
|
2851
3073
|
def validate_kind(self, value: GripperKindEnum) -> Tuple[bool, str]:
|
|
2852
3074
|
if value is None:
|
|
2853
3075
|
return [False, "kind is required for GripperCommandRequest"]
|
|
2854
3076
|
|
|
2855
|
-
if not ((isinstance(value, str) and GripperKindEnum in ['onrobot_2fg7', 'onrobot_3fg15', 'dh_ag', 'dh_pgc', 'dh_cgi', 'none_connected']) or isinstance(value, GripperKindEnum)):
|
|
3077
|
+
if not ((isinstance(value, str) and GripperKindEnum in ['onrobot_2fg7', 'onrobot_2fg14', 'onrobot_3fg15', 'dh_ag', 'dh_pgc', 'dh_cgi', 'schunk_egx', 'none_connected']) or isinstance(value, GripperKindEnum)):
|
|
2856
3078
|
return [False, "kind must be of type GripperKindEnum for GripperCommandRequest, got " + type(value).__name__]
|
|
2857
3079
|
|
|
2858
3080
|
return [True, ""]
|
|
@@ -2866,6 +3088,15 @@ class GripperCommandRequest:
|
|
|
2866
3088
|
|
|
2867
3089
|
return [True, ""]
|
|
2868
3090
|
|
|
3091
|
+
def validate_onrobot_2fg14(self, value: OnRobot2FG14GripperCommandRequest) -> Tuple[bool, str]:
|
|
3092
|
+
if value is None:
|
|
3093
|
+
return [True, ""]
|
|
3094
|
+
|
|
3095
|
+
if not isinstance(value, OnRobot2FG14GripperCommandRequest):
|
|
3096
|
+
return [False, "onrobot_2fg14 must be of type OnRobot2FG14GripperCommandRequest for GripperCommandRequest, got " + type(value).__name__]
|
|
3097
|
+
|
|
3098
|
+
return [True, ""]
|
|
3099
|
+
|
|
2869
3100
|
def validate_onrobot_3fg15(self, value: OnRobot3FG15GripperCommandRequest) -> Tuple[bool, str]:
|
|
2870
3101
|
if value is None:
|
|
2871
3102
|
return [True, ""]
|
|
@@ -2902,12 +3133,24 @@ class GripperCommandRequest:
|
|
|
2902
3133
|
|
|
2903
3134
|
return [True, ""]
|
|
2904
3135
|
|
|
3136
|
+
def validate_schunk_egx(self, value: SchunkEGxGripperCommandRequest) -> Tuple[bool, str]:
|
|
3137
|
+
if value is None:
|
|
3138
|
+
return [True, ""]
|
|
3139
|
+
|
|
3140
|
+
if not isinstance(value, SchunkEGxGripperCommandRequest):
|
|
3141
|
+
return [False, "schunk_egx must be of type SchunkEGxGripperCommandRequest for GripperCommandRequest, got " + type(value).__name__]
|
|
3142
|
+
|
|
3143
|
+
return [True, ""]
|
|
3144
|
+
|
|
2905
3145
|
def __post_init__(self):
|
|
2906
3146
|
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2907
3147
|
is_valid, error_str = self.validate_kind(self.kind)
|
|
2908
3148
|
if not is_valid:
|
|
2909
3149
|
raise TypeError(error_str)
|
|
2910
3150
|
is_valid, error_str = self.validate_onrobot_2fg7(self.onrobot_2fg7)
|
|
3151
|
+
if not is_valid:
|
|
3152
|
+
raise TypeError(error_str)
|
|
3153
|
+
is_valid, error_str = self.validate_onrobot_2fg14(self.onrobot_2fg14)
|
|
2911
3154
|
if not is_valid:
|
|
2912
3155
|
raise TypeError(error_str)
|
|
2913
3156
|
is_valid, error_str = self.validate_onrobot_3fg15(self.onrobot_3fg15)
|
|
@@ -2922,25 +3165,32 @@ class GripperCommandRequest:
|
|
|
2922
3165
|
is_valid, error_str = self.validate_dh_cgi(self.dh_cgi)
|
|
2923
3166
|
if not is_valid:
|
|
2924
3167
|
raise TypeError(error_str)
|
|
3168
|
+
is_valid, error_str = self.validate_schunk_egx(self.schunk_egx)
|
|
3169
|
+
if not is_valid:
|
|
3170
|
+
raise TypeError(error_str)
|
|
2925
3171
|
|
|
2926
3172
|
def parse_gripper_command_request(data: object):
|
|
2927
3173
|
return GripperCommandRequest(
|
|
2928
3174
|
kind=parse_gripper_kind_enum(data["kind"]) if "kind" in data else None,
|
|
2929
3175
|
onrobot_2fg7=parse_on_robot_2_fg_7_gripper_command_request(data["onrobot_2fg7"]) if "onrobot_2fg7" in data else None,
|
|
3176
|
+
onrobot_2fg14=parse_on_robot_2_fg_14_gripper_command_request(data["onrobot_2fg14"]) if "onrobot_2fg14" in data else None,
|
|
2930
3177
|
onrobot_3fg15=parse_on_robot_3_fg_15_gripper_command_request(data["onrobot_3fg15"]) if "onrobot_3fg15" in data else None,
|
|
2931
3178
|
dh_ag=parse_dhag_gripper_command_request(data["dh_ag"]) if "dh_ag" in data else None,
|
|
2932
3179
|
dh_pgc=parse_dhpgc_gripper_command_request(data["dh_pgc"]) if "dh_pgc" in data else None,
|
|
2933
3180
|
dh_cgi=parse_dhcgi_gripper_command_request(data["dh_cgi"]) if "dh_cgi" in data else None,
|
|
3181
|
+
schunk_egx=parse_schunk_e_gx_gripper_command_request(data["schunk_egx"]) if "schunk_egx" in data else None,
|
|
2934
3182
|
)
|
|
2935
3183
|
|
|
2936
3184
|
def serialize_gripper_command_request(data: GripperCommandRequest) -> object:
|
|
2937
3185
|
return {
|
|
2938
3186
|
"kind": serialize_gripper_kind_enum(data.kind),
|
|
2939
3187
|
"onrobot_2fg7": None if data.onrobot_2fg7 is None else serialize_on_robot_2_fg_7_gripper_command_request(data.onrobot_2fg7),
|
|
3188
|
+
"onrobot_2fg14": None if data.onrobot_2fg14 is None else serialize_on_robot_2_fg_14_gripper_command_request(data.onrobot_2fg14),
|
|
2940
3189
|
"onrobot_3fg15": None if data.onrobot_3fg15 is None else serialize_on_robot_3_fg_15_gripper_command_request(data.onrobot_3fg15),
|
|
2941
3190
|
"dh_ag": None if data.dh_ag is None else serialize_dhag_gripper_command_request(data.dh_ag),
|
|
2942
3191
|
"dh_pgc": None if data.dh_pgc is None else serialize_dhpgc_gripper_command_request(data.dh_pgc),
|
|
2943
3192
|
"dh_cgi": None if data.dh_cgi is None else serialize_dhcgi_gripper_command_request(data.dh_cgi),
|
|
3193
|
+
"schunk_egx": None if data.schunk_egx is None else serialize_schunk_e_gx_gripper_command_request(data.schunk_egx),
|
|
2944
3194
|
}
|
|
2945
3195
|
|
|
2946
3196
|
@dataclass
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{standardbots-2.20240723.13 → standardbots-2.20240924.1}/standardbots.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{standardbots-2.20240723.13 → standardbots-2.20240924.1}/standardbots.egg-info/top_level.txt
RENAMED
|
File without changes
|