standardbots 2.20241003.41__py3-none-any.whl → 2.20241119.1__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 +2469 -1544
- standardbots/auto_generated/models.py +1872 -1298
- {standardbots-2.20241003.41.dist-info → standardbots-2.20241119.1.dist-info}/METADATA +3 -10
- standardbots-2.20241119.1.dist-info/RECORD +8 -0
- {standardbots-2.20241003.41.dist-info → standardbots-2.20241119.1.dist-info}/WHEEL +1 -1
- standardbots-2.20241003.41.dist-info/RECORD +0 -8
- {standardbots-2.20241003.41.dist-info → standardbots-2.20241119.1.dist-info}/top_level.txt +0 -0
|
@@ -142,8 +142,8 @@ class ArmPositionUpdateCanceledEvent:
|
|
|
142
142
|
|
|
143
143
|
def parse_arm_position_update_canceled_event(data: object):
|
|
144
144
|
return ArmPositionUpdateCanceledEvent(
|
|
145
|
-
kind=parse_str(data["kind"]) if "kind" in data else None,
|
|
146
|
-
reason=parse_str(data["reason"]) if "reason" in data else None,
|
|
145
|
+
kind=parse_str(data["kind"]) if "kind" in data and data.get("kind") is not None else None,
|
|
146
|
+
reason=parse_str(data["reason"]) if "reason" in data and data.get("reason") is not None else None,
|
|
147
147
|
)
|
|
148
148
|
|
|
149
149
|
def serialize_arm_position_update_canceled_event(data: ArmPositionUpdateCanceledEvent) -> object:
|
|
@@ -336,13 +336,13 @@ class CameraIntrinsics:
|
|
|
336
336
|
|
|
337
337
|
def parse_camera_intrinsics(data: object):
|
|
338
338
|
return CameraIntrinsics(
|
|
339
|
-
width=parse_f_64(data["width"]) if "width" in data else None,
|
|
340
|
-
height=parse_f_64(data["height"]) if "height" in data else None,
|
|
341
|
-
fx=parse_f_64(data["fx"]) if "fx" in data else None,
|
|
342
|
-
fy=parse_f_64(data["fy"]) if "fy" in data else None,
|
|
343
|
-
ppx=parse_f_64(data["ppx"]) if "ppx" in data else None,
|
|
344
|
-
ppy=parse_f_64(data["ppy"]) if "ppy" in data else None,
|
|
345
|
-
error=parse_i_8(data["error"]) if "error" in data else None,
|
|
339
|
+
width=parse_f_64(data["width"]) if "width" in data and data.get("width") is not None else None,
|
|
340
|
+
height=parse_f_64(data["height"]) if "height" in data and data.get("height") is not None else None,
|
|
341
|
+
fx=parse_f_64(data["fx"]) if "fx" in data and data.get("fx") is not None else None,
|
|
342
|
+
fy=parse_f_64(data["fy"]) if "fy" in data and data.get("fy") is not None else None,
|
|
343
|
+
ppx=parse_f_64(data["ppx"]) if "ppx" in data and data.get("ppx") is not None else None,
|
|
344
|
+
ppy=parse_f_64(data["ppy"]) if "ppy" in data and data.get("ppy") is not None else None,
|
|
345
|
+
error=parse_i_8(data["error"]) if "error" in data and data.get("error") is not None else None,
|
|
346
346
|
)
|
|
347
347
|
|
|
348
348
|
def serialize_camera_intrinsics(data: CameraIntrinsics) -> object:
|
|
@@ -456,13 +456,13 @@ class CameraSettings:
|
|
|
456
456
|
|
|
457
457
|
def parse_camera_settings(data: object):
|
|
458
458
|
return CameraSettings(
|
|
459
|
-
brightness=parse_i_16(data["brightness"]) if "brightness" in data else None,
|
|
460
|
-
contrast=parse_i_16(data["contrast"]) if "contrast" in data else None,
|
|
461
|
-
exposure=parse_i_16(data["exposure"]) if "exposure" in data else None,
|
|
462
|
-
sharpness=parse_i_16(data["sharpness"]) if "sharpness" in data else None,
|
|
463
|
-
hue=parse_i_16(data["hue"]) if "hue" in data else None,
|
|
464
|
-
whiteBalance=parse_i_16(data["whiteBalance"]) if "whiteBalance" in data else None,
|
|
465
|
-
autoWhiteBalance=parse_bool(data["autoWhiteBalance"]) if "autoWhiteBalance" in data else None,
|
|
459
|
+
brightness=parse_i_16(data["brightness"]) if "brightness" in data and data.get("brightness") is not None else None,
|
|
460
|
+
contrast=parse_i_16(data["contrast"]) if "contrast" in data and data.get("contrast") is not None else None,
|
|
461
|
+
exposure=parse_i_16(data["exposure"]) if "exposure" in data and data.get("exposure") is not None else None,
|
|
462
|
+
sharpness=parse_i_16(data["sharpness"]) if "sharpness" in data and data.get("sharpness") is not None else None,
|
|
463
|
+
hue=parse_i_16(data["hue"]) if "hue" in data and data.get("hue") is not None else None,
|
|
464
|
+
whiteBalance=parse_i_16(data["whiteBalance"]) if "whiteBalance" in data and data.get("whiteBalance") is not None else None,
|
|
465
|
+
autoWhiteBalance=parse_bool(data["autoWhiteBalance"]) if "autoWhiteBalance" in data and data.get("autoWhiteBalance") is not None else None,
|
|
466
466
|
)
|
|
467
467
|
|
|
468
468
|
def serialize_camera_settings(data: CameraSettings) -> object:
|
|
@@ -476,6 +476,127 @@ def serialize_camera_settings(data: CameraSettings) -> object:
|
|
|
476
476
|
"autoWhiteBalance": None if data.autoWhiteBalance is None else serialize_bool(data.autoWhiteBalance),
|
|
477
477
|
}
|
|
478
478
|
|
|
479
|
+
@dataclass
|
|
480
|
+
class CartesianPose:
|
|
481
|
+
"""Cartesian pose
|
|
482
|
+
"""
|
|
483
|
+
x: Union[float, None] = None
|
|
484
|
+
y: Union[float, None] = None
|
|
485
|
+
z: Union[float, None] = None
|
|
486
|
+
i: Union[float, None] = None
|
|
487
|
+
j: Union[float, None] = None
|
|
488
|
+
k: Union[float, None] = None
|
|
489
|
+
w: Union[float, None] = None
|
|
490
|
+
|
|
491
|
+
def validate_x(self, value: float) -> Tuple[bool, str]:
|
|
492
|
+
if value is None:
|
|
493
|
+
return [False, "x is required for CartesianPose"]
|
|
494
|
+
|
|
495
|
+
if not isinstance(value, float):
|
|
496
|
+
return [False, "x must be of type float for CartesianPose, got " + type(value).__name__]
|
|
497
|
+
|
|
498
|
+
return [True, ""]
|
|
499
|
+
|
|
500
|
+
def validate_y(self, value: float) -> Tuple[bool, str]:
|
|
501
|
+
if value is None:
|
|
502
|
+
return [False, "y is required for CartesianPose"]
|
|
503
|
+
|
|
504
|
+
if not isinstance(value, float):
|
|
505
|
+
return [False, "y must be of type float for CartesianPose, got " + type(value).__name__]
|
|
506
|
+
|
|
507
|
+
return [True, ""]
|
|
508
|
+
|
|
509
|
+
def validate_z(self, value: float) -> Tuple[bool, str]:
|
|
510
|
+
if value is None:
|
|
511
|
+
return [False, "z is required for CartesianPose"]
|
|
512
|
+
|
|
513
|
+
if not isinstance(value, float):
|
|
514
|
+
return [False, "z must be of type float for CartesianPose, got " + type(value).__name__]
|
|
515
|
+
|
|
516
|
+
return [True, ""]
|
|
517
|
+
|
|
518
|
+
def validate_i(self, value: float) -> Tuple[bool, str]:
|
|
519
|
+
if value is None:
|
|
520
|
+
return [False, "i is required for CartesianPose"]
|
|
521
|
+
|
|
522
|
+
if not isinstance(value, float):
|
|
523
|
+
return [False, "i must be of type float for CartesianPose, got " + type(value).__name__]
|
|
524
|
+
|
|
525
|
+
return [True, ""]
|
|
526
|
+
|
|
527
|
+
def validate_j(self, value: float) -> Tuple[bool, str]:
|
|
528
|
+
if value is None:
|
|
529
|
+
return [False, "j is required for CartesianPose"]
|
|
530
|
+
|
|
531
|
+
if not isinstance(value, float):
|
|
532
|
+
return [False, "j must be of type float for CartesianPose, got " + type(value).__name__]
|
|
533
|
+
|
|
534
|
+
return [True, ""]
|
|
535
|
+
|
|
536
|
+
def validate_k(self, value: float) -> Tuple[bool, str]:
|
|
537
|
+
if value is None:
|
|
538
|
+
return [False, "k is required for CartesianPose"]
|
|
539
|
+
|
|
540
|
+
if not isinstance(value, float):
|
|
541
|
+
return [False, "k must be of type float for CartesianPose, got " + type(value).__name__]
|
|
542
|
+
|
|
543
|
+
return [True, ""]
|
|
544
|
+
|
|
545
|
+
def validate_w(self, value: float) -> Tuple[bool, str]:
|
|
546
|
+
if value is None:
|
|
547
|
+
return [False, "w is required for CartesianPose"]
|
|
548
|
+
|
|
549
|
+
if not isinstance(value, float):
|
|
550
|
+
return [False, "w must be of type float for CartesianPose, got " + type(value).__name__]
|
|
551
|
+
|
|
552
|
+
return [True, ""]
|
|
553
|
+
|
|
554
|
+
def __post_init__(self):
|
|
555
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
556
|
+
is_valid, error_str = self.validate_x(self.x)
|
|
557
|
+
if not is_valid:
|
|
558
|
+
raise TypeError(error_str)
|
|
559
|
+
is_valid, error_str = self.validate_y(self.y)
|
|
560
|
+
if not is_valid:
|
|
561
|
+
raise TypeError(error_str)
|
|
562
|
+
is_valid, error_str = self.validate_z(self.z)
|
|
563
|
+
if not is_valid:
|
|
564
|
+
raise TypeError(error_str)
|
|
565
|
+
is_valid, error_str = self.validate_i(self.i)
|
|
566
|
+
if not is_valid:
|
|
567
|
+
raise TypeError(error_str)
|
|
568
|
+
is_valid, error_str = self.validate_j(self.j)
|
|
569
|
+
if not is_valid:
|
|
570
|
+
raise TypeError(error_str)
|
|
571
|
+
is_valid, error_str = self.validate_k(self.k)
|
|
572
|
+
if not is_valid:
|
|
573
|
+
raise TypeError(error_str)
|
|
574
|
+
is_valid, error_str = self.validate_w(self.w)
|
|
575
|
+
if not is_valid:
|
|
576
|
+
raise TypeError(error_str)
|
|
577
|
+
|
|
578
|
+
def parse_cartesian_pose(data: object):
|
|
579
|
+
return CartesianPose(
|
|
580
|
+
x=parse_f_64(data["x"]) if "x" in data and data.get("x") is not None else None,
|
|
581
|
+
y=parse_f_64(data["y"]) if "y" in data and data.get("y") is not None else None,
|
|
582
|
+
z=parse_f_64(data["z"]) if "z" in data and data.get("z") is not None else None,
|
|
583
|
+
i=parse_f_64(data["i"]) if "i" in data and data.get("i") is not None else None,
|
|
584
|
+
j=parse_f_64(data["j"]) if "j" in data and data.get("j") is not None else None,
|
|
585
|
+
k=parse_f_64(data["k"]) if "k" in data and data.get("k") is not None else None,
|
|
586
|
+
w=parse_f_64(data["w"]) if "w" in data and data.get("w") is not None else None,
|
|
587
|
+
)
|
|
588
|
+
|
|
589
|
+
def serialize_cartesian_pose(data: CartesianPose) -> object:
|
|
590
|
+
return {
|
|
591
|
+
"x": serialize_f_64(data.x),
|
|
592
|
+
"y": serialize_f_64(data.y),
|
|
593
|
+
"z": serialize_f_64(data.z),
|
|
594
|
+
"i": serialize_f_64(data.i),
|
|
595
|
+
"j": serialize_f_64(data.j),
|
|
596
|
+
"k": serialize_f_64(data.k),
|
|
597
|
+
"w": serialize_f_64(data.w),
|
|
598
|
+
}
|
|
599
|
+
|
|
479
600
|
class ConnectionStatus(Enum):
|
|
480
601
|
Connected = "connected"
|
|
481
602
|
"""Enum Connected = `connected`"""
|
|
@@ -539,9 +660,9 @@ class DHAGGripperCommandRequest:
|
|
|
539
660
|
|
|
540
661
|
def parse_dhag_gripper_command_request(data: object):
|
|
541
662
|
return DHAGGripperCommandRequest(
|
|
542
|
-
target_diameter=parse_f_64(data["target_diameter"]) if "target_diameter" in data else None,
|
|
543
|
-
target_force=parse_f_64(data["target_force"]) if "target_force" in data else None,
|
|
544
|
-
target_speed=parse_f_64(data["target_speed"]) if "target_speed" in data else None,
|
|
663
|
+
target_diameter=parse_f_64(data["target_diameter"]) if "target_diameter" in data and data.get("target_diameter") is not None else None,
|
|
664
|
+
target_force=parse_f_64(data["target_force"]) if "target_force" in data and data.get("target_force") is not None else None,
|
|
665
|
+
target_speed=parse_f_64(data["target_speed"]) if "target_speed" in data and data.get("target_speed") is not None else None,
|
|
545
666
|
)
|
|
546
667
|
|
|
547
668
|
def serialize_dhag_gripper_command_request(data: DHAGGripperCommandRequest) -> object:
|
|
@@ -573,7 +694,7 @@ class DHAGGripperConfiguration:
|
|
|
573
694
|
|
|
574
695
|
def parse_dhag_gripper_configuration(data: object):
|
|
575
696
|
return DHAGGripperConfiguration(
|
|
576
|
-
diameter=parse_f_64(data["diameter"]) if "diameter" in data else None,
|
|
697
|
+
diameter=parse_f_64(data["diameter"]) if "diameter" in data and data.get("diameter") is not None else None,
|
|
577
698
|
)
|
|
578
699
|
|
|
579
700
|
def serialize_dhag_gripper_configuration(data: DHAGGripperConfiguration) -> object:
|
|
@@ -630,9 +751,9 @@ class DHCGIGripperCommandRequest:
|
|
|
630
751
|
|
|
631
752
|
def parse_dhcgi_gripper_command_request(data: object):
|
|
632
753
|
return DHCGIGripperCommandRequest(
|
|
633
|
-
target_diameter=parse_f_64(data["target_diameter"]) if "target_diameter" in data else None,
|
|
634
|
-
target_force=parse_f_64(data["target_force"]) if "target_force" in data else None,
|
|
635
|
-
target_speed=parse_f_64(data["target_speed"]) if "target_speed" in data else None,
|
|
754
|
+
target_diameter=parse_f_64(data["target_diameter"]) if "target_diameter" in data and data.get("target_diameter") is not None else None,
|
|
755
|
+
target_force=parse_f_64(data["target_force"]) if "target_force" in data and data.get("target_force") is not None else None,
|
|
756
|
+
target_speed=parse_f_64(data["target_speed"]) if "target_speed" in data and data.get("target_speed") is not None else None,
|
|
636
757
|
)
|
|
637
758
|
|
|
638
759
|
def serialize_dhcgi_gripper_command_request(data: DHCGIGripperCommandRequest) -> object:
|
|
@@ -664,7 +785,7 @@ class DHCGIGripperConfiguration:
|
|
|
664
785
|
|
|
665
786
|
def parse_dhcgi_gripper_configuration(data: object):
|
|
666
787
|
return DHCGIGripperConfiguration(
|
|
667
|
-
diameter=parse_f_64(data["diameter"]) if "diameter" in data else None,
|
|
788
|
+
diameter=parse_f_64(data["diameter"]) if "diameter" in data and data.get("diameter") is not None else None,
|
|
668
789
|
)
|
|
669
790
|
|
|
670
791
|
def serialize_dhcgi_gripper_configuration(data: DHCGIGripperConfiguration) -> object:
|
|
@@ -721,9 +842,9 @@ class DHPGCGripperCommandRequest:
|
|
|
721
842
|
|
|
722
843
|
def parse_dhpgc_gripper_command_request(data: object):
|
|
723
844
|
return DHPGCGripperCommandRequest(
|
|
724
|
-
target_diameter=parse_f_64(data["target_diameter"]) if "target_diameter" in data else None,
|
|
725
|
-
target_force=parse_f_64(data["target_force"]) if "target_force" in data else None,
|
|
726
|
-
target_speed=parse_f_64(data["target_speed"]) if "target_speed" in data else None,
|
|
845
|
+
target_diameter=parse_f_64(data["target_diameter"]) if "target_diameter" in data and data.get("target_diameter") is not None else None,
|
|
846
|
+
target_force=parse_f_64(data["target_force"]) if "target_force" in data and data.get("target_force") is not None else None,
|
|
847
|
+
target_speed=parse_f_64(data["target_speed"]) if "target_speed" in data and data.get("target_speed") is not None else None,
|
|
727
848
|
)
|
|
728
849
|
|
|
729
850
|
def serialize_dhpgc_gripper_command_request(data: DHPGCGripperCommandRequest) -> object:
|
|
@@ -755,7 +876,7 @@ class DHPGCGripperConfiguration:
|
|
|
755
876
|
|
|
756
877
|
def parse_dhpgc_gripper_configuration(data: object):
|
|
757
878
|
return DHPGCGripperConfiguration(
|
|
758
|
-
diameter=parse_f_64(data["diameter"]) if "diameter" in data else None,
|
|
879
|
+
diameter=parse_f_64(data["diameter"]) if "diameter" in data and data.get("diameter") is not None else None,
|
|
759
880
|
)
|
|
760
881
|
|
|
761
882
|
def serialize_dhpgc_gripper_configuration(data: DHPGCGripperConfiguration) -> object:
|
|
@@ -786,7 +907,7 @@ class EngageEmergencyStopRequest:
|
|
|
786
907
|
|
|
787
908
|
def parse_engage_emergency_stop_request(data: object):
|
|
788
909
|
return EngageEmergencyStopRequest(
|
|
789
|
-
reason=parse_str(data["reason"]) if "reason" in data else None,
|
|
910
|
+
reason=parse_str(data["reason"]) if "reason" in data and data.get("reason") is not None else None,
|
|
790
911
|
)
|
|
791
912
|
|
|
792
913
|
def serialize_engage_emergency_stop_request(data: EngageEmergencyStopRequest) -> object:
|
|
@@ -842,9 +963,9 @@ class EnvironmentVariable:
|
|
|
842
963
|
|
|
843
964
|
def parse_environment_variable(data: object):
|
|
844
965
|
return EnvironmentVariable(
|
|
845
|
-
id=parse_str(data["id"]) if "id" in data else None,
|
|
846
|
-
name=parse_str(data["name"]) if "name" in data else None,
|
|
847
|
-
value=parse_str(data["value"]) if "value" in data else None,
|
|
966
|
+
id=parse_str(data["id"]) if "id" in data and data.get("id") is not None else None,
|
|
967
|
+
name=parse_str(data["name"]) if "name" in data and data.get("name") is not None else None,
|
|
968
|
+
value=parse_str(data["value"]) if "value" in data and data.get("value") is not None else None,
|
|
848
969
|
)
|
|
849
970
|
|
|
850
971
|
def serialize_environment_variable(data: EnvironmentVariable) -> object:
|
|
@@ -898,6 +1019,112 @@ def parse_error_enum(data: object) -> ErrorEnum:
|
|
|
898
1019
|
def serialize_error_enum(data: Union[ErrorEnum, str]) -> object:
|
|
899
1020
|
return ErrorEnum(data).value
|
|
900
1021
|
|
|
1022
|
+
@dataclass
|
|
1023
|
+
class EulerPose:
|
|
1024
|
+
"""Euler pose
|
|
1025
|
+
"""
|
|
1026
|
+
x: Union[float, None] = None
|
|
1027
|
+
y: Union[float, None] = None
|
|
1028
|
+
z: Union[float, None] = None
|
|
1029
|
+
rx: Union[float, None] = None
|
|
1030
|
+
ry: Union[float, None] = None
|
|
1031
|
+
rz: Union[float, None] = None
|
|
1032
|
+
|
|
1033
|
+
def validate_x(self, value: float) -> Tuple[bool, str]:
|
|
1034
|
+
if value is None:
|
|
1035
|
+
return [True, ""]
|
|
1036
|
+
|
|
1037
|
+
if not isinstance(value, float):
|
|
1038
|
+
return [False, "x must be of type float for EulerPose, got " + type(value).__name__]
|
|
1039
|
+
|
|
1040
|
+
return [True, ""]
|
|
1041
|
+
|
|
1042
|
+
def validate_y(self, value: float) -> Tuple[bool, str]:
|
|
1043
|
+
if value is None:
|
|
1044
|
+
return [True, ""]
|
|
1045
|
+
|
|
1046
|
+
if not isinstance(value, float):
|
|
1047
|
+
return [False, "y must be of type float for EulerPose, got " + type(value).__name__]
|
|
1048
|
+
|
|
1049
|
+
return [True, ""]
|
|
1050
|
+
|
|
1051
|
+
def validate_z(self, value: float) -> Tuple[bool, str]:
|
|
1052
|
+
if value is None:
|
|
1053
|
+
return [True, ""]
|
|
1054
|
+
|
|
1055
|
+
if not isinstance(value, float):
|
|
1056
|
+
return [False, "z must be of type float for EulerPose, got " + type(value).__name__]
|
|
1057
|
+
|
|
1058
|
+
return [True, ""]
|
|
1059
|
+
|
|
1060
|
+
def validate_rx(self, value: float) -> Tuple[bool, str]:
|
|
1061
|
+
if value is None:
|
|
1062
|
+
return [True, ""]
|
|
1063
|
+
|
|
1064
|
+
if not isinstance(value, float):
|
|
1065
|
+
return [False, "rx must be of type float for EulerPose, got " + type(value).__name__]
|
|
1066
|
+
|
|
1067
|
+
return [True, ""]
|
|
1068
|
+
|
|
1069
|
+
def validate_ry(self, value: float) -> Tuple[bool, str]:
|
|
1070
|
+
if value is None:
|
|
1071
|
+
return [True, ""]
|
|
1072
|
+
|
|
1073
|
+
if not isinstance(value, float):
|
|
1074
|
+
return [False, "ry must be of type float for EulerPose, got " + type(value).__name__]
|
|
1075
|
+
|
|
1076
|
+
return [True, ""]
|
|
1077
|
+
|
|
1078
|
+
def validate_rz(self, value: float) -> Tuple[bool, str]:
|
|
1079
|
+
if value is None:
|
|
1080
|
+
return [True, ""]
|
|
1081
|
+
|
|
1082
|
+
if not isinstance(value, float):
|
|
1083
|
+
return [False, "rz must be of type float for EulerPose, got " + type(value).__name__]
|
|
1084
|
+
|
|
1085
|
+
return [True, ""]
|
|
1086
|
+
|
|
1087
|
+
def __post_init__(self):
|
|
1088
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1089
|
+
is_valid, error_str = self.validate_x(self.x)
|
|
1090
|
+
if not is_valid:
|
|
1091
|
+
raise TypeError(error_str)
|
|
1092
|
+
is_valid, error_str = self.validate_y(self.y)
|
|
1093
|
+
if not is_valid:
|
|
1094
|
+
raise TypeError(error_str)
|
|
1095
|
+
is_valid, error_str = self.validate_z(self.z)
|
|
1096
|
+
if not is_valid:
|
|
1097
|
+
raise TypeError(error_str)
|
|
1098
|
+
is_valid, error_str = self.validate_rx(self.rx)
|
|
1099
|
+
if not is_valid:
|
|
1100
|
+
raise TypeError(error_str)
|
|
1101
|
+
is_valid, error_str = self.validate_ry(self.ry)
|
|
1102
|
+
if not is_valid:
|
|
1103
|
+
raise TypeError(error_str)
|
|
1104
|
+
is_valid, error_str = self.validate_rz(self.rz)
|
|
1105
|
+
if not is_valid:
|
|
1106
|
+
raise TypeError(error_str)
|
|
1107
|
+
|
|
1108
|
+
def parse_euler_pose(data: object):
|
|
1109
|
+
return EulerPose(
|
|
1110
|
+
x=parse_f_64(data["x"]) if "x" in data and data.get("x") is not None else None,
|
|
1111
|
+
y=parse_f_64(data["y"]) if "y" in data and data.get("y") is not None else None,
|
|
1112
|
+
z=parse_f_64(data["z"]) if "z" in data and data.get("z") is not None else None,
|
|
1113
|
+
rx=parse_f_64(data["rx"]) if "rx" in data and data.get("rx") is not None else None,
|
|
1114
|
+
ry=parse_f_64(data["ry"]) if "ry" in data and data.get("ry") is not None else None,
|
|
1115
|
+
rz=parse_f_64(data["rz"]) if "rz" in data and data.get("rz") is not None else None,
|
|
1116
|
+
)
|
|
1117
|
+
|
|
1118
|
+
def serialize_euler_pose(data: EulerPose) -> object:
|
|
1119
|
+
return {
|
|
1120
|
+
"x": None if data.x is None else serialize_f_64(data.x),
|
|
1121
|
+
"y": None if data.y is None else serialize_f_64(data.y),
|
|
1122
|
+
"z": None if data.z is None else serialize_f_64(data.z),
|
|
1123
|
+
"rx": None if data.rx is None else serialize_f_64(data.rx),
|
|
1124
|
+
"ry": None if data.ry is None else serialize_f_64(data.ry),
|
|
1125
|
+
"rz": None if data.rz is None else serialize_f_64(data.rz),
|
|
1126
|
+
}
|
|
1127
|
+
|
|
901
1128
|
class ForceUnitKind(Enum):
|
|
902
1129
|
Newtons = "newtons"
|
|
903
1130
|
"""Enum Newtons = `newtons`"""
|
|
@@ -917,8 +1144,6 @@ class GripperKindEnum(Enum):
|
|
|
917
1144
|
"""An OnRobot 2FG14 Gripper is connected"""
|
|
918
1145
|
Onrobot3Fg15 = "onrobot_3fg15"
|
|
919
1146
|
"""An OnRobot 3FG15 Gripper is connected"""
|
|
920
|
-
OnrobotScrewdriver = "onrobot_screwdriver"
|
|
921
|
-
"""An OnRobot Screwdriver is connected"""
|
|
922
1147
|
DhAg = "dh_ag"
|
|
923
1148
|
"""A DH AG Gripper is connected"""
|
|
924
1149
|
DhPgc = "dh_pgc"
|
|
@@ -948,6 +1173,120 @@ def serialize_io_state_map(data: IOStateMap) -> object:
|
|
|
948
1173
|
serialize_str(key): serialize_str(value) for key, value in data.items()
|
|
949
1174
|
}
|
|
950
1175
|
|
|
1176
|
+
@dataclass
|
|
1177
|
+
class JointAngles:
|
|
1178
|
+
"""Joint angles
|
|
1179
|
+
"""
|
|
1180
|
+
j0: Union[float, None] = None
|
|
1181
|
+
j1: Union[float, None] = None
|
|
1182
|
+
j2: Union[float, None] = None
|
|
1183
|
+
j3: Union[float, None] = None
|
|
1184
|
+
j4: Union[float, None] = None
|
|
1185
|
+
j5: Union[float, None] = None
|
|
1186
|
+
|
|
1187
|
+
def validate_j0(self, value: float) -> Tuple[bool, str]:
|
|
1188
|
+
if value is None:
|
|
1189
|
+
return [True, ""]
|
|
1190
|
+
|
|
1191
|
+
if not isinstance(value, float):
|
|
1192
|
+
return [False, "j0 must be of type float for JointAngles, got " + type(value).__name__]
|
|
1193
|
+
|
|
1194
|
+
return [True, ""]
|
|
1195
|
+
|
|
1196
|
+
def validate_j1(self, value: float) -> Tuple[bool, str]:
|
|
1197
|
+
if value is None:
|
|
1198
|
+
return [True, ""]
|
|
1199
|
+
|
|
1200
|
+
if not isinstance(value, float):
|
|
1201
|
+
return [False, "j1 must be of type float for JointAngles, got " + type(value).__name__]
|
|
1202
|
+
|
|
1203
|
+
return [True, ""]
|
|
1204
|
+
|
|
1205
|
+
def validate_j2(self, value: float) -> Tuple[bool, str]:
|
|
1206
|
+
if value is None:
|
|
1207
|
+
return [True, ""]
|
|
1208
|
+
|
|
1209
|
+
if not isinstance(value, float):
|
|
1210
|
+
return [False, "j2 must be of type float for JointAngles, got " + type(value).__name__]
|
|
1211
|
+
|
|
1212
|
+
return [True, ""]
|
|
1213
|
+
|
|
1214
|
+
def validate_j3(self, value: float) -> Tuple[bool, str]:
|
|
1215
|
+
if value is None:
|
|
1216
|
+
return [True, ""]
|
|
1217
|
+
|
|
1218
|
+
if not isinstance(value, float):
|
|
1219
|
+
return [False, "j3 must be of type float for JointAngles, got " + type(value).__name__]
|
|
1220
|
+
|
|
1221
|
+
return [True, ""]
|
|
1222
|
+
|
|
1223
|
+
def validate_j4(self, value: float) -> Tuple[bool, str]:
|
|
1224
|
+
if value is None:
|
|
1225
|
+
return [True, ""]
|
|
1226
|
+
|
|
1227
|
+
if not isinstance(value, float):
|
|
1228
|
+
return [False, "j4 must be of type float for JointAngles, got " + type(value).__name__]
|
|
1229
|
+
|
|
1230
|
+
return [True, ""]
|
|
1231
|
+
|
|
1232
|
+
def validate_j5(self, value: float) -> Tuple[bool, str]:
|
|
1233
|
+
if value is None:
|
|
1234
|
+
return [True, ""]
|
|
1235
|
+
|
|
1236
|
+
if not isinstance(value, float):
|
|
1237
|
+
return [False, "j5 must be of type float for JointAngles, got " + type(value).__name__]
|
|
1238
|
+
|
|
1239
|
+
return [True, ""]
|
|
1240
|
+
|
|
1241
|
+
def __post_init__(self):
|
|
1242
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1243
|
+
is_valid, error_str = self.validate_j0(self.j0)
|
|
1244
|
+
if not is_valid:
|
|
1245
|
+
raise TypeError(error_str)
|
|
1246
|
+
is_valid, error_str = self.validate_j1(self.j1)
|
|
1247
|
+
if not is_valid:
|
|
1248
|
+
raise TypeError(error_str)
|
|
1249
|
+
is_valid, error_str = self.validate_j2(self.j2)
|
|
1250
|
+
if not is_valid:
|
|
1251
|
+
raise TypeError(error_str)
|
|
1252
|
+
is_valid, error_str = self.validate_j3(self.j3)
|
|
1253
|
+
if not is_valid:
|
|
1254
|
+
raise TypeError(error_str)
|
|
1255
|
+
is_valid, error_str = self.validate_j4(self.j4)
|
|
1256
|
+
if not is_valid:
|
|
1257
|
+
raise TypeError(error_str)
|
|
1258
|
+
is_valid, error_str = self.validate_j5(self.j5)
|
|
1259
|
+
if not is_valid:
|
|
1260
|
+
raise TypeError(error_str)
|
|
1261
|
+
|
|
1262
|
+
def parse_joint_angles(data: object):
|
|
1263
|
+
return JointAngles(
|
|
1264
|
+
j0=parse_f_64(data["j0"]) if "j0" in data and data.get("j0") is not None else None,
|
|
1265
|
+
j1=parse_f_64(data["j1"]) if "j1" in data and data.get("j1") is not None else None,
|
|
1266
|
+
j2=parse_f_64(data["j2"]) if "j2" in data and data.get("j2") is not None else None,
|
|
1267
|
+
j3=parse_f_64(data["j3"]) if "j3" in data and data.get("j3") is not None else None,
|
|
1268
|
+
j4=parse_f_64(data["j4"]) if "j4" in data and data.get("j4") is not None else None,
|
|
1269
|
+
j5=parse_f_64(data["j5"]) if "j5" in data and data.get("j5") is not None else None,
|
|
1270
|
+
)
|
|
1271
|
+
|
|
1272
|
+
def serialize_joint_angles(data: JointAngles) -> object:
|
|
1273
|
+
return {
|
|
1274
|
+
"j0": None if data.j0 is None else serialize_f_64(data.j0),
|
|
1275
|
+
"j1": None if data.j1 is None else serialize_f_64(data.j1),
|
|
1276
|
+
"j2": None if data.j2 is None else serialize_f_64(data.j2),
|
|
1277
|
+
"j3": None if data.j3 is None else serialize_f_64(data.j3),
|
|
1278
|
+
"j4": None if data.j4 is None else serialize_f_64(data.j4),
|
|
1279
|
+
"j5": None if data.j5 is None else serialize_f_64(data.j5),
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
JointAnglesArray = List[float]
|
|
1283
|
+
|
|
1284
|
+
def parse_joint_angles_array(data: object) -> JointAnglesArray:
|
|
1285
|
+
return [parse_f_64(item) for item in data]
|
|
1286
|
+
|
|
1287
|
+
def serialize_joint_angles_array(data: JointAnglesArray) -> List[object]:
|
|
1288
|
+
return [serialize_f_64(item) for item in data]
|
|
1289
|
+
|
|
951
1290
|
JointRotations = Tuple[float,float,float,float,float,float,]
|
|
952
1291
|
|
|
953
1292
|
def parse_joint_rotations(data: object) -> JointRotations:
|
|
@@ -986,6 +1325,34 @@ def parse_linear_unit_kind(data: object) -> LinearUnitKind:
|
|
|
986
1325
|
def serialize_linear_unit_kind(data: Union[LinearUnitKind, str]) -> object:
|
|
987
1326
|
return LinearUnitKind(data).value
|
|
988
1327
|
|
|
1328
|
+
MaxJointAcclerations = Tuple[float,float,float,float,float,float,]
|
|
1329
|
+
|
|
1330
|
+
def parse_max_joint_acclerations(data: object) -> MaxJointAcclerations:
|
|
1331
|
+
return (parse_f_64(data[0]),parse_f_64(data[1]),parse_f_64(data[2]),parse_f_64(data[3]),parse_f_64(data[4]),parse_f_64(data[5]),)
|
|
1332
|
+
|
|
1333
|
+
def serialize_max_joint_acclerations(data: MaxJointAcclerations) -> object:
|
|
1334
|
+
return [serialize_f_64(data[0]),serialize_f_64(data[1]),serialize_f_64(data[2]),serialize_f_64(data[3]),serialize_f_64(data[4]),serialize_f_64(data[5]),]
|
|
1335
|
+
|
|
1336
|
+
MaxJointSpeeds = Tuple[float,float,float,float,float,float,]
|
|
1337
|
+
|
|
1338
|
+
def parse_max_joint_speeds(data: object) -> MaxJointSpeeds:
|
|
1339
|
+
return (parse_f_64(data[0]),parse_f_64(data[1]),parse_f_64(data[2]),parse_f_64(data[3]),parse_f_64(data[4]),parse_f_64(data[5]),)
|
|
1340
|
+
|
|
1341
|
+
def serialize_max_joint_speeds(data: MaxJointSpeeds) -> object:
|
|
1342
|
+
return [serialize_f_64(data[0]),serialize_f_64(data[1]),serialize_f_64(data[2]),serialize_f_64(data[3]),serialize_f_64(data[4]),serialize_f_64(data[5]),]
|
|
1343
|
+
|
|
1344
|
+
class MovementKindEnum(Enum):
|
|
1345
|
+
Joint = "joint"
|
|
1346
|
+
"""Enum Joint = `joint`"""
|
|
1347
|
+
Line = "line"
|
|
1348
|
+
"""Enum Line = `line`"""
|
|
1349
|
+
|
|
1350
|
+
def parse_movement_kind_enum(data: object) -> MovementKindEnum:
|
|
1351
|
+
return MovementKindEnum(data)
|
|
1352
|
+
|
|
1353
|
+
def serialize_movement_kind_enum(data: Union[MovementKindEnum, str]) -> object:
|
|
1354
|
+
return MovementKindEnum(data).value
|
|
1355
|
+
|
|
989
1356
|
class OnRobot2FG14ControlKindEnum(Enum):
|
|
990
1357
|
Move = "move"
|
|
991
1358
|
"""Move gripper to target grip width"""
|
|
@@ -1024,326 +1391,270 @@ def parse_on_robot_3_fg_15_control_kind_enum(data: object) -> OnRobot3FG15Contro
|
|
|
1024
1391
|
def serialize_on_robot_3_fg_15_control_kind_enum(data: Union[OnRobot3FG15ControlKindEnum, str]) -> object:
|
|
1025
1392
|
return OnRobot3FG15ControlKindEnum(data).value
|
|
1026
1393
|
|
|
1027
|
-
class
|
|
1028
|
-
|
|
1029
|
-
"""Enum
|
|
1030
|
-
Outward = "outward"
|
|
1031
|
-
"""Enum Outward = `outward`"""
|
|
1394
|
+
class OrientationKindEnum(Enum):
|
|
1395
|
+
Quaternion = "quaternion"
|
|
1396
|
+
"""Enum Quaternion = `quaternion`"""
|
|
1032
1397
|
|
|
1033
|
-
def
|
|
1034
|
-
return
|
|
1398
|
+
def parse_orientation_kind_enum(data: object) -> OrientationKindEnum:
|
|
1399
|
+
return OrientationKindEnum(data)
|
|
1035
1400
|
|
|
1036
|
-
def
|
|
1037
|
-
return
|
|
1401
|
+
def serialize_orientation_kind_enum(data: Union[OrientationKindEnum, str]) -> object:
|
|
1402
|
+
return OrientationKindEnum(data).value
|
|
1038
1403
|
|
|
1039
1404
|
@dataclass
|
|
1040
|
-
class
|
|
1041
|
-
"""
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
additional_results: Union[int, None] = None
|
|
1046
|
-
current_torque: Union[float, None] = None
|
|
1047
|
-
shank_position: Union[float, None] = None
|
|
1048
|
-
torque_angle_gradient: Union[float, None] = None
|
|
1049
|
-
achieved_torque: Union[float, None] = None
|
|
1050
|
-
target_force: Union[float, None] = None
|
|
1051
|
-
target_torque: Union[float, None] = None
|
|
1052
|
-
quick_changer_version: Union[int, None] = None
|
|
1053
|
-
uncalibrated_error: Union[bool, None] = None
|
|
1405
|
+
class Pagination:
|
|
1406
|
+
"""Common Pagination Metadata"""
|
|
1407
|
+
total: Union[int, None] = None
|
|
1408
|
+
limit: Union[int, None] = None
|
|
1409
|
+
offset: Union[int, None] = None
|
|
1054
1410
|
|
|
1055
|
-
def
|
|
1411
|
+
def validate_total(self, value: int) -> Tuple[bool, str]:
|
|
1056
1412
|
if value is None:
|
|
1057
1413
|
return [True, ""]
|
|
1058
1414
|
|
|
1059
1415
|
if not isinstance(value, int):
|
|
1060
|
-
return [False, "
|
|
1416
|
+
return [False, "total must be of type int for Pagination, got " + type(value).__name__]
|
|
1061
1417
|
|
|
1062
1418
|
return [True, ""]
|
|
1063
1419
|
|
|
1064
|
-
def
|
|
1420
|
+
def validate_limit(self, value: int) -> Tuple[bool, str]:
|
|
1065
1421
|
if value is None:
|
|
1066
1422
|
return [True, ""]
|
|
1067
1423
|
|
|
1068
|
-
if not isinstance(value,
|
|
1069
|
-
return [False, "
|
|
1424
|
+
if not isinstance(value, int):
|
|
1425
|
+
return [False, "limit must be of type int for Pagination, got " + type(value).__name__]
|
|
1070
1426
|
|
|
1071
1427
|
return [True, ""]
|
|
1072
1428
|
|
|
1073
|
-
def
|
|
1429
|
+
def validate_offset(self, value: int) -> Tuple[bool, str]:
|
|
1074
1430
|
if value is None:
|
|
1075
1431
|
return [True, ""]
|
|
1076
1432
|
|
|
1077
|
-
if not isinstance(value,
|
|
1078
|
-
return [False, "
|
|
1433
|
+
if not isinstance(value, int):
|
|
1434
|
+
return [False, "offset must be of type int for Pagination, got " + type(value).__name__]
|
|
1079
1435
|
|
|
1080
1436
|
return [True, ""]
|
|
1081
1437
|
|
|
1082
|
-
def
|
|
1083
|
-
if
|
|
1084
|
-
|
|
1438
|
+
def __post_init__(self):
|
|
1439
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1440
|
+
is_valid, error_str = self.validate_total(self.total)
|
|
1441
|
+
if not is_valid:
|
|
1442
|
+
raise TypeError(error_str)
|
|
1443
|
+
is_valid, error_str = self.validate_limit(self.limit)
|
|
1444
|
+
if not is_valid:
|
|
1445
|
+
raise TypeError(error_str)
|
|
1446
|
+
is_valid, error_str = self.validate_offset(self.offset)
|
|
1447
|
+
if not is_valid:
|
|
1448
|
+
raise TypeError(error_str)
|
|
1085
1449
|
|
|
1086
|
-
|
|
1087
|
-
|
|
1450
|
+
def parse_pagination(data: object):
|
|
1451
|
+
return Pagination(
|
|
1452
|
+
total=parse_i_64(data["total"]) if "total" in data and data.get("total") is not None else None,
|
|
1453
|
+
limit=parse_i_64(data["limit"]) if "limit" in data and data.get("limit") is not None else None,
|
|
1454
|
+
offset=parse_i_64(data["offset"]) if "offset" in data and data.get("offset") is not None else None,
|
|
1455
|
+
)
|
|
1088
1456
|
|
|
1089
|
-
|
|
1457
|
+
def serialize_pagination(data: Pagination) -> object:
|
|
1458
|
+
return {
|
|
1459
|
+
"total": None if data.total is None else serialize_i_64(data.total),
|
|
1460
|
+
"limit": None if data.limit is None else serialize_i_64(data.limit),
|
|
1461
|
+
"offset": None if data.offset is None else serialize_i_64(data.offset),
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
@dataclass
|
|
1465
|
+
class Plane:
|
|
1466
|
+
"""Plane in 3D space"""
|
|
1467
|
+
id: Union[str, None] = None
|
|
1468
|
+
name: Union[str, None] = None
|
|
1090
1469
|
|
|
1091
|
-
def
|
|
1470
|
+
def validate_id(self, value: str) -> Tuple[bool, str]:
|
|
1092
1471
|
if value is None:
|
|
1093
1472
|
return [True, ""]
|
|
1094
1473
|
|
|
1095
|
-
if not isinstance(value,
|
|
1096
|
-
return [False, "
|
|
1474
|
+
if not isinstance(value, str):
|
|
1475
|
+
return [False, "id must be of type str for Plane, got " + type(value).__name__]
|
|
1097
1476
|
|
|
1098
1477
|
return [True, ""]
|
|
1099
1478
|
|
|
1100
|
-
def
|
|
1479
|
+
def validate_name(self, value: str) -> Tuple[bool, str]:
|
|
1101
1480
|
if value is None:
|
|
1102
1481
|
return [True, ""]
|
|
1103
1482
|
|
|
1104
|
-
if not isinstance(value,
|
|
1105
|
-
return [False, "
|
|
1483
|
+
if not isinstance(value, str):
|
|
1484
|
+
return [False, "name must be of type str for Plane, got " + type(value).__name__]
|
|
1106
1485
|
|
|
1107
1486
|
return [True, ""]
|
|
1108
1487
|
|
|
1109
|
-
def
|
|
1110
|
-
if
|
|
1111
|
-
|
|
1488
|
+
def __post_init__(self):
|
|
1489
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1490
|
+
is_valid, error_str = self.validate_id(self.id)
|
|
1491
|
+
if not is_valid:
|
|
1492
|
+
raise TypeError(error_str)
|
|
1493
|
+
is_valid, error_str = self.validate_name(self.name)
|
|
1494
|
+
if not is_valid:
|
|
1495
|
+
raise TypeError(error_str)
|
|
1112
1496
|
|
|
1113
|
-
|
|
1114
|
-
|
|
1497
|
+
def parse_plane(data: object):
|
|
1498
|
+
return Plane(
|
|
1499
|
+
id=parse_str(data["id"]) if "id" in data and data.get("id") is not None else None,
|
|
1500
|
+
name=parse_str(data["name"]) if "name" in data and data.get("name") is not None else None,
|
|
1501
|
+
)
|
|
1115
1502
|
|
|
1116
|
-
|
|
1503
|
+
def serialize_plane(data: Plane) -> object:
|
|
1504
|
+
return {
|
|
1505
|
+
"id": None if data.id is None else serialize_str(data.id),
|
|
1506
|
+
"name": None if data.name is None else serialize_str(data.name),
|
|
1507
|
+
}
|
|
1117
1508
|
|
|
1118
|
-
|
|
1509
|
+
@dataclass
|
|
1510
|
+
class PoseDistanceResponse:
|
|
1511
|
+
"""Response: Distance between two cartesian poses
|
|
1512
|
+
"""
|
|
1513
|
+
distance: Union[float, None] = None
|
|
1514
|
+
|
|
1515
|
+
def validate_distance(self, value: float) -> Tuple[bool, str]:
|
|
1119
1516
|
if value is None:
|
|
1120
1517
|
return [True, ""]
|
|
1121
1518
|
|
|
1122
1519
|
if not isinstance(value, float):
|
|
1123
|
-
return [False, "
|
|
1520
|
+
return [False, "distance must be of type float for PoseDistanceResponse, got " + type(value).__name__]
|
|
1124
1521
|
|
|
1125
1522
|
return [True, ""]
|
|
1126
1523
|
|
|
1127
|
-
def
|
|
1524
|
+
def __post_init__(self):
|
|
1525
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1526
|
+
is_valid, error_str = self.validate_distance(self.distance)
|
|
1527
|
+
if not is_valid:
|
|
1528
|
+
raise TypeError(error_str)
|
|
1529
|
+
|
|
1530
|
+
def parse_pose_distance_response(data: object):
|
|
1531
|
+
return PoseDistanceResponse(
|
|
1532
|
+
distance=parse_f_64(data["distance"]) if "distance" in data and data.get("distance") is not None else None,
|
|
1533
|
+
)
|
|
1534
|
+
|
|
1535
|
+
def serialize_pose_distance_response(data: PoseDistanceResponse) -> object:
|
|
1536
|
+
return {
|
|
1537
|
+
"distance": None if data.distance is None else serialize_f_64(data.distance),
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
@dataclass
|
|
1541
|
+
class PositionPose:
|
|
1542
|
+
"""The full 3D position with rotation"""
|
|
1543
|
+
x: Union[float, None] = None
|
|
1544
|
+
y: Union[float, None] = None
|
|
1545
|
+
z: Union[float, None] = None
|
|
1546
|
+
w: Union[float, None] = None
|
|
1547
|
+
i: Union[float, None] = None
|
|
1548
|
+
j: Union[float, None] = None
|
|
1549
|
+
k: Union[float, None] = None
|
|
1550
|
+
|
|
1551
|
+
def validate_x(self, value: float) -> Tuple[bool, str]:
|
|
1128
1552
|
if value is None:
|
|
1129
1553
|
return [True, ""]
|
|
1130
1554
|
|
|
1131
1555
|
if not isinstance(value, float):
|
|
1132
|
-
return [False, "
|
|
1556
|
+
return [False, "x must be of type float for PositionPose, got " + type(value).__name__]
|
|
1133
1557
|
|
|
1134
1558
|
return [True, ""]
|
|
1135
1559
|
|
|
1136
|
-
def
|
|
1560
|
+
def validate_y(self, value: float) -> Tuple[bool, str]:
|
|
1137
1561
|
if value is None:
|
|
1138
1562
|
return [True, ""]
|
|
1139
1563
|
|
|
1140
1564
|
if not isinstance(value, float):
|
|
1141
|
-
return [False, "
|
|
1565
|
+
return [False, "y must be of type float for PositionPose, got " + type(value).__name__]
|
|
1142
1566
|
|
|
1143
1567
|
return [True, ""]
|
|
1144
1568
|
|
|
1145
|
-
def
|
|
1569
|
+
def validate_z(self, value: float) -> Tuple[bool, str]:
|
|
1146
1570
|
if value is None:
|
|
1147
1571
|
return [True, ""]
|
|
1148
1572
|
|
|
1149
|
-
if not isinstance(value,
|
|
1150
|
-
return [False, "
|
|
1573
|
+
if not isinstance(value, float):
|
|
1574
|
+
return [False, "z must be of type float for PositionPose, got " + type(value).__name__]
|
|
1151
1575
|
|
|
1152
1576
|
return [True, ""]
|
|
1153
1577
|
|
|
1154
|
-
def
|
|
1578
|
+
def validate_w(self, value: float) -> Tuple[bool, str]:
|
|
1155
1579
|
if value is None:
|
|
1156
1580
|
return [True, ""]
|
|
1157
1581
|
|
|
1158
|
-
if not isinstance(value,
|
|
1159
|
-
return [False, "
|
|
1582
|
+
if not isinstance(value, float):
|
|
1583
|
+
return [False, "w must be of type float for PositionPose, got " + type(value).__name__]
|
|
1160
1584
|
|
|
1161
1585
|
return [True, ""]
|
|
1162
1586
|
|
|
1163
|
-
def
|
|
1164
|
-
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1165
|
-
is_valid, error_str = self.validate_status(self.status)
|
|
1166
|
-
if not is_valid:
|
|
1167
|
-
raise TypeError(error_str)
|
|
1168
|
-
is_valid, error_str = self.validate_error(self.error)
|
|
1169
|
-
if not is_valid:
|
|
1170
|
-
raise TypeError(error_str)
|
|
1171
|
-
is_valid, error_str = self.validate_busy(self.busy)
|
|
1172
|
-
if not is_valid:
|
|
1173
|
-
raise TypeError(error_str)
|
|
1174
|
-
is_valid, error_str = self.validate_additional_results(self.additional_results)
|
|
1175
|
-
if not is_valid:
|
|
1176
|
-
raise TypeError(error_str)
|
|
1177
|
-
is_valid, error_str = self.validate_current_torque(self.current_torque)
|
|
1178
|
-
if not is_valid:
|
|
1179
|
-
raise TypeError(error_str)
|
|
1180
|
-
is_valid, error_str = self.validate_shank_position(self.shank_position)
|
|
1181
|
-
if not is_valid:
|
|
1182
|
-
raise TypeError(error_str)
|
|
1183
|
-
is_valid, error_str = self.validate_torque_angle_gradient(self.torque_angle_gradient)
|
|
1184
|
-
if not is_valid:
|
|
1185
|
-
raise TypeError(error_str)
|
|
1186
|
-
is_valid, error_str = self.validate_achieved_torque(self.achieved_torque)
|
|
1187
|
-
if not is_valid:
|
|
1188
|
-
raise TypeError(error_str)
|
|
1189
|
-
is_valid, error_str = self.validate_target_force(self.target_force)
|
|
1190
|
-
if not is_valid:
|
|
1191
|
-
raise TypeError(error_str)
|
|
1192
|
-
is_valid, error_str = self.validate_target_torque(self.target_torque)
|
|
1193
|
-
if not is_valid:
|
|
1194
|
-
raise TypeError(error_str)
|
|
1195
|
-
is_valid, error_str = self.validate_quick_changer_version(self.quick_changer_version)
|
|
1196
|
-
if not is_valid:
|
|
1197
|
-
raise TypeError(error_str)
|
|
1198
|
-
is_valid, error_str = self.validate_uncalibrated_error(self.uncalibrated_error)
|
|
1199
|
-
if not is_valid:
|
|
1200
|
-
raise TypeError(error_str)
|
|
1201
|
-
|
|
1202
|
-
def parse_on_robot_screwdriver_configuration(data: object):
|
|
1203
|
-
return OnRobotScrewdriverConfiguration(
|
|
1204
|
-
status=parse_i_32(data["status"]) if "status" in data else None,
|
|
1205
|
-
error=parse_str(data["error"]) if "error" in data else None,
|
|
1206
|
-
busy=parse_bool(data["busy"]) if "busy" in data else None,
|
|
1207
|
-
additional_results=parse_i_32(data["additional_results"]) if "additional_results" in data else None,
|
|
1208
|
-
current_torque=parse_f_64(data["current_torque"]) if "current_torque" in data else None,
|
|
1209
|
-
shank_position=parse_f_64(data["shank_position"]) if "shank_position" in data else None,
|
|
1210
|
-
torque_angle_gradient=parse_f_64(data["torque_angle_gradient"]) if "torque_angle_gradient" in data else None,
|
|
1211
|
-
achieved_torque=parse_f_64(data["achieved_torque"]) if "achieved_torque" in data else None,
|
|
1212
|
-
target_force=parse_f_64(data["target_force"]) if "target_force" in data else None,
|
|
1213
|
-
target_torque=parse_f_64(data["target_torque"]) if "target_torque" in data else None,
|
|
1214
|
-
quick_changer_version=parse_i_32(data["quick_changer_version"]) if "quick_changer_version" in data else None,
|
|
1215
|
-
uncalibrated_error=parse_bool(data["uncalibrated_error"]) if "uncalibrated_error" in data else None,
|
|
1216
|
-
)
|
|
1217
|
-
|
|
1218
|
-
def serialize_on_robot_screwdriver_configuration(data: OnRobotScrewdriverConfiguration) -> object:
|
|
1219
|
-
return {
|
|
1220
|
-
"status": None if data.status is None else serialize_i_32(data.status),
|
|
1221
|
-
"error": None if data.error is None else serialize_str(data.error),
|
|
1222
|
-
"busy": None if data.busy is None else serialize_bool(data.busy),
|
|
1223
|
-
"additional_results": None if data.additional_results is None else serialize_i_32(data.additional_results),
|
|
1224
|
-
"current_torque": None if data.current_torque is None else serialize_f_64(data.current_torque),
|
|
1225
|
-
"shank_position": None if data.shank_position is None else serialize_f_64(data.shank_position),
|
|
1226
|
-
"torque_angle_gradient": None if data.torque_angle_gradient is None else serialize_f_64(data.torque_angle_gradient),
|
|
1227
|
-
"achieved_torque": None if data.achieved_torque is None else serialize_f_64(data.achieved_torque),
|
|
1228
|
-
"target_force": None if data.target_force is None else serialize_f_64(data.target_force),
|
|
1229
|
-
"target_torque": None if data.target_torque is None else serialize_f_64(data.target_torque),
|
|
1230
|
-
"quick_changer_version": None if data.quick_changer_version is None else serialize_i_32(data.quick_changer_version),
|
|
1231
|
-
"uncalibrated_error": None if data.uncalibrated_error is None else serialize_bool(data.uncalibrated_error),
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
class OrientationKindEnum(Enum):
|
|
1235
|
-
Quaternion = "quaternion"
|
|
1236
|
-
"""Enum Quaternion = `quaternion`"""
|
|
1237
|
-
|
|
1238
|
-
def parse_orientation_kind_enum(data: object) -> OrientationKindEnum:
|
|
1239
|
-
return OrientationKindEnum(data)
|
|
1240
|
-
|
|
1241
|
-
def serialize_orientation_kind_enum(data: Union[OrientationKindEnum, str]) -> object:
|
|
1242
|
-
return OrientationKindEnum(data).value
|
|
1243
|
-
|
|
1244
|
-
@dataclass
|
|
1245
|
-
class Pagination:
|
|
1246
|
-
"""Common Pagination Metadata"""
|
|
1247
|
-
total: Union[int, None] = None
|
|
1248
|
-
limit: Union[int, None] = None
|
|
1249
|
-
offset: Union[int, None] = None
|
|
1250
|
-
|
|
1251
|
-
def validate_total(self, value: int) -> Tuple[bool, str]:
|
|
1587
|
+
def validate_i(self, value: float) -> Tuple[bool, str]:
|
|
1252
1588
|
if value is None:
|
|
1253
1589
|
return [True, ""]
|
|
1254
1590
|
|
|
1255
|
-
if not isinstance(value,
|
|
1256
|
-
return [False, "
|
|
1591
|
+
if not isinstance(value, float):
|
|
1592
|
+
return [False, "i must be of type float for PositionPose, got " + type(value).__name__]
|
|
1257
1593
|
|
|
1258
1594
|
return [True, ""]
|
|
1259
1595
|
|
|
1260
|
-
def
|
|
1596
|
+
def validate_j(self, value: float) -> Tuple[bool, str]:
|
|
1261
1597
|
if value is None:
|
|
1262
1598
|
return [True, ""]
|
|
1263
1599
|
|
|
1264
|
-
if not isinstance(value,
|
|
1265
|
-
return [False, "
|
|
1600
|
+
if not isinstance(value, float):
|
|
1601
|
+
return [False, "j must be of type float for PositionPose, got " + type(value).__name__]
|
|
1266
1602
|
|
|
1267
1603
|
return [True, ""]
|
|
1268
1604
|
|
|
1269
|
-
def
|
|
1605
|
+
def validate_k(self, value: float) -> Tuple[bool, str]:
|
|
1270
1606
|
if value is None:
|
|
1271
1607
|
return [True, ""]
|
|
1272
1608
|
|
|
1273
|
-
if not isinstance(value,
|
|
1274
|
-
return [False, "
|
|
1609
|
+
if not isinstance(value, float):
|
|
1610
|
+
return [False, "k must be of type float for PositionPose, got " + type(value).__name__]
|
|
1275
1611
|
|
|
1276
1612
|
return [True, ""]
|
|
1277
1613
|
|
|
1278
1614
|
def __post_init__(self):
|
|
1279
1615
|
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1280
|
-
is_valid, error_str = self.
|
|
1616
|
+
is_valid, error_str = self.validate_x(self.x)
|
|
1281
1617
|
if not is_valid:
|
|
1282
1618
|
raise TypeError(error_str)
|
|
1283
|
-
is_valid, error_str = self.
|
|
1619
|
+
is_valid, error_str = self.validate_y(self.y)
|
|
1284
1620
|
if not is_valid:
|
|
1285
1621
|
raise TypeError(error_str)
|
|
1286
|
-
is_valid, error_str = self.
|
|
1622
|
+
is_valid, error_str = self.validate_z(self.z)
|
|
1287
1623
|
if not is_valid:
|
|
1288
1624
|
raise TypeError(error_str)
|
|
1289
|
-
|
|
1290
|
-
def parse_pagination(data: object):
|
|
1291
|
-
return Pagination(
|
|
1292
|
-
total=parse_i_64(data["total"]) if "total" in data else None,
|
|
1293
|
-
limit=parse_i_64(data["limit"]) if "limit" in data else None,
|
|
1294
|
-
offset=parse_i_64(data["offset"]) if "offset" in data else None,
|
|
1295
|
-
)
|
|
1296
|
-
|
|
1297
|
-
def serialize_pagination(data: Pagination) -> object:
|
|
1298
|
-
return {
|
|
1299
|
-
"total": None if data.total is None else serialize_i_64(data.total),
|
|
1300
|
-
"limit": None if data.limit is None else serialize_i_64(data.limit),
|
|
1301
|
-
"offset": None if data.offset is None else serialize_i_64(data.offset),
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
@dataclass
|
|
1305
|
-
class Plane:
|
|
1306
|
-
"""Plane in 3D space"""
|
|
1307
|
-
id: Union[str, None] = None
|
|
1308
|
-
name: Union[str, None] = None
|
|
1309
|
-
|
|
1310
|
-
def validate_id(self, value: str) -> Tuple[bool, str]:
|
|
1311
|
-
if value is None:
|
|
1312
|
-
return [True, ""]
|
|
1313
|
-
|
|
1314
|
-
if not isinstance(value, str):
|
|
1315
|
-
return [False, "id must be of type str for Plane, got " + type(value).__name__]
|
|
1316
|
-
|
|
1317
|
-
return [True, ""]
|
|
1318
|
-
|
|
1319
|
-
def validate_name(self, value: str) -> Tuple[bool, str]:
|
|
1320
|
-
if value is None:
|
|
1321
|
-
return [True, ""]
|
|
1322
|
-
|
|
1323
|
-
if not isinstance(value, str):
|
|
1324
|
-
return [False, "name must be of type str for Plane, got " + type(value).__name__]
|
|
1325
|
-
|
|
1326
|
-
return [True, ""]
|
|
1327
|
-
|
|
1328
|
-
def __post_init__(self):
|
|
1329
|
-
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1330
|
-
is_valid, error_str = self.validate_id(self.id)
|
|
1625
|
+
is_valid, error_str = self.validate_w(self.w)
|
|
1331
1626
|
if not is_valid:
|
|
1332
1627
|
raise TypeError(error_str)
|
|
1333
|
-
is_valid, error_str = self.
|
|
1628
|
+
is_valid, error_str = self.validate_i(self.i)
|
|
1629
|
+
if not is_valid:
|
|
1630
|
+
raise TypeError(error_str)
|
|
1631
|
+
is_valid, error_str = self.validate_j(self.j)
|
|
1632
|
+
if not is_valid:
|
|
1633
|
+
raise TypeError(error_str)
|
|
1634
|
+
is_valid, error_str = self.validate_k(self.k)
|
|
1334
1635
|
if not is_valid:
|
|
1335
1636
|
raise TypeError(error_str)
|
|
1336
1637
|
|
|
1337
|
-
def
|
|
1338
|
-
return
|
|
1339
|
-
|
|
1340
|
-
|
|
1638
|
+
def parse_position_pose(data: object):
|
|
1639
|
+
return PositionPose(
|
|
1640
|
+
x=parse_f_64(data["x"]) if "x" in data and data.get("x") is not None else None,
|
|
1641
|
+
y=parse_f_64(data["y"]) if "y" in data and data.get("y") is not None else None,
|
|
1642
|
+
z=parse_f_64(data["z"]) if "z" in data and data.get("z") is not None else None,
|
|
1643
|
+
w=parse_f_64(data["w"]) if "w" in data and data.get("w") is not None else None,
|
|
1644
|
+
i=parse_f_64(data["i"]) if "i" in data and data.get("i") is not None else None,
|
|
1645
|
+
j=parse_f_64(data["j"]) if "j" in data and data.get("j") is not None else None,
|
|
1646
|
+
k=parse_f_64(data["k"]) if "k" in data and data.get("k") is not None else None,
|
|
1341
1647
|
)
|
|
1342
1648
|
|
|
1343
|
-
def
|
|
1649
|
+
def serialize_position_pose(data: PositionPose) -> object:
|
|
1344
1650
|
return {
|
|
1345
|
-
"
|
|
1346
|
-
"
|
|
1651
|
+
"x": None if data.x is None else serialize_f_64(data.x),
|
|
1652
|
+
"y": None if data.y is None else serialize_f_64(data.y),
|
|
1653
|
+
"z": None if data.z is None else serialize_f_64(data.z),
|
|
1654
|
+
"w": None if data.w is None else serialize_f_64(data.w),
|
|
1655
|
+
"i": None if data.i is None else serialize_f_64(data.i),
|
|
1656
|
+
"j": None if data.j is None else serialize_f_64(data.j),
|
|
1657
|
+
"k": None if data.k is None else serialize_f_64(data.k),
|
|
1347
1658
|
}
|
|
1348
1659
|
|
|
1349
1660
|
@dataclass
|
|
@@ -1407,10 +1718,10 @@ class Quaternion:
|
|
|
1407
1718
|
|
|
1408
1719
|
def parse_quaternion(data: object):
|
|
1409
1720
|
return Quaternion(
|
|
1410
|
-
x=parse_f_64(data["x"]) if "x" in data else None,
|
|
1411
|
-
y=parse_f_64(data["y"]) if "y" in data else None,
|
|
1412
|
-
z=parse_f_64(data["z"]) if "z" in data else None,
|
|
1413
|
-
w=parse_f_64(data["w"]) if "w" in data else None,
|
|
1721
|
+
x=parse_f_64(data["x"]) if "x" in data and data.get("x") is not None else None,
|
|
1722
|
+
y=parse_f_64(data["y"]) if "y" in data and data.get("y") is not None else None,
|
|
1723
|
+
z=parse_f_64(data["z"]) if "z" in data and data.get("z") is not None else None,
|
|
1724
|
+
w=parse_f_64(data["w"]) if "w" in data and data.get("w") is not None else None,
|
|
1414
1725
|
)
|
|
1415
1726
|
|
|
1416
1727
|
def serialize_quaternion(data: Quaternion) -> object:
|
|
@@ -1421,6 +1732,70 @@ def serialize_quaternion(data: Quaternion) -> object:
|
|
|
1421
1732
|
"w": None if data.w is None else serialize_f_64(data.w),
|
|
1422
1733
|
}
|
|
1423
1734
|
|
|
1735
|
+
class RecoveryStateEnum(Enum):
|
|
1736
|
+
Success = "Success"
|
|
1737
|
+
"""Enum Success = `Success`"""
|
|
1738
|
+
Interrupted = "Interrupted"
|
|
1739
|
+
"""Enum Interrupted = `Interrupted`"""
|
|
1740
|
+
NonIdle = "NonIdle"
|
|
1741
|
+
"""Enum NonIdle = `NonIdle`"""
|
|
1742
|
+
Braked = "Braked"
|
|
1743
|
+
"""Enum Braked = `Braked`"""
|
|
1744
|
+
PlanningFailure = "PlanningFailure"
|
|
1745
|
+
"""Enum PlanningFailure = `PlanningFailure`"""
|
|
1746
|
+
ExecutionFailure = "ExecutionFailure"
|
|
1747
|
+
"""Enum ExecutionFailure = `ExecutionFailure`"""
|
|
1748
|
+
ControlSystemFailure = "ControlSystemFailure"
|
|
1749
|
+
"""Enum ControlSystemFailure = `ControlSystemFailure`"""
|
|
1750
|
+
EStopTriggered = "EStopTriggered"
|
|
1751
|
+
"""Enum EStopTriggered = `EStopTriggered`"""
|
|
1752
|
+
GripperFailure = "GripperFailure"
|
|
1753
|
+
"""Enum GripperFailure = `GripperFailure`"""
|
|
1754
|
+
OutOfJointLimitsFailure = "OutOfJointLimitsFailure"
|
|
1755
|
+
"""Enum OutOfJointLimitsFailure = `OutOfJointLimitsFailure`"""
|
|
1756
|
+
CollisionFailure = "CollisionFailure"
|
|
1757
|
+
"""Enum CollisionFailure = `CollisionFailure`"""
|
|
1758
|
+
TorqueCollisionFailure = "TorqueCollisionFailure"
|
|
1759
|
+
"""Enum TorqueCollisionFailure = `TorqueCollisionFailure`"""
|
|
1760
|
+
InBoxingPositionFailure = "InBoxingPositionFailure"
|
|
1761
|
+
"""Enum InBoxingPositionFailure = `InBoxingPositionFailure`"""
|
|
1762
|
+
PowerBoardCheckFailure = "PowerBoardCheckFailure"
|
|
1763
|
+
"""Enum PowerBoardCheckFailure = `PowerBoardCheckFailure`"""
|
|
1764
|
+
MotionPlannerFailure = "MotionPlannerFailure"
|
|
1765
|
+
"""Enum MotionPlannerFailure = `MotionPlannerFailure`"""
|
|
1766
|
+
MotionPlannerFailureStartPositionCollision = "MotionPlannerFailureStartPositionCollision"
|
|
1767
|
+
"""Enum MotionPlannerFailureStartPositionCollision = `MotionPlannerFailureStartPositionCollision`"""
|
|
1768
|
+
IOFailure = "IOFailure"
|
|
1769
|
+
"""Enum IOFailure = `IOFailure`"""
|
|
1770
|
+
InvalidRoutineLoadedFailure = "InvalidRoutineLoadedFailure"
|
|
1771
|
+
"""Enum InvalidRoutineLoadedFailure = `InvalidRoutineLoadedFailure`"""
|
|
1772
|
+
InferenceFailure = "InferenceFailure"
|
|
1773
|
+
"""Enum InferenceFailure = `InferenceFailure`"""
|
|
1774
|
+
CameraFailure = "CameraFailure"
|
|
1775
|
+
"""Enum CameraFailure = `CameraFailure`"""
|
|
1776
|
+
HaasFailure = "HaasFailure"
|
|
1777
|
+
"""Enum HaasFailure = `HaasFailure`"""
|
|
1778
|
+
BotmanHeartbeatLost = "BotmanHeartbeatLost"
|
|
1779
|
+
"""Enum BotmanHeartbeatLost = `BotmanHeartbeatLost`"""
|
|
1780
|
+
InternalFailure = "InternalFailure"
|
|
1781
|
+
"""Enum InternalFailure = `InternalFailure`"""
|
|
1782
|
+
TorqueLimitExceeded = "TorqueLimitExceeded"
|
|
1783
|
+
"""Enum TorqueLimitExceeded = `TorqueLimitExceeded`"""
|
|
1784
|
+
StepPlayFailure = "StepPlayFailure"
|
|
1785
|
+
"""Enum StepPlayFailure = `StepPlayFailure`"""
|
|
1786
|
+
UnbrakeFailure = "UnbrakeFailure"
|
|
1787
|
+
"""Enum UnbrakeFailure = `UnbrakeFailure`"""
|
|
1788
|
+
WeldFailure = "WeldFailure"
|
|
1789
|
+
"""Enum WeldFailure = `WeldFailure`"""
|
|
1790
|
+
TriggerFaultFailure = "TriggerFaultFailure"
|
|
1791
|
+
"""Enum TriggerFaultFailure = `TriggerFaultFailure`"""
|
|
1792
|
+
|
|
1793
|
+
def parse_recovery_state_enum(data: object) -> RecoveryStateEnum:
|
|
1794
|
+
return RecoveryStateEnum(data)
|
|
1795
|
+
|
|
1796
|
+
def serialize_recovery_state_enum(data: Union[RecoveryStateEnum, str]) -> object:
|
|
1797
|
+
return RecoveryStateEnum(data).value
|
|
1798
|
+
|
|
1424
1799
|
class RecoveryTypeEnum(Enum):
|
|
1425
1800
|
Recoverable = "Recoverable"
|
|
1426
1801
|
"""Enum Recoverable = `Recoverable`"""
|
|
@@ -1451,28 +1826,6 @@ def parse_robot_control_mode_enum(data: object) -> RobotControlModeEnum:
|
|
|
1451
1826
|
def serialize_robot_control_mode_enum(data: Union[RobotControlModeEnum, str]) -> object:
|
|
1452
1827
|
return RobotControlModeEnum(data).value
|
|
1453
1828
|
|
|
1454
|
-
class RobotStatusEnum(Enum):
|
|
1455
|
-
Idle = "Idle"
|
|
1456
|
-
"""Enum Idle = `Idle`"""
|
|
1457
|
-
RunningAdHocCommand = "RunningAdHocCommand"
|
|
1458
|
-
"""Enum RunningAdHocCommand = `RunningAdHocCommand`"""
|
|
1459
|
-
RoutineRunning = "RoutineRunning"
|
|
1460
|
-
"""Enum RoutineRunning = `RoutineRunning`"""
|
|
1461
|
-
Antigravity = "Antigravity"
|
|
1462
|
-
"""Enum Antigravity = `Antigravity`"""
|
|
1463
|
-
AntigravitySlow = "AntigravitySlow"
|
|
1464
|
-
"""Enum AntigravitySlow = `AntigravitySlow`"""
|
|
1465
|
-
Failure = "Failure"
|
|
1466
|
-
"""Enum Failure = `Failure`"""
|
|
1467
|
-
Recovering = "Recovering"
|
|
1468
|
-
"""Enum Recovering = `Recovering`"""
|
|
1469
|
-
|
|
1470
|
-
def parse_robot_status_enum(data: object) -> RobotStatusEnum:
|
|
1471
|
-
return RobotStatusEnum(data)
|
|
1472
|
-
|
|
1473
|
-
def serialize_robot_status_enum(data: Union[RobotStatusEnum, str]) -> object:
|
|
1474
|
-
return RobotStatusEnum(data).value
|
|
1475
|
-
|
|
1476
1829
|
class ROSControlStateEnum(Enum):
|
|
1477
1830
|
Enabled = "enabled"
|
|
1478
1831
|
"""ROS control is enabled."""
|
|
@@ -1485,51 +1838,210 @@ def parse_ros_control_state_enum(data: object) -> ROSControlStateEnum:
|
|
|
1485
1838
|
def serialize_ros_control_state_enum(data: Union[ROSControlStateEnum, str]) -> object:
|
|
1486
1839
|
return ROSControlStateEnum(data).value
|
|
1487
1840
|
|
|
1488
|
-
|
|
1841
|
+
@dataclass
|
|
1842
|
+
class RoutineStateResponse:
|
|
1843
|
+
"""State of the routine."""
|
|
1844
|
+
is_paused: Union[bool, None] = None
|
|
1845
|
+
current_step_id: Union[str, None] = None
|
|
1846
|
+
start_time: Union[str, None] = None
|
|
1847
|
+
run_time_seconds: Union[float, None] = None
|
|
1848
|
+
cycle_count: Union[int, None] = None
|
|
1849
|
+
total_expected_cycles: Union[int, None] = None
|
|
1850
|
+
should_next_arm_move_be_guided_mode: Union[bool, None] = None
|
|
1851
|
+
is_preflight_test_run: Union[bool, None] = None
|
|
1489
1852
|
|
|
1490
|
-
def
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
}
|
|
1853
|
+
def validate_is_paused(self, value: bool) -> Tuple[bool, str]:
|
|
1854
|
+
if value is None:
|
|
1855
|
+
return [False, "is_paused is required for RoutineStateResponse"]
|
|
1494
1856
|
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
serialize_str(key): serialize_str(value) for key, value in data.items()
|
|
1498
|
-
}
|
|
1857
|
+
if not isinstance(value, bool):
|
|
1858
|
+
return [False, "is_paused must be of type bool for RoutineStateResponse, got " + type(value).__name__]
|
|
1499
1859
|
|
|
1500
|
-
|
|
1501
|
-
class RuntimeVariable:
|
|
1502
|
-
"""Runtime Variable state"""
|
|
1503
|
-
value: Union[str, None] = None
|
|
1860
|
+
return [True, ""]
|
|
1504
1861
|
|
|
1505
|
-
def
|
|
1862
|
+
def validate_current_step_id(self, value: str) -> Tuple[bool, str]:
|
|
1506
1863
|
if value is None:
|
|
1507
|
-
return [
|
|
1864
|
+
return [False, "current_step_id is required for RoutineStateResponse"]
|
|
1508
1865
|
|
|
1509
1866
|
if not isinstance(value, str):
|
|
1510
|
-
return [False, "
|
|
1867
|
+
return [False, "current_step_id must be of type str for RoutineStateResponse, got " + type(value).__name__]
|
|
1511
1868
|
|
|
1512
1869
|
return [True, ""]
|
|
1513
1870
|
|
|
1514
|
-
def
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
if not is_valid:
|
|
1518
|
-
raise TypeError(error_str)
|
|
1871
|
+
def validate_start_time(self, value: str) -> Tuple[bool, str]:
|
|
1872
|
+
if value is None:
|
|
1873
|
+
return [False, "start_time is required for RoutineStateResponse"]
|
|
1519
1874
|
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
value=parse_str(data["value"]) if "value" in data else None,
|
|
1523
|
-
)
|
|
1875
|
+
if not isinstance(value, str):
|
|
1876
|
+
return [False, "start_time must be of type str for RoutineStateResponse, got " + type(value).__name__]
|
|
1524
1877
|
|
|
1525
|
-
|
|
1526
|
-
return {
|
|
1527
|
-
"value": None if data.value is None else serialize_str(data.value),
|
|
1528
|
-
}
|
|
1878
|
+
return [True, ""]
|
|
1529
1879
|
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1880
|
+
def validate_run_time_seconds(self, value: float) -> Tuple[bool, str]:
|
|
1881
|
+
if value is None:
|
|
1882
|
+
return [False, "run_time_seconds is required for RoutineStateResponse"]
|
|
1883
|
+
|
|
1884
|
+
if not isinstance(value, float):
|
|
1885
|
+
return [False, "run_time_seconds must be of type float for RoutineStateResponse, got " + type(value).__name__]
|
|
1886
|
+
|
|
1887
|
+
return [True, ""]
|
|
1888
|
+
|
|
1889
|
+
def validate_cycle_count(self, value: int) -> Tuple[bool, str]:
|
|
1890
|
+
if value is None:
|
|
1891
|
+
return [True, ""]
|
|
1892
|
+
|
|
1893
|
+
if not isinstance(value, int):
|
|
1894
|
+
return [False, "cycle_count must be of type int for RoutineStateResponse, got " + type(value).__name__]
|
|
1895
|
+
|
|
1896
|
+
return [True, ""]
|
|
1897
|
+
|
|
1898
|
+
def validate_total_expected_cycles(self, value: int) -> Tuple[bool, str]:
|
|
1899
|
+
if value is None:
|
|
1900
|
+
return [True, ""]
|
|
1901
|
+
|
|
1902
|
+
if not isinstance(value, int):
|
|
1903
|
+
return [False, "total_expected_cycles must be of type int for RoutineStateResponse, got " + type(value).__name__]
|
|
1904
|
+
|
|
1905
|
+
return [True, ""]
|
|
1906
|
+
|
|
1907
|
+
def validate_should_next_arm_move_be_guided_mode(self, value: bool) -> Tuple[bool, str]:
|
|
1908
|
+
if value is None:
|
|
1909
|
+
return [True, ""]
|
|
1910
|
+
|
|
1911
|
+
if not isinstance(value, bool):
|
|
1912
|
+
return [False, "should_next_arm_move_be_guided_mode must be of type bool for RoutineStateResponse, got " + type(value).__name__]
|
|
1913
|
+
|
|
1914
|
+
return [True, ""]
|
|
1915
|
+
|
|
1916
|
+
def validate_is_preflight_test_run(self, value: bool) -> Tuple[bool, str]:
|
|
1917
|
+
if value is None:
|
|
1918
|
+
return [False, "is_preflight_test_run is required for RoutineStateResponse"]
|
|
1919
|
+
|
|
1920
|
+
if not isinstance(value, bool):
|
|
1921
|
+
return [False, "is_preflight_test_run must be of type bool for RoutineStateResponse, got " + type(value).__name__]
|
|
1922
|
+
|
|
1923
|
+
return [True, ""]
|
|
1924
|
+
|
|
1925
|
+
def __post_init__(self):
|
|
1926
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1927
|
+
is_valid, error_str = self.validate_is_paused(self.is_paused)
|
|
1928
|
+
if not is_valid:
|
|
1929
|
+
raise TypeError(error_str)
|
|
1930
|
+
is_valid, error_str = self.validate_current_step_id(self.current_step_id)
|
|
1931
|
+
if not is_valid:
|
|
1932
|
+
raise TypeError(error_str)
|
|
1933
|
+
is_valid, error_str = self.validate_start_time(self.start_time)
|
|
1934
|
+
if not is_valid:
|
|
1935
|
+
raise TypeError(error_str)
|
|
1936
|
+
is_valid, error_str = self.validate_run_time_seconds(self.run_time_seconds)
|
|
1937
|
+
if not is_valid:
|
|
1938
|
+
raise TypeError(error_str)
|
|
1939
|
+
is_valid, error_str = self.validate_cycle_count(self.cycle_count)
|
|
1940
|
+
if not is_valid:
|
|
1941
|
+
raise TypeError(error_str)
|
|
1942
|
+
is_valid, error_str = self.validate_total_expected_cycles(self.total_expected_cycles)
|
|
1943
|
+
if not is_valid:
|
|
1944
|
+
raise TypeError(error_str)
|
|
1945
|
+
is_valid, error_str = self.validate_should_next_arm_move_be_guided_mode(self.should_next_arm_move_be_guided_mode)
|
|
1946
|
+
if not is_valid:
|
|
1947
|
+
raise TypeError(error_str)
|
|
1948
|
+
is_valid, error_str = self.validate_is_preflight_test_run(self.is_preflight_test_run)
|
|
1949
|
+
if not is_valid:
|
|
1950
|
+
raise TypeError(error_str)
|
|
1951
|
+
|
|
1952
|
+
def parse_routine_state_response(data: object):
|
|
1953
|
+
return RoutineStateResponse(
|
|
1954
|
+
is_paused=parse_bool(data["is_paused"]) if "is_paused" in data and data.get("is_paused") is not None else None,
|
|
1955
|
+
current_step_id=parse_str(data["current_step_id"]) if "current_step_id" in data and data.get("current_step_id") is not None else None,
|
|
1956
|
+
start_time=parse_str(data["start_time"]) if "start_time" in data and data.get("start_time") is not None else None,
|
|
1957
|
+
run_time_seconds=parse_f_64(data["run_time_seconds"]) if "run_time_seconds" in data and data.get("run_time_seconds") is not None else None,
|
|
1958
|
+
cycle_count=parse_i_64(data["cycle_count"]) if "cycle_count" in data and data.get("cycle_count") is not None else None,
|
|
1959
|
+
total_expected_cycles=parse_i_64(data["total_expected_cycles"]) if "total_expected_cycles" in data and data.get("total_expected_cycles") is not None else None,
|
|
1960
|
+
should_next_arm_move_be_guided_mode=parse_bool(data["should_next_arm_move_be_guided_mode"]) if "should_next_arm_move_be_guided_mode" in data and data.get("should_next_arm_move_be_guided_mode") is not None else None,
|
|
1961
|
+
is_preflight_test_run=parse_bool(data["is_preflight_test_run"]) if "is_preflight_test_run" in data and data.get("is_preflight_test_run") is not None else None,
|
|
1962
|
+
)
|
|
1963
|
+
|
|
1964
|
+
def serialize_routine_state_response(data: RoutineStateResponse) -> object:
|
|
1965
|
+
return {
|
|
1966
|
+
"is_paused": serialize_bool(data.is_paused),
|
|
1967
|
+
"current_step_id": serialize_str(data.current_step_id),
|
|
1968
|
+
"start_time": serialize_str(data.start_time),
|
|
1969
|
+
"run_time_seconds": serialize_f_64(data.run_time_seconds),
|
|
1970
|
+
"cycle_count": None if data.cycle_count is None else serialize_i_64(data.cycle_count),
|
|
1971
|
+
"total_expected_cycles": None if data.total_expected_cycles is None else serialize_i_64(data.total_expected_cycles),
|
|
1972
|
+
"should_next_arm_move_be_guided_mode": None if data.should_next_arm_move_be_guided_mode is None else serialize_bool(data.should_next_arm_move_be_guided_mode),
|
|
1973
|
+
"is_preflight_test_run": serialize_bool(data.is_preflight_test_run),
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1976
|
+
RoutineStepVariablesData = Dict[str, str]
|
|
1977
|
+
|
|
1978
|
+
def parse_routine_step_variables_data(data: object) -> RoutineStepVariablesData:
|
|
1979
|
+
return {
|
|
1980
|
+
parse_str(key): parse_str(value) for key, value in data.items()
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
def serialize_routine_step_variables_data(data: RoutineStepVariablesData) -> object:
|
|
1984
|
+
return {
|
|
1985
|
+
serialize_str(key): serialize_str(value) for key, value in data.items()
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
RoutineStepVariablesIdMap = Dict[str, str]
|
|
1989
|
+
|
|
1990
|
+
def parse_routine_step_variables_id_map(data: object) -> RoutineStepVariablesIdMap:
|
|
1991
|
+
return {
|
|
1992
|
+
parse_str(key): parse_str(value) for key, value in data.items()
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
def serialize_routine_step_variables_id_map(data: RoutineStepVariablesIdMap) -> object:
|
|
1996
|
+
return {
|
|
1997
|
+
serialize_str(key): serialize_str(value) for key, value in data.items()
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
RoutineVariablesStateMap = Dict[str, str]
|
|
2001
|
+
|
|
2002
|
+
def parse_routine_variables_state_map(data: object) -> RoutineVariablesStateMap:
|
|
2003
|
+
return {
|
|
2004
|
+
parse_str(key): parse_str(value) for key, value in data.items()
|
|
2005
|
+
}
|
|
2006
|
+
|
|
2007
|
+
def serialize_routine_variables_state_map(data: RoutineVariablesStateMap) -> object:
|
|
2008
|
+
return {
|
|
2009
|
+
serialize_str(key): serialize_str(value) for key, value in data.items()
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2012
|
+
@dataclass
|
|
2013
|
+
class RuntimeVariable:
|
|
2014
|
+
"""Runtime Variable state"""
|
|
2015
|
+
value: Union[str, None] = None
|
|
2016
|
+
|
|
2017
|
+
def validate_value(self, value: str) -> Tuple[bool, str]:
|
|
2018
|
+
if value is None:
|
|
2019
|
+
return [True, ""]
|
|
2020
|
+
|
|
2021
|
+
if not isinstance(value, str):
|
|
2022
|
+
return [False, "value must be of type str for RuntimeVariable, got " + type(value).__name__]
|
|
2023
|
+
|
|
2024
|
+
return [True, ""]
|
|
2025
|
+
|
|
2026
|
+
def __post_init__(self):
|
|
2027
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2028
|
+
is_valid, error_str = self.validate_value(self.value)
|
|
2029
|
+
if not is_valid:
|
|
2030
|
+
raise TypeError(error_str)
|
|
2031
|
+
|
|
2032
|
+
def parse_runtime_variable(data: object):
|
|
2033
|
+
return RuntimeVariable(
|
|
2034
|
+
value=parse_str(data["value"]) if "value" in data and data.get("value") is not None else None,
|
|
2035
|
+
)
|
|
2036
|
+
|
|
2037
|
+
def serialize_runtime_variable(data: RuntimeVariable) -> object:
|
|
2038
|
+
return {
|
|
2039
|
+
"value": None if data.value is None else serialize_str(data.value),
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
class SchunkEGxControlKindEnum(Enum):
|
|
2043
|
+
Move = "move"
|
|
2044
|
+
"""Move gripper to target grip diameter"""
|
|
1533
2045
|
|
|
1534
2046
|
def parse_schunk_e_gx_control_kind_enum(data: object) -> SchunkEGxControlKindEnum:
|
|
1535
2047
|
return SchunkEGxControlKindEnum(data)
|
|
@@ -1537,6 +2049,96 @@ def parse_schunk_e_gx_control_kind_enum(data: object) -> SchunkEGxControlKindEnu
|
|
|
1537
2049
|
def serialize_schunk_e_gx_control_kind_enum(data: Union[SchunkEGxControlKindEnum, str]) -> object:
|
|
1538
2050
|
return SchunkEGxControlKindEnum(data).value
|
|
1539
2051
|
|
|
2052
|
+
@dataclass
|
|
2053
|
+
class Sensor:
|
|
2054
|
+
"""Individual sensor information"""
|
|
2055
|
+
id: Union[str, None] = None
|
|
2056
|
+
name: Union[str, None] = None
|
|
2057
|
+
kind: Union[str, None] = None
|
|
2058
|
+
sensorValue: Union[str, None] = None
|
|
2059
|
+
equipmentId: Union[str, None] = None
|
|
2060
|
+
|
|
2061
|
+
def validate_id(self, value: str) -> Tuple[bool, str]:
|
|
2062
|
+
if value is None:
|
|
2063
|
+
return [True, ""]
|
|
2064
|
+
|
|
2065
|
+
if not isinstance(value, str):
|
|
2066
|
+
return [False, "id must be of type str for Sensor, got " + type(value).__name__]
|
|
2067
|
+
|
|
2068
|
+
return [True, ""]
|
|
2069
|
+
|
|
2070
|
+
def validate_name(self, value: str) -> Tuple[bool, str]:
|
|
2071
|
+
if value is None:
|
|
2072
|
+
return [True, ""]
|
|
2073
|
+
|
|
2074
|
+
if not isinstance(value, str):
|
|
2075
|
+
return [False, "name must be of type str for Sensor, got " + type(value).__name__]
|
|
2076
|
+
|
|
2077
|
+
return [True, ""]
|
|
2078
|
+
|
|
2079
|
+
def validate_kind(self, value: str) -> Tuple[bool, str]:
|
|
2080
|
+
if value is None:
|
|
2081
|
+
return [True, ""]
|
|
2082
|
+
|
|
2083
|
+
if not isinstance(value, str):
|
|
2084
|
+
return [False, "kind must be of type str for Sensor, got " + type(value).__name__]
|
|
2085
|
+
|
|
2086
|
+
return [True, ""]
|
|
2087
|
+
|
|
2088
|
+
def validate_sensorValue(self, value: str) -> Tuple[bool, str]:
|
|
2089
|
+
if value is None:
|
|
2090
|
+
return [True, ""]
|
|
2091
|
+
|
|
2092
|
+
if not isinstance(value, str):
|
|
2093
|
+
return [False, "sensorValue must be of type str for Sensor, got " + type(value).__name__]
|
|
2094
|
+
|
|
2095
|
+
return [True, ""]
|
|
2096
|
+
|
|
2097
|
+
def validate_equipmentId(self, value: str) -> Tuple[bool, str]:
|
|
2098
|
+
if value is None:
|
|
2099
|
+
return [True, ""]
|
|
2100
|
+
|
|
2101
|
+
if not isinstance(value, str):
|
|
2102
|
+
return [False, "equipmentId must be of type str for Sensor, got " + type(value).__name__]
|
|
2103
|
+
|
|
2104
|
+
return [True, ""]
|
|
2105
|
+
|
|
2106
|
+
def __post_init__(self):
|
|
2107
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2108
|
+
is_valid, error_str = self.validate_id(self.id)
|
|
2109
|
+
if not is_valid:
|
|
2110
|
+
raise TypeError(error_str)
|
|
2111
|
+
is_valid, error_str = self.validate_name(self.name)
|
|
2112
|
+
if not is_valid:
|
|
2113
|
+
raise TypeError(error_str)
|
|
2114
|
+
is_valid, error_str = self.validate_kind(self.kind)
|
|
2115
|
+
if not is_valid:
|
|
2116
|
+
raise TypeError(error_str)
|
|
2117
|
+
is_valid, error_str = self.validate_sensorValue(self.sensorValue)
|
|
2118
|
+
if not is_valid:
|
|
2119
|
+
raise TypeError(error_str)
|
|
2120
|
+
is_valid, error_str = self.validate_equipmentId(self.equipmentId)
|
|
2121
|
+
if not is_valid:
|
|
2122
|
+
raise TypeError(error_str)
|
|
2123
|
+
|
|
2124
|
+
def parse_sensor(data: object):
|
|
2125
|
+
return Sensor(
|
|
2126
|
+
id=parse_str(data["id"]) if "id" in data and data.get("id") is not None else None,
|
|
2127
|
+
name=parse_str(data["name"]) if "name" in data and data.get("name") is not None else None,
|
|
2128
|
+
kind=parse_str(data["kind"]) if "kind" in data and data.get("kind") is not None else None,
|
|
2129
|
+
sensorValue=parse_str(data["sensorValue"]) if "sensorValue" in data and data.get("sensorValue") is not None else None,
|
|
2130
|
+
equipmentId=parse_str(data["equipmentId"]) if "equipmentId" in data and data.get("equipmentId") is not None else None,
|
|
2131
|
+
)
|
|
2132
|
+
|
|
2133
|
+
def serialize_sensor(data: Sensor) -> object:
|
|
2134
|
+
return {
|
|
2135
|
+
"id": None if data.id is None else serialize_str(data.id),
|
|
2136
|
+
"name": None if data.name is None else serialize_str(data.name),
|
|
2137
|
+
"kind": None if data.kind is None else serialize_str(data.kind),
|
|
2138
|
+
"sensorValue": None if data.sensorValue is None else serialize_str(data.sensorValue),
|
|
2139
|
+
"equipmentId": None if data.equipmentId is None else serialize_str(data.equipmentId),
|
|
2140
|
+
}
|
|
2141
|
+
|
|
1540
2142
|
SkillsList = List[str]
|
|
1541
2143
|
|
|
1542
2144
|
def parse_skills_list(data: object) -> SkillsList:
|
|
@@ -1567,7 +2169,7 @@ class SpeechToTextRequest:
|
|
|
1567
2169
|
|
|
1568
2170
|
def parse_speech_to_text_request(data: object):
|
|
1569
2171
|
return SpeechToTextRequest(
|
|
1570
|
-
encoded_audio_data=parse_str(data["encoded_audio_data"]) if "encoded_audio_data" in data else None,
|
|
2172
|
+
encoded_audio_data=parse_str(data["encoded_audio_data"]) if "encoded_audio_data" in data and data.get("encoded_audio_data") is not None else None,
|
|
1571
2173
|
)
|
|
1572
2174
|
|
|
1573
2175
|
def serialize_speech_to_text_request(data: SpeechToTextRequest) -> object:
|
|
@@ -1624,8 +2226,8 @@ class StatusVersionData:
|
|
|
1624
2226
|
|
|
1625
2227
|
def parse_status_version_data(data: object):
|
|
1626
2228
|
return StatusVersionData(
|
|
1627
|
-
id=parse_str(data["id"]) if "id" in data else None,
|
|
1628
|
-
name=parse_str(data["name"]) if "name" in data else None,
|
|
2229
|
+
id=parse_str(data["id"]) if "id" in data and data.get("id") is not None else None,
|
|
2230
|
+
name=parse_str(data["name"]) if "name" in data and data.get("name") is not None else None,
|
|
1629
2231
|
)
|
|
1630
2232
|
|
|
1631
2233
|
def serialize_status_version_data(data: StatusVersionData) -> object:
|
|
@@ -1670,8 +2272,8 @@ class TriggerFaultRequest:
|
|
|
1670
2272
|
|
|
1671
2273
|
def parse_trigger_fault_request(data: object):
|
|
1672
2274
|
return TriggerFaultRequest(
|
|
1673
|
-
message=parse_str(data["message"]) if "message" in data else None,
|
|
1674
|
-
isRecoverable=parse_bool(data["isRecoverable"]) if "isRecoverable" in data else None,
|
|
2275
|
+
message=parse_str(data["message"]) if "message" in data and data.get("message") is not None else None,
|
|
2276
|
+
isRecoverable=parse_bool(data["isRecoverable"]) if "isRecoverable" in data and data.get("isRecoverable") is not None else None,
|
|
1675
2277
|
)
|
|
1676
2278
|
|
|
1677
2279
|
def serialize_trigger_fault_request(data: TriggerFaultRequest) -> object:
|
|
@@ -1728,9 +2330,9 @@ class ArmPositionUpdateFailureEvent:
|
|
|
1728
2330
|
|
|
1729
2331
|
def parse_arm_position_update_failure_event(data: object):
|
|
1730
2332
|
return ArmPositionUpdateFailureEvent(
|
|
1731
|
-
kind=parse_arm_position_update_failure_event_kind(data["kind"]) if "kind" in data else None,
|
|
1732
|
-
reason=parse_str(data["reason"]) if "reason" in data else None,
|
|
1733
|
-
internal_reason=parse_str(data["internal_reason"]) if "internal_reason" in data else None,
|
|
2333
|
+
kind=parse_arm_position_update_failure_event_kind(data["kind"]) if "kind" in data and data.get("kind") is not None else None,
|
|
2334
|
+
reason=parse_str(data["reason"]) if "reason" in data and data.get("reason") is not None else None,
|
|
2335
|
+
internal_reason=parse_str(data["internal_reason"]) if "internal_reason" in data and data.get("internal_reason") is not None else None,
|
|
1734
2336
|
)
|
|
1735
2337
|
|
|
1736
2338
|
def serialize_arm_position_update_failure_event(data: ArmPositionUpdateFailureEvent) -> object:
|
|
@@ -1771,7 +2373,7 @@ class BrakesState:
|
|
|
1771
2373
|
|
|
1772
2374
|
def parse_brakes_state(data: object):
|
|
1773
2375
|
return BrakesState(
|
|
1774
|
-
state=parse_brakes_state_enum(data["state"]) if "state" in data else None,
|
|
2376
|
+
state=parse_brakes_state_enum(data["state"]) if "state" in data and data.get("state") is not None else None,
|
|
1775
2377
|
)
|
|
1776
2378
|
|
|
1777
2379
|
def serialize_brakes_state(data: BrakesState) -> object:
|
|
@@ -1801,7 +2403,7 @@ class CameraIntrinsicsResponse:
|
|
|
1801
2403
|
|
|
1802
2404
|
def parse_camera_intrinsics_response(data: object):
|
|
1803
2405
|
return CameraIntrinsicsResponse(
|
|
1804
|
-
intrinsics=parse_camera_intrinsics(data["intrinsics"]) if "intrinsics" in data else None,
|
|
2406
|
+
intrinsics=parse_camera_intrinsics(data["intrinsics"]) if "intrinsics" in data and data.get("intrinsics") is not None else None,
|
|
1805
2407
|
)
|
|
1806
2408
|
|
|
1807
2409
|
def serialize_camera_intrinsics_response(data: CameraIntrinsicsResponse) -> object:
|
|
@@ -1831,7 +2433,7 @@ class CameraFrameRequest:
|
|
|
1831
2433
|
|
|
1832
2434
|
def parse_camera_frame_request(data: object):
|
|
1833
2435
|
return CameraFrameRequest(
|
|
1834
|
-
camera_settings=parse_camera_settings(data["camera_settings"]) if "camera_settings" in data else None,
|
|
2436
|
+
camera_settings=parse_camera_settings(data["camera_settings"]) if "camera_settings" in data and data.get("camera_settings") is not None else None,
|
|
1835
2437
|
)
|
|
1836
2438
|
|
|
1837
2439
|
def serialize_camera_frame_request(data: CameraFrameRequest) -> object:
|
|
@@ -1840,1183 +2442,966 @@ def serialize_camera_frame_request(data: CameraFrameRequest) -> object:
|
|
|
1840
2442
|
}
|
|
1841
2443
|
|
|
1842
2444
|
@dataclass
|
|
1843
|
-
class
|
|
1844
|
-
"""
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
inCollision: Union[bool, None] = None
|
|
1848
|
-
disturbance: Union[float, None] = None
|
|
2445
|
+
class CartesianOffsetResponse:
|
|
2446
|
+
"""Response with the cartesian offset value
|
|
2447
|
+
"""
|
|
2448
|
+
pose: Union[CartesianPose, None] = None
|
|
1849
2449
|
|
|
1850
|
-
def
|
|
2450
|
+
def validate_pose(self, value: CartesianPose) -> Tuple[bool, str]:
|
|
1851
2451
|
if value is None:
|
|
1852
|
-
return [
|
|
2452
|
+
return [False, "pose is required for CartesianOffsetResponse"]
|
|
1853
2453
|
|
|
1854
|
-
if not isinstance(value,
|
|
1855
|
-
return [False, "
|
|
2454
|
+
if not isinstance(value, CartesianPose):
|
|
2455
|
+
return [False, "pose must be of type CartesianPose for CartesianOffsetResponse, got " + type(value).__name__]
|
|
1856
2456
|
|
|
1857
2457
|
return [True, ""]
|
|
1858
2458
|
|
|
1859
|
-
def
|
|
1860
|
-
if
|
|
1861
|
-
|
|
2459
|
+
def __post_init__(self):
|
|
2460
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2461
|
+
is_valid, error_str = self.validate_pose(self.pose)
|
|
2462
|
+
if not is_valid:
|
|
2463
|
+
raise TypeError(error_str)
|
|
1862
2464
|
|
|
1863
|
-
|
|
1864
|
-
|
|
2465
|
+
def parse_cartesian_offset_response(data: object):
|
|
2466
|
+
return CartesianOffsetResponse(
|
|
2467
|
+
pose=parse_cartesian_pose(data["pose"]) if "pose" in data and data.get("pose") is not None else None,
|
|
2468
|
+
)
|
|
1865
2469
|
|
|
1866
|
-
|
|
2470
|
+
def serialize_cartesian_offset_response(data: CartesianOffsetResponse) -> object:
|
|
2471
|
+
return {
|
|
2472
|
+
"pose": serialize_cartesian_pose(data.pose),
|
|
2473
|
+
}
|
|
1867
2474
|
|
|
1868
|
-
|
|
2475
|
+
@dataclass
|
|
2476
|
+
class CartesianPoseResponse:
|
|
2477
|
+
"""Response with cartesian pose based on euler pose"""
|
|
2478
|
+
pose: Union[CartesianPose, None] = None
|
|
2479
|
+
|
|
2480
|
+
def validate_pose(self, value: CartesianPose) -> Tuple[bool, str]:
|
|
1869
2481
|
if value is None:
|
|
1870
|
-
return [
|
|
2482
|
+
return [False, "pose is required for CartesianPoseResponse"]
|
|
1871
2483
|
|
|
1872
|
-
if not isinstance(value,
|
|
1873
|
-
return [False, "
|
|
2484
|
+
if not isinstance(value, CartesianPose):
|
|
2485
|
+
return [False, "pose must be of type CartesianPose for CartesianPoseResponse, got " + type(value).__name__]
|
|
1874
2486
|
|
|
1875
2487
|
return [True, ""]
|
|
1876
2488
|
|
|
1877
|
-
def
|
|
2489
|
+
def __post_init__(self):
|
|
2490
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2491
|
+
is_valid, error_str = self.validate_pose(self.pose)
|
|
2492
|
+
if not is_valid:
|
|
2493
|
+
raise TypeError(error_str)
|
|
2494
|
+
|
|
2495
|
+
def parse_cartesian_pose_response(data: object):
|
|
2496
|
+
return CartesianPoseResponse(
|
|
2497
|
+
pose=parse_cartesian_pose(data["pose"]) if "pose" in data and data.get("pose") is not None else None,
|
|
2498
|
+
)
|
|
2499
|
+
|
|
2500
|
+
def serialize_cartesian_pose_response(data: CartesianPoseResponse) -> object:
|
|
2501
|
+
return {
|
|
2502
|
+
"pose": serialize_cartesian_pose(data.pose),
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2505
|
+
@dataclass
|
|
2506
|
+
class FlangePositionResponse:
|
|
2507
|
+
"""Response with robot flange position
|
|
2508
|
+
"""
|
|
2509
|
+
pose: Union[CartesianPose, None] = None
|
|
2510
|
+
|
|
2511
|
+
def validate_pose(self, value: CartesianPose) -> Tuple[bool, str]:
|
|
1878
2512
|
if value is None:
|
|
1879
2513
|
return [True, ""]
|
|
1880
2514
|
|
|
1881
|
-
if not isinstance(value,
|
|
1882
|
-
return [False, "
|
|
2515
|
+
if not isinstance(value, CartesianPose):
|
|
2516
|
+
return [False, "pose must be of type CartesianPose for FlangePositionResponse, got " + type(value).__name__]
|
|
1883
2517
|
|
|
1884
2518
|
return [True, ""]
|
|
1885
2519
|
|
|
1886
2520
|
def __post_init__(self):
|
|
1887
2521
|
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1888
|
-
is_valid, error_str = self.
|
|
1889
|
-
if not is_valid:
|
|
1890
|
-
raise TypeError(error_str)
|
|
1891
|
-
is_valid, error_str = self.validate_connectionStatus(self.connectionStatus)
|
|
1892
|
-
if not is_valid:
|
|
1893
|
-
raise TypeError(error_str)
|
|
1894
|
-
is_valid, error_str = self.validate_inCollision(self.inCollision)
|
|
1895
|
-
if not is_valid:
|
|
1896
|
-
raise TypeError(error_str)
|
|
1897
|
-
is_valid, error_str = self.validate_disturbance(self.disturbance)
|
|
2522
|
+
is_valid, error_str = self.validate_pose(self.pose)
|
|
1898
2523
|
if not is_valid:
|
|
1899
2524
|
raise TypeError(error_str)
|
|
1900
2525
|
|
|
1901
|
-
def
|
|
1902
|
-
return
|
|
1903
|
-
|
|
1904
|
-
connectionStatus=parse_connection_status(data["connectionStatus"]) if "connectionStatus" in data else None,
|
|
1905
|
-
inCollision=parse_bool(data["inCollision"]) if "inCollision" in data else None,
|
|
1906
|
-
disturbance=parse_f_64(data["disturbance"]) if "disturbance" in data else None,
|
|
2526
|
+
def parse_flange_position_response(data: object):
|
|
2527
|
+
return FlangePositionResponse(
|
|
2528
|
+
pose=parse_cartesian_pose(data["pose"]) if "pose" in data and data.get("pose") is not None else None,
|
|
1907
2529
|
)
|
|
1908
2530
|
|
|
1909
|
-
def
|
|
2531
|
+
def serialize_flange_position_response(data: FlangePositionResponse) -> object:
|
|
1910
2532
|
return {
|
|
1911
|
-
"
|
|
1912
|
-
"connectionStatus": None if data.connectionStatus is None else serialize_connection_status(data.connectionStatus),
|
|
1913
|
-
"inCollision": None if data.inCollision is None else serialize_bool(data.inCollision),
|
|
1914
|
-
"disturbance": None if data.disturbance is None else serialize_f_64(data.disturbance),
|
|
2533
|
+
"pose": None if data.pose is None else serialize_cartesian_pose(data.pose),
|
|
1915
2534
|
}
|
|
1916
2535
|
|
|
1917
|
-
|
|
2536
|
+
@dataclass
|
|
2537
|
+
class JointPoseResponse:
|
|
2538
|
+
"""Response with cartesian pose based on joint angles"""
|
|
2539
|
+
pose: Union[CartesianPose, None] = None
|
|
1918
2540
|
|
|
1919
|
-
def
|
|
1920
|
-
|
|
2541
|
+
def validate_pose(self, value: CartesianPose) -> Tuple[bool, str]:
|
|
2542
|
+
if value is None:
|
|
2543
|
+
return [False, "pose is required for JointPoseResponse"]
|
|
1921
2544
|
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
@dataclass
|
|
1926
|
-
class ErrorResponse:
|
|
1927
|
-
"""Error Response"""
|
|
1928
|
-
error: Union[ErrorEnum, None] = None
|
|
1929
|
-
message: Union[str, None] = None
|
|
1930
|
-
|
|
1931
|
-
def validate_error(self, value: ErrorEnum) -> Tuple[bool, str]:
|
|
1932
|
-
if value is None:
|
|
1933
|
-
return [False, "error is required for ErrorResponse"]
|
|
1934
|
-
|
|
1935
|
-
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']) or isinstance(value, ErrorEnum)):
|
|
1936
|
-
return [False, "error must be of type ErrorEnum for ErrorResponse, got " + type(value).__name__]
|
|
1937
|
-
|
|
1938
|
-
return [True, ""]
|
|
1939
|
-
|
|
1940
|
-
def validate_message(self, value: str) -> Tuple[bool, str]:
|
|
1941
|
-
if value is None:
|
|
1942
|
-
return [False, "message is required for ErrorResponse"]
|
|
1943
|
-
|
|
1944
|
-
if not isinstance(value, str):
|
|
1945
|
-
return [False, "message must be of type str for ErrorResponse, got " + type(value).__name__]
|
|
2545
|
+
if not isinstance(value, CartesianPose):
|
|
2546
|
+
return [False, "pose must be of type CartesianPose for JointPoseResponse, got " + type(value).__name__]
|
|
1946
2547
|
|
|
1947
2548
|
return [True, ""]
|
|
1948
2549
|
|
|
1949
2550
|
def __post_init__(self):
|
|
1950
2551
|
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1951
|
-
is_valid, error_str = self.
|
|
1952
|
-
if not is_valid:
|
|
1953
|
-
raise TypeError(error_str)
|
|
1954
|
-
is_valid, error_str = self.validate_message(self.message)
|
|
2552
|
+
is_valid, error_str = self.validate_pose(self.pose)
|
|
1955
2553
|
if not is_valid:
|
|
1956
2554
|
raise TypeError(error_str)
|
|
1957
2555
|
|
|
1958
|
-
def
|
|
1959
|
-
return
|
|
1960
|
-
|
|
1961
|
-
message=parse_str(data["message"]) if "message" in data else None,
|
|
2556
|
+
def parse_joint_pose_response(data: object):
|
|
2557
|
+
return JointPoseResponse(
|
|
2558
|
+
pose=parse_cartesian_pose(data["pose"]) if "pose" in data and data.get("pose") is not None else None,
|
|
1962
2559
|
)
|
|
1963
2560
|
|
|
1964
|
-
def
|
|
2561
|
+
def serialize_joint_pose_response(data: JointPoseResponse) -> object:
|
|
1965
2562
|
return {
|
|
1966
|
-
"
|
|
1967
|
-
"message": serialize_str(data.message),
|
|
2563
|
+
"pose": serialize_cartesian_pose(data.pose),
|
|
1968
2564
|
}
|
|
1969
2565
|
|
|
1970
2566
|
@dataclass
|
|
1971
|
-
class
|
|
1972
|
-
"""
|
|
2567
|
+
class PoseDistanceRequest:
|
|
2568
|
+
"""Request: Calculate the distance between two cartesian poses
|
|
1973
2569
|
"""
|
|
1974
|
-
|
|
1975
|
-
|
|
2570
|
+
pose1: Union[CartesianPose, None] = None
|
|
2571
|
+
pose2: Union[CartesianPose, None] = None
|
|
1976
2572
|
|
|
1977
|
-
def
|
|
2573
|
+
def validate_pose1(self, value: CartesianPose) -> Tuple[bool, str]:
|
|
1978
2574
|
if value is None:
|
|
1979
|
-
return [False, "
|
|
2575
|
+
return [False, "pose1 is required for PoseDistanceRequest"]
|
|
1980
2576
|
|
|
1981
|
-
if not
|
|
1982
|
-
return [False, "
|
|
2577
|
+
if not isinstance(value, CartesianPose):
|
|
2578
|
+
return [False, "pose1 must be of type CartesianPose for PoseDistanceRequest, got " + type(value).__name__]
|
|
1983
2579
|
|
|
1984
2580
|
return [True, ""]
|
|
1985
2581
|
|
|
1986
|
-
def
|
|
2582
|
+
def validate_pose2(self, value: CartesianPose) -> Tuple[bool, str]:
|
|
1987
2583
|
if value is None:
|
|
1988
|
-
return [
|
|
2584
|
+
return [False, "pose2 is required for PoseDistanceRequest"]
|
|
1989
2585
|
|
|
1990
|
-
if not isinstance(value,
|
|
1991
|
-
return [False, "
|
|
2586
|
+
if not isinstance(value, CartesianPose):
|
|
2587
|
+
return [False, "pose2 must be of type CartesianPose for PoseDistanceRequest, got " + type(value).__name__]
|
|
1992
2588
|
|
|
1993
2589
|
return [True, ""]
|
|
1994
2590
|
|
|
1995
2591
|
def __post_init__(self):
|
|
1996
2592
|
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1997
|
-
is_valid, error_str = self.
|
|
2593
|
+
is_valid, error_str = self.validate_pose1(self.pose1)
|
|
1998
2594
|
if not is_valid:
|
|
1999
2595
|
raise TypeError(error_str)
|
|
2000
|
-
is_valid, error_str = self.
|
|
2596
|
+
is_valid, error_str = self.validate_pose2(self.pose2)
|
|
2001
2597
|
if not is_valid:
|
|
2002
2598
|
raise TypeError(error_str)
|
|
2003
2599
|
|
|
2004
|
-
def
|
|
2005
|
-
return
|
|
2006
|
-
|
|
2007
|
-
|
|
2600
|
+
def parse_pose_distance_request(data: object):
|
|
2601
|
+
return PoseDistanceRequest(
|
|
2602
|
+
pose1=parse_cartesian_pose(data["pose1"]) if "pose1" in data and data.get("pose1") is not None else None,
|
|
2603
|
+
pose2=parse_cartesian_pose(data["pose2"]) if "pose2" in data and data.get("pose2") is not None else None,
|
|
2008
2604
|
)
|
|
2009
2605
|
|
|
2010
|
-
def
|
|
2606
|
+
def serialize_pose_distance_request(data: PoseDistanceRequest) -> object:
|
|
2011
2607
|
return {
|
|
2012
|
-
"
|
|
2013
|
-
"
|
|
2608
|
+
"pose1": serialize_cartesian_pose(data.pose1),
|
|
2609
|
+
"pose2": serialize_cartesian_pose(data.pose2),
|
|
2014
2610
|
}
|
|
2015
2611
|
|
|
2016
2612
|
@dataclass
|
|
2017
|
-
class
|
|
2018
|
-
"""
|
|
2019
|
-
|
|
2613
|
+
class PoseOperationsRequest:
|
|
2614
|
+
"""Request: Calculate add or substract operations between two cartesian poses
|
|
2615
|
+
"""
|
|
2616
|
+
pose1: Union[CartesianPose, None] = None
|
|
2617
|
+
pose2: Union[CartesianPose, None] = None
|
|
2020
2618
|
|
|
2021
|
-
def
|
|
2619
|
+
def validate_pose1(self, value: CartesianPose) -> Tuple[bool, str]:
|
|
2022
2620
|
if value is None:
|
|
2023
|
-
return [
|
|
2621
|
+
return [False, "pose1 is required for PoseOperationsRequest"]
|
|
2024
2622
|
|
|
2025
|
-
if not
|
|
2026
|
-
return [False, "
|
|
2623
|
+
if not isinstance(value, CartesianPose):
|
|
2624
|
+
return [False, "pose1 must be of type CartesianPose for PoseOperationsRequest, got " + type(value).__name__]
|
|
2027
2625
|
|
|
2028
2626
|
return [True, ""]
|
|
2029
2627
|
|
|
2030
|
-
def
|
|
2031
|
-
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2032
|
-
is_valid, error_str = self.validate_state(self.state)
|
|
2033
|
-
if not is_valid:
|
|
2034
|
-
raise TypeError(error_str)
|
|
2035
|
-
|
|
2036
|
-
def parse_io_state_response(data: object):
|
|
2037
|
-
return IOStateResponse(
|
|
2038
|
-
state=parse_io_state_map(data["state"]) if "state" in data else None,
|
|
2039
|
-
)
|
|
2040
|
-
|
|
2041
|
-
def serialize_io_state_response(data: IOStateResponse) -> object:
|
|
2042
|
-
return {
|
|
2043
|
-
"state": None if data.state is None else serialize_io_state_map(data.state),
|
|
2044
|
-
}
|
|
2045
|
-
|
|
2046
|
-
@dataclass
|
|
2047
|
-
class IOStateUpdateRequest:
|
|
2048
|
-
"""Request to update the state of I/O for multiple ports."""
|
|
2049
|
-
state: Union[IOStateMap, None] = None
|
|
2050
|
-
|
|
2051
|
-
def validate_state(self, value: IOStateMap) -> Tuple[bool, str]:
|
|
2628
|
+
def validate_pose2(self, value: CartesianPose) -> Tuple[bool, str]:
|
|
2052
2629
|
if value is None:
|
|
2053
|
-
return [
|
|
2630
|
+
return [False, "pose2 is required for PoseOperationsRequest"]
|
|
2054
2631
|
|
|
2055
|
-
if not
|
|
2056
|
-
return [False, "
|
|
2632
|
+
if not isinstance(value, CartesianPose):
|
|
2633
|
+
return [False, "pose2 must be of type CartesianPose for PoseOperationsRequest, got " + type(value).__name__]
|
|
2057
2634
|
|
|
2058
2635
|
return [True, ""]
|
|
2059
2636
|
|
|
2060
2637
|
def __post_init__(self):
|
|
2061
2638
|
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2062
|
-
is_valid, error_str = self.
|
|
2639
|
+
is_valid, error_str = self.validate_pose1(self.pose1)
|
|
2640
|
+
if not is_valid:
|
|
2641
|
+
raise TypeError(error_str)
|
|
2642
|
+
is_valid, error_str = self.validate_pose2(self.pose2)
|
|
2063
2643
|
if not is_valid:
|
|
2064
2644
|
raise TypeError(error_str)
|
|
2065
2645
|
|
|
2066
|
-
def
|
|
2067
|
-
return
|
|
2068
|
-
|
|
2646
|
+
def parse_pose_operations_request(data: object):
|
|
2647
|
+
return PoseOperationsRequest(
|
|
2648
|
+
pose1=parse_cartesian_pose(data["pose1"]) if "pose1" in data and data.get("pose1") is not None else None,
|
|
2649
|
+
pose2=parse_cartesian_pose(data["pose2"]) if "pose2" in data and data.get("pose2") is not None else None,
|
|
2069
2650
|
)
|
|
2070
2651
|
|
|
2071
|
-
def
|
|
2652
|
+
def serialize_pose_operations_request(data: PoseOperationsRequest) -> object:
|
|
2072
2653
|
return {
|
|
2073
|
-
"
|
|
2654
|
+
"pose1": serialize_cartesian_pose(data.pose1),
|
|
2655
|
+
"pose2": serialize_cartesian_pose(data.pose2),
|
|
2074
2656
|
}
|
|
2075
2657
|
|
|
2076
2658
|
@dataclass
|
|
2077
|
-
class
|
|
2078
|
-
"""
|
|
2079
|
-
|
|
2659
|
+
class PoseOperationsResponse:
|
|
2660
|
+
"""Response: Operation result between two cartesian poses
|
|
2661
|
+
"""
|
|
2662
|
+
pose: Union[CartesianPose, None] = None
|
|
2080
2663
|
|
|
2081
|
-
def
|
|
2664
|
+
def validate_pose(self, value: CartesianPose) -> Tuple[bool, str]:
|
|
2082
2665
|
if value is None:
|
|
2083
|
-
return [False, "
|
|
2666
|
+
return [False, "pose is required for PoseOperationsResponse"]
|
|
2084
2667
|
|
|
2085
|
-
if not
|
|
2086
|
-
return [False, "
|
|
2668
|
+
if not isinstance(value, CartesianPose):
|
|
2669
|
+
return [False, "pose must be of type CartesianPose for PoseOperationsResponse, got " + type(value).__name__]
|
|
2087
2670
|
|
|
2088
2671
|
return [True, ""]
|
|
2089
2672
|
|
|
2090
2673
|
def __post_init__(self):
|
|
2091
2674
|
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2092
|
-
is_valid, error_str = self.
|
|
2675
|
+
is_valid, error_str = self.validate_pose(self.pose)
|
|
2093
2676
|
if not is_valid:
|
|
2094
2677
|
raise TypeError(error_str)
|
|
2095
2678
|
|
|
2096
|
-
def
|
|
2097
|
-
return
|
|
2098
|
-
|
|
2679
|
+
def parse_pose_operations_response(data: object):
|
|
2680
|
+
return PoseOperationsResponse(
|
|
2681
|
+
pose=parse_cartesian_pose(data["pose"]) if "pose" in data and data.get("pose") is not None else None,
|
|
2099
2682
|
)
|
|
2100
2683
|
|
|
2101
|
-
def
|
|
2684
|
+
def serialize_pose_operations_response(data: PoseOperationsResponse) -> object:
|
|
2102
2685
|
return {
|
|
2103
|
-
"
|
|
2686
|
+
"pose": serialize_cartesian_pose(data.pose),
|
|
2104
2687
|
}
|
|
2105
2688
|
|
|
2106
2689
|
@dataclass
|
|
2107
|
-
class
|
|
2108
|
-
"""
|
|
2690
|
+
class TooltipPositionResponse:
|
|
2691
|
+
"""Response with robot tooltip position
|
|
2109
2692
|
"""
|
|
2110
|
-
|
|
2111
|
-
value: Union[float, None] = None
|
|
2693
|
+
pose: Union[CartesianPose, None] = None
|
|
2112
2694
|
|
|
2113
|
-
def
|
|
2114
|
-
if value is None:
|
|
2115
|
-
return [False, "unit_kind is required for LinearUnit"]
|
|
2116
|
-
|
|
2117
|
-
if not ((isinstance(value, str) and LinearUnitKind in ['millimeters', 'centimeters', 'meters', 'inches', 'feet']) or isinstance(value, LinearUnitKind)):
|
|
2118
|
-
return [False, "unit_kind must be of type LinearUnitKind for LinearUnit, got " + type(value).__name__]
|
|
2119
|
-
|
|
2120
|
-
return [True, ""]
|
|
2121
|
-
|
|
2122
|
-
def validate_value(self, value: float) -> Tuple[bool, str]:
|
|
2695
|
+
def validate_pose(self, value: CartesianPose) -> Tuple[bool, str]:
|
|
2123
2696
|
if value is None:
|
|
2124
2697
|
return [True, ""]
|
|
2125
2698
|
|
|
2126
|
-
if not isinstance(value,
|
|
2127
|
-
return [False, "
|
|
2699
|
+
if not isinstance(value, CartesianPose):
|
|
2700
|
+
return [False, "pose must be of type CartesianPose for TooltipPositionResponse, got " + type(value).__name__]
|
|
2128
2701
|
|
|
2129
2702
|
return [True, ""]
|
|
2130
2703
|
|
|
2131
2704
|
def __post_init__(self):
|
|
2132
2705
|
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2133
|
-
is_valid, error_str = self.
|
|
2134
|
-
if not is_valid:
|
|
2135
|
-
raise TypeError(error_str)
|
|
2136
|
-
is_valid, error_str = self.validate_value(self.value)
|
|
2706
|
+
is_valid, error_str = self.validate_pose(self.pose)
|
|
2137
2707
|
if not is_valid:
|
|
2138
2708
|
raise TypeError(error_str)
|
|
2139
2709
|
|
|
2140
|
-
def
|
|
2141
|
-
return
|
|
2142
|
-
|
|
2143
|
-
value=parse_f_64(data["value"]) if "value" in data else None,
|
|
2710
|
+
def parse_tooltip_position_response(data: object):
|
|
2711
|
+
return TooltipPositionResponse(
|
|
2712
|
+
pose=parse_cartesian_pose(data["pose"]) if "pose" in data and data.get("pose") is not None else None,
|
|
2144
2713
|
)
|
|
2145
2714
|
|
|
2146
|
-
def
|
|
2715
|
+
def serialize_tooltip_position_response(data: TooltipPositionResponse) -> object:
|
|
2147
2716
|
return {
|
|
2148
|
-
"
|
|
2149
|
-
"value": None if data.value is None else serialize_f_64(data.value),
|
|
2717
|
+
"pose": None if data.pose is None else serialize_cartesian_pose(data.pose),
|
|
2150
2718
|
}
|
|
2151
2719
|
|
|
2152
2720
|
@dataclass
|
|
2153
|
-
class
|
|
2154
|
-
"""
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2721
|
+
class JointState:
|
|
2722
|
+
"""State of a joint"""
|
|
2723
|
+
braked: Union[bool, None] = None
|
|
2724
|
+
connectionStatus: Union[ConnectionStatus, None] = None
|
|
2725
|
+
inCollision: Union[bool, None] = None
|
|
2726
|
+
disturbance: Union[float, None] = None
|
|
2159
2727
|
|
|
2160
|
-
def
|
|
2728
|
+
def validate_braked(self, value: bool) -> Tuple[bool, str]:
|
|
2161
2729
|
if value is None:
|
|
2162
2730
|
return [True, ""]
|
|
2163
2731
|
|
|
2164
|
-
if not
|
|
2165
|
-
return [False, "
|
|
2732
|
+
if not isinstance(value, bool):
|
|
2733
|
+
return [False, "braked must be of type bool for JointState, got " + type(value).__name__]
|
|
2166
2734
|
|
|
2167
2735
|
return [True, ""]
|
|
2168
2736
|
|
|
2169
|
-
def
|
|
2737
|
+
def validate_connectionStatus(self, value: ConnectionStatus) -> Tuple[bool, str]:
|
|
2170
2738
|
if value is None:
|
|
2171
2739
|
return [True, ""]
|
|
2172
2740
|
|
|
2173
|
-
if not isinstance(value,
|
|
2174
|
-
return [False, "
|
|
2741
|
+
if not ((isinstance(value, str) and ConnectionStatus in ['connected', 'disconnected', 'ready']) or isinstance(value, ConnectionStatus)):
|
|
2742
|
+
return [False, "connectionStatus must be of type ConnectionStatus for JointState, got " + type(value).__name__]
|
|
2175
2743
|
|
|
2176
2744
|
return [True, ""]
|
|
2177
2745
|
|
|
2178
|
-
def
|
|
2746
|
+
def validate_inCollision(self, value: bool) -> Tuple[bool, str]:
|
|
2179
2747
|
if value is None:
|
|
2180
2748
|
return [True, ""]
|
|
2181
2749
|
|
|
2182
|
-
if not isinstance(value,
|
|
2183
|
-
return [False, "
|
|
2750
|
+
if not isinstance(value, bool):
|
|
2751
|
+
return [False, "inCollision must be of type bool for JointState, got " + type(value).__name__]
|
|
2184
2752
|
|
|
2185
2753
|
return [True, ""]
|
|
2186
2754
|
|
|
2187
|
-
def
|
|
2755
|
+
def validate_disturbance(self, value: float) -> Tuple[bool, str]:
|
|
2188
2756
|
if value is None:
|
|
2189
2757
|
return [True, ""]
|
|
2190
2758
|
|
|
2191
2759
|
if not isinstance(value, float):
|
|
2192
|
-
return [False, "
|
|
2760
|
+
return [False, "disturbance must be of type float for JointState, got " + type(value).__name__]
|
|
2193
2761
|
|
|
2194
2762
|
return [True, ""]
|
|
2195
2763
|
|
|
2196
2764
|
def __post_init__(self):
|
|
2197
2765
|
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2198
|
-
is_valid, error_str = self.
|
|
2766
|
+
is_valid, error_str = self.validate_braked(self.braked)
|
|
2199
2767
|
if not is_valid:
|
|
2200
2768
|
raise TypeError(error_str)
|
|
2201
|
-
is_valid, error_str = self.
|
|
2769
|
+
is_valid, error_str = self.validate_connectionStatus(self.connectionStatus)
|
|
2202
2770
|
if not is_valid:
|
|
2203
2771
|
raise TypeError(error_str)
|
|
2204
|
-
is_valid, error_str = self.
|
|
2772
|
+
is_valid, error_str = self.validate_inCollision(self.inCollision)
|
|
2205
2773
|
if not is_valid:
|
|
2206
2774
|
raise TypeError(error_str)
|
|
2207
|
-
is_valid, error_str = self.
|
|
2775
|
+
is_valid, error_str = self.validate_disturbance(self.disturbance)
|
|
2208
2776
|
if not is_valid:
|
|
2209
2777
|
raise TypeError(error_str)
|
|
2210
2778
|
|
|
2211
|
-
def
|
|
2212
|
-
return
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2779
|
+
def parse_joint_state(data: object):
|
|
2780
|
+
return JointState(
|
|
2781
|
+
braked=parse_bool(data["braked"]) if "braked" in data and data.get("braked") is not None else None,
|
|
2782
|
+
connectionStatus=parse_connection_status(data["connectionStatus"]) if "connectionStatus" in data and data.get("connectionStatus") is not None else None,
|
|
2783
|
+
inCollision=parse_bool(data["inCollision"]) if "inCollision" in data and data.get("inCollision") is not None else None,
|
|
2784
|
+
disturbance=parse_f_64(data["disturbance"]) if "disturbance" in data and data.get("disturbance") is not None else None,
|
|
2217
2785
|
)
|
|
2218
2786
|
|
|
2219
|
-
def
|
|
2787
|
+
def serialize_joint_state(data: JointState) -> object:
|
|
2220
2788
|
return {
|
|
2221
|
-
"
|
|
2222
|
-
"
|
|
2223
|
-
"
|
|
2224
|
-
"
|
|
2789
|
+
"braked": None if data.braked is None else serialize_bool(data.braked),
|
|
2790
|
+
"connectionStatus": None if data.connectionStatus is None else serialize_connection_status(data.connectionStatus),
|
|
2791
|
+
"inCollision": None if data.inCollision is None else serialize_bool(data.inCollision),
|
|
2792
|
+
"disturbance": None if data.disturbance is None else serialize_f_64(data.disturbance),
|
|
2225
2793
|
}
|
|
2226
2794
|
|
|
2227
|
-
|
|
2228
|
-
class OnRobot2FG14GripperConfiguration:
|
|
2229
|
-
"""Configuration for OnRobot 2FG14 Gripper"""
|
|
2230
|
-
grip_kind: Union[OnRobotGripKindEnum, None] = None
|
|
2231
|
-
grip_detected: Union[bool, None] = None
|
|
2232
|
-
normalized_width_inner: Union[float, None] = None
|
|
2233
|
-
normalized_width_outer: Union[float, None] = None
|
|
2234
|
-
width_inner: Union[float, None] = None
|
|
2235
|
-
min_width_inner: Union[float, None] = None
|
|
2236
|
-
max_width_inner: Union[float, None] = None
|
|
2237
|
-
width_outer: Union[float, None] = None
|
|
2238
|
-
min_width_outer: Union[float, None] = None
|
|
2239
|
-
max_width_outer: Union[float, None] = None
|
|
2240
|
-
force: Union[float, None] = None
|
|
2241
|
-
max_force: Union[float, None] = None
|
|
2242
|
-
finger_mounting_position: Union[str, None] = None
|
|
2243
|
-
finger_offset: Union[float, None] = None
|
|
2244
|
-
finger_angle: Union[float, None] = None
|
|
2245
|
-
finger_length: Union[float, None] = None
|
|
2246
|
-
finger_height: Union[float, None] = None
|
|
2247
|
-
linear_sensor_error: Union[bool, None] = None
|
|
2248
|
-
uncalibrated_error: Union[bool, None] = None
|
|
2249
|
-
|
|
2250
|
-
def validate_grip_kind(self, value: OnRobotGripKindEnum) -> Tuple[bool, str]:
|
|
2251
|
-
if value is None:
|
|
2252
|
-
return [True, ""]
|
|
2253
|
-
|
|
2254
|
-
if not ((isinstance(value, str) and OnRobotGripKindEnum in ['inward', 'outward']) or isinstance(value, OnRobotGripKindEnum)):
|
|
2255
|
-
return [False, "grip_kind must be of type OnRobotGripKindEnum for OnRobot2FG14GripperConfiguration, got " + type(value).__name__]
|
|
2256
|
-
|
|
2257
|
-
return [True, ""]
|
|
2795
|
+
EnvironmentVariablesList = List[EnvironmentVariable]
|
|
2258
2796
|
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
return [True, ""]
|
|
2797
|
+
def parse_environment_variables_list(data: object) -> EnvironmentVariablesList:
|
|
2798
|
+
return [parse_environment_variable(item) for item in data]
|
|
2262
2799
|
|
|
2263
|
-
|
|
2264
|
-
|
|
2800
|
+
def serialize_environment_variables_list(data: EnvironmentVariablesList) -> List[object]:
|
|
2801
|
+
return [serialize_environment_variable(item) for item in data]
|
|
2265
2802
|
|
|
2266
|
-
|
|
2803
|
+
@dataclass
|
|
2804
|
+
class ErrorResponse:
|
|
2805
|
+
"""Error Response"""
|
|
2806
|
+
error: Union[ErrorEnum, None] = None
|
|
2807
|
+
message: Union[str, None] = None
|
|
2267
2808
|
|
|
2268
|
-
def
|
|
2809
|
+
def validate_error(self, value: ErrorEnum) -> Tuple[bool, str]:
|
|
2269
2810
|
if value is None:
|
|
2270
|
-
return [
|
|
2811
|
+
return [False, "error is required for ErrorResponse"]
|
|
2271
2812
|
|
|
2272
|
-
if not isinstance(value,
|
|
2273
|
-
return [False, "
|
|
2813
|
+
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']) or isinstance(value, ErrorEnum)):
|
|
2814
|
+
return [False, "error must be of type ErrorEnum for ErrorResponse, got " + type(value).__name__]
|
|
2274
2815
|
|
|
2275
2816
|
return [True, ""]
|
|
2276
2817
|
|
|
2277
|
-
def
|
|
2818
|
+
def validate_message(self, value: str) -> Tuple[bool, str]:
|
|
2278
2819
|
if value is None:
|
|
2279
|
-
return [
|
|
2820
|
+
return [False, "message is required for ErrorResponse"]
|
|
2280
2821
|
|
|
2281
|
-
if not isinstance(value,
|
|
2282
|
-
return [False, "
|
|
2822
|
+
if not isinstance(value, str):
|
|
2823
|
+
return [False, "message must be of type str for ErrorResponse, got " + type(value).__name__]
|
|
2283
2824
|
|
|
2284
2825
|
return [True, ""]
|
|
2285
2826
|
|
|
2286
|
-
def
|
|
2287
|
-
if
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2827
|
+
def __post_init__(self):
|
|
2828
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2829
|
+
is_valid, error_str = self.validate_error(self.error)
|
|
2830
|
+
if not is_valid:
|
|
2831
|
+
raise TypeError(error_str)
|
|
2832
|
+
is_valid, error_str = self.validate_message(self.message)
|
|
2833
|
+
if not is_valid:
|
|
2834
|
+
raise TypeError(error_str)
|
|
2294
2835
|
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2836
|
+
def parse_error_response(data: object):
|
|
2837
|
+
return ErrorResponse(
|
|
2838
|
+
error=parse_error_enum(data["error"]) if "error" in data and data.get("error") is not None else None,
|
|
2839
|
+
message=parse_str(data["message"]) if "message" in data and data.get("message") is not None else None,
|
|
2840
|
+
)
|
|
2298
2841
|
|
|
2299
|
-
|
|
2300
|
-
|
|
2842
|
+
def serialize_error_response(data: ErrorResponse) -> object:
|
|
2843
|
+
return {
|
|
2844
|
+
"error": serialize_error_enum(data.error),
|
|
2845
|
+
"message": serialize_str(data.message),
|
|
2846
|
+
}
|
|
2301
2847
|
|
|
2302
|
-
|
|
2848
|
+
@dataclass
|
|
2849
|
+
class CartesianOffsetRequest:
|
|
2850
|
+
"""Request to retrieve the cartesian offset based on robot position
|
|
2851
|
+
"""
|
|
2852
|
+
pose: Union[EulerPose, None] = None
|
|
2303
2853
|
|
|
2304
|
-
def
|
|
2854
|
+
def validate_pose(self, value: EulerPose) -> Tuple[bool, str]:
|
|
2305
2855
|
if value is None:
|
|
2306
|
-
return [
|
|
2856
|
+
return [False, "pose is required for CartesianOffsetRequest"]
|
|
2307
2857
|
|
|
2308
|
-
if not isinstance(value,
|
|
2309
|
-
return [False, "
|
|
2858
|
+
if not isinstance(value, EulerPose):
|
|
2859
|
+
return [False, "pose must be of type EulerPose for CartesianOffsetRequest, got " + type(value).__name__]
|
|
2310
2860
|
|
|
2311
2861
|
return [True, ""]
|
|
2312
2862
|
|
|
2313
|
-
def
|
|
2314
|
-
if
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
return [False, "width_outer must be of type float for OnRobot2FG14GripperConfiguration, got " + type(value).__name__]
|
|
2319
|
-
|
|
2320
|
-
return [True, ""]
|
|
2863
|
+
def __post_init__(self):
|
|
2864
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2865
|
+
is_valid, error_str = self.validate_pose(self.pose)
|
|
2866
|
+
if not is_valid:
|
|
2867
|
+
raise TypeError(error_str)
|
|
2321
2868
|
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2869
|
+
def parse_cartesian_offset_request(data: object):
|
|
2870
|
+
return CartesianOffsetRequest(
|
|
2871
|
+
pose=parse_euler_pose(data["pose"]) if "pose" in data and data.get("pose") is not None else None,
|
|
2872
|
+
)
|
|
2325
2873
|
|
|
2326
|
-
|
|
2327
|
-
|
|
2874
|
+
def serialize_cartesian_offset_request(data: CartesianOffsetRequest) -> object:
|
|
2875
|
+
return {
|
|
2876
|
+
"pose": serialize_euler_pose(data.pose),
|
|
2877
|
+
}
|
|
2328
2878
|
|
|
2329
|
-
|
|
2879
|
+
@dataclass
|
|
2880
|
+
class CartesianPoseRequest:
|
|
2881
|
+
"""Request to transform the euler pose to cartesian pose"""
|
|
2882
|
+
pose: Union[EulerPose, None] = None
|
|
2330
2883
|
|
|
2331
|
-
def
|
|
2884
|
+
def validate_pose(self, value: EulerPose) -> Tuple[bool, str]:
|
|
2332
2885
|
if value is None:
|
|
2333
|
-
return [
|
|
2886
|
+
return [False, "pose is required for CartesianPoseRequest"]
|
|
2334
2887
|
|
|
2335
|
-
if not isinstance(value,
|
|
2336
|
-
return [False, "
|
|
2888
|
+
if not isinstance(value, EulerPose):
|
|
2889
|
+
return [False, "pose must be of type EulerPose for CartesianPoseRequest, got " + type(value).__name__]
|
|
2337
2890
|
|
|
2338
2891
|
return [True, ""]
|
|
2339
2892
|
|
|
2340
|
-
def
|
|
2341
|
-
if
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
return [False, "force must be of type float for OnRobot2FG14GripperConfiguration, got " + type(value).__name__]
|
|
2346
|
-
|
|
2347
|
-
return [True, ""]
|
|
2893
|
+
def __post_init__(self):
|
|
2894
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2895
|
+
is_valid, error_str = self.validate_pose(self.pose)
|
|
2896
|
+
if not is_valid:
|
|
2897
|
+
raise TypeError(error_str)
|
|
2348
2898
|
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2899
|
+
def parse_cartesian_pose_request(data: object):
|
|
2900
|
+
return CartesianPoseRequest(
|
|
2901
|
+
pose=parse_euler_pose(data["pose"]) if "pose" in data and data.get("pose") is not None else None,
|
|
2902
|
+
)
|
|
2352
2903
|
|
|
2353
|
-
|
|
2354
|
-
|
|
2904
|
+
def serialize_cartesian_pose_request(data: CartesianPoseRequest) -> object:
|
|
2905
|
+
return {
|
|
2906
|
+
"pose": serialize_euler_pose(data.pose),
|
|
2907
|
+
}
|
|
2355
2908
|
|
|
2356
|
-
|
|
2909
|
+
@dataclass
|
|
2910
|
+
class ForceUnit:
|
|
2911
|
+
"""Reusable Abstraction for force units (eg force, torque)
|
|
2912
|
+
"""
|
|
2913
|
+
unit_kind: Union[ForceUnitKind, None] = None
|
|
2914
|
+
value: Union[float, None] = None
|
|
2357
2915
|
|
|
2358
|
-
def
|
|
2916
|
+
def validate_unit_kind(self, value: ForceUnitKind) -> Tuple[bool, str]:
|
|
2359
2917
|
if value is None:
|
|
2360
|
-
return [
|
|
2918
|
+
return [False, "unit_kind is required for ForceUnit"]
|
|
2361
2919
|
|
|
2362
|
-
if not isinstance(value, str):
|
|
2363
|
-
return [False, "
|
|
2920
|
+
if not ((isinstance(value, str) and ForceUnitKind in ['newtons', 'pounds']) or isinstance(value, ForceUnitKind)):
|
|
2921
|
+
return [False, "unit_kind must be of type ForceUnitKind for ForceUnit, got " + type(value).__name__]
|
|
2364
2922
|
|
|
2365
2923
|
return [True, ""]
|
|
2366
2924
|
|
|
2367
|
-
def
|
|
2925
|
+
def validate_value(self, value: float) -> Tuple[bool, str]:
|
|
2368
2926
|
if value is None:
|
|
2369
2927
|
return [True, ""]
|
|
2370
2928
|
|
|
2371
2929
|
if not isinstance(value, float):
|
|
2372
|
-
return [False, "
|
|
2930
|
+
return [False, "value must be of type float for ForceUnit, got " + type(value).__name__]
|
|
2373
2931
|
|
|
2374
2932
|
return [True, ""]
|
|
2375
2933
|
|
|
2376
|
-
def
|
|
2377
|
-
if
|
|
2378
|
-
|
|
2934
|
+
def __post_init__(self):
|
|
2935
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2936
|
+
is_valid, error_str = self.validate_unit_kind(self.unit_kind)
|
|
2937
|
+
if not is_valid:
|
|
2938
|
+
raise TypeError(error_str)
|
|
2939
|
+
is_valid, error_str = self.validate_value(self.value)
|
|
2940
|
+
if not is_valid:
|
|
2941
|
+
raise TypeError(error_str)
|
|
2379
2942
|
|
|
2380
|
-
|
|
2381
|
-
|
|
2943
|
+
def parse_force_unit(data: object):
|
|
2944
|
+
return ForceUnit(
|
|
2945
|
+
unit_kind=parse_force_unit_kind(data["unit_kind"]) if "unit_kind" in data and data.get("unit_kind") is not None else None,
|
|
2946
|
+
value=parse_f_64(data["value"]) if "value" in data and data.get("value") is not None else None,
|
|
2947
|
+
)
|
|
2382
2948
|
|
|
2383
|
-
|
|
2949
|
+
def serialize_force_unit(data: ForceUnit) -> object:
|
|
2950
|
+
return {
|
|
2951
|
+
"unit_kind": serialize_force_unit_kind(data.unit_kind),
|
|
2952
|
+
"value": None if data.value is None else serialize_f_64(data.value),
|
|
2953
|
+
}
|
|
2384
2954
|
|
|
2385
|
-
|
|
2955
|
+
@dataclass
|
|
2956
|
+
class GripperConfiguration:
|
|
2957
|
+
"""Configuration of gripper, also known as End Effector"""
|
|
2958
|
+
kind: Union[GripperKindEnum, None] = None
|
|
2959
|
+
dh_ag: Union[DHAGGripperConfiguration, None] = None
|
|
2960
|
+
dh_pgc: Union[DHPGCGripperConfiguration, None] = None
|
|
2961
|
+
dh_cgi: Union[DHCGIGripperConfiguration, None] = None
|
|
2962
|
+
|
|
2963
|
+
def validate_kind(self, value: GripperKindEnum) -> Tuple[bool, str]:
|
|
2386
2964
|
if value is None:
|
|
2387
|
-
return [
|
|
2965
|
+
return [False, "kind is required for GripperConfiguration"]
|
|
2388
2966
|
|
|
2389
|
-
if not isinstance(value,
|
|
2390
|
-
return [False, "
|
|
2967
|
+
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)):
|
|
2968
|
+
return [False, "kind must be of type GripperKindEnum for GripperConfiguration, got " + type(value).__name__]
|
|
2391
2969
|
|
|
2392
2970
|
return [True, ""]
|
|
2393
2971
|
|
|
2394
|
-
def
|
|
2972
|
+
def validate_dh_ag(self, value: DHAGGripperConfiguration) -> Tuple[bool, str]:
|
|
2395
2973
|
if value is None:
|
|
2396
2974
|
return [True, ""]
|
|
2397
2975
|
|
|
2398
|
-
if not isinstance(value,
|
|
2399
|
-
return [False, "
|
|
2976
|
+
if not isinstance(value, DHAGGripperConfiguration):
|
|
2977
|
+
return [False, "dh_ag must be of type DHAGGripperConfiguration for GripperConfiguration, got " + type(value).__name__]
|
|
2400
2978
|
|
|
2401
2979
|
return [True, ""]
|
|
2402
2980
|
|
|
2403
|
-
def
|
|
2981
|
+
def validate_dh_pgc(self, value: DHPGCGripperConfiguration) -> Tuple[bool, str]:
|
|
2404
2982
|
if value is None:
|
|
2405
2983
|
return [True, ""]
|
|
2406
2984
|
|
|
2407
|
-
if not isinstance(value,
|
|
2408
|
-
return [False, "
|
|
2985
|
+
if not isinstance(value, DHPGCGripperConfiguration):
|
|
2986
|
+
return [False, "dh_pgc must be of type DHPGCGripperConfiguration for GripperConfiguration, got " + type(value).__name__]
|
|
2409
2987
|
|
|
2410
2988
|
return [True, ""]
|
|
2411
2989
|
|
|
2412
|
-
def
|
|
2990
|
+
def validate_dh_cgi(self, value: DHCGIGripperConfiguration) -> Tuple[bool, str]:
|
|
2413
2991
|
if value is None:
|
|
2414
2992
|
return [True, ""]
|
|
2415
2993
|
|
|
2416
|
-
if not isinstance(value,
|
|
2417
|
-
return [False, "
|
|
2994
|
+
if not isinstance(value, DHCGIGripperConfiguration):
|
|
2995
|
+
return [False, "dh_cgi must be of type DHCGIGripperConfiguration for GripperConfiguration, got " + type(value).__name__]
|
|
2418
2996
|
|
|
2419
2997
|
return [True, ""]
|
|
2420
2998
|
|
|
2421
2999
|
def __post_init__(self):
|
|
2422
3000
|
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2423
|
-
is_valid, error_str = self.
|
|
2424
|
-
if not is_valid:
|
|
2425
|
-
raise TypeError(error_str)
|
|
2426
|
-
is_valid, error_str = self.validate_grip_detected(self.grip_detected)
|
|
2427
|
-
if not is_valid:
|
|
2428
|
-
raise TypeError(error_str)
|
|
2429
|
-
is_valid, error_str = self.validate_normalized_width_inner(self.normalized_width_inner)
|
|
2430
|
-
if not is_valid:
|
|
2431
|
-
raise TypeError(error_str)
|
|
2432
|
-
is_valid, error_str = self.validate_normalized_width_outer(self.normalized_width_outer)
|
|
2433
|
-
if not is_valid:
|
|
2434
|
-
raise TypeError(error_str)
|
|
2435
|
-
is_valid, error_str = self.validate_width_inner(self.width_inner)
|
|
2436
|
-
if not is_valid:
|
|
2437
|
-
raise TypeError(error_str)
|
|
2438
|
-
is_valid, error_str = self.validate_min_width_inner(self.min_width_inner)
|
|
2439
|
-
if not is_valid:
|
|
2440
|
-
raise TypeError(error_str)
|
|
2441
|
-
is_valid, error_str = self.validate_max_width_inner(self.max_width_inner)
|
|
2442
|
-
if not is_valid:
|
|
2443
|
-
raise TypeError(error_str)
|
|
2444
|
-
is_valid, error_str = self.validate_width_outer(self.width_outer)
|
|
2445
|
-
if not is_valid:
|
|
2446
|
-
raise TypeError(error_str)
|
|
2447
|
-
is_valid, error_str = self.validate_min_width_outer(self.min_width_outer)
|
|
2448
|
-
if not is_valid:
|
|
2449
|
-
raise TypeError(error_str)
|
|
2450
|
-
is_valid, error_str = self.validate_max_width_outer(self.max_width_outer)
|
|
2451
|
-
if not is_valid:
|
|
2452
|
-
raise TypeError(error_str)
|
|
2453
|
-
is_valid, error_str = self.validate_force(self.force)
|
|
2454
|
-
if not is_valid:
|
|
2455
|
-
raise TypeError(error_str)
|
|
2456
|
-
is_valid, error_str = self.validate_max_force(self.max_force)
|
|
2457
|
-
if not is_valid:
|
|
2458
|
-
raise TypeError(error_str)
|
|
2459
|
-
is_valid, error_str = self.validate_finger_mounting_position(self.finger_mounting_position)
|
|
2460
|
-
if not is_valid:
|
|
2461
|
-
raise TypeError(error_str)
|
|
2462
|
-
is_valid, error_str = self.validate_finger_offset(self.finger_offset)
|
|
2463
|
-
if not is_valid:
|
|
2464
|
-
raise TypeError(error_str)
|
|
2465
|
-
is_valid, error_str = self.validate_finger_angle(self.finger_angle)
|
|
2466
|
-
if not is_valid:
|
|
2467
|
-
raise TypeError(error_str)
|
|
2468
|
-
is_valid, error_str = self.validate_finger_length(self.finger_length)
|
|
3001
|
+
is_valid, error_str = self.validate_kind(self.kind)
|
|
2469
3002
|
if not is_valid:
|
|
2470
3003
|
raise TypeError(error_str)
|
|
2471
|
-
is_valid, error_str = self.
|
|
3004
|
+
is_valid, error_str = self.validate_dh_ag(self.dh_ag)
|
|
2472
3005
|
if not is_valid:
|
|
2473
3006
|
raise TypeError(error_str)
|
|
2474
|
-
is_valid, error_str = self.
|
|
3007
|
+
is_valid, error_str = self.validate_dh_pgc(self.dh_pgc)
|
|
2475
3008
|
if not is_valid:
|
|
2476
3009
|
raise TypeError(error_str)
|
|
2477
|
-
is_valid, error_str = self.
|
|
3010
|
+
is_valid, error_str = self.validate_dh_cgi(self.dh_cgi)
|
|
2478
3011
|
if not is_valid:
|
|
2479
3012
|
raise TypeError(error_str)
|
|
2480
3013
|
|
|
2481
|
-
def
|
|
2482
|
-
return
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
width_inner=parse_f_64(data["width_inner"]) if "width_inner" in data else None,
|
|
2488
|
-
min_width_inner=parse_f_64(data["min_width_inner"]) if "min_width_inner" in data else None,
|
|
2489
|
-
max_width_inner=parse_f_64(data["max_width_inner"]) if "max_width_inner" in data else None,
|
|
2490
|
-
width_outer=parse_f_64(data["width_outer"]) if "width_outer" in data else None,
|
|
2491
|
-
min_width_outer=parse_f_64(data["min_width_outer"]) if "min_width_outer" in data else None,
|
|
2492
|
-
max_width_outer=parse_f_64(data["max_width_outer"]) if "max_width_outer" in data else None,
|
|
2493
|
-
force=parse_f_64(data["force"]) if "force" in data else None,
|
|
2494
|
-
max_force=parse_f_64(data["max_force"]) if "max_force" in data else None,
|
|
2495
|
-
finger_mounting_position=parse_str(data["finger_mounting_position"]) if "finger_mounting_position" in data else None,
|
|
2496
|
-
finger_offset=parse_f_64(data["finger_offset"]) if "finger_offset" in data else None,
|
|
2497
|
-
finger_angle=parse_f_64(data["finger_angle"]) if "finger_angle" in data else None,
|
|
2498
|
-
finger_length=parse_f_64(data["finger_length"]) if "finger_length" in data else None,
|
|
2499
|
-
finger_height=parse_f_64(data["finger_height"]) if "finger_height" in data else None,
|
|
2500
|
-
linear_sensor_error=parse_bool(data["linear_sensor_error"]) if "linear_sensor_error" in data else None,
|
|
2501
|
-
uncalibrated_error=parse_bool(data["uncalibrated_error"]) if "uncalibrated_error" in data else None,
|
|
3014
|
+
def parse_gripper_configuration(data: object):
|
|
3015
|
+
return GripperConfiguration(
|
|
3016
|
+
kind=parse_gripper_kind_enum(data["kind"]) if "kind" in data and data.get("kind") is not None else None,
|
|
3017
|
+
dh_ag=parse_dhag_gripper_configuration(data["dh_ag"]) if "dh_ag" in data and data.get("dh_ag") is not None else None,
|
|
3018
|
+
dh_pgc=parse_dhpgc_gripper_configuration(data["dh_pgc"]) if "dh_pgc" in data and data.get("dh_pgc") is not None else None,
|
|
3019
|
+
dh_cgi=parse_dhcgi_gripper_configuration(data["dh_cgi"]) if "dh_cgi" in data and data.get("dh_cgi") is not None else None,
|
|
2502
3020
|
)
|
|
2503
3021
|
|
|
2504
|
-
def
|
|
3022
|
+
def serialize_gripper_configuration(data: GripperConfiguration) -> object:
|
|
2505
3023
|
return {
|
|
2506
|
-
"
|
|
2507
|
-
"
|
|
2508
|
-
"
|
|
2509
|
-
"
|
|
2510
|
-
"width_inner": None if data.width_inner is None else serialize_f_64(data.width_inner),
|
|
2511
|
-
"min_width_inner": None if data.min_width_inner is None else serialize_f_64(data.min_width_inner),
|
|
2512
|
-
"max_width_inner": None if data.max_width_inner is None else serialize_f_64(data.max_width_inner),
|
|
2513
|
-
"width_outer": None if data.width_outer is None else serialize_f_64(data.width_outer),
|
|
2514
|
-
"min_width_outer": None if data.min_width_outer is None else serialize_f_64(data.min_width_outer),
|
|
2515
|
-
"max_width_outer": None if data.max_width_outer is None else serialize_f_64(data.max_width_outer),
|
|
2516
|
-
"force": None if data.force is None else serialize_f_64(data.force),
|
|
2517
|
-
"max_force": None if data.max_force is None else serialize_f_64(data.max_force),
|
|
2518
|
-
"finger_mounting_position": None if data.finger_mounting_position is None else serialize_str(data.finger_mounting_position),
|
|
2519
|
-
"finger_offset": None if data.finger_offset is None else serialize_f_64(data.finger_offset),
|
|
2520
|
-
"finger_angle": None if data.finger_angle is None else serialize_f_64(data.finger_angle),
|
|
2521
|
-
"finger_length": None if data.finger_length is None else serialize_f_64(data.finger_length),
|
|
2522
|
-
"finger_height": None if data.finger_height is None else serialize_f_64(data.finger_height),
|
|
2523
|
-
"linear_sensor_error": None if data.linear_sensor_error is None else serialize_bool(data.linear_sensor_error),
|
|
2524
|
-
"uncalibrated_error": None if data.uncalibrated_error is None else serialize_bool(data.uncalibrated_error),
|
|
3024
|
+
"kind": serialize_gripper_kind_enum(data.kind),
|
|
3025
|
+
"dh_ag": None if data.dh_ag is None else serialize_dhag_gripper_configuration(data.dh_ag),
|
|
3026
|
+
"dh_pgc": None if data.dh_pgc is None else serialize_dhpgc_gripper_configuration(data.dh_pgc),
|
|
3027
|
+
"dh_cgi": None if data.dh_cgi is None else serialize_dhcgi_gripper_configuration(data.dh_cgi),
|
|
2525
3028
|
}
|
|
2526
3029
|
|
|
2527
3030
|
@dataclass
|
|
2528
|
-
class
|
|
2529
|
-
"""
|
|
2530
|
-
|
|
2531
|
-
grip_detected: Union[bool, None] = None
|
|
2532
|
-
normalized_width_inner: Union[float, None] = None
|
|
2533
|
-
normalized_width_outer: Union[float, None] = None
|
|
2534
|
-
width_inner: Union[float, None] = None
|
|
2535
|
-
min_width_inner: Union[float, None] = None
|
|
2536
|
-
max_width_inner: Union[float, None] = None
|
|
2537
|
-
width_outer: Union[float, None] = None
|
|
2538
|
-
min_width_outer: Union[float, None] = None
|
|
2539
|
-
max_width_outer: Union[float, None] = None
|
|
2540
|
-
force: Union[float, None] = None
|
|
2541
|
-
max_force: Union[float, None] = None
|
|
2542
|
-
finger_mounting_position: Union[str, None] = None
|
|
2543
|
-
finger_offset: Union[float, None] = None
|
|
2544
|
-
finger_angle: Union[float, None] = None
|
|
2545
|
-
finger_length: Union[float, None] = None
|
|
2546
|
-
finger_height: Union[float, None] = None
|
|
2547
|
-
linear_sensor_error: Union[bool, None] = None
|
|
2548
|
-
uncalibrated_error: Union[bool, None] = None
|
|
2549
|
-
|
|
2550
|
-
def validate_grip_kind(self, value: OnRobotGripKindEnum) -> Tuple[bool, str]:
|
|
2551
|
-
if value is None:
|
|
2552
|
-
return [True, ""]
|
|
2553
|
-
|
|
2554
|
-
if not ((isinstance(value, str) and OnRobotGripKindEnum in ['inward', 'outward']) or isinstance(value, OnRobotGripKindEnum)):
|
|
2555
|
-
return [False, "grip_kind must be of type OnRobotGripKindEnum for OnRobot2FG7GripperConfiguration, got " + type(value).__name__]
|
|
2556
|
-
|
|
2557
|
-
return [True, ""]
|
|
2558
|
-
|
|
2559
|
-
def validate_grip_detected(self, value: bool) -> Tuple[bool, str]:
|
|
2560
|
-
if value is None:
|
|
2561
|
-
return [True, ""]
|
|
2562
|
-
|
|
2563
|
-
if not isinstance(value, bool):
|
|
2564
|
-
return [False, "grip_detected must be of type bool for OnRobot2FG7GripperConfiguration, got " + type(value).__name__]
|
|
2565
|
-
|
|
2566
|
-
return [True, ""]
|
|
2567
|
-
|
|
2568
|
-
def validate_normalized_width_inner(self, value: float) -> Tuple[bool, str]:
|
|
2569
|
-
if value is None:
|
|
2570
|
-
return [True, ""]
|
|
2571
|
-
|
|
2572
|
-
if not isinstance(value, float):
|
|
2573
|
-
return [False, "normalized_width_inner must be of type float for OnRobot2FG7GripperConfiguration, got " + type(value).__name__]
|
|
2574
|
-
|
|
2575
|
-
return [True, ""]
|
|
2576
|
-
|
|
2577
|
-
def validate_normalized_width_outer(self, value: float) -> Tuple[bool, str]:
|
|
2578
|
-
if value is None:
|
|
2579
|
-
return [True, ""]
|
|
2580
|
-
|
|
2581
|
-
if not isinstance(value, float):
|
|
2582
|
-
return [False, "normalized_width_outer must be of type float for OnRobot2FG7GripperConfiguration, got " + type(value).__name__]
|
|
2583
|
-
|
|
2584
|
-
return [True, ""]
|
|
3031
|
+
class IOStateResponse:
|
|
3032
|
+
"""Response to a query for the current state of I/O."""
|
|
3033
|
+
state: Union[IOStateMap, None] = None
|
|
2585
3034
|
|
|
2586
|
-
def
|
|
3035
|
+
def validate_state(self, value: IOStateMap) -> Tuple[bool, str]:
|
|
2587
3036
|
if value is None:
|
|
2588
3037
|
return [True, ""]
|
|
2589
3038
|
|
|
2590
|
-
if not isinstance(value,
|
|
2591
|
-
return [False, "
|
|
3039
|
+
if not (isinstance(value, dict) and all((isinstance(k, str) and isinstance(val, str)) for k, val in value.items())):
|
|
3040
|
+
return [False, "state must be of type IOStateMap for IOStateResponse, got " + type(value).__name__]
|
|
2592
3041
|
|
|
2593
3042
|
return [True, ""]
|
|
2594
3043
|
|
|
2595
|
-
def
|
|
2596
|
-
if
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
return [False, "min_width_inner must be of type float for OnRobot2FG7GripperConfiguration, got " + type(value).__name__]
|
|
2601
|
-
|
|
2602
|
-
return [True, ""]
|
|
3044
|
+
def __post_init__(self):
|
|
3045
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3046
|
+
is_valid, error_str = self.validate_state(self.state)
|
|
3047
|
+
if not is_valid:
|
|
3048
|
+
raise TypeError(error_str)
|
|
2603
3049
|
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
3050
|
+
def parse_io_state_response(data: object):
|
|
3051
|
+
return IOStateResponse(
|
|
3052
|
+
state=parse_io_state_map(data["state"]) if "state" in data and data.get("state") is not None else None,
|
|
3053
|
+
)
|
|
2607
3054
|
|
|
2608
|
-
|
|
2609
|
-
|
|
3055
|
+
def serialize_io_state_response(data: IOStateResponse) -> object:
|
|
3056
|
+
return {
|
|
3057
|
+
"state": None if data.state is None else serialize_io_state_map(data.state),
|
|
3058
|
+
}
|
|
2610
3059
|
|
|
2611
|
-
|
|
3060
|
+
@dataclass
|
|
3061
|
+
class IOStateUpdateRequest:
|
|
3062
|
+
"""Request to update the state of I/O for multiple ports."""
|
|
3063
|
+
state: Union[IOStateMap, None] = None
|
|
2612
3064
|
|
|
2613
|
-
def
|
|
3065
|
+
def validate_state(self, value: IOStateMap) -> Tuple[bool, str]:
|
|
2614
3066
|
if value is None:
|
|
2615
3067
|
return [True, ""]
|
|
2616
3068
|
|
|
2617
|
-
if not isinstance(value,
|
|
2618
|
-
return [False, "
|
|
3069
|
+
if not (isinstance(value, dict) and all((isinstance(k, str) and isinstance(val, str)) for k, val in value.items())):
|
|
3070
|
+
return [False, "state must be of type IOStateMap for IOStateUpdateRequest, got " + type(value).__name__]
|
|
2619
3071
|
|
|
2620
3072
|
return [True, ""]
|
|
2621
3073
|
|
|
2622
|
-
def
|
|
2623
|
-
if
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
return [False, "min_width_outer must be of type float for OnRobot2FG7GripperConfiguration, got " + type(value).__name__]
|
|
2628
|
-
|
|
2629
|
-
return [True, ""]
|
|
3074
|
+
def __post_init__(self):
|
|
3075
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3076
|
+
is_valid, error_str = self.validate_state(self.state)
|
|
3077
|
+
if not is_valid:
|
|
3078
|
+
raise TypeError(error_str)
|
|
2630
3079
|
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
3080
|
+
def parse_io_state_update_request(data: object):
|
|
3081
|
+
return IOStateUpdateRequest(
|
|
3082
|
+
state=parse_io_state_map(data["state"]) if "state" in data and data.get("state") is not None else None,
|
|
3083
|
+
)
|
|
2634
3084
|
|
|
2635
|
-
|
|
2636
|
-
|
|
3085
|
+
def serialize_io_state_update_request(data: IOStateUpdateRequest) -> object:
|
|
3086
|
+
return {
|
|
3087
|
+
"state": None if data.state is None else serialize_io_state_map(data.state),
|
|
3088
|
+
}
|
|
2637
3089
|
|
|
2638
|
-
|
|
3090
|
+
@dataclass
|
|
3091
|
+
class JointPoseRequest:
|
|
3092
|
+
"""Request to transform the joint angles to cartesian pose"""
|
|
3093
|
+
pose: Union[JointAngles, None] = None
|
|
2639
3094
|
|
|
2640
|
-
def
|
|
3095
|
+
def validate_pose(self, value: JointAngles) -> Tuple[bool, str]:
|
|
2641
3096
|
if value is None:
|
|
2642
|
-
return [
|
|
3097
|
+
return [False, "pose is required for JointPoseRequest"]
|
|
2643
3098
|
|
|
2644
|
-
if not isinstance(value,
|
|
2645
|
-
return [False, "
|
|
3099
|
+
if not isinstance(value, JointAngles):
|
|
3100
|
+
return [False, "pose must be of type JointAngles for JointPoseRequest, got " + type(value).__name__]
|
|
2646
3101
|
|
|
2647
3102
|
return [True, ""]
|
|
2648
3103
|
|
|
2649
|
-
def
|
|
2650
|
-
if
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
return [False, "max_force must be of type float for OnRobot2FG7GripperConfiguration, got " + type(value).__name__]
|
|
2655
|
-
|
|
2656
|
-
return [True, ""]
|
|
3104
|
+
def __post_init__(self):
|
|
3105
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3106
|
+
is_valid, error_str = self.validate_pose(self.pose)
|
|
3107
|
+
if not is_valid:
|
|
3108
|
+
raise TypeError(error_str)
|
|
2657
3109
|
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
3110
|
+
def parse_joint_pose_request(data: object):
|
|
3111
|
+
return JointPoseRequest(
|
|
3112
|
+
pose=parse_joint_angles(data["pose"]) if "pose" in data and data.get("pose") is not None else None,
|
|
3113
|
+
)
|
|
2661
3114
|
|
|
2662
|
-
|
|
2663
|
-
|
|
3115
|
+
def serialize_joint_pose_request(data: JointPoseRequest) -> object:
|
|
3116
|
+
return {
|
|
3117
|
+
"pose": serialize_joint_angles(data.pose),
|
|
3118
|
+
}
|
|
2664
3119
|
|
|
2665
|
-
|
|
3120
|
+
@dataclass
|
|
3121
|
+
class JointsPositionResponse:
|
|
3122
|
+
"""Response with robot joints position
|
|
3123
|
+
"""
|
|
3124
|
+
pose: Union[JointAngles, None] = None
|
|
2666
3125
|
|
|
2667
|
-
def
|
|
3126
|
+
def validate_pose(self, value: JointAngles) -> Tuple[bool, str]:
|
|
2668
3127
|
if value is None:
|
|
2669
3128
|
return [True, ""]
|
|
2670
3129
|
|
|
2671
|
-
if not isinstance(value,
|
|
2672
|
-
return [False, "
|
|
3130
|
+
if not isinstance(value, JointAngles):
|
|
3131
|
+
return [False, "pose must be of type JointAngles for JointsPositionResponse, got " + type(value).__name__]
|
|
2673
3132
|
|
|
2674
3133
|
return [True, ""]
|
|
2675
3134
|
|
|
2676
|
-
def
|
|
2677
|
-
if
|
|
2678
|
-
|
|
3135
|
+
def __post_init__(self):
|
|
3136
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3137
|
+
is_valid, error_str = self.validate_pose(self.pose)
|
|
3138
|
+
if not is_valid:
|
|
3139
|
+
raise TypeError(error_str)
|
|
2679
3140
|
|
|
2680
|
-
|
|
2681
|
-
|
|
3141
|
+
def parse_joints_position_response(data: object):
|
|
3142
|
+
return JointsPositionResponse(
|
|
3143
|
+
pose=parse_joint_angles(data["pose"]) if "pose" in data and data.get("pose") is not None else None,
|
|
3144
|
+
)
|
|
2682
3145
|
|
|
2683
|
-
|
|
3146
|
+
def serialize_joints_position_response(data: JointsPositionResponse) -> object:
|
|
3147
|
+
return {
|
|
3148
|
+
"pose": None if data.pose is None else serialize_joint_angles(data.pose),
|
|
3149
|
+
}
|
|
3150
|
+
|
|
3151
|
+
@dataclass
|
|
3152
|
+
class ArmJointRotations:
|
|
3153
|
+
"""Rotational positions of arm joints"""
|
|
3154
|
+
joints: Union[JointRotations, None] = None
|
|
2684
3155
|
|
|
2685
|
-
def
|
|
3156
|
+
def validate_joints(self, value: JointRotations) -> Tuple[bool, str]:
|
|
2686
3157
|
if value is None:
|
|
2687
|
-
return [
|
|
3158
|
+
return [False, "joints is required for ArmJointRotations"]
|
|
2688
3159
|
|
|
2689
|
-
if not isinstance(value,
|
|
2690
|
-
return [False, "
|
|
3160
|
+
if not (isinstance(value, tuple) and len(value) == 6):
|
|
3161
|
+
return [False, "joints must be of type JointRotations for ArmJointRotations, got " + type(value).__name__]
|
|
2691
3162
|
|
|
2692
3163
|
return [True, ""]
|
|
2693
3164
|
|
|
2694
|
-
def
|
|
2695
|
-
if
|
|
2696
|
-
|
|
3165
|
+
def __post_init__(self):
|
|
3166
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3167
|
+
is_valid, error_str = self.validate_joints(self.joints)
|
|
3168
|
+
if not is_valid:
|
|
3169
|
+
raise TypeError(error_str)
|
|
2697
3170
|
|
|
2698
|
-
|
|
2699
|
-
|
|
3171
|
+
def parse_arm_joint_rotations(data: object):
|
|
3172
|
+
return ArmJointRotations(
|
|
3173
|
+
joints=parse_joint_rotations(data["joints"]) if "joints" in data and data.get("joints") is not None else None,
|
|
3174
|
+
)
|
|
2700
3175
|
|
|
2701
|
-
|
|
3176
|
+
def serialize_arm_joint_rotations(data: ArmJointRotations) -> object:
|
|
3177
|
+
return {
|
|
3178
|
+
"joints": serialize_joint_rotations(data.joints),
|
|
3179
|
+
}
|
|
3180
|
+
|
|
3181
|
+
@dataclass
|
|
3182
|
+
class LinearUnit:
|
|
3183
|
+
"""Reusable Abstraction for linear units (eg distance, position, offset)
|
|
3184
|
+
"""
|
|
3185
|
+
unit_kind: Union[LinearUnitKind, None] = None
|
|
3186
|
+
value: Union[float, None] = None
|
|
2702
3187
|
|
|
2703
|
-
def
|
|
3188
|
+
def validate_unit_kind(self, value: LinearUnitKind) -> Tuple[bool, str]:
|
|
2704
3189
|
if value is None:
|
|
2705
|
-
return [
|
|
3190
|
+
return [False, "unit_kind is required for LinearUnit"]
|
|
2706
3191
|
|
|
2707
|
-
if not isinstance(value,
|
|
2708
|
-
return [False, "
|
|
3192
|
+
if not ((isinstance(value, str) and LinearUnitKind in ['millimeters', 'centimeters', 'meters', 'inches', 'feet']) or isinstance(value, LinearUnitKind)):
|
|
3193
|
+
return [False, "unit_kind must be of type LinearUnitKind for LinearUnit, got " + type(value).__name__]
|
|
2709
3194
|
|
|
2710
3195
|
return [True, ""]
|
|
2711
3196
|
|
|
2712
|
-
def
|
|
3197
|
+
def validate_value(self, value: float) -> Tuple[bool, str]:
|
|
2713
3198
|
if value is None:
|
|
2714
3199
|
return [True, ""]
|
|
2715
3200
|
|
|
2716
|
-
if not isinstance(value,
|
|
2717
|
-
return [False, "
|
|
3201
|
+
if not isinstance(value, float):
|
|
3202
|
+
return [False, "value must be of type float for LinearUnit, got " + type(value).__name__]
|
|
2718
3203
|
|
|
2719
3204
|
return [True, ""]
|
|
2720
3205
|
|
|
2721
3206
|
def __post_init__(self):
|
|
2722
3207
|
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2723
|
-
is_valid, error_str = self.
|
|
2724
|
-
if not is_valid:
|
|
2725
|
-
raise TypeError(error_str)
|
|
2726
|
-
is_valid, error_str = self.validate_grip_detected(self.grip_detected)
|
|
2727
|
-
if not is_valid:
|
|
2728
|
-
raise TypeError(error_str)
|
|
2729
|
-
is_valid, error_str = self.validate_normalized_width_inner(self.normalized_width_inner)
|
|
2730
|
-
if not is_valid:
|
|
2731
|
-
raise TypeError(error_str)
|
|
2732
|
-
is_valid, error_str = self.validate_normalized_width_outer(self.normalized_width_outer)
|
|
2733
|
-
if not is_valid:
|
|
2734
|
-
raise TypeError(error_str)
|
|
2735
|
-
is_valid, error_str = self.validate_width_inner(self.width_inner)
|
|
2736
|
-
if not is_valid:
|
|
2737
|
-
raise TypeError(error_str)
|
|
2738
|
-
is_valid, error_str = self.validate_min_width_inner(self.min_width_inner)
|
|
2739
|
-
if not is_valid:
|
|
2740
|
-
raise TypeError(error_str)
|
|
2741
|
-
is_valid, error_str = self.validate_max_width_inner(self.max_width_inner)
|
|
2742
|
-
if not is_valid:
|
|
2743
|
-
raise TypeError(error_str)
|
|
2744
|
-
is_valid, error_str = self.validate_width_outer(self.width_outer)
|
|
2745
|
-
if not is_valid:
|
|
2746
|
-
raise TypeError(error_str)
|
|
2747
|
-
is_valid, error_str = self.validate_min_width_outer(self.min_width_outer)
|
|
2748
|
-
if not is_valid:
|
|
2749
|
-
raise TypeError(error_str)
|
|
2750
|
-
is_valid, error_str = self.validate_max_width_outer(self.max_width_outer)
|
|
2751
|
-
if not is_valid:
|
|
2752
|
-
raise TypeError(error_str)
|
|
2753
|
-
is_valid, error_str = self.validate_force(self.force)
|
|
2754
|
-
if not is_valid:
|
|
2755
|
-
raise TypeError(error_str)
|
|
2756
|
-
is_valid, error_str = self.validate_max_force(self.max_force)
|
|
2757
|
-
if not is_valid:
|
|
2758
|
-
raise TypeError(error_str)
|
|
2759
|
-
is_valid, error_str = self.validate_finger_mounting_position(self.finger_mounting_position)
|
|
2760
|
-
if not is_valid:
|
|
2761
|
-
raise TypeError(error_str)
|
|
2762
|
-
is_valid, error_str = self.validate_finger_offset(self.finger_offset)
|
|
2763
|
-
if not is_valid:
|
|
2764
|
-
raise TypeError(error_str)
|
|
2765
|
-
is_valid, error_str = self.validate_finger_angle(self.finger_angle)
|
|
2766
|
-
if not is_valid:
|
|
2767
|
-
raise TypeError(error_str)
|
|
2768
|
-
is_valid, error_str = self.validate_finger_length(self.finger_length)
|
|
2769
|
-
if not is_valid:
|
|
2770
|
-
raise TypeError(error_str)
|
|
2771
|
-
is_valid, error_str = self.validate_finger_height(self.finger_height)
|
|
2772
|
-
if not is_valid:
|
|
2773
|
-
raise TypeError(error_str)
|
|
2774
|
-
is_valid, error_str = self.validate_linear_sensor_error(self.linear_sensor_error)
|
|
3208
|
+
is_valid, error_str = self.validate_unit_kind(self.unit_kind)
|
|
2775
3209
|
if not is_valid:
|
|
2776
3210
|
raise TypeError(error_str)
|
|
2777
|
-
is_valid, error_str = self.
|
|
3211
|
+
is_valid, error_str = self.validate_value(self.value)
|
|
2778
3212
|
if not is_valid:
|
|
2779
3213
|
raise TypeError(error_str)
|
|
2780
3214
|
|
|
2781
|
-
def
|
|
2782
|
-
return
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
normalized_width_inner=parse_f_64(data["normalized_width_inner"]) if "normalized_width_inner" in data else None,
|
|
2786
|
-
normalized_width_outer=parse_f_64(data["normalized_width_outer"]) if "normalized_width_outer" in data else None,
|
|
2787
|
-
width_inner=parse_f_64(data["width_inner"]) if "width_inner" in data else None,
|
|
2788
|
-
min_width_inner=parse_f_64(data["min_width_inner"]) if "min_width_inner" in data else None,
|
|
2789
|
-
max_width_inner=parse_f_64(data["max_width_inner"]) if "max_width_inner" in data else None,
|
|
2790
|
-
width_outer=parse_f_64(data["width_outer"]) if "width_outer" in data else None,
|
|
2791
|
-
min_width_outer=parse_f_64(data["min_width_outer"]) if "min_width_outer" in data else None,
|
|
2792
|
-
max_width_outer=parse_f_64(data["max_width_outer"]) if "max_width_outer" in data else None,
|
|
2793
|
-
force=parse_f_64(data["force"]) if "force" in data else None,
|
|
2794
|
-
max_force=parse_f_64(data["max_force"]) if "max_force" in data else None,
|
|
2795
|
-
finger_mounting_position=parse_str(data["finger_mounting_position"]) if "finger_mounting_position" in data else None,
|
|
2796
|
-
finger_offset=parse_f_64(data["finger_offset"]) if "finger_offset" in data else None,
|
|
2797
|
-
finger_angle=parse_f_64(data["finger_angle"]) if "finger_angle" in data else None,
|
|
2798
|
-
finger_length=parse_f_64(data["finger_length"]) if "finger_length" in data else None,
|
|
2799
|
-
finger_height=parse_f_64(data["finger_height"]) if "finger_height" in data else None,
|
|
2800
|
-
linear_sensor_error=parse_bool(data["linear_sensor_error"]) if "linear_sensor_error" in data else None,
|
|
2801
|
-
uncalibrated_error=parse_bool(data["uncalibrated_error"]) if "uncalibrated_error" in data else None,
|
|
3215
|
+
def parse_linear_unit(data: object):
|
|
3216
|
+
return LinearUnit(
|
|
3217
|
+
unit_kind=parse_linear_unit_kind(data["unit_kind"]) if "unit_kind" in data and data.get("unit_kind") is not None else None,
|
|
3218
|
+
value=parse_f_64(data["value"]) if "value" in data and data.get("value") is not None else None,
|
|
2802
3219
|
)
|
|
2803
3220
|
|
|
2804
|
-
def
|
|
3221
|
+
def serialize_linear_unit(data: LinearUnit) -> object:
|
|
2805
3222
|
return {
|
|
2806
|
-
"
|
|
2807
|
-
"
|
|
2808
|
-
"normalized_width_inner": None if data.normalized_width_inner is None else serialize_f_64(data.normalized_width_inner),
|
|
2809
|
-
"normalized_width_outer": None if data.normalized_width_outer is None else serialize_f_64(data.normalized_width_outer),
|
|
2810
|
-
"width_inner": None if data.width_inner is None else serialize_f_64(data.width_inner),
|
|
2811
|
-
"min_width_inner": None if data.min_width_inner is None else serialize_f_64(data.min_width_inner),
|
|
2812
|
-
"max_width_inner": None if data.max_width_inner is None else serialize_f_64(data.max_width_inner),
|
|
2813
|
-
"width_outer": None if data.width_outer is None else serialize_f_64(data.width_outer),
|
|
2814
|
-
"min_width_outer": None if data.min_width_outer is None else serialize_f_64(data.min_width_outer),
|
|
2815
|
-
"max_width_outer": None if data.max_width_outer is None else serialize_f_64(data.max_width_outer),
|
|
2816
|
-
"force": None if data.force is None else serialize_f_64(data.force),
|
|
2817
|
-
"max_force": None if data.max_force is None else serialize_f_64(data.max_force),
|
|
2818
|
-
"finger_mounting_position": None if data.finger_mounting_position is None else serialize_str(data.finger_mounting_position),
|
|
2819
|
-
"finger_offset": None if data.finger_offset is None else serialize_f_64(data.finger_offset),
|
|
2820
|
-
"finger_angle": None if data.finger_angle is None else serialize_f_64(data.finger_angle),
|
|
2821
|
-
"finger_length": None if data.finger_length is None else serialize_f_64(data.finger_length),
|
|
2822
|
-
"finger_height": None if data.finger_height is None else serialize_f_64(data.finger_height),
|
|
2823
|
-
"linear_sensor_error": None if data.linear_sensor_error is None else serialize_bool(data.linear_sensor_error),
|
|
2824
|
-
"uncalibrated_error": None if data.uncalibrated_error is None else serialize_bool(data.uncalibrated_error),
|
|
3223
|
+
"unit_kind": serialize_linear_unit_kind(data.unit_kind),
|
|
3224
|
+
"value": None if data.value is None else serialize_f_64(data.value),
|
|
2825
3225
|
}
|
|
2826
3226
|
|
|
2827
3227
|
@dataclass
|
|
2828
|
-
class
|
|
2829
|
-
"""
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
grip_kind: Union[OnRobotGripKindEnum, None] = None
|
|
2835
|
-
finger_angle: Union[float, None] = None
|
|
2836
|
-
force_applied_fraction: Union[float, None] = None
|
|
2837
|
-
force_applied_newtons: Union[float, None] = None
|
|
2838
|
-
target_force_newtons: Union[float, None] = None
|
|
2839
|
-
finger_length: Union[float, None] = None
|
|
2840
|
-
finger_mounting_position: Union[float, None] = None
|
|
2841
|
-
finger_offset: Union[float, None] = None
|
|
3228
|
+
class Position:
|
|
3229
|
+
"""Position of an object in 3D space. All empty values default to 0"""
|
|
3230
|
+
unit_kind: Union[LinearUnitKind, None] = None
|
|
3231
|
+
x: Union[float, None] = None
|
|
3232
|
+
y: Union[float, None] = None
|
|
3233
|
+
z: Union[float, None] = None
|
|
2842
3234
|
|
|
2843
|
-
def
|
|
3235
|
+
def validate_unit_kind(self, value: LinearUnitKind) -> Tuple[bool, str]:
|
|
2844
3236
|
if value is None:
|
|
2845
3237
|
return [True, ""]
|
|
2846
3238
|
|
|
2847
|
-
if not isinstance(value,
|
|
2848
|
-
return [False, "
|
|
3239
|
+
if not ((isinstance(value, str) and LinearUnitKind in ['millimeters', 'centimeters', 'meters', 'inches', 'feet']) or isinstance(value, LinearUnitKind)):
|
|
3240
|
+
return [False, "unit_kind must be of type LinearUnitKind for Position, got " + type(value).__name__]
|
|
2849
3241
|
|
|
2850
3242
|
return [True, ""]
|
|
2851
3243
|
|
|
2852
|
-
def
|
|
3244
|
+
def validate_x(self, value: float) -> Tuple[bool, str]:
|
|
2853
3245
|
if value is None:
|
|
2854
3246
|
return [True, ""]
|
|
2855
3247
|
|
|
2856
|
-
if not isinstance(value,
|
|
2857
|
-
return [False, "
|
|
3248
|
+
if not isinstance(value, float):
|
|
3249
|
+
return [False, "x must be of type float for Position, got " + type(value).__name__]
|
|
2858
3250
|
|
|
2859
3251
|
return [True, ""]
|
|
2860
3252
|
|
|
2861
|
-
def
|
|
3253
|
+
def validate_y(self, value: float) -> Tuple[bool, str]:
|
|
2862
3254
|
if value is None:
|
|
2863
3255
|
return [True, ""]
|
|
2864
3256
|
|
|
2865
|
-
if not isinstance(value,
|
|
2866
|
-
return [False, "
|
|
3257
|
+
if not isinstance(value, float):
|
|
3258
|
+
return [False, "y must be of type float for Position, got " + type(value).__name__]
|
|
2867
3259
|
|
|
2868
3260
|
return [True, ""]
|
|
2869
3261
|
|
|
2870
|
-
def
|
|
3262
|
+
def validate_z(self, value: float) -> Tuple[bool, str]:
|
|
2871
3263
|
if value is None:
|
|
2872
3264
|
return [True, ""]
|
|
2873
3265
|
|
|
2874
3266
|
if not isinstance(value, float):
|
|
2875
|
-
return [False, "
|
|
3267
|
+
return [False, "z must be of type float for Position, got " + type(value).__name__]
|
|
2876
3268
|
|
|
2877
3269
|
return [True, ""]
|
|
2878
3270
|
|
|
2879
|
-
def
|
|
2880
|
-
if
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
3271
|
+
def __post_init__(self):
|
|
3272
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3273
|
+
is_valid, error_str = self.validate_unit_kind(self.unit_kind)
|
|
3274
|
+
if not is_valid:
|
|
3275
|
+
raise TypeError(error_str)
|
|
3276
|
+
is_valid, error_str = self.validate_x(self.x)
|
|
3277
|
+
if not is_valid:
|
|
3278
|
+
raise TypeError(error_str)
|
|
3279
|
+
is_valid, error_str = self.validate_y(self.y)
|
|
3280
|
+
if not is_valid:
|
|
3281
|
+
raise TypeError(error_str)
|
|
3282
|
+
is_valid, error_str = self.validate_z(self.z)
|
|
3283
|
+
if not is_valid:
|
|
3284
|
+
raise TypeError(error_str)
|
|
2887
3285
|
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
3286
|
+
def parse_position(data: object):
|
|
3287
|
+
return Position(
|
|
3288
|
+
unit_kind=parse_linear_unit_kind(data["unit_kind"]) if "unit_kind" in data and data.get("unit_kind") is not None else None,
|
|
3289
|
+
x=parse_f_64(data["x"]) if "x" in data and data.get("x") is not None else None,
|
|
3290
|
+
y=parse_f_64(data["y"]) if "y" in data and data.get("y") is not None else None,
|
|
3291
|
+
z=parse_f_64(data["z"]) if "z" in data and data.get("z") is not None else None,
|
|
3292
|
+
)
|
|
2891
3293
|
|
|
2892
|
-
|
|
2893
|
-
|
|
3294
|
+
def serialize_position(data: Position) -> object:
|
|
3295
|
+
return {
|
|
3296
|
+
"unit_kind": None if data.unit_kind is None else serialize_linear_unit_kind(data.unit_kind),
|
|
3297
|
+
"x": None if data.x is None else serialize_f_64(data.x),
|
|
3298
|
+
"y": None if data.y is None else serialize_f_64(data.y),
|
|
3299
|
+
"z": None if data.z is None else serialize_f_64(data.z),
|
|
3300
|
+
}
|
|
2894
3301
|
|
|
2895
|
-
|
|
3302
|
+
@dataclass
|
|
3303
|
+
class SpeedProfile:
|
|
3304
|
+
"""Speed profile/limits for arm movements"""
|
|
3305
|
+
max_joint_speeds: Union[MaxJointSpeeds, None] = None
|
|
3306
|
+
max_joint_accelerations: Union[MaxJointAcclerations, None] = None
|
|
3307
|
+
max_tooltip_speed: Union[float, None] = None
|
|
3308
|
+
base_acceleration_scaling: Union[float, None] = None
|
|
3309
|
+
base_velocity_scaling: Union[float, None] = None
|
|
3310
|
+
scaling_factor: Union[float, None] = None
|
|
2896
3311
|
|
|
2897
|
-
def
|
|
3312
|
+
def validate_max_joint_speeds(self, value: MaxJointSpeeds) -> Tuple[bool, str]:
|
|
2898
3313
|
if value is None:
|
|
2899
3314
|
return [True, ""]
|
|
2900
3315
|
|
|
2901
|
-
if not isinstance(value,
|
|
2902
|
-
return [False, "
|
|
3316
|
+
if not (isinstance(value, tuple) and len(value) == 6):
|
|
3317
|
+
return [False, "max_joint_speeds must be of type MaxJointSpeeds for SpeedProfile, got " + type(value).__name__]
|
|
2903
3318
|
|
|
2904
3319
|
return [True, ""]
|
|
2905
3320
|
|
|
2906
|
-
def
|
|
3321
|
+
def validate_max_joint_accelerations(self, value: MaxJointAcclerations) -> Tuple[bool, str]:
|
|
2907
3322
|
if value is None:
|
|
2908
3323
|
return [True, ""]
|
|
2909
3324
|
|
|
2910
|
-
if not isinstance(value,
|
|
2911
|
-
return [False, "
|
|
3325
|
+
if not (isinstance(value, tuple) and len(value) == 6):
|
|
3326
|
+
return [False, "max_joint_accelerations must be of type MaxJointAcclerations for SpeedProfile, got " + type(value).__name__]
|
|
2912
3327
|
|
|
2913
3328
|
return [True, ""]
|
|
2914
3329
|
|
|
2915
|
-
def
|
|
3330
|
+
def validate_max_tooltip_speed(self, value: float) -> Tuple[bool, str]:
|
|
2916
3331
|
if value is None:
|
|
2917
3332
|
return [True, ""]
|
|
2918
3333
|
|
|
2919
3334
|
if not isinstance(value, float):
|
|
2920
|
-
return [False, "
|
|
3335
|
+
return [False, "max_tooltip_speed must be of type float for SpeedProfile, got " + type(value).__name__]
|
|
2921
3336
|
|
|
2922
3337
|
return [True, ""]
|
|
2923
3338
|
|
|
2924
|
-
def
|
|
3339
|
+
def validate_base_acceleration_scaling(self, value: float) -> Tuple[bool, str]:
|
|
2925
3340
|
if value is None:
|
|
2926
3341
|
return [True, ""]
|
|
2927
3342
|
|
|
2928
3343
|
if not isinstance(value, float):
|
|
2929
|
-
return [False, "
|
|
3344
|
+
return [False, "base_acceleration_scaling must be of type float for SpeedProfile, got " + type(value).__name__]
|
|
2930
3345
|
|
|
2931
3346
|
return [True, ""]
|
|
2932
3347
|
|
|
2933
|
-
def
|
|
3348
|
+
def validate_base_velocity_scaling(self, value: float) -> Tuple[bool, str]:
|
|
2934
3349
|
if value is None:
|
|
2935
3350
|
return [True, ""]
|
|
2936
3351
|
|
|
2937
3352
|
if not isinstance(value, float):
|
|
2938
|
-
return [False, "
|
|
3353
|
+
return [False, "base_velocity_scaling must be of type float for SpeedProfile, got " + type(value).__name__]
|
|
2939
3354
|
|
|
2940
3355
|
return [True, ""]
|
|
2941
3356
|
|
|
2942
|
-
def
|
|
3357
|
+
def validate_scaling_factor(self, value: float) -> Tuple[bool, str]:
|
|
2943
3358
|
if value is None:
|
|
2944
3359
|
return [True, ""]
|
|
2945
3360
|
|
|
2946
3361
|
if not isinstance(value, float):
|
|
2947
|
-
return [False, "
|
|
3362
|
+
return [False, "scaling_factor must be of type float for SpeedProfile, got " + type(value).__name__]
|
|
2948
3363
|
|
|
2949
3364
|
return [True, ""]
|
|
2950
3365
|
|
|
2951
3366
|
def __post_init__(self):
|
|
2952
3367
|
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2953
|
-
is_valid, error_str = self.
|
|
2954
|
-
if not is_valid:
|
|
2955
|
-
raise TypeError(error_str)
|
|
2956
|
-
is_valid, error_str = self.validate_force_grip_detected(self.force_grip_detected)
|
|
2957
|
-
if not is_valid:
|
|
2958
|
-
raise TypeError(error_str)
|
|
2959
|
-
is_valid, error_str = self.validate_calibration_ok(self.calibration_ok)
|
|
2960
|
-
if not is_valid:
|
|
2961
|
-
raise TypeError(error_str)
|
|
2962
|
-
is_valid, error_str = self.validate_diameter(self.diameter)
|
|
2963
|
-
if not is_valid:
|
|
2964
|
-
raise TypeError(error_str)
|
|
2965
|
-
is_valid, error_str = self.validate_grip_kind(self.grip_kind)
|
|
3368
|
+
is_valid, error_str = self.validate_max_joint_speeds(self.max_joint_speeds)
|
|
2966
3369
|
if not is_valid:
|
|
2967
3370
|
raise TypeError(error_str)
|
|
2968
|
-
is_valid, error_str = self.
|
|
3371
|
+
is_valid, error_str = self.validate_max_joint_accelerations(self.max_joint_accelerations)
|
|
2969
3372
|
if not is_valid:
|
|
2970
3373
|
raise TypeError(error_str)
|
|
2971
|
-
is_valid, error_str = self.
|
|
3374
|
+
is_valid, error_str = self.validate_max_tooltip_speed(self.max_tooltip_speed)
|
|
2972
3375
|
if not is_valid:
|
|
2973
3376
|
raise TypeError(error_str)
|
|
2974
|
-
is_valid, error_str = self.
|
|
3377
|
+
is_valid, error_str = self.validate_base_acceleration_scaling(self.base_acceleration_scaling)
|
|
2975
3378
|
if not is_valid:
|
|
2976
3379
|
raise TypeError(error_str)
|
|
2977
|
-
is_valid, error_str = self.
|
|
3380
|
+
is_valid, error_str = self.validate_base_velocity_scaling(self.base_velocity_scaling)
|
|
2978
3381
|
if not is_valid:
|
|
2979
3382
|
raise TypeError(error_str)
|
|
2980
|
-
is_valid, error_str = self.
|
|
2981
|
-
if not is_valid:
|
|
2982
|
-
raise TypeError(error_str)
|
|
2983
|
-
is_valid, error_str = self.validate_finger_mounting_position(self.finger_mounting_position)
|
|
2984
|
-
if not is_valid:
|
|
2985
|
-
raise TypeError(error_str)
|
|
2986
|
-
is_valid, error_str = self.validate_finger_offset(self.finger_offset)
|
|
3383
|
+
is_valid, error_str = self.validate_scaling_factor(self.scaling_factor)
|
|
2987
3384
|
if not is_valid:
|
|
2988
3385
|
raise TypeError(error_str)
|
|
2989
3386
|
|
|
2990
|
-
def
|
|
2991
|
-
return
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
force_applied_fraction=parse_f_64(data["force_applied_fraction"]) if "force_applied_fraction" in data else None,
|
|
2999
|
-
force_applied_newtons=parse_f_64(data["force_applied_newtons"]) if "force_applied_newtons" in data else None,
|
|
3000
|
-
target_force_newtons=parse_f_64(data["target_force_newtons"]) if "target_force_newtons" in data else None,
|
|
3001
|
-
finger_length=parse_f_64(data["finger_length"]) if "finger_length" in data else None,
|
|
3002
|
-
finger_mounting_position=parse_f_64(data["finger_mounting_position"]) if "finger_mounting_position" in data else None,
|
|
3003
|
-
finger_offset=parse_f_64(data["finger_offset"]) if "finger_offset" in data else None,
|
|
3387
|
+
def parse_speed_profile(data: object):
|
|
3388
|
+
return SpeedProfile(
|
|
3389
|
+
max_joint_speeds=parse_max_joint_speeds(data["max_joint_speeds"]) if "max_joint_speeds" in data and data.get("max_joint_speeds") is not None else None,
|
|
3390
|
+
max_joint_accelerations=parse_max_joint_acclerations(data["max_joint_accelerations"]) if "max_joint_accelerations" in data and data.get("max_joint_accelerations") is not None else None,
|
|
3391
|
+
max_tooltip_speed=parse_f_64(data["max_tooltip_speed"]) if "max_tooltip_speed" in data and data.get("max_tooltip_speed") is not None else None,
|
|
3392
|
+
base_acceleration_scaling=parse_f_64(data["base_acceleration_scaling"]) if "base_acceleration_scaling" in data and data.get("base_acceleration_scaling") is not None else None,
|
|
3393
|
+
base_velocity_scaling=parse_f_64(data["base_velocity_scaling"]) if "base_velocity_scaling" in data and data.get("base_velocity_scaling") is not None else None,
|
|
3394
|
+
scaling_factor=parse_f_64(data["scaling_factor"]) if "scaling_factor" in data and data.get("scaling_factor") is not None else None,
|
|
3004
3395
|
)
|
|
3005
3396
|
|
|
3006
|
-
def
|
|
3397
|
+
def serialize_speed_profile(data: SpeedProfile) -> object:
|
|
3007
3398
|
return {
|
|
3008
|
-
"
|
|
3009
|
-
"
|
|
3010
|
-
"
|
|
3011
|
-
"
|
|
3012
|
-
"
|
|
3013
|
-
"
|
|
3014
|
-
"force_applied_fraction": None if data.force_applied_fraction is None else serialize_f_64(data.force_applied_fraction),
|
|
3015
|
-
"force_applied_newtons": None if data.force_applied_newtons is None else serialize_f_64(data.force_applied_newtons),
|
|
3016
|
-
"target_force_newtons": None if data.target_force_newtons is None else serialize_f_64(data.target_force_newtons),
|
|
3017
|
-
"finger_length": None if data.finger_length is None else serialize_f_64(data.finger_length),
|
|
3018
|
-
"finger_mounting_position": None if data.finger_mounting_position is None else serialize_f_64(data.finger_mounting_position),
|
|
3019
|
-
"finger_offset": None if data.finger_offset is None else serialize_f_64(data.finger_offset),
|
|
3399
|
+
"max_joint_speeds": None if data.max_joint_speeds is None else serialize_max_joint_speeds(data.max_joint_speeds),
|
|
3400
|
+
"max_joint_accelerations": None if data.max_joint_accelerations is None else serialize_max_joint_acclerations(data.max_joint_accelerations),
|
|
3401
|
+
"max_tooltip_speed": None if data.max_tooltip_speed is None else serialize_f_64(data.max_tooltip_speed),
|
|
3402
|
+
"base_acceleration_scaling": None if data.base_acceleration_scaling is None else serialize_f_64(data.base_acceleration_scaling),
|
|
3403
|
+
"base_velocity_scaling": None if data.base_velocity_scaling is None else serialize_f_64(data.base_velocity_scaling),
|
|
3404
|
+
"scaling_factor": None if data.scaling_factor is None else serialize_f_64(data.scaling_factor),
|
|
3020
3405
|
}
|
|
3021
3406
|
|
|
3022
3407
|
PlanesList = List[Plane]
|
|
@@ -3027,6 +3412,51 @@ def parse_planes_list(data: object) -> PlanesList:
|
|
|
3027
3412
|
def serialize_planes_list(data: PlanesList) -> List[object]:
|
|
3028
3413
|
return [serialize_plane(item) for item in data]
|
|
3029
3414
|
|
|
3415
|
+
@dataclass
|
|
3416
|
+
class PositionMap:
|
|
3417
|
+
"""The position in 3D space"""
|
|
3418
|
+
jointAngles: Union[JointAnglesArray, None] = None
|
|
3419
|
+
pose: Union[PositionPose, None] = None
|
|
3420
|
+
|
|
3421
|
+
def validate_jointAngles(self, value: JointAnglesArray) -> Tuple[bool, str]:
|
|
3422
|
+
if value is None:
|
|
3423
|
+
return [True, ""]
|
|
3424
|
+
|
|
3425
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3426
|
+
return [False, "jointAngles must be of type JointAnglesArray for PositionMap, got " + type(value).__name__]
|
|
3427
|
+
|
|
3428
|
+
return [True, ""]
|
|
3429
|
+
|
|
3430
|
+
def validate_pose(self, value: PositionPose) -> Tuple[bool, str]:
|
|
3431
|
+
if value is None:
|
|
3432
|
+
return [True, ""]
|
|
3433
|
+
|
|
3434
|
+
if not isinstance(value, PositionPose):
|
|
3435
|
+
return [False, "pose must be of type PositionPose for PositionMap, got " + type(value).__name__]
|
|
3436
|
+
|
|
3437
|
+
return [True, ""]
|
|
3438
|
+
|
|
3439
|
+
def __post_init__(self):
|
|
3440
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3441
|
+
is_valid, error_str = self.validate_jointAngles(self.jointAngles)
|
|
3442
|
+
if not is_valid:
|
|
3443
|
+
raise TypeError(error_str)
|
|
3444
|
+
is_valid, error_str = self.validate_pose(self.pose)
|
|
3445
|
+
if not is_valid:
|
|
3446
|
+
raise TypeError(error_str)
|
|
3447
|
+
|
|
3448
|
+
def parse_position_map(data: object):
|
|
3449
|
+
return PositionMap(
|
|
3450
|
+
jointAngles=parse_joint_angles_array(data["jointAngles"]) if "jointAngles" in data and data.get("jointAngles") is not None else None,
|
|
3451
|
+
pose=parse_position_pose(data["pose"]) if "pose" in data and data.get("pose") is not None else None,
|
|
3452
|
+
)
|
|
3453
|
+
|
|
3454
|
+
def serialize_position_map(data: PositionMap) -> object:
|
|
3455
|
+
return {
|
|
3456
|
+
"jointAngles": None if data.jointAngles is None else serialize_joint_angles_array(data.jointAngles),
|
|
3457
|
+
"pose": None if data.pose is None else serialize_position_pose(data.pose),
|
|
3458
|
+
}
|
|
3459
|
+
|
|
3030
3460
|
@dataclass
|
|
3031
3461
|
class Orientation:
|
|
3032
3462
|
"""Orientation of an object in 3D space"""
|
|
@@ -3062,8 +3492,8 @@ class Orientation:
|
|
|
3062
3492
|
|
|
3063
3493
|
def parse_orientation(data: object):
|
|
3064
3494
|
return Orientation(
|
|
3065
|
-
kind=parse_orientation_kind_enum(data["kind"]) if "kind" in data else None,
|
|
3066
|
-
quaternion=parse_quaternion(data["quaternion"]) if "quaternion" in data else None,
|
|
3495
|
+
kind=parse_orientation_kind_enum(data["kind"]) if "kind" in data and data.get("kind") is not None else None,
|
|
3496
|
+
quaternion=parse_quaternion(data["quaternion"]) if "quaternion" in data and data.get("quaternion") is not None else None,
|
|
3067
3497
|
)
|
|
3068
3498
|
|
|
3069
3499
|
def serialize_orientation(data: Orientation) -> object:
|
|
@@ -3072,6 +3502,36 @@ def serialize_orientation(data: Orientation) -> object:
|
|
|
3072
3502
|
"quaternion": None if data.quaternion is None else serialize_quaternion(data.quaternion),
|
|
3073
3503
|
}
|
|
3074
3504
|
|
|
3505
|
+
@dataclass
|
|
3506
|
+
class RecoveryStatusResponse:
|
|
3507
|
+
"""Recovery status response"""
|
|
3508
|
+
state: Union[RecoveryStateEnum, None] = None
|
|
3509
|
+
|
|
3510
|
+
def validate_state(self, value: RecoveryStateEnum) -> Tuple[bool, str]:
|
|
3511
|
+
if value is None:
|
|
3512
|
+
return [True, ""]
|
|
3513
|
+
|
|
3514
|
+
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)):
|
|
3515
|
+
return [False, "state must be of type RecoveryStateEnum for RecoveryStatusResponse, got " + type(value).__name__]
|
|
3516
|
+
|
|
3517
|
+
return [True, ""]
|
|
3518
|
+
|
|
3519
|
+
def __post_init__(self):
|
|
3520
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3521
|
+
is_valid, error_str = self.validate_state(self.state)
|
|
3522
|
+
if not is_valid:
|
|
3523
|
+
raise TypeError(error_str)
|
|
3524
|
+
|
|
3525
|
+
def parse_recovery_status_response(data: object):
|
|
3526
|
+
return RecoveryStatusResponse(
|
|
3527
|
+
state=parse_recovery_state_enum(data["state"]) if "state" in data and data.get("state") is not None else None,
|
|
3528
|
+
)
|
|
3529
|
+
|
|
3530
|
+
def serialize_recovery_status_response(data: RecoveryStatusResponse) -> object:
|
|
3531
|
+
return {
|
|
3532
|
+
"state": None if data.state is None else serialize_recovery_state_enum(data.state),
|
|
3533
|
+
}
|
|
3534
|
+
|
|
3075
3535
|
@dataclass
|
|
3076
3536
|
class FailureStateDetails:
|
|
3077
3537
|
"""Failure state details."""
|
|
@@ -3159,12 +3619,12 @@ class FailureStateDetails:
|
|
|
3159
3619
|
|
|
3160
3620
|
def parse_failure_state_details(data: object):
|
|
3161
3621
|
return FailureStateDetails(
|
|
3162
|
-
failure_trace_id=parse_str(data["failure_trace_id"]) if "failure_trace_id" in data else None,
|
|
3163
|
-
kind=parse_str(data["kind"]) if "kind" in data else None,
|
|
3164
|
-
failed_step=parse_str(data["failed_step"]) if "failed_step" in data else None,
|
|
3165
|
-
reason=parse_str(data["reason"]) if "reason" in data else None,
|
|
3166
|
-
recovery_type=parse_recovery_type_enum(data["recovery_type"]) if "recovery_type" in data else None,
|
|
3167
|
-
is_recoverable_with_wrist_button=parse_bool(data["is_recoverable_with_wrist_button"]) if "is_recoverable_with_wrist_button" in data else None,
|
|
3622
|
+
failure_trace_id=parse_str(data["failure_trace_id"]) if "failure_trace_id" in data and data.get("failure_trace_id") is not None else None,
|
|
3623
|
+
kind=parse_str(data["kind"]) if "kind" in data and data.get("kind") is not None else None,
|
|
3624
|
+
failed_step=parse_str(data["failed_step"]) if "failed_step" in data and data.get("failed_step") is not None else None,
|
|
3625
|
+
reason=parse_str(data["reason"]) if "reason" in data and data.get("reason") is not None else None,
|
|
3626
|
+
recovery_type=parse_recovery_type_enum(data["recovery_type"]) if "recovery_type" in data and data.get("recovery_type") is not None else None,
|
|
3627
|
+
is_recoverable_with_wrist_button=parse_bool(data["is_recoverable_with_wrist_button"]) if "is_recoverable_with_wrist_button" in data and data.get("is_recoverable_with_wrist_button") is not None else None,
|
|
3168
3628
|
)
|
|
3169
3629
|
|
|
3170
3630
|
def serialize_failure_state_details(data: FailureStateDetails) -> object:
|
|
@@ -3199,7 +3659,7 @@ class RobotControlMode:
|
|
|
3199
3659
|
|
|
3200
3660
|
def parse_robot_control_mode(data: object):
|
|
3201
3661
|
return RobotControlMode(
|
|
3202
|
-
kind=parse_robot_control_mode_enum(data["kind"]) if "kind" in data else None,
|
|
3662
|
+
kind=parse_robot_control_mode_enum(data["kind"]) if "kind" in data and data.get("kind") is not None else None,
|
|
3203
3663
|
)
|
|
3204
3664
|
|
|
3205
3665
|
def serialize_robot_control_mode(data: RobotControlMode) -> object:
|
|
@@ -3229,7 +3689,7 @@ class ROSControlStateResponse:
|
|
|
3229
3689
|
|
|
3230
3690
|
def parse_ros_control_state_response(data: object):
|
|
3231
3691
|
return ROSControlStateResponse(
|
|
3232
|
-
state=parse_ros_control_state_enum(data["state"]) if "state" in data else None,
|
|
3692
|
+
state=parse_ros_control_state_enum(data["state"]) if "state" in data and data.get("state") is not None else None,
|
|
3233
3693
|
)
|
|
3234
3694
|
|
|
3235
3695
|
def serialize_ros_control_state_response(data: ROSControlStateResponse) -> object:
|
|
@@ -3257,14 +3717,59 @@ class ROSControlUpdateRequest:
|
|
|
3257
3717
|
if not is_valid:
|
|
3258
3718
|
raise TypeError(error_str)
|
|
3259
3719
|
|
|
3260
|
-
def parse_ros_control_update_request(data: object):
|
|
3261
|
-
return ROSControlUpdateRequest(
|
|
3262
|
-
action=parse_ros_control_state_enum(data["action"]) if "action" in data else None,
|
|
3720
|
+
def parse_ros_control_update_request(data: object):
|
|
3721
|
+
return ROSControlUpdateRequest(
|
|
3722
|
+
action=parse_ros_control_state_enum(data["action"]) if "action" in data and data.get("action") is not None else None,
|
|
3723
|
+
)
|
|
3724
|
+
|
|
3725
|
+
def serialize_ros_control_update_request(data: ROSControlUpdateRequest) -> object:
|
|
3726
|
+
return {
|
|
3727
|
+
"action": None if data.action is None else serialize_ros_control_state_enum(data.action),
|
|
3728
|
+
}
|
|
3729
|
+
|
|
3730
|
+
@dataclass
|
|
3731
|
+
class RoutineStepVariablesResponse:
|
|
3732
|
+
"""Step variables from the routine."""
|
|
3733
|
+
variables: Union[RoutineStepVariablesData, None] = None
|
|
3734
|
+
step_id_map: Union[RoutineStepVariablesIdMap, None] = None
|
|
3735
|
+
|
|
3736
|
+
def validate_variables(self, value: RoutineStepVariablesData) -> Tuple[bool, str]:
|
|
3737
|
+
if value is None:
|
|
3738
|
+
return [True, ""]
|
|
3739
|
+
|
|
3740
|
+
if not (isinstance(value, dict) and all((isinstance(k, str) and isinstance(val, str)) for k, val in value.items())):
|
|
3741
|
+
return [False, "variables must be of type RoutineStepVariablesData for RoutineStepVariablesResponse, got " + type(value).__name__]
|
|
3742
|
+
|
|
3743
|
+
return [True, ""]
|
|
3744
|
+
|
|
3745
|
+
def validate_step_id_map(self, value: RoutineStepVariablesIdMap) -> Tuple[bool, str]:
|
|
3746
|
+
if value is None:
|
|
3747
|
+
return [True, ""]
|
|
3748
|
+
|
|
3749
|
+
if not (isinstance(value, dict) and all((isinstance(k, str) and isinstance(val, str)) for k, val in value.items())):
|
|
3750
|
+
return [False, "step_id_map must be of type RoutineStepVariablesIdMap for RoutineStepVariablesResponse, got " + type(value).__name__]
|
|
3751
|
+
|
|
3752
|
+
return [True, ""]
|
|
3753
|
+
|
|
3754
|
+
def __post_init__(self):
|
|
3755
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3756
|
+
is_valid, error_str = self.validate_variables(self.variables)
|
|
3757
|
+
if not is_valid:
|
|
3758
|
+
raise TypeError(error_str)
|
|
3759
|
+
is_valid, error_str = self.validate_step_id_map(self.step_id_map)
|
|
3760
|
+
if not is_valid:
|
|
3761
|
+
raise TypeError(error_str)
|
|
3762
|
+
|
|
3763
|
+
def parse_routine_step_variables_response(data: object):
|
|
3764
|
+
return RoutineStepVariablesResponse(
|
|
3765
|
+
variables=parse_routine_step_variables_data(data["variables"]) if "variables" in data and data.get("variables") is not None else None,
|
|
3766
|
+
step_id_map=parse_routine_step_variables_id_map(data["step_id_map"]) if "step_id_map" in data and data.get("step_id_map") is not None else None,
|
|
3263
3767
|
)
|
|
3264
3768
|
|
|
3265
|
-
def
|
|
3769
|
+
def serialize_routine_step_variables_response(data: RoutineStepVariablesResponse) -> object:
|
|
3266
3770
|
return {
|
|
3267
|
-
"
|
|
3771
|
+
"variables": None if data.variables is None else serialize_routine_step_variables_data(data.variables),
|
|
3772
|
+
"step_id_map": None if data.step_id_map is None else serialize_routine_step_variables_id_map(data.step_id_map),
|
|
3268
3773
|
}
|
|
3269
3774
|
|
|
3270
3775
|
@dataclass
|
|
@@ -3289,7 +3794,7 @@ class PlayRoutineRequest:
|
|
|
3289
3794
|
|
|
3290
3795
|
def parse_play_routine_request(data: object):
|
|
3291
3796
|
return PlayRoutineRequest(
|
|
3292
|
-
variables=parse_routine_variables_state_map(data["variables"]) if "variables" in data else None,
|
|
3797
|
+
variables=parse_routine_variables_state_map(data["variables"]) if "variables" in data and data.get("variables") is not None else None,
|
|
3293
3798
|
)
|
|
3294
3799
|
|
|
3295
3800
|
def serialize_play_routine_request(data: PlayRoutineRequest) -> object:
|
|
@@ -3297,6 +3802,14 @@ def serialize_play_routine_request(data: PlayRoutineRequest) -> object:
|
|
|
3297
3802
|
"variables": None if data.variables is None else serialize_routine_variables_state_map(data.variables),
|
|
3298
3803
|
}
|
|
3299
3804
|
|
|
3805
|
+
SensorsList = List[Sensor]
|
|
3806
|
+
|
|
3807
|
+
def parse_sensors_list(data: object) -> SensorsList:
|
|
3808
|
+
return [parse_sensor(item) for item in data]
|
|
3809
|
+
|
|
3810
|
+
def serialize_sensors_list(data: SensorsList) -> List[object]:
|
|
3811
|
+
return [serialize_sensor(item) for item in data]
|
|
3812
|
+
|
|
3300
3813
|
@dataclass
|
|
3301
3814
|
class TextToSkillRequest:
|
|
3302
3815
|
"""Request to convert text to a skill."""
|
|
@@ -3332,8 +3845,8 @@ class TextToSkillRequest:
|
|
|
3332
3845
|
|
|
3333
3846
|
def parse_text_to_skill_request(data: object):
|
|
3334
3847
|
return TextToSkillRequest(
|
|
3335
|
-
text=parse_str(data["text"]) if "text" in data else None,
|
|
3336
|
-
skills=parse_skills_list(data["skills"]) if "skills" in data else None,
|
|
3848
|
+
text=parse_str(data["text"]) if "text" in data and data.get("text") is not None else None,
|
|
3849
|
+
skills=parse_skills_list(data["skills"]) if "skills" in data and data.get("skills") is not None else None,
|
|
3337
3850
|
)
|
|
3338
3851
|
|
|
3339
3852
|
def serialize_text_to_skill_request(data: TextToSkillRequest) -> object:
|
|
@@ -3377,8 +3890,8 @@ class StatusHealthResponse:
|
|
|
3377
3890
|
|
|
3378
3891
|
def parse_status_health_response(data: object):
|
|
3379
3892
|
return StatusHealthResponse(
|
|
3380
|
-
health=parse_status_health_enum(data["health"]) if "health" in data else None,
|
|
3381
|
-
build=parse_status_version_data(data["build"]) if "build" in data else None,
|
|
3893
|
+
health=parse_status_health_enum(data["health"]) if "health" in data and data.get("health") is not None else None,
|
|
3894
|
+
build=parse_status_version_data(data["build"]) if "build" in data and data.get("build") is not None else None,
|
|
3382
3895
|
)
|
|
3383
3896
|
|
|
3384
3897
|
def serialize_status_health_response(data: StatusHealthResponse) -> object:
|
|
@@ -3410,7 +3923,7 @@ class ArmPositionUpdateRequestResponseEventStreamDetails:
|
|
|
3410
3923
|
|
|
3411
3924
|
def parse_arm_position_update_request_response_event_stream_details(data: object):
|
|
3412
3925
|
return ArmPositionUpdateRequestResponseEventStreamDetails(
|
|
3413
|
-
subscriptions=parse_arm_position_update_request_response_event_stream_subscriptions_list(data["subscriptions"]) if "subscriptions" in data else None,
|
|
3926
|
+
subscriptions=parse_arm_position_update_request_response_event_stream_subscriptions_list(data["subscriptions"]) if "subscriptions" in data and data.get("subscriptions") is not None else None,
|
|
3414
3927
|
)
|
|
3415
3928
|
|
|
3416
3929
|
def serialize_arm_position_update_request_response_event_stream_details(data: ArmPositionUpdateRequestResponseEventStreamDetails) -> object:
|
|
@@ -3505,12 +4018,12 @@ class JointsStateResponse:
|
|
|
3505
4018
|
|
|
3506
4019
|
def parse_joints_state_response(data: object):
|
|
3507
4020
|
return JointsStateResponse(
|
|
3508
|
-
J0=parse_joint_state(data["J0"]) if "J0" in data else None,
|
|
3509
|
-
J1=parse_joint_state(data["J1"]) if "J1" in data else None,
|
|
3510
|
-
J2=parse_joint_state(data["J2"]) if "J2" in data else None,
|
|
3511
|
-
J3=parse_joint_state(data["J3"]) if "J3" in data else None,
|
|
3512
|
-
J4=parse_joint_state(data["J4"]) if "J4" in data else None,
|
|
3513
|
-
J5=parse_joint_state(data["J5"]) if "J5" in data else None,
|
|
4021
|
+
J0=parse_joint_state(data["J0"]) if "J0" in data and data.get("J0") is not None else None,
|
|
4022
|
+
J1=parse_joint_state(data["J1"]) if "J1" in data and data.get("J1") is not None else None,
|
|
4023
|
+
J2=parse_joint_state(data["J2"]) if "J2" in data and data.get("J2") is not None else None,
|
|
4024
|
+
J3=parse_joint_state(data["J3"]) if "J3" in data and data.get("J3") is not None else None,
|
|
4025
|
+
J4=parse_joint_state(data["J4"]) if "J4" in data and data.get("J4") is not None else None,
|
|
4026
|
+
J5=parse_joint_state(data["J5"]) if "J5" in data and data.get("J5") is not None else None,
|
|
3514
4027
|
)
|
|
3515
4028
|
|
|
3516
4029
|
def serialize_joints_state_response(data: JointsStateResponse) -> object:
|
|
@@ -3571,9 +4084,9 @@ class Routine:
|
|
|
3571
4084
|
|
|
3572
4085
|
def parse_routine(data: object):
|
|
3573
4086
|
return Routine(
|
|
3574
|
-
id=parse_str(data["id"]) if "id" in data else None,
|
|
3575
|
-
name=parse_str(data["name"]) if "name" in data else None,
|
|
3576
|
-
environment_variables=parse_environment_variables_list(data["environment_variables"]) if "environment_variables" in data else None,
|
|
4087
|
+
id=parse_str(data["id"]) if "id" in data and data.get("id") is not None else None,
|
|
4088
|
+
name=parse_str(data["name"]) if "name" in data and data.get("name") is not None else None,
|
|
4089
|
+
environment_variables=parse_environment_variables_list(data["environment_variables"]) if "environment_variables" in data and data.get("environment_variables") is not None else None,
|
|
3577
4090
|
)
|
|
3578
4091
|
|
|
3579
4092
|
def serialize_routine(data: Routine) -> object:
|
|
@@ -3653,10 +4166,10 @@ class OnRobot2FG14GripperCommandRequest:
|
|
|
3653
4166
|
|
|
3654
4167
|
def parse_on_robot_2_fg_14_gripper_command_request(data: object):
|
|
3655
4168
|
return OnRobot2FG14GripperCommandRequest(
|
|
3656
|
-
grip_direction=parse_linear_grip_direction_enum(data["grip_direction"]) if "grip_direction" in data else None,
|
|
3657
|
-
target_force=parse_force_unit(data["target_force"]) if "target_force" in data else None,
|
|
3658
|
-
target_grip_width=parse_linear_unit(data["target_grip_width"]) if "target_grip_width" in data else None,
|
|
3659
|
-
control_kind=parse_on_robot_2_fg_14_control_kind_enum(data["control_kind"]) if "control_kind" in data else None,
|
|
4169
|
+
grip_direction=parse_linear_grip_direction_enum(data["grip_direction"]) if "grip_direction" in data and data.get("grip_direction") is not None else None,
|
|
4170
|
+
target_force=parse_force_unit(data["target_force"]) if "target_force" in data and data.get("target_force") is not None else None,
|
|
4171
|
+
target_grip_width=parse_linear_unit(data["target_grip_width"]) if "target_grip_width" in data and data.get("target_grip_width") is not None else None,
|
|
4172
|
+
control_kind=parse_on_robot_2_fg_14_control_kind_enum(data["control_kind"]) if "control_kind" in data and data.get("control_kind") is not None else None,
|
|
3660
4173
|
)
|
|
3661
4174
|
|
|
3662
4175
|
def serialize_on_robot_2_fg_14_gripper_command_request(data: OnRobot2FG14GripperCommandRequest) -> object:
|
|
@@ -3729,10 +4242,10 @@ class OnRobot2FG7GripperCommandRequest:
|
|
|
3729
4242
|
|
|
3730
4243
|
def parse_on_robot_2_fg_7_gripper_command_request(data: object):
|
|
3731
4244
|
return OnRobot2FG7GripperCommandRequest(
|
|
3732
|
-
grip_direction=parse_linear_grip_direction_enum(data["grip_direction"]) if "grip_direction" in data else None,
|
|
3733
|
-
target_force=parse_force_unit(data["target_force"]) if "target_force" in data else None,
|
|
3734
|
-
target_grip_width=parse_linear_unit(data["target_grip_width"]) if "target_grip_width" in data else None,
|
|
3735
|
-
control_kind=parse_on_robot_2_fg_7_control_kind_enum(data["control_kind"]) if "control_kind" in data else None,
|
|
4245
|
+
grip_direction=parse_linear_grip_direction_enum(data["grip_direction"]) if "grip_direction" in data and data.get("grip_direction") is not None else None,
|
|
4246
|
+
target_force=parse_force_unit(data["target_force"]) if "target_force" in data and data.get("target_force") is not None else None,
|
|
4247
|
+
target_grip_width=parse_linear_unit(data["target_grip_width"]) if "target_grip_width" in data and data.get("target_grip_width") is not None else None,
|
|
4248
|
+
control_kind=parse_on_robot_2_fg_7_control_kind_enum(data["control_kind"]) if "control_kind" in data and data.get("control_kind") is not None else None,
|
|
3736
4249
|
)
|
|
3737
4250
|
|
|
3738
4251
|
def serialize_on_robot_2_fg_7_gripper_command_request(data: OnRobot2FG7GripperCommandRequest) -> object:
|
|
@@ -3805,10 +4318,10 @@ class OnRobot3FG15GripperCommandRequest:
|
|
|
3805
4318
|
|
|
3806
4319
|
def parse_on_robot_3_fg_15_gripper_command_request(data: object):
|
|
3807
4320
|
return OnRobot3FG15GripperCommandRequest(
|
|
3808
|
-
grip_direction=parse_linear_grip_direction_enum(data["grip_direction"]) if "grip_direction" in data else None,
|
|
3809
|
-
target_force=parse_force_unit(data["target_force"]) if "target_force" in data else None,
|
|
3810
|
-
target_grip_diameter=parse_linear_unit(data["target_grip_diameter"]) if "target_grip_diameter" in data else None,
|
|
3811
|
-
control_kind=parse_on_robot_3_fg_15_control_kind_enum(data["control_kind"]) if "control_kind" in data else None,
|
|
4321
|
+
grip_direction=parse_linear_grip_direction_enum(data["grip_direction"]) if "grip_direction" in data and data.get("grip_direction") is not None else None,
|
|
4322
|
+
target_force=parse_force_unit(data["target_force"]) if "target_force" in data and data.get("target_force") is not None else None,
|
|
4323
|
+
target_grip_diameter=parse_linear_unit(data["target_grip_diameter"]) if "target_grip_diameter" in data and data.get("target_grip_diameter") is not None else None,
|
|
4324
|
+
control_kind=parse_on_robot_3_fg_15_control_kind_enum(data["control_kind"]) if "control_kind" in data and data.get("control_kind") is not None else None,
|
|
3812
4325
|
)
|
|
3813
4326
|
|
|
3814
4327
|
def serialize_on_robot_3_fg_15_gripper_command_request(data: OnRobot3FG15GripperCommandRequest) -> object:
|
|
@@ -3855,8 +4368,8 @@ class SchunkEGxGripperCommandRequest:
|
|
|
3855
4368
|
|
|
3856
4369
|
def parse_schunk_e_gx_gripper_command_request(data: object):
|
|
3857
4370
|
return SchunkEGxGripperCommandRequest(
|
|
3858
|
-
target_grip_width=parse_linear_unit(data["target_grip_width"]) if "target_grip_width" in data else None,
|
|
3859
|
-
control_kind=parse_schunk_e_gx_control_kind_enum(data["control_kind"]) if "control_kind" in data else None,
|
|
4371
|
+
target_grip_width=parse_linear_unit(data["target_grip_width"]) if "target_grip_width" in data and data.get("target_grip_width") is not None else None,
|
|
4372
|
+
control_kind=parse_schunk_e_gx_control_kind_enum(data["control_kind"]) if "control_kind" in data and data.get("control_kind") is not None else None,
|
|
3860
4373
|
)
|
|
3861
4374
|
|
|
3862
4375
|
def serialize_schunk_e_gx_gripper_command_request(data: SchunkEGxGripperCommandRequest) -> object:
|
|
@@ -3865,141 +4378,6 @@ def serialize_schunk_e_gx_gripper_command_request(data: SchunkEGxGripperCommandR
|
|
|
3865
4378
|
"control_kind": serialize_schunk_e_gx_control_kind_enum(data.control_kind),
|
|
3866
4379
|
}
|
|
3867
4380
|
|
|
3868
|
-
@dataclass
|
|
3869
|
-
class GripperConfiguration:
|
|
3870
|
-
"""Configuration of gripper, also known as End Effector"""
|
|
3871
|
-
kind: Union[GripperKindEnum, None] = None
|
|
3872
|
-
onrobot_2fg7: Union[OnRobot2FG7GripperConfiguration, None] = None
|
|
3873
|
-
onrobot_2fg14: Union[OnRobot2FG14GripperConfiguration, None] = None
|
|
3874
|
-
onrobot_3fg15: Union[OnRobot3FG15GripperConfiguration, None] = None
|
|
3875
|
-
onrobot_screwdriver: Union[OnRobotScrewdriverConfiguration, None] = None
|
|
3876
|
-
dh_ag: Union[DHAGGripperConfiguration, None] = None
|
|
3877
|
-
dh_pgc: Union[DHPGCGripperConfiguration, None] = None
|
|
3878
|
-
dh_cgi: Union[DHCGIGripperConfiguration, None] = None
|
|
3879
|
-
|
|
3880
|
-
def validate_kind(self, value: GripperKindEnum) -> Tuple[bool, str]:
|
|
3881
|
-
if value is None:
|
|
3882
|
-
return [False, "kind is required for GripperConfiguration"]
|
|
3883
|
-
|
|
3884
|
-
if not ((isinstance(value, str) and GripperKindEnum in ['onrobot_2fg7', 'onrobot_2fg14', 'onrobot_3fg15', 'onrobot_screwdriver', 'dh_ag', 'dh_pgc', 'dh_cgi', 'schunk_egx', 'none_connected']) or isinstance(value, GripperKindEnum)):
|
|
3885
|
-
return [False, "kind must be of type GripperKindEnum for GripperConfiguration, got " + type(value).__name__]
|
|
3886
|
-
|
|
3887
|
-
return [True, ""]
|
|
3888
|
-
|
|
3889
|
-
def validate_onrobot_2fg7(self, value: OnRobot2FG7GripperConfiguration) -> Tuple[bool, str]:
|
|
3890
|
-
if value is None:
|
|
3891
|
-
return [True, ""]
|
|
3892
|
-
|
|
3893
|
-
if not isinstance(value, OnRobot2FG7GripperConfiguration):
|
|
3894
|
-
return [False, "onrobot_2fg7 must be of type OnRobot2FG7GripperConfiguration for GripperConfiguration, got " + type(value).__name__]
|
|
3895
|
-
|
|
3896
|
-
return [True, ""]
|
|
3897
|
-
|
|
3898
|
-
def validate_onrobot_2fg14(self, value: OnRobot2FG14GripperConfiguration) -> Tuple[bool, str]:
|
|
3899
|
-
if value is None:
|
|
3900
|
-
return [True, ""]
|
|
3901
|
-
|
|
3902
|
-
if not isinstance(value, OnRobot2FG14GripperConfiguration):
|
|
3903
|
-
return [False, "onrobot_2fg14 must be of type OnRobot2FG14GripperConfiguration for GripperConfiguration, got " + type(value).__name__]
|
|
3904
|
-
|
|
3905
|
-
return [True, ""]
|
|
3906
|
-
|
|
3907
|
-
def validate_onrobot_3fg15(self, value: OnRobot3FG15GripperConfiguration) -> Tuple[bool, str]:
|
|
3908
|
-
if value is None:
|
|
3909
|
-
return [True, ""]
|
|
3910
|
-
|
|
3911
|
-
if not isinstance(value, OnRobot3FG15GripperConfiguration):
|
|
3912
|
-
return [False, "onrobot_3fg15 must be of type OnRobot3FG15GripperConfiguration for GripperConfiguration, got " + type(value).__name__]
|
|
3913
|
-
|
|
3914
|
-
return [True, ""]
|
|
3915
|
-
|
|
3916
|
-
def validate_onrobot_screwdriver(self, value: OnRobotScrewdriverConfiguration) -> Tuple[bool, str]:
|
|
3917
|
-
if value is None:
|
|
3918
|
-
return [True, ""]
|
|
3919
|
-
|
|
3920
|
-
if not isinstance(value, OnRobotScrewdriverConfiguration):
|
|
3921
|
-
return [False, "onrobot_screwdriver must be of type OnRobotScrewdriverConfiguration for GripperConfiguration, got " + type(value).__name__]
|
|
3922
|
-
|
|
3923
|
-
return [True, ""]
|
|
3924
|
-
|
|
3925
|
-
def validate_dh_ag(self, value: DHAGGripperConfiguration) -> Tuple[bool, str]:
|
|
3926
|
-
if value is None:
|
|
3927
|
-
return [True, ""]
|
|
3928
|
-
|
|
3929
|
-
if not isinstance(value, DHAGGripperConfiguration):
|
|
3930
|
-
return [False, "dh_ag must be of type DHAGGripperConfiguration for GripperConfiguration, got " + type(value).__name__]
|
|
3931
|
-
|
|
3932
|
-
return [True, ""]
|
|
3933
|
-
|
|
3934
|
-
def validate_dh_pgc(self, value: DHPGCGripperConfiguration) -> Tuple[bool, str]:
|
|
3935
|
-
if value is None:
|
|
3936
|
-
return [True, ""]
|
|
3937
|
-
|
|
3938
|
-
if not isinstance(value, DHPGCGripperConfiguration):
|
|
3939
|
-
return [False, "dh_pgc must be of type DHPGCGripperConfiguration for GripperConfiguration, got " + type(value).__name__]
|
|
3940
|
-
|
|
3941
|
-
return [True, ""]
|
|
3942
|
-
|
|
3943
|
-
def validate_dh_cgi(self, value: DHCGIGripperConfiguration) -> Tuple[bool, str]:
|
|
3944
|
-
if value is None:
|
|
3945
|
-
return [True, ""]
|
|
3946
|
-
|
|
3947
|
-
if not isinstance(value, DHCGIGripperConfiguration):
|
|
3948
|
-
return [False, "dh_cgi must be of type DHCGIGripperConfiguration for GripperConfiguration, got " + type(value).__name__]
|
|
3949
|
-
|
|
3950
|
-
return [True, ""]
|
|
3951
|
-
|
|
3952
|
-
def __post_init__(self):
|
|
3953
|
-
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3954
|
-
is_valid, error_str = self.validate_kind(self.kind)
|
|
3955
|
-
if not is_valid:
|
|
3956
|
-
raise TypeError(error_str)
|
|
3957
|
-
is_valid, error_str = self.validate_onrobot_2fg7(self.onrobot_2fg7)
|
|
3958
|
-
if not is_valid:
|
|
3959
|
-
raise TypeError(error_str)
|
|
3960
|
-
is_valid, error_str = self.validate_onrobot_2fg14(self.onrobot_2fg14)
|
|
3961
|
-
if not is_valid:
|
|
3962
|
-
raise TypeError(error_str)
|
|
3963
|
-
is_valid, error_str = self.validate_onrobot_3fg15(self.onrobot_3fg15)
|
|
3964
|
-
if not is_valid:
|
|
3965
|
-
raise TypeError(error_str)
|
|
3966
|
-
is_valid, error_str = self.validate_onrobot_screwdriver(self.onrobot_screwdriver)
|
|
3967
|
-
if not is_valid:
|
|
3968
|
-
raise TypeError(error_str)
|
|
3969
|
-
is_valid, error_str = self.validate_dh_ag(self.dh_ag)
|
|
3970
|
-
if not is_valid:
|
|
3971
|
-
raise TypeError(error_str)
|
|
3972
|
-
is_valid, error_str = self.validate_dh_pgc(self.dh_pgc)
|
|
3973
|
-
if not is_valid:
|
|
3974
|
-
raise TypeError(error_str)
|
|
3975
|
-
is_valid, error_str = self.validate_dh_cgi(self.dh_cgi)
|
|
3976
|
-
if not is_valid:
|
|
3977
|
-
raise TypeError(error_str)
|
|
3978
|
-
|
|
3979
|
-
def parse_gripper_configuration(data: object):
|
|
3980
|
-
return GripperConfiguration(
|
|
3981
|
-
kind=parse_gripper_kind_enum(data["kind"]) if "kind" in data else None,
|
|
3982
|
-
onrobot_2fg7=parse_on_robot_2_fg_7_gripper_configuration(data["onrobot_2fg7"]) if "onrobot_2fg7" in data else None,
|
|
3983
|
-
onrobot_2fg14=parse_on_robot_2_fg_14_gripper_configuration(data["onrobot_2fg14"]) if "onrobot_2fg14" in data else None,
|
|
3984
|
-
onrobot_3fg15=parse_on_robot_3_fg_15_gripper_configuration(data["onrobot_3fg15"]) if "onrobot_3fg15" in data else None,
|
|
3985
|
-
onrobot_screwdriver=parse_on_robot_screwdriver_configuration(data["onrobot_screwdriver"]) if "onrobot_screwdriver" in data else None,
|
|
3986
|
-
dh_ag=parse_dhag_gripper_configuration(data["dh_ag"]) if "dh_ag" in data else None,
|
|
3987
|
-
dh_pgc=parse_dhpgc_gripper_configuration(data["dh_pgc"]) if "dh_pgc" in data else None,
|
|
3988
|
-
dh_cgi=parse_dhcgi_gripper_configuration(data["dh_cgi"]) if "dh_cgi" in data else None,
|
|
3989
|
-
)
|
|
3990
|
-
|
|
3991
|
-
def serialize_gripper_configuration(data: GripperConfiguration) -> object:
|
|
3992
|
-
return {
|
|
3993
|
-
"kind": serialize_gripper_kind_enum(data.kind),
|
|
3994
|
-
"onrobot_2fg7": None if data.onrobot_2fg7 is None else serialize_on_robot_2_fg_7_gripper_configuration(data.onrobot_2fg7),
|
|
3995
|
-
"onrobot_2fg14": None if data.onrobot_2fg14 is None else serialize_on_robot_2_fg_14_gripper_configuration(data.onrobot_2fg14),
|
|
3996
|
-
"onrobot_3fg15": None if data.onrobot_3fg15 is None else serialize_on_robot_3_fg_15_gripper_configuration(data.onrobot_3fg15),
|
|
3997
|
-
"onrobot_screwdriver": None if data.onrobot_screwdriver is None else serialize_on_robot_screwdriver_configuration(data.onrobot_screwdriver),
|
|
3998
|
-
"dh_ag": None if data.dh_ag is None else serialize_dhag_gripper_configuration(data.dh_ag),
|
|
3999
|
-
"dh_pgc": None if data.dh_pgc is None else serialize_dhpgc_gripper_configuration(data.dh_pgc),
|
|
4000
|
-
"dh_cgi": None if data.dh_cgi is None else serialize_dhcgi_gripper_configuration(data.dh_cgi),
|
|
4001
|
-
}
|
|
4002
|
-
|
|
4003
4381
|
@dataclass
|
|
4004
4382
|
class PlanesPaginatedResponse:
|
|
4005
4383
|
"""Paginated response containing plane data"""
|
|
@@ -4035,8 +4413,8 @@ class PlanesPaginatedResponse:
|
|
|
4035
4413
|
|
|
4036
4414
|
def parse_planes_paginated_response(data: object):
|
|
4037
4415
|
return PlanesPaginatedResponse(
|
|
4038
|
-
items=parse_planes_list(data["items"]) if "items" in data else None,
|
|
4039
|
-
pagination=parse_pagination(data["pagination"]) if "pagination" in data else None,
|
|
4416
|
+
items=parse_planes_list(data["items"]) if "items" in data and data.get("items") is not None else None,
|
|
4417
|
+
pagination=parse_pagination(data["pagination"]) if "pagination" in data and data.get("pagination") is not None else None,
|
|
4040
4418
|
)
|
|
4041
4419
|
|
|
4042
4420
|
def serialize_planes_paginated_response(data: PlanesPaginatedResponse) -> object:
|
|
@@ -4045,6 +4423,14 @@ def serialize_planes_paginated_response(data: PlanesPaginatedResponse) -> object
|
|
|
4045
4423
|
"pagination": None if data.pagination is None else serialize_pagination(data.pagination),
|
|
4046
4424
|
}
|
|
4047
4425
|
|
|
4426
|
+
SpacePositionsMap = List[PositionMap]
|
|
4427
|
+
|
|
4428
|
+
def parse_space_positions_map(data: object) -> SpacePositionsMap:
|
|
4429
|
+
return [parse_position_map(item) for item in data]
|
|
4430
|
+
|
|
4431
|
+
def serialize_space_positions_map(data: SpacePositionsMap) -> List[object]:
|
|
4432
|
+
return [serialize_position_map(item) for item in data]
|
|
4433
|
+
|
|
4048
4434
|
@dataclass
|
|
4049
4435
|
class PositionAndOrientation:
|
|
4050
4436
|
"""Position of the arm tooltip"""
|
|
@@ -4119,11 +4505,11 @@ class PositionAndOrientation:
|
|
|
4119
4505
|
|
|
4120
4506
|
def parse_position_and_orientation(data: object):
|
|
4121
4507
|
return PositionAndOrientation(
|
|
4122
|
-
axis_alignment=parse_str(data["axis_alignment"]) if "axis_alignment" in data else None,
|
|
4123
|
-
reference_frame=parse_str(data["reference_frame"]) if "reference_frame" in data else None,
|
|
4124
|
-
local_accuracy_calibration=parse_str(data["local_accuracy_calibration"]) if "local_accuracy_calibration" in data else None,
|
|
4125
|
-
position=parse_position(data["position"]) if "position" in data else None,
|
|
4126
|
-
orientation=parse_orientation(data["orientation"]) if "orientation" in data else None,
|
|
4508
|
+
axis_alignment=parse_str(data["axis_alignment"]) if "axis_alignment" in data and data.get("axis_alignment") is not None else None,
|
|
4509
|
+
reference_frame=parse_str(data["reference_frame"]) if "reference_frame" in data and data.get("reference_frame") is not None else None,
|
|
4510
|
+
local_accuracy_calibration=parse_str(data["local_accuracy_calibration"]) if "local_accuracy_calibration" in data and data.get("local_accuracy_calibration") is not None else None,
|
|
4511
|
+
position=parse_position(data["position"]) if "position" in data and data.get("position") is not None else None,
|
|
4512
|
+
orientation=parse_orientation(data["orientation"]) if "orientation" in data and data.get("orientation") is not None else None,
|
|
4127
4513
|
)
|
|
4128
4514
|
|
|
4129
4515
|
def serialize_position_and_orientation(data: PositionAndOrientation) -> object:
|
|
@@ -4138,19 +4524,9 @@ def serialize_position_and_orientation(data: PositionAndOrientation) -> object:
|
|
|
4138
4524
|
@dataclass
|
|
4139
4525
|
class FailureStateResponse:
|
|
4140
4526
|
"""Failure state response informs user of how and whether the robot may be recovered."""
|
|
4141
|
-
status: Union[RobotStatusEnum, None] = None
|
|
4142
4527
|
failed: Union[bool, None] = None
|
|
4143
4528
|
failure: Union[FailureStateDetails, None] = None
|
|
4144
4529
|
|
|
4145
|
-
def validate_status(self, value: RobotStatusEnum) -> Tuple[bool, str]:
|
|
4146
|
-
if value is None:
|
|
4147
|
-
return [True, ""]
|
|
4148
|
-
|
|
4149
|
-
if not ((isinstance(value, str) and RobotStatusEnum in ['Idle', 'RunningAdHocCommand', 'RoutineRunning', 'Antigravity', 'AntigravitySlow', 'Failure', 'Recovering']) or isinstance(value, RobotStatusEnum)):
|
|
4150
|
-
return [False, "status must be of type RobotStatusEnum for FailureStateResponse, got " + type(value).__name__]
|
|
4151
|
-
|
|
4152
|
-
return [True, ""]
|
|
4153
|
-
|
|
4154
4530
|
def validate_failed(self, value: bool) -> Tuple[bool, str]:
|
|
4155
4531
|
if value is None:
|
|
4156
4532
|
return [True, ""]
|
|
@@ -4171,9 +4547,6 @@ class FailureStateResponse:
|
|
|
4171
4547
|
|
|
4172
4548
|
def __post_init__(self):
|
|
4173
4549
|
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
4174
|
-
is_valid, error_str = self.validate_status(self.status)
|
|
4175
|
-
if not is_valid:
|
|
4176
|
-
raise TypeError(error_str)
|
|
4177
4550
|
is_valid, error_str = self.validate_failed(self.failed)
|
|
4178
4551
|
if not is_valid:
|
|
4179
4552
|
raise TypeError(error_str)
|
|
@@ -4183,18 +4556,46 @@ class FailureStateResponse:
|
|
|
4183
4556
|
|
|
4184
4557
|
def parse_failure_state_response(data: object):
|
|
4185
4558
|
return FailureStateResponse(
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
failure=parse_failure_state_details(data["failure"]) if "failure" in data else None,
|
|
4559
|
+
failed=parse_bool(data["failed"]) if "failed" in data and data.get("failed") is not None else None,
|
|
4560
|
+
failure=parse_failure_state_details(data["failure"]) if "failure" in data and data.get("failure") is not None else None,
|
|
4189
4561
|
)
|
|
4190
4562
|
|
|
4191
4563
|
def serialize_failure_state_response(data: FailureStateResponse) -> object:
|
|
4192
4564
|
return {
|
|
4193
|
-
"status": None if data.status is None else serialize_robot_status_enum(data.status),
|
|
4194
4565
|
"failed": None if data.failed is None else serialize_bool(data.failed),
|
|
4195
4566
|
"failure": None if data.failure is None else serialize_failure_state_details(data.failure),
|
|
4196
4567
|
}
|
|
4197
4568
|
|
|
4569
|
+
@dataclass
|
|
4570
|
+
class SensorsConfiguration:
|
|
4571
|
+
"""Configuration of all sensors defined in custom equipment"""
|
|
4572
|
+
sensors: Union[SensorsList, None] = None
|
|
4573
|
+
|
|
4574
|
+
def validate_sensors(self, value: SensorsList) -> Tuple[bool, str]:
|
|
4575
|
+
if value is None:
|
|
4576
|
+
return [True, ""]
|
|
4577
|
+
|
|
4578
|
+
if not (isinstance(value, list) and all(isinstance(x, Sensor) for x in value)):
|
|
4579
|
+
return [False, "sensors must be of type SensorsList for SensorsConfiguration, got " + type(value).__name__]
|
|
4580
|
+
|
|
4581
|
+
return [True, ""]
|
|
4582
|
+
|
|
4583
|
+
def __post_init__(self):
|
|
4584
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
4585
|
+
is_valid, error_str = self.validate_sensors(self.sensors)
|
|
4586
|
+
if not is_valid:
|
|
4587
|
+
raise TypeError(error_str)
|
|
4588
|
+
|
|
4589
|
+
def parse_sensors_configuration(data: object):
|
|
4590
|
+
return SensorsConfiguration(
|
|
4591
|
+
sensors=parse_sensors_list(data["sensors"]) if "sensors" in data and data.get("sensors") is not None else None,
|
|
4592
|
+
)
|
|
4593
|
+
|
|
4594
|
+
def serialize_sensors_configuration(data: SensorsConfiguration) -> object:
|
|
4595
|
+
return {
|
|
4596
|
+
"sensors": None if data.sensors is None else serialize_sensors_list(data.sensors),
|
|
4597
|
+
}
|
|
4598
|
+
|
|
4198
4599
|
@dataclass
|
|
4199
4600
|
class ArmPositionUpdateRequestResponseFormat:
|
|
4200
4601
|
"""Specify how the response should be sent
|
|
@@ -4231,8 +4632,8 @@ class ArmPositionUpdateRequestResponseFormat:
|
|
|
4231
4632
|
|
|
4232
4633
|
def parse_arm_position_update_request_response_format(data: object):
|
|
4233
4634
|
return ArmPositionUpdateRequestResponseFormat(
|
|
4234
|
-
kind=parse_arm_position_update_request_response_kind_enum(data["kind"]) if "kind" in data else None,
|
|
4235
|
-
event_stream=parse_arm_position_update_request_response_event_stream_details(data["event_stream"]) if "event_stream" in data else None,
|
|
4635
|
+
kind=parse_arm_position_update_request_response_kind_enum(data["kind"]) if "kind" in data and data.get("kind") is not None else None,
|
|
4636
|
+
event_stream=parse_arm_position_update_request_response_event_stream_details(data["event_stream"]) if "event_stream" in data and data.get("event_stream") is not None else None,
|
|
4236
4637
|
)
|
|
4237
4638
|
|
|
4238
4639
|
def serialize_arm_position_update_request_response_format(data: ArmPositionUpdateRequestResponseFormat) -> object:
|
|
@@ -4266,7 +4667,7 @@ class GripperCommandRequest:
|
|
|
4266
4667
|
if value is None:
|
|
4267
4668
|
return [False, "kind is required for GripperCommandRequest"]
|
|
4268
4669
|
|
|
4269
|
-
if not ((isinstance(value, str) and GripperKindEnum in ['onrobot_2fg7', 'onrobot_2fg14', 'onrobot_3fg15', '
|
|
4670
|
+
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)):
|
|
4270
4671
|
return [False, "kind must be of type GripperKindEnum for GripperCommandRequest, got " + type(value).__name__]
|
|
4271
4672
|
|
|
4272
4673
|
return [True, ""]
|
|
@@ -4363,14 +4764,14 @@ class GripperCommandRequest:
|
|
|
4363
4764
|
|
|
4364
4765
|
def parse_gripper_command_request(data: object):
|
|
4365
4766
|
return GripperCommandRequest(
|
|
4366
|
-
kind=parse_gripper_kind_enum(data["kind"]) if "kind" in data else None,
|
|
4367
|
-
onrobot_2fg7=parse_on_robot_2_fg_7_gripper_command_request(data["onrobot_2fg7"]) if "onrobot_2fg7" in data else None,
|
|
4368
|
-
onrobot_2fg14=parse_on_robot_2_fg_14_gripper_command_request(data["onrobot_2fg14"]) if "onrobot_2fg14" in data else None,
|
|
4369
|
-
onrobot_3fg15=parse_on_robot_3_fg_15_gripper_command_request(data["onrobot_3fg15"]) if "onrobot_3fg15" in data else None,
|
|
4370
|
-
dh_ag=parse_dhag_gripper_command_request(data["dh_ag"]) if "dh_ag" in data else None,
|
|
4371
|
-
dh_pgc=parse_dhpgc_gripper_command_request(data["dh_pgc"]) if "dh_pgc" in data else None,
|
|
4372
|
-
dh_cgi=parse_dhcgi_gripper_command_request(data["dh_cgi"]) if "dh_cgi" in data else None,
|
|
4373
|
-
schunk_egx=parse_schunk_e_gx_gripper_command_request(data["schunk_egx"]) if "schunk_egx" in data else None,
|
|
4767
|
+
kind=parse_gripper_kind_enum(data["kind"]) if "kind" in data and data.get("kind") is not None else None,
|
|
4768
|
+
onrobot_2fg7=parse_on_robot_2_fg_7_gripper_command_request(data["onrobot_2fg7"]) if "onrobot_2fg7" in data and data.get("onrobot_2fg7") is not None else None,
|
|
4769
|
+
onrobot_2fg14=parse_on_robot_2_fg_14_gripper_command_request(data["onrobot_2fg14"]) if "onrobot_2fg14" in data and data.get("onrobot_2fg14") is not None else None,
|
|
4770
|
+
onrobot_3fg15=parse_on_robot_3_fg_15_gripper_command_request(data["onrobot_3fg15"]) if "onrobot_3fg15" in data and data.get("onrobot_3fg15") is not None else None,
|
|
4771
|
+
dh_ag=parse_dhag_gripper_command_request(data["dh_ag"]) if "dh_ag" in data and data.get("dh_ag") is not None else None,
|
|
4772
|
+
dh_pgc=parse_dhpgc_gripper_command_request(data["dh_pgc"]) if "dh_pgc" in data and data.get("dh_pgc") is not None else None,
|
|
4773
|
+
dh_cgi=parse_dhcgi_gripper_command_request(data["dh_cgi"]) if "dh_cgi" in data and data.get("dh_cgi") is not None else None,
|
|
4774
|
+
schunk_egx=parse_schunk_e_gx_gripper_command_request(data["schunk_egx"]) if "schunk_egx" in data and data.get("schunk_egx") is not None else None,
|
|
4374
4775
|
)
|
|
4375
4776
|
|
|
4376
4777
|
def serialize_gripper_command_request(data: GripperCommandRequest) -> object:
|
|
@@ -4385,6 +4786,111 @@ def serialize_gripper_command_request(data: GripperCommandRequest) -> object:
|
|
|
4385
4786
|
"schunk_egx": None if data.schunk_egx is None else serialize_schunk_e_gx_gripper_command_request(data.schunk_egx),
|
|
4386
4787
|
}
|
|
4387
4788
|
|
|
4789
|
+
@dataclass
|
|
4790
|
+
class Space:
|
|
4791
|
+
"""Space in 3D space"""
|
|
4792
|
+
id: Union[str, None] = None
|
|
4793
|
+
kind: Union[str, None] = None
|
|
4794
|
+
name: Union[str, None] = None
|
|
4795
|
+
description: Union[str, None] = None
|
|
4796
|
+
isGlobal: Union[bool, None] = None
|
|
4797
|
+
positions: Union[SpacePositionsMap, None] = None
|
|
4798
|
+
|
|
4799
|
+
def validate_id(self, value: str) -> Tuple[bool, str]:
|
|
4800
|
+
if value is None:
|
|
4801
|
+
return [True, ""]
|
|
4802
|
+
|
|
4803
|
+
if not isinstance(value, str):
|
|
4804
|
+
return [False, "id must be of type str for Space, got " + type(value).__name__]
|
|
4805
|
+
|
|
4806
|
+
return [True, ""]
|
|
4807
|
+
|
|
4808
|
+
def validate_kind(self, value: str) -> Tuple[bool, str]:
|
|
4809
|
+
if value is None:
|
|
4810
|
+
return [True, ""]
|
|
4811
|
+
|
|
4812
|
+
if not isinstance(value, str):
|
|
4813
|
+
return [False, "kind must be of type str for Space, got " + type(value).__name__]
|
|
4814
|
+
|
|
4815
|
+
return [True, ""]
|
|
4816
|
+
|
|
4817
|
+
def validate_name(self, value: str) -> Tuple[bool, str]:
|
|
4818
|
+
if value is None:
|
|
4819
|
+
return [True, ""]
|
|
4820
|
+
|
|
4821
|
+
if not isinstance(value, str):
|
|
4822
|
+
return [False, "name must be of type str for Space, got " + type(value).__name__]
|
|
4823
|
+
|
|
4824
|
+
return [True, ""]
|
|
4825
|
+
|
|
4826
|
+
def validate_description(self, value: str) -> Tuple[bool, str]:
|
|
4827
|
+
if value is None:
|
|
4828
|
+
return [True, ""]
|
|
4829
|
+
|
|
4830
|
+
if not isinstance(value, str):
|
|
4831
|
+
return [False, "description must be of type str for Space, got " + type(value).__name__]
|
|
4832
|
+
|
|
4833
|
+
return [True, ""]
|
|
4834
|
+
|
|
4835
|
+
def validate_isGlobal(self, value: bool) -> Tuple[bool, str]:
|
|
4836
|
+
if value is None:
|
|
4837
|
+
return [True, ""]
|
|
4838
|
+
|
|
4839
|
+
if not isinstance(value, bool):
|
|
4840
|
+
return [False, "isGlobal must be of type bool for Space, got " + type(value).__name__]
|
|
4841
|
+
|
|
4842
|
+
return [True, ""]
|
|
4843
|
+
|
|
4844
|
+
def validate_positions(self, value: SpacePositionsMap) -> Tuple[bool, str]:
|
|
4845
|
+
if value is None:
|
|
4846
|
+
return [True, ""]
|
|
4847
|
+
|
|
4848
|
+
if not (isinstance(value, list) and all(isinstance(x, PositionMap) for x in value)):
|
|
4849
|
+
return [False, "positions must be of type SpacePositionsMap for Space, got " + type(value).__name__]
|
|
4850
|
+
|
|
4851
|
+
return [True, ""]
|
|
4852
|
+
|
|
4853
|
+
def __post_init__(self):
|
|
4854
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
4855
|
+
is_valid, error_str = self.validate_id(self.id)
|
|
4856
|
+
if not is_valid:
|
|
4857
|
+
raise TypeError(error_str)
|
|
4858
|
+
is_valid, error_str = self.validate_kind(self.kind)
|
|
4859
|
+
if not is_valid:
|
|
4860
|
+
raise TypeError(error_str)
|
|
4861
|
+
is_valid, error_str = self.validate_name(self.name)
|
|
4862
|
+
if not is_valid:
|
|
4863
|
+
raise TypeError(error_str)
|
|
4864
|
+
is_valid, error_str = self.validate_description(self.description)
|
|
4865
|
+
if not is_valid:
|
|
4866
|
+
raise TypeError(error_str)
|
|
4867
|
+
is_valid, error_str = self.validate_isGlobal(self.isGlobal)
|
|
4868
|
+
if not is_valid:
|
|
4869
|
+
raise TypeError(error_str)
|
|
4870
|
+
is_valid, error_str = self.validate_positions(self.positions)
|
|
4871
|
+
if not is_valid:
|
|
4872
|
+
raise TypeError(error_str)
|
|
4873
|
+
|
|
4874
|
+
def parse_space(data: object):
|
|
4875
|
+
return Space(
|
|
4876
|
+
id=parse_str(data["id"]) if "id" in data and data.get("id") is not None else None,
|
|
4877
|
+
kind=parse_str(data["kind"]) if "kind" in data and data.get("kind") is not None else None,
|
|
4878
|
+
name=parse_str(data["name"]) if "name" in data and data.get("name") is not None else None,
|
|
4879
|
+
description=parse_str(data["description"]) if "description" in data and data.get("description") is not None else None,
|
|
4880
|
+
isGlobal=parse_bool(data["isGlobal"]) if "isGlobal" in data and data.get("isGlobal") is not None else None,
|
|
4881
|
+
positions=parse_space_positions_map(data["positions"]) if "positions" in data and data.get("positions") is not None else None,
|
|
4882
|
+
)
|
|
4883
|
+
|
|
4884
|
+
def serialize_space(data: Space) -> object:
|
|
4885
|
+
return {
|
|
4886
|
+
"id": None if data.id is None else serialize_str(data.id),
|
|
4887
|
+
"kind": None if data.kind is None else serialize_str(data.kind),
|
|
4888
|
+
"name": None if data.name is None else serialize_str(data.name),
|
|
4889
|
+
"description": None if data.description is None else serialize_str(data.description),
|
|
4890
|
+
"isGlobal": None if data.isGlobal is None else serialize_bool(data.isGlobal),
|
|
4891
|
+
"positions": None if data.positions is None else serialize_space_positions_map(data.positions),
|
|
4892
|
+
}
|
|
4893
|
+
|
|
4388
4894
|
@dataclass
|
|
4389
4895
|
class CombinedArmPosition:
|
|
4390
4896
|
"""Combined tooltip position and joint rotations defining the arm's position"""
|
|
@@ -4420,8 +4926,8 @@ class CombinedArmPosition:
|
|
|
4420
4926
|
|
|
4421
4927
|
def parse_combined_arm_position(data: object):
|
|
4422
4928
|
return CombinedArmPosition(
|
|
4423
|
-
joint_rotations=parse_joint_rotations(data["joint_rotations"]) if "joint_rotations" in data else None,
|
|
4424
|
-
tooltip_position=parse_position_and_orientation(data["tooltip_position"]) if "tooltip_position" in data else None,
|
|
4929
|
+
joint_rotations=parse_joint_rotations(data["joint_rotations"]) if "joint_rotations" in data and data.get("joint_rotations") is not None else None,
|
|
4930
|
+
tooltip_position=parse_position_and_orientation(data["tooltip_position"]) if "tooltip_position" in data and data.get("tooltip_position") is not None else None,
|
|
4425
4931
|
)
|
|
4426
4932
|
|
|
4427
4933
|
def serialize_combined_arm_position(data: CombinedArmPosition) -> object:
|
|
@@ -4473,8 +4979,8 @@ class RoutinesPaginatedResponse:
|
|
|
4473
4979
|
|
|
4474
4980
|
def parse_routines_paginated_response(data: object):
|
|
4475
4981
|
return RoutinesPaginatedResponse(
|
|
4476
|
-
items=parse_routines_list(data["items"]) if "items" in data else None,
|
|
4477
|
-
pagination=parse_pagination(data["pagination"]) if "pagination" in data else None,
|
|
4982
|
+
items=parse_routines_list(data["items"]) if "items" in data and data.get("items") is not None else None,
|
|
4983
|
+
pagination=parse_pagination(data["pagination"]) if "pagination" in data and data.get("pagination") is not None else None,
|
|
4478
4984
|
)
|
|
4479
4985
|
|
|
4480
4986
|
def serialize_routines_paginated_response(data: RoutinesPaginatedResponse) -> object:
|
|
@@ -4483,6 +4989,14 @@ def serialize_routines_paginated_response(data: RoutinesPaginatedResponse) -> ob
|
|
|
4483
4989
|
"pagination": None if data.pagination is None else serialize_pagination(data.pagination),
|
|
4484
4990
|
}
|
|
4485
4991
|
|
|
4992
|
+
SpacesList = List[Space]
|
|
4993
|
+
|
|
4994
|
+
def parse_spaces_list(data: object) -> SpacesList:
|
|
4995
|
+
return [parse_space(item) for item in data]
|
|
4996
|
+
|
|
4997
|
+
def serialize_spaces_list(data: SpacesList) -> List[object]:
|
|
4998
|
+
return [serialize_space(item) for item in data]
|
|
4999
|
+
|
|
4486
5000
|
@dataclass
|
|
4487
5001
|
class ArmPositionUpdateEvent:
|
|
4488
5002
|
"""Event emitted by the move robot API"""
|
|
@@ -4544,10 +5058,10 @@ class ArmPositionUpdateEvent:
|
|
|
4544
5058
|
|
|
4545
5059
|
def parse_arm_position_update_event(data: object):
|
|
4546
5060
|
return ArmPositionUpdateEvent(
|
|
4547
|
-
kind=parse_arm_position_update_kind_enum(data["kind"]) if "kind" in data else None,
|
|
4548
|
-
failure=parse_arm_position_update_failure_event(data["failure"]) if "failure" in data else None,
|
|
4549
|
-
canceled=parse_arm_position_update_canceled_event(data["canceled"]) if "canceled" in data else None,
|
|
4550
|
-
position=parse_combined_arm_position(data["position"]) if "position" in data else None,
|
|
5061
|
+
kind=parse_arm_position_update_kind_enum(data["kind"]) if "kind" in data and data.get("kind") is not None else None,
|
|
5062
|
+
failure=parse_arm_position_update_failure_event(data["failure"]) if "failure" in data and data.get("failure") is not None else None,
|
|
5063
|
+
canceled=parse_arm_position_update_canceled_event(data["canceled"]) if "canceled" in data and data.get("canceled") is not None else None,
|
|
5064
|
+
position=parse_combined_arm_position(data["position"]) if "position" in data and data.get("position") is not None else None,
|
|
4551
5065
|
)
|
|
4552
5066
|
|
|
4553
5067
|
def serialize_arm_position_update_event(data: ArmPositionUpdateEvent) -> object:
|
|
@@ -4566,6 +5080,8 @@ class ArmPositionUpdateRequest:
|
|
|
4566
5080
|
tooltip_position: Union[PositionAndOrientation, None] = None
|
|
4567
5081
|
joint_rotations: Union[ArmJointRotationsList, None] = None
|
|
4568
5082
|
joint_rotation: Union[ArmJointRotations, None] = None
|
|
5083
|
+
movement_kind: Union[MovementKindEnum, None] = None
|
|
5084
|
+
speed_profile: Union[SpeedProfile, None] = None
|
|
4569
5085
|
response: Union[ArmPositionUpdateRequestResponseFormat, None] = None
|
|
4570
5086
|
|
|
4571
5087
|
def validate_kind(self, value: ArmPositionUpdateRequestKindEnum) -> Tuple[bool, str]:
|
|
@@ -4613,6 +5129,24 @@ class ArmPositionUpdateRequest:
|
|
|
4613
5129
|
|
|
4614
5130
|
return [True, ""]
|
|
4615
5131
|
|
|
5132
|
+
def validate_movement_kind(self, value: MovementKindEnum) -> Tuple[bool, str]:
|
|
5133
|
+
if value is None:
|
|
5134
|
+
return [True, ""]
|
|
5135
|
+
|
|
5136
|
+
if not ((isinstance(value, str) and MovementKindEnum in ['joint', 'line']) or isinstance(value, MovementKindEnum)):
|
|
5137
|
+
return [False, "movement_kind must be of type MovementKindEnum for ArmPositionUpdateRequest, got " + type(value).__name__]
|
|
5138
|
+
|
|
5139
|
+
return [True, ""]
|
|
5140
|
+
|
|
5141
|
+
def validate_speed_profile(self, value: SpeedProfile) -> Tuple[bool, str]:
|
|
5142
|
+
if value is None:
|
|
5143
|
+
return [True, ""]
|
|
5144
|
+
|
|
5145
|
+
if not isinstance(value, SpeedProfile):
|
|
5146
|
+
return [False, "speed_profile must be of type SpeedProfile for ArmPositionUpdateRequest, got " + type(value).__name__]
|
|
5147
|
+
|
|
5148
|
+
return [True, ""]
|
|
5149
|
+
|
|
4616
5150
|
def validate_response(self, value: ArmPositionUpdateRequestResponseFormat) -> Tuple[bool, str]:
|
|
4617
5151
|
if value is None:
|
|
4618
5152
|
return [True, ""]
|
|
@@ -4637,6 +5171,12 @@ class ArmPositionUpdateRequest:
|
|
|
4637
5171
|
if not is_valid:
|
|
4638
5172
|
raise TypeError(error_str)
|
|
4639
5173
|
is_valid, error_str = self.validate_joint_rotation(self.joint_rotation)
|
|
5174
|
+
if not is_valid:
|
|
5175
|
+
raise TypeError(error_str)
|
|
5176
|
+
is_valid, error_str = self.validate_movement_kind(self.movement_kind)
|
|
5177
|
+
if not is_valid:
|
|
5178
|
+
raise TypeError(error_str)
|
|
5179
|
+
is_valid, error_str = self.validate_speed_profile(self.speed_profile)
|
|
4640
5180
|
if not is_valid:
|
|
4641
5181
|
raise TypeError(error_str)
|
|
4642
5182
|
is_valid, error_str = self.validate_response(self.response)
|
|
@@ -4645,12 +5185,14 @@ class ArmPositionUpdateRequest:
|
|
|
4645
5185
|
|
|
4646
5186
|
def parse_arm_position_update_request(data: object):
|
|
4647
5187
|
return ArmPositionUpdateRequest(
|
|
4648
|
-
kind=parse_arm_position_update_request_kind_enum(data["kind"]) if "kind" in data else None,
|
|
4649
|
-
tooltip_positions=parse_position_and_orientation_list(data["tooltip_positions"]) if "tooltip_positions" in data else None,
|
|
4650
|
-
tooltip_position=parse_position_and_orientation(data["tooltip_position"]) if "tooltip_position" in data else None,
|
|
4651
|
-
joint_rotations=parse_arm_joint_rotations_list(data["joint_rotations"]) if "joint_rotations" in data else None,
|
|
4652
|
-
joint_rotation=parse_arm_joint_rotations(data["joint_rotation"]) if "joint_rotation" in data else None,
|
|
4653
|
-
|
|
5188
|
+
kind=parse_arm_position_update_request_kind_enum(data["kind"]) if "kind" in data and data.get("kind") is not None else None,
|
|
5189
|
+
tooltip_positions=parse_position_and_orientation_list(data["tooltip_positions"]) if "tooltip_positions" in data and data.get("tooltip_positions") is not None else None,
|
|
5190
|
+
tooltip_position=parse_position_and_orientation(data["tooltip_position"]) if "tooltip_position" in data and data.get("tooltip_position") is not None else None,
|
|
5191
|
+
joint_rotations=parse_arm_joint_rotations_list(data["joint_rotations"]) if "joint_rotations" in data and data.get("joint_rotations") is not None else None,
|
|
5192
|
+
joint_rotation=parse_arm_joint_rotations(data["joint_rotation"]) if "joint_rotation" in data and data.get("joint_rotation") is not None else None,
|
|
5193
|
+
movement_kind=parse_movement_kind_enum(data["movement_kind"]) if "movement_kind" in data and data.get("movement_kind") is not None else None,
|
|
5194
|
+
speed_profile=parse_speed_profile(data["speed_profile"]) if "speed_profile" in data and data.get("speed_profile") is not None else None,
|
|
5195
|
+
response=parse_arm_position_update_request_response_format(data["response"]) if "response" in data and data.get("response") is not None else None,
|
|
4654
5196
|
)
|
|
4655
5197
|
|
|
4656
5198
|
def serialize_arm_position_update_request(data: ArmPositionUpdateRequest) -> object:
|
|
@@ -4660,9 +5202,41 @@ def serialize_arm_position_update_request(data: ArmPositionUpdateRequest) -> obj
|
|
|
4660
5202
|
"tooltip_position": None if data.tooltip_position is None else serialize_position_and_orientation(data.tooltip_position),
|
|
4661
5203
|
"joint_rotations": None if data.joint_rotations is None else serialize_arm_joint_rotations_list(data.joint_rotations),
|
|
4662
5204
|
"joint_rotation": None if data.joint_rotation is None else serialize_arm_joint_rotations(data.joint_rotation),
|
|
5205
|
+
"movement_kind": None if data.movement_kind is None else serialize_movement_kind_enum(data.movement_kind),
|
|
5206
|
+
"speed_profile": None if data.speed_profile is None else serialize_speed_profile(data.speed_profile),
|
|
4663
5207
|
"response": None if data.response is None else serialize_arm_position_update_request_response_format(data.response),
|
|
4664
5208
|
}
|
|
4665
5209
|
|
|
5210
|
+
@dataclass
|
|
5211
|
+
class SpacesPaginatedResponse:
|
|
5212
|
+
"""Paginated response containing space data"""
|
|
5213
|
+
items: Union[SpacesList, None] = None
|
|
5214
|
+
|
|
5215
|
+
def validate_items(self, value: SpacesList) -> Tuple[bool, str]:
|
|
5216
|
+
if value is None:
|
|
5217
|
+
return [True, ""]
|
|
5218
|
+
|
|
5219
|
+
if not (isinstance(value, list) and all(isinstance(x, Space) for x in value)):
|
|
5220
|
+
return [False, "items must be of type SpacesList for SpacesPaginatedResponse, got " + type(value).__name__]
|
|
5221
|
+
|
|
5222
|
+
return [True, ""]
|
|
5223
|
+
|
|
5224
|
+
def __post_init__(self):
|
|
5225
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
5226
|
+
is_valid, error_str = self.validate_items(self.items)
|
|
5227
|
+
if not is_valid:
|
|
5228
|
+
raise TypeError(error_str)
|
|
5229
|
+
|
|
5230
|
+
def parse_spaces_paginated_response(data: object):
|
|
5231
|
+
return SpacesPaginatedResponse(
|
|
5232
|
+
items=parse_spaces_list(data["items"]) if "items" in data and data.get("items") is not None else None,
|
|
5233
|
+
)
|
|
5234
|
+
|
|
5235
|
+
def serialize_spaces_paginated_response(data: SpacesPaginatedResponse) -> object:
|
|
5236
|
+
return {
|
|
5237
|
+
"items": None if data.items is None else serialize_spaces_list(data.items),
|
|
5238
|
+
}
|
|
5239
|
+
|
|
4666
5240
|
ArmPositionUpdateEventStream = List[ArmPositionUpdateEvent]
|
|
4667
5241
|
|
|
4668
5242
|
def parse_arm_position_update_event_stream(data: object) -> ArmPositionUpdateEventStream:
|