standardbots 2.0.0.dev1737492400__py3-none-any.whl → 2.0.0.dev1740502639__py3-none-any.whl
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/auto_generated/apis.py +185 -14
- standardbots/auto_generated/models.py +393 -45
- {standardbots-2.0.0.dev1737492400.dist-info → standardbots-2.0.0.dev1740502639.dist-info}/METADATA +1 -1
- standardbots-2.0.0.dev1740502639.dist-info/RECORD +11 -0
- {standardbots-2.0.0.dev1737492400.dist-info → standardbots-2.0.0.dev1740502639.dist-info}/WHEEL +1 -1
- standardbots-2.0.0.dev1737492400.dist-info/RECORD +0 -11
- {standardbots-2.0.0.dev1737492400.dist-info → standardbots-2.0.0.dev1740502639.dist-info}/top_level.txt +0 -0
|
@@ -76,6 +76,95 @@ class RequestManager:
|
|
|
76
76
|
|
|
77
77
|
class Default:
|
|
78
78
|
_request_manager: RequestManager
|
|
79
|
+
class Calibration:
|
|
80
|
+
def __init__(self, request_manager: RequestManager):
|
|
81
|
+
self._request_manager = request_manager
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def get_active_calibration(
|
|
85
|
+
self,
|
|
86
|
+
) -> Response[
|
|
87
|
+
Union[
|
|
88
|
+
models.ActiveCalibrationContainer,
|
|
89
|
+
models.ErrorResponse,
|
|
90
|
+
None
|
|
91
|
+
],
|
|
92
|
+
models.ActiveCalibrationContainer
|
|
93
|
+
]:
|
|
94
|
+
"""
|
|
95
|
+
Get the active calibration for the robot.
|
|
96
|
+
|
|
97
|
+
"""
|
|
98
|
+
path = "/api/v1/calibration/active"
|
|
99
|
+
try:
|
|
100
|
+
response = self._request_manager.request(
|
|
101
|
+
"GET",
|
|
102
|
+
path,
|
|
103
|
+
headers=self._request_manager.json_headers(),
|
|
104
|
+
)
|
|
105
|
+
parsed = None
|
|
106
|
+
if response.status == 200:
|
|
107
|
+
parsed = models.parse_active_calibration_container(json.loads(response.data))
|
|
108
|
+
|
|
109
|
+
is_user_error = response.status >= 400 and response.status <= 500
|
|
110
|
+
is_unavailable = response.status == 503
|
|
111
|
+
if parsed is None and (is_user_error or is_unavailable):
|
|
112
|
+
parsed = models.parse_error_response(json.loads(response.data))
|
|
113
|
+
|
|
114
|
+
return Response(
|
|
115
|
+
parsed,
|
|
116
|
+
response.status,
|
|
117
|
+
response
|
|
118
|
+
)
|
|
119
|
+
except urllib3.exceptions.MaxRetryError:
|
|
120
|
+
return Response(
|
|
121
|
+
models.ErrorResponse(
|
|
122
|
+
error=models.ErrorEnum.InternalServerError,
|
|
123
|
+
message="Connection Refused"
|
|
124
|
+
),
|
|
125
|
+
503,
|
|
126
|
+
None
|
|
127
|
+
)
|
|
128
|
+
def set_active_calibration(
|
|
129
|
+
self,
|
|
130
|
+
body: models.ActiveCalibrationContainer,
|
|
131
|
+
) -> Response[
|
|
132
|
+
None,
|
|
133
|
+
None
|
|
134
|
+
]:
|
|
135
|
+
"""
|
|
136
|
+
Set the active calibration for the robot.
|
|
137
|
+
|
|
138
|
+
"""
|
|
139
|
+
path = "/api/v1/calibration/active"
|
|
140
|
+
try:
|
|
141
|
+
response = self._request_manager.request(
|
|
142
|
+
"POST",
|
|
143
|
+
path,
|
|
144
|
+
headers=self._request_manager.json_headers(),
|
|
145
|
+
body=json.dumps(models.serialize_active_calibration_container(body)),
|
|
146
|
+
)
|
|
147
|
+
parsed = None
|
|
148
|
+
|
|
149
|
+
is_user_error = response.status >= 400 and response.status <= 500
|
|
150
|
+
is_unavailable = response.status == 503
|
|
151
|
+
if parsed is None and (is_user_error or is_unavailable):
|
|
152
|
+
parsed = models.parse_error_response(json.loads(response.data))
|
|
153
|
+
|
|
154
|
+
return Response(
|
|
155
|
+
parsed,
|
|
156
|
+
response.status,
|
|
157
|
+
response
|
|
158
|
+
)
|
|
159
|
+
except urllib3.exceptions.MaxRetryError:
|
|
160
|
+
return Response(
|
|
161
|
+
models.ErrorResponse(
|
|
162
|
+
error=models.ErrorEnum.InternalServerError,
|
|
163
|
+
message="Connection Refused"
|
|
164
|
+
),
|
|
165
|
+
503,
|
|
166
|
+
None
|
|
167
|
+
)
|
|
79
168
|
class Equipment:
|
|
80
169
|
def __init__(self, request_manager: RequestManager):
|
|
81
170
|
self._request_manager = request_manager
|
|
@@ -83,7 +172,7 @@ class Default:
|
|
|
83
172
|
def onrobot_2fg7_move(
|
|
84
173
|
self,
|
|
85
174
|
value: Union[int, float],
|
|
86
|
-
direction: Union[str, models.LinearGripDirectionEnum] = models.LinearGripDirectionEnum.
|
|
175
|
+
direction: Union[str, models.LinearGripDirectionEnum] = models.LinearGripDirectionEnum.Internal,
|
|
87
176
|
unit_kind: Union[str, models.LinearUnitKind] = models.LinearUnitKind.Millimeters
|
|
88
177
|
):
|
|
89
178
|
"""Move the robot to the onrobot_2fg7 position.
|
|
@@ -105,7 +194,7 @@ class Default:
|
|
|
105
194
|
def onrobot_2fg7_grip(
|
|
106
195
|
self,
|
|
107
196
|
value: Union[int, float],
|
|
108
|
-
direction: Union[str, models.LinearGripDirectionEnum] = models.LinearGripDirectionEnum.
|
|
197
|
+
direction: Union[str, models.LinearGripDirectionEnum] = models.LinearGripDirectionEnum.Internal,
|
|
109
198
|
unit_kind: Union[str, models.LinearUnitKind] = models.LinearUnitKind.Millimeters,
|
|
110
199
|
force: Union[int, float] = 0.0,
|
|
111
200
|
force_unit: Union[str, models.ForceUnitKind] = models.ForceUnitKind.Newtons
|
|
@@ -382,12 +471,14 @@ class Default:
|
|
|
382
471
|
None
|
|
383
472
|
)
|
|
384
473
|
|
|
474
|
+
calibration: Calibration
|
|
385
475
|
equipment: Equipment
|
|
386
476
|
sensors: Sensors
|
|
387
477
|
space: Space
|
|
388
478
|
|
|
389
479
|
def __init__(self, request_manager: RequestManager):
|
|
390
480
|
self._request_manager = request_manager
|
|
481
|
+
self.calibration = Default.Calibration(request_manager)
|
|
391
482
|
self.equipment = Default.Equipment(request_manager)
|
|
392
483
|
self.sensors = Default.Sensors(request_manager)
|
|
393
484
|
self.space = Default.Space(request_manager)
|
|
@@ -425,6 +516,7 @@ class Movement:
|
|
|
425
516
|
Union[
|
|
426
517
|
models.BrakesState,
|
|
427
518
|
models.ErrorResponse,
|
|
519
|
+
models.ErrorResponse,
|
|
428
520
|
None
|
|
429
521
|
],
|
|
430
522
|
models.BrakesState
|
|
@@ -444,6 +536,8 @@ class Movement:
|
|
|
444
536
|
parsed = None
|
|
445
537
|
if response.status == 200:
|
|
446
538
|
parsed = models.parse_brakes_state(json.loads(response.data))
|
|
539
|
+
if response.status == 500:
|
|
540
|
+
parsed = models.parse_error_response(json.loads(response.data))
|
|
447
541
|
|
|
448
542
|
is_user_error = response.status >= 400 and response.status <= 500
|
|
449
543
|
is_unavailable = response.status == 503
|
|
@@ -713,7 +807,7 @@ class Camera:
|
|
|
713
807
|
None
|
|
714
808
|
]:
|
|
715
809
|
"""
|
|
716
|
-
Retrieve the latest RGB frame from the camera. In JPEG format.
|
|
810
|
+
Retrieve the latest RGB frame from the camera as base64 string. In JPEG format.
|
|
717
811
|
"""
|
|
718
812
|
path = "/api/v1/camera/frame/rgb"
|
|
719
813
|
try:
|
|
@@ -747,8 +841,12 @@ class Camera:
|
|
|
747
841
|
def get_camera_intrinsics_color(
|
|
748
842
|
self,
|
|
749
843
|
) -> Response[
|
|
750
|
-
|
|
751
|
-
|
|
844
|
+
Union[
|
|
845
|
+
models.CameraIntrinsics,
|
|
846
|
+
models.ErrorResponse,
|
|
847
|
+
None
|
|
848
|
+
],
|
|
849
|
+
models.CameraIntrinsics
|
|
752
850
|
]:
|
|
753
851
|
"""
|
|
754
852
|
Retrieve the intrinsic parameters for the color camera.
|
|
@@ -761,6 +859,8 @@ class Camera:
|
|
|
761
859
|
headers=self._request_manager.json_headers(),
|
|
762
860
|
)
|
|
763
861
|
parsed = None
|
|
862
|
+
if response.status == 200:
|
|
863
|
+
parsed = models.parse_camera_intrinsics(json.loads(response.data))
|
|
764
864
|
|
|
765
865
|
is_user_error = response.status >= 400 and response.status <= 500
|
|
766
866
|
is_unavailable = response.status == 503
|
|
@@ -788,7 +888,7 @@ class Camera:
|
|
|
788
888
|
None
|
|
789
889
|
]:
|
|
790
890
|
"""
|
|
791
|
-
Retrieve the latest RGB frame from the camera.
|
|
891
|
+
Retrieve the latest RGB frame from the camera as base64 string. In JPEG format.
|
|
792
892
|
"""
|
|
793
893
|
path = "/api/v1/camera/stream/rgb"
|
|
794
894
|
try:
|
|
@@ -863,14 +963,64 @@ class Camera:
|
|
|
863
963
|
503,
|
|
864
964
|
None
|
|
865
965
|
)
|
|
966
|
+
class Status:
|
|
967
|
+
def __init__(self, request_manager: RequestManager):
|
|
968
|
+
self._request_manager = request_manager
|
|
969
|
+
|
|
970
|
+
|
|
971
|
+
def get_camera_status(
|
|
972
|
+
self,
|
|
973
|
+
) -> Response[
|
|
974
|
+
Union[
|
|
975
|
+
models.CameraStatus,
|
|
976
|
+
models.ErrorResponse,
|
|
977
|
+
None
|
|
978
|
+
],
|
|
979
|
+
models.CameraStatus
|
|
980
|
+
]:
|
|
981
|
+
"""
|
|
982
|
+
Retrieve the current status of the camera.
|
|
983
|
+
"""
|
|
984
|
+
path = "/api/v1/camera/status"
|
|
985
|
+
try:
|
|
986
|
+
response = self._request_manager.request(
|
|
987
|
+
"GET",
|
|
988
|
+
path,
|
|
989
|
+
headers=self._request_manager.json_headers(),
|
|
990
|
+
)
|
|
991
|
+
parsed = None
|
|
992
|
+
if response.status == 200:
|
|
993
|
+
parsed = models.parse_camera_status(json.loads(response.data))
|
|
994
|
+
|
|
995
|
+
is_user_error = response.status >= 400 and response.status <= 500
|
|
996
|
+
is_unavailable = response.status == 503
|
|
997
|
+
if parsed is None and (is_user_error or is_unavailable):
|
|
998
|
+
parsed = models.parse_error_response(json.loads(response.data))
|
|
999
|
+
|
|
1000
|
+
return Response(
|
|
1001
|
+
parsed,
|
|
1002
|
+
response.status,
|
|
1003
|
+
response
|
|
1004
|
+
)
|
|
1005
|
+
except urllib3.exceptions.MaxRetryError:
|
|
1006
|
+
return Response(
|
|
1007
|
+
models.ErrorResponse(
|
|
1008
|
+
error=models.ErrorEnum.InternalServerError,
|
|
1009
|
+
message="Connection Refused"
|
|
1010
|
+
),
|
|
1011
|
+
503,
|
|
1012
|
+
None
|
|
1013
|
+
)
|
|
866
1014
|
|
|
867
1015
|
data: Data
|
|
868
1016
|
settings: Settings
|
|
1017
|
+
status: Status
|
|
869
1018
|
|
|
870
1019
|
def __init__(self, request_manager: RequestManager):
|
|
871
1020
|
self._request_manager = request_manager
|
|
872
1021
|
self.data = Camera.Data(request_manager)
|
|
873
1022
|
self.settings = Camera.Settings(request_manager)
|
|
1023
|
+
self.status = Camera.Status(request_manager)
|
|
874
1024
|
|
|
875
1025
|
class Faults:
|
|
876
1026
|
_request_manager: RequestManager
|
|
@@ -1927,8 +2077,13 @@ class RoutineEditor:
|
|
|
1927
2077
|
body: models.PlayRoutineRequest,
|
|
1928
2078
|
routine_id: str,
|
|
1929
2079
|
) -> Response[
|
|
1930
|
-
|
|
1931
|
-
|
|
2080
|
+
Union[
|
|
2081
|
+
models.PlayRoutineResponse,
|
|
2082
|
+
models.ErrorResponse,
|
|
2083
|
+
models.ErrorResponse,
|
|
2084
|
+
None
|
|
2085
|
+
],
|
|
2086
|
+
models.PlayRoutineResponse
|
|
1932
2087
|
]:
|
|
1933
2088
|
"""
|
|
1934
2089
|
Play a routine
|
|
@@ -1943,6 +2098,10 @@ class RoutineEditor:
|
|
|
1943
2098
|
body=json.dumps(models.serialize_play_routine_request(body)),
|
|
1944
2099
|
)
|
|
1945
2100
|
parsed = None
|
|
2101
|
+
if response.status == 200:
|
|
2102
|
+
parsed = models.parse_play_routine_response(json.loads(response.data))
|
|
2103
|
+
if response.status == 400:
|
|
2104
|
+
parsed = models.parse_error_response(json.loads(response.data))
|
|
1946
2105
|
|
|
1947
2106
|
is_user_error = response.status >= 400 and response.status <= 500
|
|
1948
2107
|
is_unavailable = response.status == 503
|
|
@@ -1967,11 +2126,15 @@ class RoutineEditor:
|
|
|
1967
2126
|
self,
|
|
1968
2127
|
routine_id: str,
|
|
1969
2128
|
) -> Response[
|
|
1970
|
-
|
|
2129
|
+
Union[
|
|
2130
|
+
models.ErrorResponse,
|
|
2131
|
+
models.ErrorResponse,
|
|
2132
|
+
None
|
|
2133
|
+
],
|
|
1971
2134
|
None
|
|
1972
2135
|
]:
|
|
1973
2136
|
"""
|
|
1974
|
-
Pause a routine
|
|
2137
|
+
Pause a routine. Routine must be running.
|
|
1975
2138
|
"""
|
|
1976
2139
|
path = "/api/v1/routine-editor/routines/{routine_id}/pause"
|
|
1977
2140
|
path = path.replace("{routine_id}", str(routine_id))
|
|
@@ -1982,6 +2145,8 @@ class RoutineEditor:
|
|
|
1982
2145
|
headers=self._request_manager.json_headers(),
|
|
1983
2146
|
)
|
|
1984
2147
|
parsed = None
|
|
2148
|
+
if response.status == 400:
|
|
2149
|
+
parsed = models.parse_error_response(json.loads(response.data))
|
|
1985
2150
|
|
|
1986
2151
|
is_user_error = response.status >= 400 and response.status <= 500
|
|
1987
2152
|
is_unavailable = response.status == 503
|
|
@@ -2005,11 +2170,15 @@ class RoutineEditor:
|
|
|
2005
2170
|
def stop(
|
|
2006
2171
|
self,
|
|
2007
2172
|
) -> Response[
|
|
2008
|
-
|
|
2173
|
+
Union[
|
|
2174
|
+
models.ErrorResponse,
|
|
2175
|
+
models.ErrorResponse,
|
|
2176
|
+
None
|
|
2177
|
+
],
|
|
2009
2178
|
None
|
|
2010
2179
|
]:
|
|
2011
2180
|
"""
|
|
2012
|
-
Stop running routine and all ongoing motions
|
|
2181
|
+
Stop running routine and all ongoing motions. Routine must be running.
|
|
2013
2182
|
"""
|
|
2014
2183
|
path = "/api/v1/routine-editor/stop"
|
|
2015
2184
|
try:
|
|
@@ -2019,6 +2188,8 @@ class RoutineEditor:
|
|
|
2019
2188
|
headers=self._request_manager.json_headers(),
|
|
2020
2189
|
)
|
|
2021
2190
|
parsed = None
|
|
2191
|
+
if response.status == 400:
|
|
2192
|
+
parsed = models.parse_error_response(json.loads(response.data))
|
|
2022
2193
|
|
|
2023
2194
|
is_user_error = response.status >= 400 and response.status <= 500
|
|
2024
2195
|
is_unavailable = response.status == 503
|
|
@@ -2293,7 +2464,7 @@ class RoutineEditor:
|
|
|
2293
2464
|
models.RuntimeVariable
|
|
2294
2465
|
]:
|
|
2295
2466
|
"""
|
|
2296
|
-
Returns current state of a variable
|
|
2467
|
+
Returns current state of a variable. Routine must be running.
|
|
2297
2468
|
"""
|
|
2298
2469
|
path = "/api/v1/routine-editor/variables/{variable_name}"
|
|
2299
2470
|
path = path.replace("{variable_name}", str(variable_name))
|
|
@@ -2339,7 +2510,7 @@ class RoutineEditor:
|
|
|
2339
2510
|
models.RuntimeVariable
|
|
2340
2511
|
]:
|
|
2341
2512
|
"""
|
|
2342
|
-
Update the value of a variable
|
|
2513
|
+
Update the value of a variable. Routine must be running.
|
|
2343
2514
|
"""
|
|
2344
2515
|
path = "/api/v1/routine-editor/variables/{variable_name}"
|
|
2345
2516
|
path = path.replace("{variable_name}", str(variable_name))
|
|
@@ -551,6 +551,51 @@ def serialize_camera_settings(data: CameraSettings) -> object:
|
|
|
551
551
|
"autoWhiteBalance": None if data.autoWhiteBalance is None else serialize_bool(data.autoWhiteBalance),
|
|
552
552
|
}
|
|
553
553
|
|
|
554
|
+
@dataclass
|
|
555
|
+
class CameraStatus:
|
|
556
|
+
"""Current camera status."""
|
|
557
|
+
connected: Union[bool, None] = None
|
|
558
|
+
message: Union[str, None] = None
|
|
559
|
+
|
|
560
|
+
def validate_connected(self, value: bool) -> Tuple[bool, str]:
|
|
561
|
+
if value is None:
|
|
562
|
+
return [True, ""]
|
|
563
|
+
|
|
564
|
+
if not isinstance(value, bool):
|
|
565
|
+
return [False, "connected must be of type bool for CameraStatus, got " + type(value).__name__]
|
|
566
|
+
|
|
567
|
+
return [True, ""]
|
|
568
|
+
|
|
569
|
+
def validate_message(self, value: str) -> Tuple[bool, str]:
|
|
570
|
+
if value is None:
|
|
571
|
+
return [True, ""]
|
|
572
|
+
|
|
573
|
+
if not isinstance(value, str):
|
|
574
|
+
return [False, "message must be of type str for CameraStatus, got " + type(value).__name__]
|
|
575
|
+
|
|
576
|
+
return [True, ""]
|
|
577
|
+
|
|
578
|
+
def __post_init__(self):
|
|
579
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
580
|
+
is_valid, error_str = self.validate_connected(self.connected)
|
|
581
|
+
if not is_valid:
|
|
582
|
+
raise TypeError(error_str)
|
|
583
|
+
is_valid, error_str = self.validate_message(self.message)
|
|
584
|
+
if not is_valid:
|
|
585
|
+
raise TypeError(error_str)
|
|
586
|
+
|
|
587
|
+
def parse_camera_status(data: object):
|
|
588
|
+
return CameraStatus(
|
|
589
|
+
connected=parse_bool(data["connected"]) if "connected" in data and data.get("connected") is not None else None,
|
|
590
|
+
message=parse_str(data["message"]) if "message" in data and data.get("message") is not None else None,
|
|
591
|
+
)
|
|
592
|
+
|
|
593
|
+
def serialize_camera_status(data: CameraStatus) -> object:
|
|
594
|
+
return {
|
|
595
|
+
"connected": None if data.connected is None else serialize_bool(data.connected),
|
|
596
|
+
"message": None if data.message is None else serialize_str(data.message),
|
|
597
|
+
}
|
|
598
|
+
|
|
554
599
|
@dataclass
|
|
555
600
|
class CartesianPose:
|
|
556
601
|
"""Cartesian pose
|
|
@@ -1089,6 +1134,16 @@ class ErrorEnum(Enum):
|
|
|
1089
1134
|
"""Space specified was invalid or not found"""
|
|
1090
1135
|
InvalidParameters = "invalid_parameters"
|
|
1091
1136
|
"""Parameters are invalid"""
|
|
1137
|
+
RoutineDoesNotExist = "routine_does_not_exist"
|
|
1138
|
+
"""Routine does not exist"""
|
|
1139
|
+
CannotPlayRoutine = "cannot_play_routine"
|
|
1140
|
+
"""Routine is not in the correct state to play"""
|
|
1141
|
+
RoutineMustBePlaying = "routine_must_be_playing"
|
|
1142
|
+
"""Routine must be playing"""
|
|
1143
|
+
CannotChangeRosState = "cannot_change_ros_state"
|
|
1144
|
+
"""Cannot change ROS state"""
|
|
1145
|
+
IoSafeguardError = "io_safeguard_error"
|
|
1146
|
+
"""Cannot change IO state because of safeguard"""
|
|
1092
1147
|
|
|
1093
1148
|
def parse_error_enum(data: object) -> ErrorEnum:
|
|
1094
1149
|
return ErrorEnum(data)
|
|
@@ -1202,6 +1257,14 @@ def serialize_euler_pose(data: EulerPose) -> object:
|
|
|
1202
1257
|
"rz": None if data.rz is None else serialize_f_64(data.rz),
|
|
1203
1258
|
}
|
|
1204
1259
|
|
|
1260
|
+
FloatList = List[float]
|
|
1261
|
+
|
|
1262
|
+
def parse_float_list(data: object) -> FloatList:
|
|
1263
|
+
return [parse_f_64(item) for item in data]
|
|
1264
|
+
|
|
1265
|
+
def serialize_float_list(data: FloatList) -> List[object]:
|
|
1266
|
+
return [serialize_f_64(item) for item in data]
|
|
1267
|
+
|
|
1205
1268
|
class ForceUnitKind(Enum):
|
|
1206
1269
|
Newtons = "newtons"
|
|
1207
1270
|
"""Enum Newtons = `newtons`"""
|
|
@@ -1435,10 +1498,10 @@ def serialize_joint_state_disturbance(data: JointStateDisturbance) -> object:
|
|
|
1435
1498
|
}
|
|
1436
1499
|
|
|
1437
1500
|
class LinearGripDirectionEnum(Enum):
|
|
1438
|
-
|
|
1439
|
-
"""
|
|
1440
|
-
|
|
1441
|
-
"""Grip
|
|
1501
|
+
Internal = "internal"
|
|
1502
|
+
"""Grip object on the inside of gripper fingers. Measure grip position based on interior of gripper fingers and exterior of object"""
|
|
1503
|
+
External = "external"
|
|
1504
|
+
"""Grip object on the outside of gripper fingers. Measure grip position based on exterior of gripper fingers and interior of object"""
|
|
1442
1505
|
|
|
1443
1506
|
def parse_linear_grip_direction_enum(data: object) -> LinearGripDirectionEnum:
|
|
1444
1507
|
return LinearGripDirectionEnum(data)
|
|
@@ -1531,10 +1594,10 @@ def serialize_on_robot_3_fg_15_control_kind_enum(data: Union[OnRobot3FG15Control
|
|
|
1531
1594
|
return OnRobot3FG15ControlKindEnum(data).value
|
|
1532
1595
|
|
|
1533
1596
|
class OnRobotGripKindEnum(Enum):
|
|
1534
|
-
|
|
1535
|
-
"""Enum
|
|
1536
|
-
|
|
1537
|
-
"""Enum
|
|
1597
|
+
Internal = "internal"
|
|
1598
|
+
"""Enum Internal = `internal`"""
|
|
1599
|
+
External = "external"
|
|
1600
|
+
"""Enum External = `external`"""
|
|
1538
1601
|
|
|
1539
1602
|
def parse_on_robot_grip_kind_enum(data: object) -> OnRobotGripKindEnum:
|
|
1540
1603
|
return OnRobotGripKindEnum(data)
|
|
@@ -2685,36 +2748,6 @@ def serialize_brakes_state(data: BrakesState) -> object:
|
|
|
2685
2748
|
"state": serialize_brakes_state_enum(data.state),
|
|
2686
2749
|
}
|
|
2687
2750
|
|
|
2688
|
-
@dataclass
|
|
2689
|
-
class CameraIntrinsicsResponse:
|
|
2690
|
-
"""Response with intrinsic parameters of the camera."""
|
|
2691
|
-
intrinsics: Union[CameraIntrinsics, None] = None
|
|
2692
|
-
|
|
2693
|
-
def validate_intrinsics(self, value: CameraIntrinsics) -> Tuple[bool, str]:
|
|
2694
|
-
if value is None:
|
|
2695
|
-
return [True, ""]
|
|
2696
|
-
|
|
2697
|
-
if not isinstance(value, CameraIntrinsics):
|
|
2698
|
-
return [False, "intrinsics must be of type CameraIntrinsics for CameraIntrinsicsResponse, got " + type(value).__name__]
|
|
2699
|
-
|
|
2700
|
-
return [True, ""]
|
|
2701
|
-
|
|
2702
|
-
def __post_init__(self):
|
|
2703
|
-
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2704
|
-
is_valid, error_str = self.validate_intrinsics(self.intrinsics)
|
|
2705
|
-
if not is_valid:
|
|
2706
|
-
raise TypeError(error_str)
|
|
2707
|
-
|
|
2708
|
-
def parse_camera_intrinsics_response(data: object):
|
|
2709
|
-
return CameraIntrinsicsResponse(
|
|
2710
|
-
intrinsics=parse_camera_intrinsics(data["intrinsics"]) if "intrinsics" in data and data.get("intrinsics") is not None else None,
|
|
2711
|
-
)
|
|
2712
|
-
|
|
2713
|
-
def serialize_camera_intrinsics_response(data: CameraIntrinsicsResponse) -> object:
|
|
2714
|
-
return {
|
|
2715
|
-
"intrinsics": None if data.intrinsics is None else serialize_camera_intrinsics(data.intrinsics),
|
|
2716
|
-
}
|
|
2717
|
-
|
|
2718
2751
|
@dataclass
|
|
2719
2752
|
class CameraFrameRequest:
|
|
2720
2753
|
"""Request for a single camera frame. In JPEG format."""
|
|
@@ -3039,7 +3072,7 @@ class ErrorResponse:
|
|
|
3039
3072
|
if value is None:
|
|
3040
3073
|
return [False, "error is required for ErrorResponse"]
|
|
3041
3074
|
|
|
3042
|
-
if not ((isinstance(value, str) and ErrorEnum in ['authorization_required', 'routine_must_be_running', 'api_control_required', 'robot_brakes_disengage_failed', 'robot_brakes_engage_failed', 'request_failed_validation', 'robot_not_idle', 'brakes_must_be_engaged', 'brakes_must_be_disengaged', 'equipment_no_matching', 'service_initializing', 'camera_disconnected', 'settings_validation_error', 'settings_timeout', 'internal_server_error', 'recovery_error', 'not_found', 'invalid_space_specified', 'invalid_parameters']) or isinstance(value, ErrorEnum)):
|
|
3075
|
+
if not ((isinstance(value, str) and ErrorEnum in ['authorization_required', 'routine_must_be_running', 'api_control_required', 'robot_brakes_disengage_failed', 'robot_brakes_engage_failed', 'request_failed_validation', 'robot_not_idle', 'brakes_must_be_engaged', 'brakes_must_be_disengaged', 'equipment_no_matching', 'service_initializing', 'camera_disconnected', 'settings_validation_error', 'settings_timeout', 'internal_server_error', 'recovery_error', 'not_found', 'invalid_space_specified', 'invalid_parameters', 'routine_does_not_exist', 'cannot_play_routine', 'routine_must_be_playing', 'cannot_change_ros_state', 'io_safeguard_error']) or isinstance(value, ErrorEnum)):
|
|
3043
3076
|
return [False, "error must be of type ErrorEnum for ErrorResponse, got " + type(value).__name__]
|
|
3044
3077
|
|
|
3045
3078
|
return [True, ""]
|
|
@@ -3135,6 +3168,201 @@ def serialize_cartesian_pose_request(data: CartesianPoseRequest) -> object:
|
|
|
3135
3168
|
"pose": serialize_euler_pose(data.pose),
|
|
3136
3169
|
}
|
|
3137
3170
|
|
|
3171
|
+
@dataclass
|
|
3172
|
+
class URDFParameters:
|
|
3173
|
+
"""The URDF parameters for the robot"""
|
|
3174
|
+
joint0_xyz: Union[FloatList, None] = None
|
|
3175
|
+
joint0_rpy: Union[FloatList, None] = None
|
|
3176
|
+
joint1_xyz: Union[FloatList, None] = None
|
|
3177
|
+
joint1_rpy: Union[FloatList, None] = None
|
|
3178
|
+
joint2_xyz: Union[FloatList, None] = None
|
|
3179
|
+
joint2_rpy: Union[FloatList, None] = None
|
|
3180
|
+
joint3_xyz: Union[FloatList, None] = None
|
|
3181
|
+
joint3_rpy: Union[FloatList, None] = None
|
|
3182
|
+
joint4_xyz: Union[FloatList, None] = None
|
|
3183
|
+
joint4_rpy: Union[FloatList, None] = None
|
|
3184
|
+
joint5_xyz: Union[FloatList, None] = None
|
|
3185
|
+
joint5_rpy: Union[FloatList, None] = None
|
|
3186
|
+
|
|
3187
|
+
def validate_joint0_xyz(self, value: FloatList) -> Tuple[bool, str]:
|
|
3188
|
+
if value is None:
|
|
3189
|
+
return [False, "joint0_xyz is required for URDFParameters"]
|
|
3190
|
+
|
|
3191
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3192
|
+
return [False, "joint0_xyz must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3193
|
+
|
|
3194
|
+
return [True, ""]
|
|
3195
|
+
|
|
3196
|
+
def validate_joint0_rpy(self, value: FloatList) -> Tuple[bool, str]:
|
|
3197
|
+
if value is None:
|
|
3198
|
+
return [False, "joint0_rpy is required for URDFParameters"]
|
|
3199
|
+
|
|
3200
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3201
|
+
return [False, "joint0_rpy must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3202
|
+
|
|
3203
|
+
return [True, ""]
|
|
3204
|
+
|
|
3205
|
+
def validate_joint1_xyz(self, value: FloatList) -> Tuple[bool, str]:
|
|
3206
|
+
if value is None:
|
|
3207
|
+
return [False, "joint1_xyz is required for URDFParameters"]
|
|
3208
|
+
|
|
3209
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3210
|
+
return [False, "joint1_xyz must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3211
|
+
|
|
3212
|
+
return [True, ""]
|
|
3213
|
+
|
|
3214
|
+
def validate_joint1_rpy(self, value: FloatList) -> Tuple[bool, str]:
|
|
3215
|
+
if value is None:
|
|
3216
|
+
return [False, "joint1_rpy is required for URDFParameters"]
|
|
3217
|
+
|
|
3218
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3219
|
+
return [False, "joint1_rpy must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3220
|
+
|
|
3221
|
+
return [True, ""]
|
|
3222
|
+
|
|
3223
|
+
def validate_joint2_xyz(self, value: FloatList) -> Tuple[bool, str]:
|
|
3224
|
+
if value is None:
|
|
3225
|
+
return [False, "joint2_xyz is required for URDFParameters"]
|
|
3226
|
+
|
|
3227
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3228
|
+
return [False, "joint2_xyz must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3229
|
+
|
|
3230
|
+
return [True, ""]
|
|
3231
|
+
|
|
3232
|
+
def validate_joint2_rpy(self, value: FloatList) -> Tuple[bool, str]:
|
|
3233
|
+
if value is None:
|
|
3234
|
+
return [False, "joint2_rpy is required for URDFParameters"]
|
|
3235
|
+
|
|
3236
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3237
|
+
return [False, "joint2_rpy must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3238
|
+
|
|
3239
|
+
return [True, ""]
|
|
3240
|
+
|
|
3241
|
+
def validate_joint3_xyz(self, value: FloatList) -> Tuple[bool, str]:
|
|
3242
|
+
if value is None:
|
|
3243
|
+
return [False, "joint3_xyz is required for URDFParameters"]
|
|
3244
|
+
|
|
3245
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3246
|
+
return [False, "joint3_xyz must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3247
|
+
|
|
3248
|
+
return [True, ""]
|
|
3249
|
+
|
|
3250
|
+
def validate_joint3_rpy(self, value: FloatList) -> Tuple[bool, str]:
|
|
3251
|
+
if value is None:
|
|
3252
|
+
return [False, "joint3_rpy is required for URDFParameters"]
|
|
3253
|
+
|
|
3254
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3255
|
+
return [False, "joint3_rpy must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3256
|
+
|
|
3257
|
+
return [True, ""]
|
|
3258
|
+
|
|
3259
|
+
def validate_joint4_xyz(self, value: FloatList) -> Tuple[bool, str]:
|
|
3260
|
+
if value is None:
|
|
3261
|
+
return [False, "joint4_xyz is required for URDFParameters"]
|
|
3262
|
+
|
|
3263
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3264
|
+
return [False, "joint4_xyz must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3265
|
+
|
|
3266
|
+
return [True, ""]
|
|
3267
|
+
|
|
3268
|
+
def validate_joint4_rpy(self, value: FloatList) -> Tuple[bool, str]:
|
|
3269
|
+
if value is None:
|
|
3270
|
+
return [False, "joint4_rpy is required for URDFParameters"]
|
|
3271
|
+
|
|
3272
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3273
|
+
return [False, "joint4_rpy must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3274
|
+
|
|
3275
|
+
return [True, ""]
|
|
3276
|
+
|
|
3277
|
+
def validate_joint5_xyz(self, value: FloatList) -> Tuple[bool, str]:
|
|
3278
|
+
if value is None:
|
|
3279
|
+
return [False, "joint5_xyz is required for URDFParameters"]
|
|
3280
|
+
|
|
3281
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3282
|
+
return [False, "joint5_xyz must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3283
|
+
|
|
3284
|
+
return [True, ""]
|
|
3285
|
+
|
|
3286
|
+
def validate_joint5_rpy(self, value: FloatList) -> Tuple[bool, str]:
|
|
3287
|
+
if value is None:
|
|
3288
|
+
return [False, "joint5_rpy is required for URDFParameters"]
|
|
3289
|
+
|
|
3290
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3291
|
+
return [False, "joint5_rpy must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3292
|
+
|
|
3293
|
+
return [True, ""]
|
|
3294
|
+
|
|
3295
|
+
def __post_init__(self):
|
|
3296
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3297
|
+
is_valid, error_str = self.validate_joint0_xyz(self.joint0_xyz)
|
|
3298
|
+
if not is_valid:
|
|
3299
|
+
raise TypeError(error_str)
|
|
3300
|
+
is_valid, error_str = self.validate_joint0_rpy(self.joint0_rpy)
|
|
3301
|
+
if not is_valid:
|
|
3302
|
+
raise TypeError(error_str)
|
|
3303
|
+
is_valid, error_str = self.validate_joint1_xyz(self.joint1_xyz)
|
|
3304
|
+
if not is_valid:
|
|
3305
|
+
raise TypeError(error_str)
|
|
3306
|
+
is_valid, error_str = self.validate_joint1_rpy(self.joint1_rpy)
|
|
3307
|
+
if not is_valid:
|
|
3308
|
+
raise TypeError(error_str)
|
|
3309
|
+
is_valid, error_str = self.validate_joint2_xyz(self.joint2_xyz)
|
|
3310
|
+
if not is_valid:
|
|
3311
|
+
raise TypeError(error_str)
|
|
3312
|
+
is_valid, error_str = self.validate_joint2_rpy(self.joint2_rpy)
|
|
3313
|
+
if not is_valid:
|
|
3314
|
+
raise TypeError(error_str)
|
|
3315
|
+
is_valid, error_str = self.validate_joint3_xyz(self.joint3_xyz)
|
|
3316
|
+
if not is_valid:
|
|
3317
|
+
raise TypeError(error_str)
|
|
3318
|
+
is_valid, error_str = self.validate_joint3_rpy(self.joint3_rpy)
|
|
3319
|
+
if not is_valid:
|
|
3320
|
+
raise TypeError(error_str)
|
|
3321
|
+
is_valid, error_str = self.validate_joint4_xyz(self.joint4_xyz)
|
|
3322
|
+
if not is_valid:
|
|
3323
|
+
raise TypeError(error_str)
|
|
3324
|
+
is_valid, error_str = self.validate_joint4_rpy(self.joint4_rpy)
|
|
3325
|
+
if not is_valid:
|
|
3326
|
+
raise TypeError(error_str)
|
|
3327
|
+
is_valid, error_str = self.validate_joint5_xyz(self.joint5_xyz)
|
|
3328
|
+
if not is_valid:
|
|
3329
|
+
raise TypeError(error_str)
|
|
3330
|
+
is_valid, error_str = self.validate_joint5_rpy(self.joint5_rpy)
|
|
3331
|
+
if not is_valid:
|
|
3332
|
+
raise TypeError(error_str)
|
|
3333
|
+
|
|
3334
|
+
def parse_urdf_parameters(data: object):
|
|
3335
|
+
return URDFParameters(
|
|
3336
|
+
joint0_xyz=parse_float_list(data["joint0_xyz"]) if "joint0_xyz" in data and data.get("joint0_xyz") is not None else None,
|
|
3337
|
+
joint0_rpy=parse_float_list(data["joint0_rpy"]) if "joint0_rpy" in data and data.get("joint0_rpy") is not None else None,
|
|
3338
|
+
joint1_xyz=parse_float_list(data["joint1_xyz"]) if "joint1_xyz" in data and data.get("joint1_xyz") is not None else None,
|
|
3339
|
+
joint1_rpy=parse_float_list(data["joint1_rpy"]) if "joint1_rpy" in data and data.get("joint1_rpy") is not None else None,
|
|
3340
|
+
joint2_xyz=parse_float_list(data["joint2_xyz"]) if "joint2_xyz" in data and data.get("joint2_xyz") is not None else None,
|
|
3341
|
+
joint2_rpy=parse_float_list(data["joint2_rpy"]) if "joint2_rpy" in data and data.get("joint2_rpy") is not None else None,
|
|
3342
|
+
joint3_xyz=parse_float_list(data["joint3_xyz"]) if "joint3_xyz" in data and data.get("joint3_xyz") is not None else None,
|
|
3343
|
+
joint3_rpy=parse_float_list(data["joint3_rpy"]) if "joint3_rpy" in data and data.get("joint3_rpy") is not None else None,
|
|
3344
|
+
joint4_xyz=parse_float_list(data["joint4_xyz"]) if "joint4_xyz" in data and data.get("joint4_xyz") is not None else None,
|
|
3345
|
+
joint4_rpy=parse_float_list(data["joint4_rpy"]) if "joint4_rpy" in data and data.get("joint4_rpy") is not None else None,
|
|
3346
|
+
joint5_xyz=parse_float_list(data["joint5_xyz"]) if "joint5_xyz" in data and data.get("joint5_xyz") is not None else None,
|
|
3347
|
+
joint5_rpy=parse_float_list(data["joint5_rpy"]) if "joint5_rpy" in data and data.get("joint5_rpy") is not None else None,
|
|
3348
|
+
)
|
|
3349
|
+
|
|
3350
|
+
def serialize_urdf_parameters(data: URDFParameters) -> object:
|
|
3351
|
+
return {
|
|
3352
|
+
"joint0_xyz": serialize_float_list(data.joint0_xyz),
|
|
3353
|
+
"joint0_rpy": serialize_float_list(data.joint0_rpy),
|
|
3354
|
+
"joint1_xyz": serialize_float_list(data.joint1_xyz),
|
|
3355
|
+
"joint1_rpy": serialize_float_list(data.joint1_rpy),
|
|
3356
|
+
"joint2_xyz": serialize_float_list(data.joint2_xyz),
|
|
3357
|
+
"joint2_rpy": serialize_float_list(data.joint2_rpy),
|
|
3358
|
+
"joint3_xyz": serialize_float_list(data.joint3_xyz),
|
|
3359
|
+
"joint3_rpy": serialize_float_list(data.joint3_rpy),
|
|
3360
|
+
"joint4_xyz": serialize_float_list(data.joint4_xyz),
|
|
3361
|
+
"joint4_rpy": serialize_float_list(data.joint4_rpy),
|
|
3362
|
+
"joint5_xyz": serialize_float_list(data.joint5_xyz),
|
|
3363
|
+
"joint5_rpy": serialize_float_list(data.joint5_rpy),
|
|
3364
|
+
}
|
|
3365
|
+
|
|
3138
3366
|
@dataclass
|
|
3139
3367
|
class ForceUnit:
|
|
3140
3368
|
"""Reusable Abstraction for force units (eg force, torque)
|
|
@@ -3660,7 +3888,7 @@ class OnRobot2FG14GripperConfiguration:
|
|
|
3660
3888
|
if value is None:
|
|
3661
3889
|
return [True, ""]
|
|
3662
3890
|
|
|
3663
|
-
if not ((isinstance(value, str) and OnRobotGripKindEnum in ['
|
|
3891
|
+
if not ((isinstance(value, str) and OnRobotGripKindEnum in ['internal', 'external']) or isinstance(value, OnRobotGripKindEnum)):
|
|
3664
3892
|
return [False, "grip_kind must be of type OnRobotGripKindEnum for OnRobot2FG14GripperConfiguration, got " + type(value).__name__]
|
|
3665
3893
|
|
|
3666
3894
|
return [True, ""]
|
|
@@ -3960,7 +4188,7 @@ class OnRobot2FG7GripperConfiguration:
|
|
|
3960
4188
|
if value is None:
|
|
3961
4189
|
return [True, ""]
|
|
3962
4190
|
|
|
3963
|
-
if not ((isinstance(value, str) and OnRobotGripKindEnum in ['
|
|
4191
|
+
if not ((isinstance(value, str) and OnRobotGripKindEnum in ['internal', 'external']) or isinstance(value, OnRobotGripKindEnum)):
|
|
3964
4192
|
return [False, "grip_kind must be of type OnRobotGripKindEnum for OnRobot2FG7GripperConfiguration, got " + type(value).__name__]
|
|
3965
4193
|
|
|
3966
4194
|
return [True, ""]
|
|
@@ -4289,7 +4517,7 @@ class OnRobot3FG15GripperConfiguration:
|
|
|
4289
4517
|
if value is None:
|
|
4290
4518
|
return [True, ""]
|
|
4291
4519
|
|
|
4292
|
-
if not ((isinstance(value, str) and OnRobotGripKindEnum in ['
|
|
4520
|
+
if not ((isinstance(value, str) and OnRobotGripKindEnum in ['internal', 'external']) or isinstance(value, OnRobotGripKindEnum)):
|
|
4293
4521
|
return [False, "grip_kind must be of type OnRobotGripKindEnum for OnRobot3FG15GripperConfiguration, got " + type(value).__name__]
|
|
4294
4522
|
|
|
4295
4523
|
return [True, ""]
|
|
@@ -4661,6 +4889,36 @@ def serialize_robot_control_mode(data: RobotControlMode) -> object:
|
|
|
4661
4889
|
"kind": None if data.kind is None else serialize_robot_control_mode_enum(data.kind),
|
|
4662
4890
|
}
|
|
4663
4891
|
|
|
4892
|
+
@dataclass
|
|
4893
|
+
class PlayRoutineResponse:
|
|
4894
|
+
"""Status response informs user of of robot state"""
|
|
4895
|
+
status: Union[RobotStatusEnum, None] = None
|
|
4896
|
+
|
|
4897
|
+
def validate_status(self, value: RobotStatusEnum) -> Tuple[bool, str]:
|
|
4898
|
+
if value is None:
|
|
4899
|
+
return [True, ""]
|
|
4900
|
+
|
|
4901
|
+
if not ((isinstance(value, str) and RobotStatusEnum in ['Idle', 'RunningAdHocCommand', 'RoutineRunning', 'Antigravity', 'AntigravitySlow', 'Failure', 'Recovering']) or isinstance(value, RobotStatusEnum)):
|
|
4902
|
+
return [False, "status must be of type RobotStatusEnum for PlayRoutineResponse, got " + type(value).__name__]
|
|
4903
|
+
|
|
4904
|
+
return [True, ""]
|
|
4905
|
+
|
|
4906
|
+
def __post_init__(self):
|
|
4907
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
4908
|
+
is_valid, error_str = self.validate_status(self.status)
|
|
4909
|
+
if not is_valid:
|
|
4910
|
+
raise TypeError(error_str)
|
|
4911
|
+
|
|
4912
|
+
def parse_play_routine_response(data: object):
|
|
4913
|
+
return PlayRoutineResponse(
|
|
4914
|
+
status=parse_robot_status_enum(data["status"]) if "status" in data and data.get("status") is not None else None,
|
|
4915
|
+
)
|
|
4916
|
+
|
|
4917
|
+
def serialize_play_routine_response(data: PlayRoutineResponse) -> object:
|
|
4918
|
+
return {
|
|
4919
|
+
"status": None if data.status is None else serialize_robot_status_enum(data.status),
|
|
4920
|
+
}
|
|
4921
|
+
|
|
4664
4922
|
@dataclass
|
|
4665
4923
|
class ROSControlStateResponse:
|
|
4666
4924
|
"""Response to a query for the current state of ROS control."""
|
|
@@ -4985,6 +5243,66 @@ def serialize_routine(data: Routine) -> object:
|
|
|
4985
5243
|
"environment_variables": None if data.environment_variables is None else serialize_environment_variables_list(data.environment_variables),
|
|
4986
5244
|
}
|
|
4987
5245
|
|
|
5246
|
+
@dataclass
|
|
5247
|
+
class CalibrationData:
|
|
5248
|
+
"""The result of a calibration"""
|
|
5249
|
+
timestamp: Union[str, None] = None
|
|
5250
|
+
armSerial: Union[str, None] = None
|
|
5251
|
+
urdfParameters: Union[URDFParameters, None] = None
|
|
5252
|
+
|
|
5253
|
+
def validate_timestamp(self, value: str) -> Tuple[bool, str]:
|
|
5254
|
+
if value is None:
|
|
5255
|
+
return [False, "timestamp is required for CalibrationData"]
|
|
5256
|
+
|
|
5257
|
+
if not isinstance(value, str):
|
|
5258
|
+
return [False, "timestamp must be of type str for CalibrationData, got " + type(value).__name__]
|
|
5259
|
+
|
|
5260
|
+
return [True, ""]
|
|
5261
|
+
|
|
5262
|
+
def validate_armSerial(self, value: str) -> Tuple[bool, str]:
|
|
5263
|
+
if value is None:
|
|
5264
|
+
return [False, "armSerial is required for CalibrationData"]
|
|
5265
|
+
|
|
5266
|
+
if not isinstance(value, str):
|
|
5267
|
+
return [False, "armSerial must be of type str for CalibrationData, got " + type(value).__name__]
|
|
5268
|
+
|
|
5269
|
+
return [True, ""]
|
|
5270
|
+
|
|
5271
|
+
def validate_urdfParameters(self, value: URDFParameters) -> Tuple[bool, str]:
|
|
5272
|
+
if value is None:
|
|
5273
|
+
return [False, "urdfParameters is required for CalibrationData"]
|
|
5274
|
+
|
|
5275
|
+
if not isinstance(value, URDFParameters):
|
|
5276
|
+
return [False, "urdfParameters must be of type URDFParameters for CalibrationData, got " + type(value).__name__]
|
|
5277
|
+
|
|
5278
|
+
return [True, ""]
|
|
5279
|
+
|
|
5280
|
+
def __post_init__(self):
|
|
5281
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
5282
|
+
is_valid, error_str = self.validate_timestamp(self.timestamp)
|
|
5283
|
+
if not is_valid:
|
|
5284
|
+
raise TypeError(error_str)
|
|
5285
|
+
is_valid, error_str = self.validate_armSerial(self.armSerial)
|
|
5286
|
+
if not is_valid:
|
|
5287
|
+
raise TypeError(error_str)
|
|
5288
|
+
is_valid, error_str = self.validate_urdfParameters(self.urdfParameters)
|
|
5289
|
+
if not is_valid:
|
|
5290
|
+
raise TypeError(error_str)
|
|
5291
|
+
|
|
5292
|
+
def parse_calibration_data(data: object):
|
|
5293
|
+
return CalibrationData(
|
|
5294
|
+
timestamp=parse_str(data["timestamp"]) if "timestamp" in data and data.get("timestamp") is not None else None,
|
|
5295
|
+
armSerial=parse_str(data["armSerial"]) if "armSerial" in data and data.get("armSerial") is not None else None,
|
|
5296
|
+
urdfParameters=parse_urdf_parameters(data["urdfParameters"]) if "urdfParameters" in data and data.get("urdfParameters") is not None else None,
|
|
5297
|
+
)
|
|
5298
|
+
|
|
5299
|
+
def serialize_calibration_data(data: CalibrationData) -> object:
|
|
5300
|
+
return {
|
|
5301
|
+
"timestamp": serialize_str(data.timestamp),
|
|
5302
|
+
"armSerial": serialize_str(data.armSerial),
|
|
5303
|
+
"urdfParameters": serialize_urdf_parameters(data.urdfParameters),
|
|
5304
|
+
}
|
|
5305
|
+
|
|
4988
5306
|
ArmJointRotationsList = List[ArmJointRotations]
|
|
4989
5307
|
|
|
4990
5308
|
def parse_arm_joint_rotations_list(data: object) -> ArmJointRotationsList:
|
|
@@ -5111,7 +5429,7 @@ class OnRobot2FG14GripperCommandRequest:
|
|
|
5111
5429
|
if value is None:
|
|
5112
5430
|
return [False, "grip_direction is required for OnRobot2FG14GripperCommandRequest"]
|
|
5113
5431
|
|
|
5114
|
-
if not ((isinstance(value, str) and LinearGripDirectionEnum in ['
|
|
5432
|
+
if not ((isinstance(value, str) and LinearGripDirectionEnum in ['internal', 'external']) or isinstance(value, LinearGripDirectionEnum)):
|
|
5115
5433
|
return [False, "grip_direction must be of type LinearGripDirectionEnum for OnRobot2FG14GripperCommandRequest, got " + type(value).__name__]
|
|
5116
5434
|
|
|
5117
5435
|
return [True, ""]
|
|
@@ -5187,7 +5505,7 @@ class OnRobot2FG7GripperCommandRequest:
|
|
|
5187
5505
|
if value is None:
|
|
5188
5506
|
return [False, "grip_direction is required for OnRobot2FG7GripperCommandRequest"]
|
|
5189
5507
|
|
|
5190
|
-
if not ((isinstance(value, str) and LinearGripDirectionEnum in ['
|
|
5508
|
+
if not ((isinstance(value, str) and LinearGripDirectionEnum in ['internal', 'external']) or isinstance(value, LinearGripDirectionEnum)):
|
|
5191
5509
|
return [False, "grip_direction must be of type LinearGripDirectionEnum for OnRobot2FG7GripperCommandRequest, got " + type(value).__name__]
|
|
5192
5510
|
|
|
5193
5511
|
return [True, ""]
|
|
@@ -5263,7 +5581,7 @@ class OnRobot3FG15GripperCommandRequest:
|
|
|
5263
5581
|
if value is None:
|
|
5264
5582
|
return [False, "grip_direction is required for OnRobot3FG15GripperCommandRequest"]
|
|
5265
5583
|
|
|
5266
|
-
if not ((isinstance(value, str) and LinearGripDirectionEnum in ['
|
|
5584
|
+
if not ((isinstance(value, str) and LinearGripDirectionEnum in ['internal', 'external']) or isinstance(value, LinearGripDirectionEnum)):
|
|
5267
5585
|
return [False, "grip_direction must be of type LinearGripDirectionEnum for OnRobot3FG15GripperCommandRequest, got " + type(value).__name__]
|
|
5268
5586
|
|
|
5269
5587
|
return [True, ""]
|
|
@@ -5794,6 +6112,36 @@ def parse_routines_list(data: object) -> RoutinesList:
|
|
|
5794
6112
|
def serialize_routines_list(data: RoutinesList) -> List[object]:
|
|
5795
6113
|
return [serialize_routine(item) for item in data]
|
|
5796
6114
|
|
|
6115
|
+
@dataclass
|
|
6116
|
+
class ActiveCalibrationContainer:
|
|
6117
|
+
"""The response to an active calibration request"""
|
|
6118
|
+
calibrationData: Union[CalibrationData, None] = None
|
|
6119
|
+
|
|
6120
|
+
def validate_calibrationData(self, value: CalibrationData) -> Tuple[bool, str]:
|
|
6121
|
+
if value is None:
|
|
6122
|
+
return [True, ""]
|
|
6123
|
+
|
|
6124
|
+
if not isinstance(value, CalibrationData):
|
|
6125
|
+
return [False, "calibrationData must be of type CalibrationData for ActiveCalibrationContainer, got " + type(value).__name__]
|
|
6126
|
+
|
|
6127
|
+
return [True, ""]
|
|
6128
|
+
|
|
6129
|
+
def __post_init__(self):
|
|
6130
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
6131
|
+
is_valid, error_str = self.validate_calibrationData(self.calibrationData)
|
|
6132
|
+
if not is_valid:
|
|
6133
|
+
raise TypeError(error_str)
|
|
6134
|
+
|
|
6135
|
+
def parse_active_calibration_container(data: object):
|
|
6136
|
+
return ActiveCalibrationContainer(
|
|
6137
|
+
calibrationData=parse_calibration_data(data["calibrationData"]) if "calibrationData" in data and data.get("calibrationData") is not None else None,
|
|
6138
|
+
)
|
|
6139
|
+
|
|
6140
|
+
def serialize_active_calibration_container(data: ActiveCalibrationContainer) -> object:
|
|
6141
|
+
return {
|
|
6142
|
+
"calibrationData": None if data.calibrationData is None else serialize_calibration_data(data.calibrationData),
|
|
6143
|
+
}
|
|
6144
|
+
|
|
5797
6145
|
@dataclass
|
|
5798
6146
|
class GripperCommandRequest:
|
|
5799
6147
|
"""Control the gripper (end effector) of the robot
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
standardbots/__init__.py,sha256=PT6Z2HPama2fb6SaNhF3J1skpYABQWGgDzKEtQY6BDM,29
|
|
2
|
+
standardbots/auto_generated/__init__.py,sha256=PZtDUzYcjIO6R-gE-0NzY0vFXk1Je1tJ3je0ivV5o-k,98
|
|
3
|
+
standardbots/auto_generated/apis.py,sha256=y0U33UjyD6yDF2dgqNjJLdMWdmC4TwceqpL8d0v_EoU,97866
|
|
4
|
+
standardbots/auto_generated/models.py,sha256=Rk0fLn4gcMyXZr-GCJ-CZXA8I5nO2kR8pBUNs3yJrrY,276937
|
|
5
|
+
tests/fixtures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
tests/fixtures/client_fixt.py,sha256=Va_L90iYIYPguyqr2eYE15ERkCgGgbee3AVLei8TCq4,644
|
|
7
|
+
tests/fixtures/routines_fixt.py,sha256=CpdwndlSDmwFCxzCXicIAeFT2CO2VQqFm_6gVAF385c,1326
|
|
8
|
+
standardbots-2.0.0.dev1740502639.dist-info/METADATA,sha256=f7psIGUJZeErcicgzUmq3mT_SgRm-GEOale-ZHWroLE,558
|
|
9
|
+
standardbots-2.0.0.dev1740502639.dist-info/WHEEL,sha256=nn6H5-ilmfVryoAQl3ZQ2l8SH5imPWFpm1A5FgEuFV4,91
|
|
10
|
+
standardbots-2.0.0.dev1740502639.dist-info/top_level.txt,sha256=eHgNxowGe-eEE7gOyeuwXN3bHLClu-TQ1VnsOOzzTkw,19
|
|
11
|
+
standardbots-2.0.0.dev1740502639.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
standardbots/__init__.py,sha256=PT6Z2HPama2fb6SaNhF3J1skpYABQWGgDzKEtQY6BDM,29
|
|
2
|
-
standardbots/auto_generated/__init__.py,sha256=PZtDUzYcjIO6R-gE-0NzY0vFXk1Je1tJ3je0ivV5o-k,98
|
|
3
|
-
standardbots/auto_generated/apis.py,sha256=G3sh8CbbfjxoFTmzc8xI4swajPxD5xOWTaKg6hjY5kg,91393
|
|
4
|
-
standardbots/auto_generated/models.py,sha256=VtkMHR2aEnsXO3U2xuhDQrRMcVCQp2uRj_WbAKLZYAc,261851
|
|
5
|
-
tests/fixtures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
tests/fixtures/client_fixt.py,sha256=Va_L90iYIYPguyqr2eYE15ERkCgGgbee3AVLei8TCq4,644
|
|
7
|
-
tests/fixtures/routines_fixt.py,sha256=CpdwndlSDmwFCxzCXicIAeFT2CO2VQqFm_6gVAF385c,1326
|
|
8
|
-
standardbots-2.0.0.dev1737492400.dist-info/METADATA,sha256=Kq7S7_-CRiWzSdLyABdW0bz8HDUlFKyP33OYJxttDx8,558
|
|
9
|
-
standardbots-2.0.0.dev1737492400.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
10
|
-
standardbots-2.0.0.dev1737492400.dist-info/top_level.txt,sha256=eHgNxowGe-eEE7gOyeuwXN3bHLClu-TQ1VnsOOzzTkw,19
|
|
11
|
-
standardbots-2.0.0.dev1737492400.dist-info/RECORD,,
|
|
File without changes
|