standardbots 2.0.0.dev1737138088__py3-none-any.whl → 2.0.0.dev1740502639__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of standardbots might be problematic. Click here for more details.
- standardbots/auto_generated/apis.py +186 -15
- standardbots/auto_generated/models.py +665 -255
- {standardbots-2.0.0.dev1737138088.dist-info → standardbots-2.0.0.dev1740502639.dist-info}/METADATA +1 -1
- standardbots-2.0.0.dev1740502639.dist-info/RECORD +11 -0
- {standardbots-2.0.0.dev1737138088.dist-info → standardbots-2.0.0.dev1740502639.dist-info}/WHEEL +1 -1
- {standardbots-2.0.0.dev1737138088.dist-info → standardbots-2.0.0.dev1740502639.dist-info}/top_level.txt +1 -0
- tests/fixtures/__init__.py +0 -0
- tests/fixtures/client_fixt.py +25 -0
- tests/fixtures/routines_fixt.py +48 -0
- standardbots-2.0.0.dev1737138088.dist-info/RECORD +0 -8
|
@@ -551,6 +551,51 @@ def serialize_camera_settings(data: CameraSettings) -> object:
|
|
|
551
551
|
"autoWhiteBalance": None if data.autoWhiteBalance is None else serialize_bool(data.autoWhiteBalance),
|
|
552
552
|
}
|
|
553
553
|
|
|
554
|
+
@dataclass
|
|
555
|
+
class CameraStatus:
|
|
556
|
+
"""Current camera status."""
|
|
557
|
+
connected: Union[bool, None] = None
|
|
558
|
+
message: Union[str, None] = None
|
|
559
|
+
|
|
560
|
+
def validate_connected(self, value: bool) -> Tuple[bool, str]:
|
|
561
|
+
if value is None:
|
|
562
|
+
return [True, ""]
|
|
563
|
+
|
|
564
|
+
if not isinstance(value, bool):
|
|
565
|
+
return [False, "connected must be of type bool for CameraStatus, got " + type(value).__name__]
|
|
566
|
+
|
|
567
|
+
return [True, ""]
|
|
568
|
+
|
|
569
|
+
def validate_message(self, value: str) -> Tuple[bool, str]:
|
|
570
|
+
if value is None:
|
|
571
|
+
return [True, ""]
|
|
572
|
+
|
|
573
|
+
if not isinstance(value, str):
|
|
574
|
+
return [False, "message must be of type str for CameraStatus, got " + type(value).__name__]
|
|
575
|
+
|
|
576
|
+
return [True, ""]
|
|
577
|
+
|
|
578
|
+
def __post_init__(self):
|
|
579
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
580
|
+
is_valid, error_str = self.validate_connected(self.connected)
|
|
581
|
+
if not is_valid:
|
|
582
|
+
raise TypeError(error_str)
|
|
583
|
+
is_valid, error_str = self.validate_message(self.message)
|
|
584
|
+
if not is_valid:
|
|
585
|
+
raise TypeError(error_str)
|
|
586
|
+
|
|
587
|
+
def parse_camera_status(data: object):
|
|
588
|
+
return CameraStatus(
|
|
589
|
+
connected=parse_bool(data["connected"]) if "connected" in data and data.get("connected") is not None else None,
|
|
590
|
+
message=parse_str(data["message"]) if "message" in data and data.get("message") is not None else None,
|
|
591
|
+
)
|
|
592
|
+
|
|
593
|
+
def serialize_camera_status(data: CameraStatus) -> object:
|
|
594
|
+
return {
|
|
595
|
+
"connected": None if data.connected is None else serialize_bool(data.connected),
|
|
596
|
+
"message": None if data.message is None else serialize_str(data.message),
|
|
597
|
+
}
|
|
598
|
+
|
|
554
599
|
@dataclass
|
|
555
600
|
class CartesianPose:
|
|
556
601
|
"""Cartesian pose
|
|
@@ -1087,6 +1132,18 @@ class ErrorEnum(Enum):
|
|
|
1087
1132
|
"""Requested resource not found"""
|
|
1088
1133
|
InvalidSpaceSpecified = "invalid_space_specified"
|
|
1089
1134
|
"""Space specified was invalid or not found"""
|
|
1135
|
+
InvalidParameters = "invalid_parameters"
|
|
1136
|
+
"""Parameters are invalid"""
|
|
1137
|
+
RoutineDoesNotExist = "routine_does_not_exist"
|
|
1138
|
+
"""Routine does not exist"""
|
|
1139
|
+
CannotPlayRoutine = "cannot_play_routine"
|
|
1140
|
+
"""Routine is not in the correct state to play"""
|
|
1141
|
+
RoutineMustBePlaying = "routine_must_be_playing"
|
|
1142
|
+
"""Routine must be playing"""
|
|
1143
|
+
CannotChangeRosState = "cannot_change_ros_state"
|
|
1144
|
+
"""Cannot change ROS state"""
|
|
1145
|
+
IoSafeguardError = "io_safeguard_error"
|
|
1146
|
+
"""Cannot change IO state because of safeguard"""
|
|
1090
1147
|
|
|
1091
1148
|
def parse_error_enum(data: object) -> ErrorEnum:
|
|
1092
1149
|
return ErrorEnum(data)
|
|
@@ -1200,6 +1257,14 @@ def serialize_euler_pose(data: EulerPose) -> object:
|
|
|
1200
1257
|
"rz": None if data.rz is None else serialize_f_64(data.rz),
|
|
1201
1258
|
}
|
|
1202
1259
|
|
|
1260
|
+
FloatList = List[float]
|
|
1261
|
+
|
|
1262
|
+
def parse_float_list(data: object) -> FloatList:
|
|
1263
|
+
return [parse_f_64(item) for item in data]
|
|
1264
|
+
|
|
1265
|
+
def serialize_float_list(data: FloatList) -> List[object]:
|
|
1266
|
+
return [serialize_f_64(item) for item in data]
|
|
1267
|
+
|
|
1203
1268
|
class ForceUnitKind(Enum):
|
|
1204
1269
|
Newtons = "newtons"
|
|
1205
1270
|
"""Enum Newtons = `newtons`"""
|
|
@@ -1372,11 +1437,71 @@ def parse_joint_rotations(data: object) -> JointRotations:
|
|
|
1372
1437
|
def serialize_joint_rotations(data: JointRotations) -> object:
|
|
1373
1438
|
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]),]
|
|
1374
1439
|
|
|
1440
|
+
@dataclass
|
|
1441
|
+
class JointStateDisturbance:
|
|
1442
|
+
"""Disturbance of a joint"""
|
|
1443
|
+
disturbance: Union[float, None] = None
|
|
1444
|
+
amperageDisturbance: Union[float, None] = None
|
|
1445
|
+
windupDisturbance: Union[float, None] = None
|
|
1446
|
+
|
|
1447
|
+
def validate_disturbance(self, value: float) -> Tuple[bool, str]:
|
|
1448
|
+
if value is None:
|
|
1449
|
+
return [True, ""]
|
|
1450
|
+
|
|
1451
|
+
if not isinstance(value, float):
|
|
1452
|
+
return [False, "disturbance must be of type float for JointStateDisturbance, got " + type(value).__name__]
|
|
1453
|
+
|
|
1454
|
+
return [True, ""]
|
|
1455
|
+
|
|
1456
|
+
def validate_amperageDisturbance(self, value: float) -> Tuple[bool, str]:
|
|
1457
|
+
if value is None:
|
|
1458
|
+
return [True, ""]
|
|
1459
|
+
|
|
1460
|
+
if not isinstance(value, float):
|
|
1461
|
+
return [False, "amperageDisturbance must be of type float for JointStateDisturbance, got " + type(value).__name__]
|
|
1462
|
+
|
|
1463
|
+
return [True, ""]
|
|
1464
|
+
|
|
1465
|
+
def validate_windupDisturbance(self, value: float) -> Tuple[bool, str]:
|
|
1466
|
+
if value is None:
|
|
1467
|
+
return [True, ""]
|
|
1468
|
+
|
|
1469
|
+
if not isinstance(value, float):
|
|
1470
|
+
return [False, "windupDisturbance must be of type float for JointStateDisturbance, got " + type(value).__name__]
|
|
1471
|
+
|
|
1472
|
+
return [True, ""]
|
|
1473
|
+
|
|
1474
|
+
def __post_init__(self):
|
|
1475
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
1476
|
+
is_valid, error_str = self.validate_disturbance(self.disturbance)
|
|
1477
|
+
if not is_valid:
|
|
1478
|
+
raise TypeError(error_str)
|
|
1479
|
+
is_valid, error_str = self.validate_amperageDisturbance(self.amperageDisturbance)
|
|
1480
|
+
if not is_valid:
|
|
1481
|
+
raise TypeError(error_str)
|
|
1482
|
+
is_valid, error_str = self.validate_windupDisturbance(self.windupDisturbance)
|
|
1483
|
+
if not is_valid:
|
|
1484
|
+
raise TypeError(error_str)
|
|
1485
|
+
|
|
1486
|
+
def parse_joint_state_disturbance(data: object):
|
|
1487
|
+
return JointStateDisturbance(
|
|
1488
|
+
disturbance=parse_f_64(data["disturbance"]) if "disturbance" in data and data.get("disturbance") is not None else None,
|
|
1489
|
+
amperageDisturbance=parse_f_64(data["amperageDisturbance"]) if "amperageDisturbance" in data and data.get("amperageDisturbance") is not None else None,
|
|
1490
|
+
windupDisturbance=parse_f_64(data["windupDisturbance"]) if "windupDisturbance" in data and data.get("windupDisturbance") is not None else None,
|
|
1491
|
+
)
|
|
1492
|
+
|
|
1493
|
+
def serialize_joint_state_disturbance(data: JointStateDisturbance) -> object:
|
|
1494
|
+
return {
|
|
1495
|
+
"disturbance": None if data.disturbance is None else serialize_f_64(data.disturbance),
|
|
1496
|
+
"amperageDisturbance": None if data.amperageDisturbance is None else serialize_f_64(data.amperageDisturbance),
|
|
1497
|
+
"windupDisturbance": None if data.windupDisturbance is None else serialize_f_64(data.windupDisturbance),
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1375
1500
|
class LinearGripDirectionEnum(Enum):
|
|
1376
|
-
|
|
1377
|
-
"""
|
|
1378
|
-
|
|
1379
|
-
"""Grip
|
|
1501
|
+
Internal = "internal"
|
|
1502
|
+
"""Grip object on the inside of gripper fingers. Measure grip position based on interior of gripper fingers and exterior of object"""
|
|
1503
|
+
External = "external"
|
|
1504
|
+
"""Grip object on the outside of gripper fingers. Measure grip position based on exterior of gripper fingers and interior of object"""
|
|
1380
1505
|
|
|
1381
1506
|
def parse_linear_grip_direction_enum(data: object) -> LinearGripDirectionEnum:
|
|
1382
1507
|
return LinearGripDirectionEnum(data)
|
|
@@ -1469,10 +1594,10 @@ def serialize_on_robot_3_fg_15_control_kind_enum(data: Union[OnRobot3FG15Control
|
|
|
1469
1594
|
return OnRobot3FG15ControlKindEnum(data).value
|
|
1470
1595
|
|
|
1471
1596
|
class OnRobotGripKindEnum(Enum):
|
|
1472
|
-
|
|
1473
|
-
"""Enum
|
|
1474
|
-
|
|
1475
|
-
"""Enum
|
|
1597
|
+
Internal = "internal"
|
|
1598
|
+
"""Enum Internal = `internal`"""
|
|
1599
|
+
External = "external"
|
|
1600
|
+
"""Enum External = `external`"""
|
|
1476
1601
|
|
|
1477
1602
|
def parse_on_robot_grip_kind_enum(data: object) -> OnRobotGripKindEnum:
|
|
1478
1603
|
return OnRobotGripKindEnum(data)
|
|
@@ -2623,39 +2748,9 @@ def serialize_brakes_state(data: BrakesState) -> object:
|
|
|
2623
2748
|
"state": serialize_brakes_state_enum(data.state),
|
|
2624
2749
|
}
|
|
2625
2750
|
|
|
2626
|
-
@dataclass
|
|
2627
|
-
class CameraIntrinsicsResponse:
|
|
2628
|
-
"""Response with intrinsic parameters of the camera."""
|
|
2629
|
-
intrinsics: Union[CameraIntrinsics, None] = None
|
|
2630
|
-
|
|
2631
|
-
def validate_intrinsics(self, value: CameraIntrinsics) -> Tuple[bool, str]:
|
|
2632
|
-
if value is None:
|
|
2633
|
-
return [True, ""]
|
|
2634
|
-
|
|
2635
|
-
if not isinstance(value, CameraIntrinsics):
|
|
2636
|
-
return [False, "intrinsics must be of type CameraIntrinsics for CameraIntrinsicsResponse, got " + type(value).__name__]
|
|
2637
|
-
|
|
2638
|
-
return [True, ""]
|
|
2639
|
-
|
|
2640
|
-
def __post_init__(self):
|
|
2641
|
-
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
2642
|
-
is_valid, error_str = self.validate_intrinsics(self.intrinsics)
|
|
2643
|
-
if not is_valid:
|
|
2644
|
-
raise TypeError(error_str)
|
|
2645
|
-
|
|
2646
|
-
def parse_camera_intrinsics_response(data: object):
|
|
2647
|
-
return CameraIntrinsicsResponse(
|
|
2648
|
-
intrinsics=parse_camera_intrinsics(data["intrinsics"]) if "intrinsics" in data and data.get("intrinsics") is not None else None,
|
|
2649
|
-
)
|
|
2650
|
-
|
|
2651
|
-
def serialize_camera_intrinsics_response(data: CameraIntrinsicsResponse) -> object:
|
|
2652
|
-
return {
|
|
2653
|
-
"intrinsics": None if data.intrinsics is None else serialize_camera_intrinsics(data.intrinsics),
|
|
2654
|
-
}
|
|
2655
|
-
|
|
2656
2751
|
@dataclass
|
|
2657
2752
|
class CameraFrameRequest:
|
|
2658
|
-
"""Request for a single camera frame."""
|
|
2753
|
+
"""Request for a single camera frame. In JPEG format."""
|
|
2659
2754
|
camera_settings: Union[CameraSettings, None] = None
|
|
2660
2755
|
|
|
2661
2756
|
def validate_camera_settings(self, value: CameraSettings) -> Tuple[bool, str]:
|
|
@@ -2959,81 +3054,6 @@ def serialize_tooltip_position_response(data: TooltipPositionResponse) -> object
|
|
|
2959
3054
|
"pose": None if data.pose is None else serialize_cartesian_pose(data.pose),
|
|
2960
3055
|
}
|
|
2961
3056
|
|
|
2962
|
-
@dataclass
|
|
2963
|
-
class JointState:
|
|
2964
|
-
"""State of a joint"""
|
|
2965
|
-
braked: Union[bool, None] = None
|
|
2966
|
-
connectionStatus: Union[ConnectionStatus, None] = None
|
|
2967
|
-
inCollision: Union[bool, None] = None
|
|
2968
|
-
disturbance: Union[float, None] = None
|
|
2969
|
-
|
|
2970
|
-
def validate_braked(self, value: bool) -> Tuple[bool, str]:
|
|
2971
|
-
if value is None:
|
|
2972
|
-
return [True, ""]
|
|
2973
|
-
|
|
2974
|
-
if not isinstance(value, bool):
|
|
2975
|
-
return [False, "braked must be of type bool for JointState, got " + type(value).__name__]
|
|
2976
|
-
|
|
2977
|
-
return [True, ""]
|
|
2978
|
-
|
|
2979
|
-
def validate_connectionStatus(self, value: ConnectionStatus) -> Tuple[bool, str]:
|
|
2980
|
-
if value is None:
|
|
2981
|
-
return [True, ""]
|
|
2982
|
-
|
|
2983
|
-
if not ((isinstance(value, str) and ConnectionStatus in ['connected', 'disconnected', 'ready']) or isinstance(value, ConnectionStatus)):
|
|
2984
|
-
return [False, "connectionStatus must be of type ConnectionStatus for JointState, got " + type(value).__name__]
|
|
2985
|
-
|
|
2986
|
-
return [True, ""]
|
|
2987
|
-
|
|
2988
|
-
def validate_inCollision(self, value: bool) -> Tuple[bool, str]:
|
|
2989
|
-
if value is None:
|
|
2990
|
-
return [True, ""]
|
|
2991
|
-
|
|
2992
|
-
if not isinstance(value, bool):
|
|
2993
|
-
return [False, "inCollision must be of type bool for JointState, got " + type(value).__name__]
|
|
2994
|
-
|
|
2995
|
-
return [True, ""]
|
|
2996
|
-
|
|
2997
|
-
def validate_disturbance(self, value: float) -> Tuple[bool, str]:
|
|
2998
|
-
if value is None:
|
|
2999
|
-
return [True, ""]
|
|
3000
|
-
|
|
3001
|
-
if not isinstance(value, float):
|
|
3002
|
-
return [False, "disturbance must be of type float for JointState, got " + type(value).__name__]
|
|
3003
|
-
|
|
3004
|
-
return [True, ""]
|
|
3005
|
-
|
|
3006
|
-
def __post_init__(self):
|
|
3007
|
-
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3008
|
-
is_valid, error_str = self.validate_braked(self.braked)
|
|
3009
|
-
if not is_valid:
|
|
3010
|
-
raise TypeError(error_str)
|
|
3011
|
-
is_valid, error_str = self.validate_connectionStatus(self.connectionStatus)
|
|
3012
|
-
if not is_valid:
|
|
3013
|
-
raise TypeError(error_str)
|
|
3014
|
-
is_valid, error_str = self.validate_inCollision(self.inCollision)
|
|
3015
|
-
if not is_valid:
|
|
3016
|
-
raise TypeError(error_str)
|
|
3017
|
-
is_valid, error_str = self.validate_disturbance(self.disturbance)
|
|
3018
|
-
if not is_valid:
|
|
3019
|
-
raise TypeError(error_str)
|
|
3020
|
-
|
|
3021
|
-
def parse_joint_state(data: object):
|
|
3022
|
-
return JointState(
|
|
3023
|
-
braked=parse_bool(data["braked"]) if "braked" in data and data.get("braked") is not None else None,
|
|
3024
|
-
connectionStatus=parse_connection_status(data["connectionStatus"]) if "connectionStatus" in data and data.get("connectionStatus") is not None else None,
|
|
3025
|
-
inCollision=parse_bool(data["inCollision"]) if "inCollision" in data and data.get("inCollision") is not None else None,
|
|
3026
|
-
disturbance=parse_f_64(data["disturbance"]) if "disturbance" in data and data.get("disturbance") is not None else None,
|
|
3027
|
-
)
|
|
3028
|
-
|
|
3029
|
-
def serialize_joint_state(data: JointState) -> object:
|
|
3030
|
-
return {
|
|
3031
|
-
"braked": None if data.braked is None else serialize_bool(data.braked),
|
|
3032
|
-
"connectionStatus": None if data.connectionStatus is None else serialize_connection_status(data.connectionStatus),
|
|
3033
|
-
"inCollision": None if data.inCollision is None else serialize_bool(data.inCollision),
|
|
3034
|
-
"disturbance": None if data.disturbance is None else serialize_f_64(data.disturbance),
|
|
3035
|
-
}
|
|
3036
|
-
|
|
3037
3057
|
EnvironmentVariablesList = List[EnvironmentVariable]
|
|
3038
3058
|
|
|
3039
3059
|
def parse_environment_variables_list(data: object) -> EnvironmentVariablesList:
|
|
@@ -3052,7 +3072,7 @@ class ErrorResponse:
|
|
|
3052
3072
|
if value is None:
|
|
3053
3073
|
return [False, "error is required for ErrorResponse"]
|
|
3054
3074
|
|
|
3055
|
-
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)):
|
|
3075
|
+
if not ((isinstance(value, str) and ErrorEnum in ['authorization_required', 'routine_must_be_running', 'api_control_required', 'robot_brakes_disengage_failed', 'robot_brakes_engage_failed', 'request_failed_validation', 'robot_not_idle', 'brakes_must_be_engaged', 'brakes_must_be_disengaged', 'equipment_no_matching', 'service_initializing', 'camera_disconnected', 'settings_validation_error', 'settings_timeout', 'internal_server_error', 'recovery_error', 'not_found', 'invalid_space_specified', 'invalid_parameters', 'routine_does_not_exist', 'cannot_play_routine', 'routine_must_be_playing', 'cannot_change_ros_state', 'io_safeguard_error']) or isinstance(value, ErrorEnum)):
|
|
3056
3076
|
return [False, "error must be of type ErrorEnum for ErrorResponse, got " + type(value).__name__]
|
|
3057
3077
|
|
|
3058
3078
|
return [True, ""]
|
|
@@ -3149,92 +3169,287 @@ def serialize_cartesian_pose_request(data: CartesianPoseRequest) -> object:
|
|
|
3149
3169
|
}
|
|
3150
3170
|
|
|
3151
3171
|
@dataclass
|
|
3152
|
-
class
|
|
3153
|
-
"""
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3172
|
+
class URDFParameters:
|
|
3173
|
+
"""The URDF parameters for the robot"""
|
|
3174
|
+
joint0_xyz: Union[FloatList, None] = None
|
|
3175
|
+
joint0_rpy: Union[FloatList, None] = None
|
|
3176
|
+
joint1_xyz: Union[FloatList, None] = None
|
|
3177
|
+
joint1_rpy: Union[FloatList, None] = None
|
|
3178
|
+
joint2_xyz: Union[FloatList, None] = None
|
|
3179
|
+
joint2_rpy: Union[FloatList, None] = None
|
|
3180
|
+
joint3_xyz: Union[FloatList, None] = None
|
|
3181
|
+
joint3_rpy: Union[FloatList, None] = None
|
|
3182
|
+
joint4_xyz: Union[FloatList, None] = None
|
|
3183
|
+
joint4_rpy: Union[FloatList, None] = None
|
|
3184
|
+
joint5_xyz: Union[FloatList, None] = None
|
|
3185
|
+
joint5_rpy: Union[FloatList, None] = None
|
|
3186
|
+
|
|
3187
|
+
def validate_joint0_xyz(self, value: FloatList) -> Tuple[bool, str]:
|
|
3188
|
+
if value is None:
|
|
3189
|
+
return [False, "joint0_xyz is required for URDFParameters"]
|
|
3157
3190
|
|
|
3158
|
-
|
|
3191
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3192
|
+
return [False, "joint0_xyz must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3193
|
+
|
|
3194
|
+
return [True, ""]
|
|
3195
|
+
|
|
3196
|
+
def validate_joint0_rpy(self, value: FloatList) -> Tuple[bool, str]:
|
|
3159
3197
|
if value is None:
|
|
3160
|
-
return [False, "
|
|
3198
|
+
return [False, "joint0_rpy is required for URDFParameters"]
|
|
3161
3199
|
|
|
3162
|
-
if not (
|
|
3163
|
-
return [False, "
|
|
3200
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3201
|
+
return [False, "joint0_rpy must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3164
3202
|
|
|
3165
3203
|
return [True, ""]
|
|
3166
3204
|
|
|
3167
|
-
def
|
|
3205
|
+
def validate_joint1_xyz(self, value: FloatList) -> Tuple[bool, str]:
|
|
3168
3206
|
if value is None:
|
|
3169
|
-
return [
|
|
3207
|
+
return [False, "joint1_xyz is required for URDFParameters"]
|
|
3170
3208
|
|
|
3171
|
-
if not isinstance(value, float):
|
|
3172
|
-
return [False, "
|
|
3209
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3210
|
+
return [False, "joint1_xyz must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3173
3211
|
|
|
3174
3212
|
return [True, ""]
|
|
3175
3213
|
|
|
3176
|
-
def
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
if not is_valid:
|
|
3180
|
-
raise TypeError(error_str)
|
|
3181
|
-
is_valid, error_str = self.validate_value(self.value)
|
|
3182
|
-
if not is_valid:
|
|
3183
|
-
raise TypeError(error_str)
|
|
3214
|
+
def validate_joint1_rpy(self, value: FloatList) -> Tuple[bool, str]:
|
|
3215
|
+
if value is None:
|
|
3216
|
+
return [False, "joint1_rpy is required for URDFParameters"]
|
|
3184
3217
|
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
unit_kind=parse_force_unit_kind(data["unit_kind"]) if "unit_kind" in data and data.get("unit_kind") is not None else None,
|
|
3188
|
-
value=parse_f_64(data["value"]) if "value" in data and data.get("value") is not None else None,
|
|
3189
|
-
)
|
|
3218
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3219
|
+
return [False, "joint1_rpy must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3190
3220
|
|
|
3191
|
-
|
|
3192
|
-
return {
|
|
3193
|
-
"unit_kind": serialize_force_unit_kind(data.unit_kind),
|
|
3194
|
-
"value": None if data.value is None else serialize_f_64(data.value),
|
|
3195
|
-
}
|
|
3221
|
+
return [True, ""]
|
|
3196
3222
|
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
state: Union[IOStateMap, None] = None
|
|
3223
|
+
def validate_joint2_xyz(self, value: FloatList) -> Tuple[bool, str]:
|
|
3224
|
+
if value is None:
|
|
3225
|
+
return [False, "joint2_xyz is required for URDFParameters"]
|
|
3201
3226
|
|
|
3202
|
-
|
|
3227
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3228
|
+
return [False, "joint2_xyz must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3229
|
+
|
|
3230
|
+
return [True, ""]
|
|
3231
|
+
|
|
3232
|
+
def validate_joint2_rpy(self, value: FloatList) -> Tuple[bool, str]:
|
|
3203
3233
|
if value is None:
|
|
3204
|
-
return [
|
|
3234
|
+
return [False, "joint2_rpy is required for URDFParameters"]
|
|
3205
3235
|
|
|
3206
|
-
if not (isinstance(value,
|
|
3207
|
-
return [False, "
|
|
3236
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3237
|
+
return [False, "joint2_rpy must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3208
3238
|
|
|
3209
3239
|
return [True, ""]
|
|
3210
3240
|
|
|
3211
|
-
def
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
if not is_valid:
|
|
3215
|
-
raise TypeError(error_str)
|
|
3241
|
+
def validate_joint3_xyz(self, value: FloatList) -> Tuple[bool, str]:
|
|
3242
|
+
if value is None:
|
|
3243
|
+
return [False, "joint3_xyz is required for URDFParameters"]
|
|
3216
3244
|
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
state=parse_io_state_map(data["state"]) if "state" in data and data.get("state") is not None else None,
|
|
3220
|
-
)
|
|
3245
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3246
|
+
return [False, "joint3_xyz must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3221
3247
|
|
|
3222
|
-
|
|
3223
|
-
return {
|
|
3224
|
-
"state": None if data.state is None else serialize_io_state_map(data.state),
|
|
3225
|
-
}
|
|
3248
|
+
return [True, ""]
|
|
3226
3249
|
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
state: Union[IOStateMap, None] = None
|
|
3250
|
+
def validate_joint3_rpy(self, value: FloatList) -> Tuple[bool, str]:
|
|
3251
|
+
if value is None:
|
|
3252
|
+
return [False, "joint3_rpy is required for URDFParameters"]
|
|
3231
3253
|
|
|
3232
|
-
|
|
3254
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3255
|
+
return [False, "joint3_rpy must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3256
|
+
|
|
3257
|
+
return [True, ""]
|
|
3258
|
+
|
|
3259
|
+
def validate_joint4_xyz(self, value: FloatList) -> Tuple[bool, str]:
|
|
3233
3260
|
if value is None:
|
|
3234
|
-
return [
|
|
3261
|
+
return [False, "joint4_xyz is required for URDFParameters"]
|
|
3235
3262
|
|
|
3236
|
-
if not (isinstance(value,
|
|
3237
|
-
return [False, "
|
|
3263
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3264
|
+
return [False, "joint4_xyz must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3265
|
+
|
|
3266
|
+
return [True, ""]
|
|
3267
|
+
|
|
3268
|
+
def validate_joint4_rpy(self, value: FloatList) -> Tuple[bool, str]:
|
|
3269
|
+
if value is None:
|
|
3270
|
+
return [False, "joint4_rpy is required for URDFParameters"]
|
|
3271
|
+
|
|
3272
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3273
|
+
return [False, "joint4_rpy must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3274
|
+
|
|
3275
|
+
return [True, ""]
|
|
3276
|
+
|
|
3277
|
+
def validate_joint5_xyz(self, value: FloatList) -> Tuple[bool, str]:
|
|
3278
|
+
if value is None:
|
|
3279
|
+
return [False, "joint5_xyz is required for URDFParameters"]
|
|
3280
|
+
|
|
3281
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3282
|
+
return [False, "joint5_xyz must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3283
|
+
|
|
3284
|
+
return [True, ""]
|
|
3285
|
+
|
|
3286
|
+
def validate_joint5_rpy(self, value: FloatList) -> Tuple[bool, str]:
|
|
3287
|
+
if value is None:
|
|
3288
|
+
return [False, "joint5_rpy is required for URDFParameters"]
|
|
3289
|
+
|
|
3290
|
+
if not (isinstance(value, list) and all(isinstance(x, float) for x in value)):
|
|
3291
|
+
return [False, "joint5_rpy must be of type FloatList for URDFParameters, got " + type(value).__name__]
|
|
3292
|
+
|
|
3293
|
+
return [True, ""]
|
|
3294
|
+
|
|
3295
|
+
def __post_init__(self):
|
|
3296
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3297
|
+
is_valid, error_str = self.validate_joint0_xyz(self.joint0_xyz)
|
|
3298
|
+
if not is_valid:
|
|
3299
|
+
raise TypeError(error_str)
|
|
3300
|
+
is_valid, error_str = self.validate_joint0_rpy(self.joint0_rpy)
|
|
3301
|
+
if not is_valid:
|
|
3302
|
+
raise TypeError(error_str)
|
|
3303
|
+
is_valid, error_str = self.validate_joint1_xyz(self.joint1_xyz)
|
|
3304
|
+
if not is_valid:
|
|
3305
|
+
raise TypeError(error_str)
|
|
3306
|
+
is_valid, error_str = self.validate_joint1_rpy(self.joint1_rpy)
|
|
3307
|
+
if not is_valid:
|
|
3308
|
+
raise TypeError(error_str)
|
|
3309
|
+
is_valid, error_str = self.validate_joint2_xyz(self.joint2_xyz)
|
|
3310
|
+
if not is_valid:
|
|
3311
|
+
raise TypeError(error_str)
|
|
3312
|
+
is_valid, error_str = self.validate_joint2_rpy(self.joint2_rpy)
|
|
3313
|
+
if not is_valid:
|
|
3314
|
+
raise TypeError(error_str)
|
|
3315
|
+
is_valid, error_str = self.validate_joint3_xyz(self.joint3_xyz)
|
|
3316
|
+
if not is_valid:
|
|
3317
|
+
raise TypeError(error_str)
|
|
3318
|
+
is_valid, error_str = self.validate_joint3_rpy(self.joint3_rpy)
|
|
3319
|
+
if not is_valid:
|
|
3320
|
+
raise TypeError(error_str)
|
|
3321
|
+
is_valid, error_str = self.validate_joint4_xyz(self.joint4_xyz)
|
|
3322
|
+
if not is_valid:
|
|
3323
|
+
raise TypeError(error_str)
|
|
3324
|
+
is_valid, error_str = self.validate_joint4_rpy(self.joint4_rpy)
|
|
3325
|
+
if not is_valid:
|
|
3326
|
+
raise TypeError(error_str)
|
|
3327
|
+
is_valid, error_str = self.validate_joint5_xyz(self.joint5_xyz)
|
|
3328
|
+
if not is_valid:
|
|
3329
|
+
raise TypeError(error_str)
|
|
3330
|
+
is_valid, error_str = self.validate_joint5_rpy(self.joint5_rpy)
|
|
3331
|
+
if not is_valid:
|
|
3332
|
+
raise TypeError(error_str)
|
|
3333
|
+
|
|
3334
|
+
def parse_urdf_parameters(data: object):
|
|
3335
|
+
return URDFParameters(
|
|
3336
|
+
joint0_xyz=parse_float_list(data["joint0_xyz"]) if "joint0_xyz" in data and data.get("joint0_xyz") is not None else None,
|
|
3337
|
+
joint0_rpy=parse_float_list(data["joint0_rpy"]) if "joint0_rpy" in data and data.get("joint0_rpy") is not None else None,
|
|
3338
|
+
joint1_xyz=parse_float_list(data["joint1_xyz"]) if "joint1_xyz" in data and data.get("joint1_xyz") is not None else None,
|
|
3339
|
+
joint1_rpy=parse_float_list(data["joint1_rpy"]) if "joint1_rpy" in data and data.get("joint1_rpy") is not None else None,
|
|
3340
|
+
joint2_xyz=parse_float_list(data["joint2_xyz"]) if "joint2_xyz" in data and data.get("joint2_xyz") is not None else None,
|
|
3341
|
+
joint2_rpy=parse_float_list(data["joint2_rpy"]) if "joint2_rpy" in data and data.get("joint2_rpy") is not None else None,
|
|
3342
|
+
joint3_xyz=parse_float_list(data["joint3_xyz"]) if "joint3_xyz" in data and data.get("joint3_xyz") is not None else None,
|
|
3343
|
+
joint3_rpy=parse_float_list(data["joint3_rpy"]) if "joint3_rpy" in data and data.get("joint3_rpy") is not None else None,
|
|
3344
|
+
joint4_xyz=parse_float_list(data["joint4_xyz"]) if "joint4_xyz" in data and data.get("joint4_xyz") is not None else None,
|
|
3345
|
+
joint4_rpy=parse_float_list(data["joint4_rpy"]) if "joint4_rpy" in data and data.get("joint4_rpy") is not None else None,
|
|
3346
|
+
joint5_xyz=parse_float_list(data["joint5_xyz"]) if "joint5_xyz" in data and data.get("joint5_xyz") is not None else None,
|
|
3347
|
+
joint5_rpy=parse_float_list(data["joint5_rpy"]) if "joint5_rpy" in data and data.get("joint5_rpy") is not None else None,
|
|
3348
|
+
)
|
|
3349
|
+
|
|
3350
|
+
def serialize_urdf_parameters(data: URDFParameters) -> object:
|
|
3351
|
+
return {
|
|
3352
|
+
"joint0_xyz": serialize_float_list(data.joint0_xyz),
|
|
3353
|
+
"joint0_rpy": serialize_float_list(data.joint0_rpy),
|
|
3354
|
+
"joint1_xyz": serialize_float_list(data.joint1_xyz),
|
|
3355
|
+
"joint1_rpy": serialize_float_list(data.joint1_rpy),
|
|
3356
|
+
"joint2_xyz": serialize_float_list(data.joint2_xyz),
|
|
3357
|
+
"joint2_rpy": serialize_float_list(data.joint2_rpy),
|
|
3358
|
+
"joint3_xyz": serialize_float_list(data.joint3_xyz),
|
|
3359
|
+
"joint3_rpy": serialize_float_list(data.joint3_rpy),
|
|
3360
|
+
"joint4_xyz": serialize_float_list(data.joint4_xyz),
|
|
3361
|
+
"joint4_rpy": serialize_float_list(data.joint4_rpy),
|
|
3362
|
+
"joint5_xyz": serialize_float_list(data.joint5_xyz),
|
|
3363
|
+
"joint5_rpy": serialize_float_list(data.joint5_rpy),
|
|
3364
|
+
}
|
|
3365
|
+
|
|
3366
|
+
@dataclass
|
|
3367
|
+
class ForceUnit:
|
|
3368
|
+
"""Reusable Abstraction for force units (eg force, torque)
|
|
3369
|
+
"""
|
|
3370
|
+
unit_kind: Union[ForceUnitKind, None] = None
|
|
3371
|
+
value: Union[float, None] = None
|
|
3372
|
+
|
|
3373
|
+
def validate_unit_kind(self, value: ForceUnitKind) -> Tuple[bool, str]:
|
|
3374
|
+
if value is None:
|
|
3375
|
+
return [False, "unit_kind is required for ForceUnit"]
|
|
3376
|
+
|
|
3377
|
+
if not ((isinstance(value, str) and ForceUnitKind in ['newtons', 'pounds']) or isinstance(value, ForceUnitKind)):
|
|
3378
|
+
return [False, "unit_kind must be of type ForceUnitKind for ForceUnit, got " + type(value).__name__]
|
|
3379
|
+
|
|
3380
|
+
return [True, ""]
|
|
3381
|
+
|
|
3382
|
+
def validate_value(self, value: float) -> Tuple[bool, str]:
|
|
3383
|
+
if value is None:
|
|
3384
|
+
return [True, ""]
|
|
3385
|
+
|
|
3386
|
+
if not isinstance(value, float):
|
|
3387
|
+
return [False, "value must be of type float for ForceUnit, got " + type(value).__name__]
|
|
3388
|
+
|
|
3389
|
+
return [True, ""]
|
|
3390
|
+
|
|
3391
|
+
def __post_init__(self):
|
|
3392
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3393
|
+
is_valid, error_str = self.validate_unit_kind(self.unit_kind)
|
|
3394
|
+
if not is_valid:
|
|
3395
|
+
raise TypeError(error_str)
|
|
3396
|
+
is_valid, error_str = self.validate_value(self.value)
|
|
3397
|
+
if not is_valid:
|
|
3398
|
+
raise TypeError(error_str)
|
|
3399
|
+
|
|
3400
|
+
def parse_force_unit(data: object):
|
|
3401
|
+
return ForceUnit(
|
|
3402
|
+
unit_kind=parse_force_unit_kind(data["unit_kind"]) if "unit_kind" in data and data.get("unit_kind") is not None else None,
|
|
3403
|
+
value=parse_f_64(data["value"]) if "value" in data and data.get("value") is not None else None,
|
|
3404
|
+
)
|
|
3405
|
+
|
|
3406
|
+
def serialize_force_unit(data: ForceUnit) -> object:
|
|
3407
|
+
return {
|
|
3408
|
+
"unit_kind": serialize_force_unit_kind(data.unit_kind),
|
|
3409
|
+
"value": None if data.value is None else serialize_f_64(data.value),
|
|
3410
|
+
}
|
|
3411
|
+
|
|
3412
|
+
@dataclass
|
|
3413
|
+
class IOStateResponse:
|
|
3414
|
+
"""Response to a query for the current state of I/O."""
|
|
3415
|
+
state: Union[IOStateMap, None] = None
|
|
3416
|
+
|
|
3417
|
+
def validate_state(self, value: IOStateMap) -> Tuple[bool, str]:
|
|
3418
|
+
if value is None:
|
|
3419
|
+
return [True, ""]
|
|
3420
|
+
|
|
3421
|
+
if not (isinstance(value, dict) and all((isinstance(k, str) and isinstance(val, str)) for k, val in value.items())):
|
|
3422
|
+
return [False, "state must be of type IOStateMap for IOStateResponse, got " + type(value).__name__]
|
|
3423
|
+
|
|
3424
|
+
return [True, ""]
|
|
3425
|
+
|
|
3426
|
+
def __post_init__(self):
|
|
3427
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3428
|
+
is_valid, error_str = self.validate_state(self.state)
|
|
3429
|
+
if not is_valid:
|
|
3430
|
+
raise TypeError(error_str)
|
|
3431
|
+
|
|
3432
|
+
def parse_io_state_response(data: object):
|
|
3433
|
+
return IOStateResponse(
|
|
3434
|
+
state=parse_io_state_map(data["state"]) if "state" in data and data.get("state") is not None else None,
|
|
3435
|
+
)
|
|
3436
|
+
|
|
3437
|
+
def serialize_io_state_response(data: IOStateResponse) -> object:
|
|
3438
|
+
return {
|
|
3439
|
+
"state": None if data.state is None else serialize_io_state_map(data.state),
|
|
3440
|
+
}
|
|
3441
|
+
|
|
3442
|
+
@dataclass
|
|
3443
|
+
class IOStateUpdateRequest:
|
|
3444
|
+
"""Request to update the state of I/O for multiple ports."""
|
|
3445
|
+
state: Union[IOStateMap, None] = None
|
|
3446
|
+
|
|
3447
|
+
def validate_state(self, value: IOStateMap) -> Tuple[bool, str]:
|
|
3448
|
+
if value is None:
|
|
3449
|
+
return [True, ""]
|
|
3450
|
+
|
|
3451
|
+
if not (isinstance(value, dict) and all((isinstance(k, str) and isinstance(val, str)) for k, val in value.items())):
|
|
3452
|
+
return [False, "state must be of type IOStateMap for IOStateUpdateRequest, got " + type(value).__name__]
|
|
3238
3453
|
|
|
3239
3454
|
return [True, ""]
|
|
3240
3455
|
|
|
@@ -3345,6 +3560,81 @@ def serialize_arm_joint_rotations(data: ArmJointRotations) -> object:
|
|
|
3345
3560
|
"joints": serialize_joint_rotations(data.joints),
|
|
3346
3561
|
}
|
|
3347
3562
|
|
|
3563
|
+
@dataclass
|
|
3564
|
+
class JointState:
|
|
3565
|
+
"""State of a joint"""
|
|
3566
|
+
braked: Union[bool, None] = None
|
|
3567
|
+
connectionStatus: Union[ConnectionStatus, None] = None
|
|
3568
|
+
inCollision: Union[bool, None] = None
|
|
3569
|
+
disturbance: Union[JointStateDisturbance, None] = None
|
|
3570
|
+
|
|
3571
|
+
def validate_braked(self, value: bool) -> Tuple[bool, str]:
|
|
3572
|
+
if value is None:
|
|
3573
|
+
return [True, ""]
|
|
3574
|
+
|
|
3575
|
+
if not isinstance(value, bool):
|
|
3576
|
+
return [False, "braked must be of type bool for JointState, got " + type(value).__name__]
|
|
3577
|
+
|
|
3578
|
+
return [True, ""]
|
|
3579
|
+
|
|
3580
|
+
def validate_connectionStatus(self, value: ConnectionStatus) -> Tuple[bool, str]:
|
|
3581
|
+
if value is None:
|
|
3582
|
+
return [True, ""]
|
|
3583
|
+
|
|
3584
|
+
if not ((isinstance(value, str) and ConnectionStatus in ['connected', 'disconnected', 'ready']) or isinstance(value, ConnectionStatus)):
|
|
3585
|
+
return [False, "connectionStatus must be of type ConnectionStatus for JointState, got " + type(value).__name__]
|
|
3586
|
+
|
|
3587
|
+
return [True, ""]
|
|
3588
|
+
|
|
3589
|
+
def validate_inCollision(self, value: bool) -> Tuple[bool, str]:
|
|
3590
|
+
if value is None:
|
|
3591
|
+
return [True, ""]
|
|
3592
|
+
|
|
3593
|
+
if not isinstance(value, bool):
|
|
3594
|
+
return [False, "inCollision must be of type bool for JointState, got " + type(value).__name__]
|
|
3595
|
+
|
|
3596
|
+
return [True, ""]
|
|
3597
|
+
|
|
3598
|
+
def validate_disturbance(self, value: JointStateDisturbance) -> Tuple[bool, str]:
|
|
3599
|
+
if value is None:
|
|
3600
|
+
return [True, ""]
|
|
3601
|
+
|
|
3602
|
+
if not isinstance(value, JointStateDisturbance):
|
|
3603
|
+
return [False, "disturbance must be of type JointStateDisturbance for JointState, got " + type(value).__name__]
|
|
3604
|
+
|
|
3605
|
+
return [True, ""]
|
|
3606
|
+
|
|
3607
|
+
def __post_init__(self):
|
|
3608
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
3609
|
+
is_valid, error_str = self.validate_braked(self.braked)
|
|
3610
|
+
if not is_valid:
|
|
3611
|
+
raise TypeError(error_str)
|
|
3612
|
+
is_valid, error_str = self.validate_connectionStatus(self.connectionStatus)
|
|
3613
|
+
if not is_valid:
|
|
3614
|
+
raise TypeError(error_str)
|
|
3615
|
+
is_valid, error_str = self.validate_inCollision(self.inCollision)
|
|
3616
|
+
if not is_valid:
|
|
3617
|
+
raise TypeError(error_str)
|
|
3618
|
+
is_valid, error_str = self.validate_disturbance(self.disturbance)
|
|
3619
|
+
if not is_valid:
|
|
3620
|
+
raise TypeError(error_str)
|
|
3621
|
+
|
|
3622
|
+
def parse_joint_state(data: object):
|
|
3623
|
+
return JointState(
|
|
3624
|
+
braked=parse_bool(data["braked"]) if "braked" in data and data.get("braked") is not None else None,
|
|
3625
|
+
connectionStatus=parse_connection_status(data["connectionStatus"]) if "connectionStatus" in data and data.get("connectionStatus") is not None else None,
|
|
3626
|
+
inCollision=parse_bool(data["inCollision"]) if "inCollision" in data and data.get("inCollision") is not None else None,
|
|
3627
|
+
disturbance=parse_joint_state_disturbance(data["disturbance"]) if "disturbance" in data and data.get("disturbance") is not None else None,
|
|
3628
|
+
)
|
|
3629
|
+
|
|
3630
|
+
def serialize_joint_state(data: JointState) -> object:
|
|
3631
|
+
return {
|
|
3632
|
+
"braked": None if data.braked is None else serialize_bool(data.braked),
|
|
3633
|
+
"connectionStatus": None if data.connectionStatus is None else serialize_connection_status(data.connectionStatus),
|
|
3634
|
+
"inCollision": None if data.inCollision is None else serialize_bool(data.inCollision),
|
|
3635
|
+
"disturbance": None if data.disturbance is None else serialize_joint_state_disturbance(data.disturbance),
|
|
3636
|
+
}
|
|
3637
|
+
|
|
3348
3638
|
@dataclass
|
|
3349
3639
|
class LinearUnit:
|
|
3350
3640
|
"""Reusable Abstraction for linear units (eg distance, position, offset)
|
|
@@ -3598,7 +3888,7 @@ class OnRobot2FG14GripperConfiguration:
|
|
|
3598
3888
|
if value is None:
|
|
3599
3889
|
return [True, ""]
|
|
3600
3890
|
|
|
3601
|
-
if not ((isinstance(value, str) and OnRobotGripKindEnum in ['
|
|
3891
|
+
if not ((isinstance(value, str) and OnRobotGripKindEnum in ['internal', 'external']) or isinstance(value, OnRobotGripKindEnum)):
|
|
3602
3892
|
return [False, "grip_kind must be of type OnRobotGripKindEnum for OnRobot2FG14GripperConfiguration, got " + type(value).__name__]
|
|
3603
3893
|
|
|
3604
3894
|
return [True, ""]
|
|
@@ -3898,7 +4188,7 @@ class OnRobot2FG7GripperConfiguration:
|
|
|
3898
4188
|
if value is None:
|
|
3899
4189
|
return [True, ""]
|
|
3900
4190
|
|
|
3901
|
-
if not ((isinstance(value, str) and OnRobotGripKindEnum in ['
|
|
4191
|
+
if not ((isinstance(value, str) and OnRobotGripKindEnum in ['internal', 'external']) or isinstance(value, OnRobotGripKindEnum)):
|
|
3902
4192
|
return [False, "grip_kind must be of type OnRobotGripKindEnum for OnRobot2FG7GripperConfiguration, got " + type(value).__name__]
|
|
3903
4193
|
|
|
3904
4194
|
return [True, ""]
|
|
@@ -4227,7 +4517,7 @@ class OnRobot3FG15GripperConfiguration:
|
|
|
4227
4517
|
if value is None:
|
|
4228
4518
|
return [True, ""]
|
|
4229
4519
|
|
|
4230
|
-
if not ((isinstance(value, str) and OnRobotGripKindEnum in ['
|
|
4520
|
+
if not ((isinstance(value, str) and OnRobotGripKindEnum in ['internal', 'external']) or isinstance(value, OnRobotGripKindEnum)):
|
|
4231
4521
|
return [False, "grip_kind must be of type OnRobotGripKindEnum for OnRobot3FG15GripperConfiguration, got " + type(value).__name__]
|
|
4232
4522
|
|
|
4233
4523
|
return [True, ""]
|
|
@@ -4599,6 +4889,36 @@ def serialize_robot_control_mode(data: RobotControlMode) -> object:
|
|
|
4599
4889
|
"kind": None if data.kind is None else serialize_robot_control_mode_enum(data.kind),
|
|
4600
4890
|
}
|
|
4601
4891
|
|
|
4892
|
+
@dataclass
|
|
4893
|
+
class PlayRoutineResponse:
|
|
4894
|
+
"""Status response informs user of of robot state"""
|
|
4895
|
+
status: Union[RobotStatusEnum, None] = None
|
|
4896
|
+
|
|
4897
|
+
def validate_status(self, value: RobotStatusEnum) -> Tuple[bool, str]:
|
|
4898
|
+
if value is None:
|
|
4899
|
+
return [True, ""]
|
|
4900
|
+
|
|
4901
|
+
if not ((isinstance(value, str) and RobotStatusEnum in ['Idle', 'RunningAdHocCommand', 'RoutineRunning', 'Antigravity', 'AntigravitySlow', 'Failure', 'Recovering']) or isinstance(value, RobotStatusEnum)):
|
|
4902
|
+
return [False, "status must be of type RobotStatusEnum for PlayRoutineResponse, got " + type(value).__name__]
|
|
4903
|
+
|
|
4904
|
+
return [True, ""]
|
|
4905
|
+
|
|
4906
|
+
def __post_init__(self):
|
|
4907
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
4908
|
+
is_valid, error_str = self.validate_status(self.status)
|
|
4909
|
+
if not is_valid:
|
|
4910
|
+
raise TypeError(error_str)
|
|
4911
|
+
|
|
4912
|
+
def parse_play_routine_response(data: object):
|
|
4913
|
+
return PlayRoutineResponse(
|
|
4914
|
+
status=parse_robot_status_enum(data["status"]) if "status" in data and data.get("status") is not None else None,
|
|
4915
|
+
)
|
|
4916
|
+
|
|
4917
|
+
def serialize_play_routine_response(data: PlayRoutineResponse) -> object:
|
|
4918
|
+
return {
|
|
4919
|
+
"status": None if data.status is None else serialize_robot_status_enum(data.status),
|
|
4920
|
+
}
|
|
4921
|
+
|
|
4602
4922
|
@dataclass
|
|
4603
4923
|
class ROSControlStateResponse:
|
|
4604
4924
|
"""Response to a query for the current state of ROS control."""
|
|
@@ -4863,6 +5183,134 @@ def serialize_arm_position_update_request_response_event_stream_details(data: Ar
|
|
|
4863
5183
|
"subscriptions": serialize_arm_position_update_request_response_event_stream_subscriptions_list(data.subscriptions),
|
|
4864
5184
|
}
|
|
4865
5185
|
|
|
5186
|
+
@dataclass
|
|
5187
|
+
class Routine:
|
|
5188
|
+
"""Robot Routine containing steps to automate robot movement and operations"""
|
|
5189
|
+
id: Union[str, None] = None
|
|
5190
|
+
name: Union[str, None] = None
|
|
5191
|
+
environment_variables: Union[EnvironmentVariablesList, None] = None
|
|
5192
|
+
|
|
5193
|
+
def validate_id(self, value: str) -> Tuple[bool, str]:
|
|
5194
|
+
if value is None:
|
|
5195
|
+
return [True, ""]
|
|
5196
|
+
|
|
5197
|
+
if not isinstance(value, str):
|
|
5198
|
+
return [False, "id must be of type str for Routine, got " + type(value).__name__]
|
|
5199
|
+
|
|
5200
|
+
return [True, ""]
|
|
5201
|
+
|
|
5202
|
+
def validate_name(self, value: str) -> Tuple[bool, str]:
|
|
5203
|
+
if value is None:
|
|
5204
|
+
return [True, ""]
|
|
5205
|
+
|
|
5206
|
+
if not isinstance(value, str):
|
|
5207
|
+
return [False, "name must be of type str for Routine, got " + type(value).__name__]
|
|
5208
|
+
|
|
5209
|
+
return [True, ""]
|
|
5210
|
+
|
|
5211
|
+
def validate_environment_variables(self, value: EnvironmentVariablesList) -> Tuple[bool, str]:
|
|
5212
|
+
if value is None:
|
|
5213
|
+
return [True, ""]
|
|
5214
|
+
|
|
5215
|
+
if not (isinstance(value, list) and all(isinstance(x, EnvironmentVariable) for x in value)):
|
|
5216
|
+
return [False, "environment_variables must be of type EnvironmentVariablesList for Routine, got " + type(value).__name__]
|
|
5217
|
+
|
|
5218
|
+
return [True, ""]
|
|
5219
|
+
|
|
5220
|
+
def __post_init__(self):
|
|
5221
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
5222
|
+
is_valid, error_str = self.validate_id(self.id)
|
|
5223
|
+
if not is_valid:
|
|
5224
|
+
raise TypeError(error_str)
|
|
5225
|
+
is_valid, error_str = self.validate_name(self.name)
|
|
5226
|
+
if not is_valid:
|
|
5227
|
+
raise TypeError(error_str)
|
|
5228
|
+
is_valid, error_str = self.validate_environment_variables(self.environment_variables)
|
|
5229
|
+
if not is_valid:
|
|
5230
|
+
raise TypeError(error_str)
|
|
5231
|
+
|
|
5232
|
+
def parse_routine(data: object):
|
|
5233
|
+
return Routine(
|
|
5234
|
+
id=parse_str(data["id"]) if "id" in data and data.get("id") is not None else None,
|
|
5235
|
+
name=parse_str(data["name"]) if "name" in data and data.get("name") is not None else None,
|
|
5236
|
+
environment_variables=parse_environment_variables_list(data["environment_variables"]) if "environment_variables" in data and data.get("environment_variables") is not None else None,
|
|
5237
|
+
)
|
|
5238
|
+
|
|
5239
|
+
def serialize_routine(data: Routine) -> object:
|
|
5240
|
+
return {
|
|
5241
|
+
"id": None if data.id is None else serialize_str(data.id),
|
|
5242
|
+
"name": None if data.name is None else serialize_str(data.name),
|
|
5243
|
+
"environment_variables": None if data.environment_variables is None else serialize_environment_variables_list(data.environment_variables),
|
|
5244
|
+
}
|
|
5245
|
+
|
|
5246
|
+
@dataclass
|
|
5247
|
+
class CalibrationData:
|
|
5248
|
+
"""The result of a calibration"""
|
|
5249
|
+
timestamp: Union[str, None] = None
|
|
5250
|
+
armSerial: Union[str, None] = None
|
|
5251
|
+
urdfParameters: Union[URDFParameters, None] = None
|
|
5252
|
+
|
|
5253
|
+
def validate_timestamp(self, value: str) -> Tuple[bool, str]:
|
|
5254
|
+
if value is None:
|
|
5255
|
+
return [False, "timestamp is required for CalibrationData"]
|
|
5256
|
+
|
|
5257
|
+
if not isinstance(value, str):
|
|
5258
|
+
return [False, "timestamp must be of type str for CalibrationData, got " + type(value).__name__]
|
|
5259
|
+
|
|
5260
|
+
return [True, ""]
|
|
5261
|
+
|
|
5262
|
+
def validate_armSerial(self, value: str) -> Tuple[bool, str]:
|
|
5263
|
+
if value is None:
|
|
5264
|
+
return [False, "armSerial is required for CalibrationData"]
|
|
5265
|
+
|
|
5266
|
+
if not isinstance(value, str):
|
|
5267
|
+
return [False, "armSerial must be of type str for CalibrationData, got " + type(value).__name__]
|
|
5268
|
+
|
|
5269
|
+
return [True, ""]
|
|
5270
|
+
|
|
5271
|
+
def validate_urdfParameters(self, value: URDFParameters) -> Tuple[bool, str]:
|
|
5272
|
+
if value is None:
|
|
5273
|
+
return [False, "urdfParameters is required for CalibrationData"]
|
|
5274
|
+
|
|
5275
|
+
if not isinstance(value, URDFParameters):
|
|
5276
|
+
return [False, "urdfParameters must be of type URDFParameters for CalibrationData, got " + type(value).__name__]
|
|
5277
|
+
|
|
5278
|
+
return [True, ""]
|
|
5279
|
+
|
|
5280
|
+
def __post_init__(self):
|
|
5281
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
5282
|
+
is_valid, error_str = self.validate_timestamp(self.timestamp)
|
|
5283
|
+
if not is_valid:
|
|
5284
|
+
raise TypeError(error_str)
|
|
5285
|
+
is_valid, error_str = self.validate_armSerial(self.armSerial)
|
|
5286
|
+
if not is_valid:
|
|
5287
|
+
raise TypeError(error_str)
|
|
5288
|
+
is_valid, error_str = self.validate_urdfParameters(self.urdfParameters)
|
|
5289
|
+
if not is_valid:
|
|
5290
|
+
raise TypeError(error_str)
|
|
5291
|
+
|
|
5292
|
+
def parse_calibration_data(data: object):
|
|
5293
|
+
return CalibrationData(
|
|
5294
|
+
timestamp=parse_str(data["timestamp"]) if "timestamp" in data and data.get("timestamp") is not None else None,
|
|
5295
|
+
armSerial=parse_str(data["armSerial"]) if "armSerial" in data and data.get("armSerial") is not None else None,
|
|
5296
|
+
urdfParameters=parse_urdf_parameters(data["urdfParameters"]) if "urdfParameters" in data and data.get("urdfParameters") is not None else None,
|
|
5297
|
+
)
|
|
5298
|
+
|
|
5299
|
+
def serialize_calibration_data(data: CalibrationData) -> object:
|
|
5300
|
+
return {
|
|
5301
|
+
"timestamp": serialize_str(data.timestamp),
|
|
5302
|
+
"armSerial": serialize_str(data.armSerial),
|
|
5303
|
+
"urdfParameters": serialize_urdf_parameters(data.urdfParameters),
|
|
5304
|
+
}
|
|
5305
|
+
|
|
5306
|
+
ArmJointRotationsList = List[ArmJointRotations]
|
|
5307
|
+
|
|
5308
|
+
def parse_arm_joint_rotations_list(data: object) -> ArmJointRotationsList:
|
|
5309
|
+
return [parse_arm_joint_rotations(item) for item in data]
|
|
5310
|
+
|
|
5311
|
+
def serialize_arm_joint_rotations_list(data: ArmJointRotationsList) -> List[object]:
|
|
5312
|
+
return [serialize_arm_joint_rotations(item) for item in data]
|
|
5313
|
+
|
|
4866
5314
|
@dataclass
|
|
4867
5315
|
class JointsStateResponse:
|
|
4868
5316
|
"""Response to a query for the current state of the joints"""
|
|
@@ -4968,74 +5416,6 @@ def serialize_joints_state_response(data: JointsStateResponse) -> object:
|
|
|
4968
5416
|
"J5": None if data.J5 is None else serialize_joint_state(data.J5),
|
|
4969
5417
|
}
|
|
4970
5418
|
|
|
4971
|
-
@dataclass
|
|
4972
|
-
class Routine:
|
|
4973
|
-
"""Robot Routine containing steps to automate robot movement and operations"""
|
|
4974
|
-
id: Union[str, None] = None
|
|
4975
|
-
name: Union[str, None] = None
|
|
4976
|
-
environment_variables: Union[EnvironmentVariablesList, None] = None
|
|
4977
|
-
|
|
4978
|
-
def validate_id(self, value: str) -> Tuple[bool, str]:
|
|
4979
|
-
if value is None:
|
|
4980
|
-
return [True, ""]
|
|
4981
|
-
|
|
4982
|
-
if not isinstance(value, str):
|
|
4983
|
-
return [False, "id must be of type str for Routine, got " + type(value).__name__]
|
|
4984
|
-
|
|
4985
|
-
return [True, ""]
|
|
4986
|
-
|
|
4987
|
-
def validate_name(self, value: str) -> Tuple[bool, str]:
|
|
4988
|
-
if value is None:
|
|
4989
|
-
return [True, ""]
|
|
4990
|
-
|
|
4991
|
-
if not isinstance(value, str):
|
|
4992
|
-
return [False, "name must be of type str for Routine, got " + type(value).__name__]
|
|
4993
|
-
|
|
4994
|
-
return [True, ""]
|
|
4995
|
-
|
|
4996
|
-
def validate_environment_variables(self, value: EnvironmentVariablesList) -> Tuple[bool, str]:
|
|
4997
|
-
if value is None:
|
|
4998
|
-
return [True, ""]
|
|
4999
|
-
|
|
5000
|
-
if not (isinstance(value, list) and all(isinstance(x, EnvironmentVariable) for x in value)):
|
|
5001
|
-
return [False, "environment_variables must be of type EnvironmentVariablesList for Routine, got " + type(value).__name__]
|
|
5002
|
-
|
|
5003
|
-
return [True, ""]
|
|
5004
|
-
|
|
5005
|
-
def __post_init__(self):
|
|
5006
|
-
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
5007
|
-
is_valid, error_str = self.validate_id(self.id)
|
|
5008
|
-
if not is_valid:
|
|
5009
|
-
raise TypeError(error_str)
|
|
5010
|
-
is_valid, error_str = self.validate_name(self.name)
|
|
5011
|
-
if not is_valid:
|
|
5012
|
-
raise TypeError(error_str)
|
|
5013
|
-
is_valid, error_str = self.validate_environment_variables(self.environment_variables)
|
|
5014
|
-
if not is_valid:
|
|
5015
|
-
raise TypeError(error_str)
|
|
5016
|
-
|
|
5017
|
-
def parse_routine(data: object):
|
|
5018
|
-
return Routine(
|
|
5019
|
-
id=parse_str(data["id"]) if "id" in data and data.get("id") is not None else None,
|
|
5020
|
-
name=parse_str(data["name"]) if "name" in data and data.get("name") is not None else None,
|
|
5021
|
-
environment_variables=parse_environment_variables_list(data["environment_variables"]) if "environment_variables" in data and data.get("environment_variables") is not None else None,
|
|
5022
|
-
)
|
|
5023
|
-
|
|
5024
|
-
def serialize_routine(data: Routine) -> object:
|
|
5025
|
-
return {
|
|
5026
|
-
"id": None if data.id is None else serialize_str(data.id),
|
|
5027
|
-
"name": None if data.name is None else serialize_str(data.name),
|
|
5028
|
-
"environment_variables": None if data.environment_variables is None else serialize_environment_variables_list(data.environment_variables),
|
|
5029
|
-
}
|
|
5030
|
-
|
|
5031
|
-
ArmJointRotationsList = List[ArmJointRotations]
|
|
5032
|
-
|
|
5033
|
-
def parse_arm_joint_rotations_list(data: object) -> ArmJointRotationsList:
|
|
5034
|
-
return [parse_arm_joint_rotations(item) for item in data]
|
|
5035
|
-
|
|
5036
|
-
def serialize_arm_joint_rotations_list(data: ArmJointRotationsList) -> List[object]:
|
|
5037
|
-
return [serialize_arm_joint_rotations(item) for item in data]
|
|
5038
|
-
|
|
5039
5419
|
@dataclass
|
|
5040
5420
|
class OnRobot2FG14GripperCommandRequest:
|
|
5041
5421
|
"""Control the OnRobot 2FG14 gripper (end effector) of the robot
|
|
@@ -5049,7 +5429,7 @@ class OnRobot2FG14GripperCommandRequest:
|
|
|
5049
5429
|
if value is None:
|
|
5050
5430
|
return [False, "grip_direction is required for OnRobot2FG14GripperCommandRequest"]
|
|
5051
5431
|
|
|
5052
|
-
if not ((isinstance(value, str) and LinearGripDirectionEnum in ['
|
|
5432
|
+
if not ((isinstance(value, str) and LinearGripDirectionEnum in ['internal', 'external']) or isinstance(value, LinearGripDirectionEnum)):
|
|
5053
5433
|
return [False, "grip_direction must be of type LinearGripDirectionEnum for OnRobot2FG14GripperCommandRequest, got " + type(value).__name__]
|
|
5054
5434
|
|
|
5055
5435
|
return [True, ""]
|
|
@@ -5125,7 +5505,7 @@ class OnRobot2FG7GripperCommandRequest:
|
|
|
5125
5505
|
if value is None:
|
|
5126
5506
|
return [False, "grip_direction is required for OnRobot2FG7GripperCommandRequest"]
|
|
5127
5507
|
|
|
5128
|
-
if not ((isinstance(value, str) and LinearGripDirectionEnum in ['
|
|
5508
|
+
if not ((isinstance(value, str) and LinearGripDirectionEnum in ['internal', 'external']) or isinstance(value, LinearGripDirectionEnum)):
|
|
5129
5509
|
return [False, "grip_direction must be of type LinearGripDirectionEnum for OnRobot2FG7GripperCommandRequest, got " + type(value).__name__]
|
|
5130
5510
|
|
|
5131
5511
|
return [True, ""]
|
|
@@ -5201,7 +5581,7 @@ class OnRobot3FG15GripperCommandRequest:
|
|
|
5201
5581
|
if value is None:
|
|
5202
5582
|
return [False, "grip_direction is required for OnRobot3FG15GripperCommandRequest"]
|
|
5203
5583
|
|
|
5204
|
-
if not ((isinstance(value, str) and LinearGripDirectionEnum in ['
|
|
5584
|
+
if not ((isinstance(value, str) and LinearGripDirectionEnum in ['internal', 'external']) or isinstance(value, LinearGripDirectionEnum)):
|
|
5205
5585
|
return [False, "grip_direction must be of type LinearGripDirectionEnum for OnRobot3FG15GripperCommandRequest, got " + type(value).__name__]
|
|
5206
5586
|
|
|
5207
5587
|
return [True, ""]
|
|
@@ -5732,6 +6112,36 @@ def parse_routines_list(data: object) -> RoutinesList:
|
|
|
5732
6112
|
def serialize_routines_list(data: RoutinesList) -> List[object]:
|
|
5733
6113
|
return [serialize_routine(item) for item in data]
|
|
5734
6114
|
|
|
6115
|
+
@dataclass
|
|
6116
|
+
class ActiveCalibrationContainer:
|
|
6117
|
+
"""The response to an active calibration request"""
|
|
6118
|
+
calibrationData: Union[CalibrationData, None] = None
|
|
6119
|
+
|
|
6120
|
+
def validate_calibrationData(self, value: CalibrationData) -> Tuple[bool, str]:
|
|
6121
|
+
if value is None:
|
|
6122
|
+
return [True, ""]
|
|
6123
|
+
|
|
6124
|
+
if not isinstance(value, CalibrationData):
|
|
6125
|
+
return [False, "calibrationData must be of type CalibrationData for ActiveCalibrationContainer, got " + type(value).__name__]
|
|
6126
|
+
|
|
6127
|
+
return [True, ""]
|
|
6128
|
+
|
|
6129
|
+
def __post_init__(self):
|
|
6130
|
+
# Type check incoming model - raise error if invalid (required or wrong type)
|
|
6131
|
+
is_valid, error_str = self.validate_calibrationData(self.calibrationData)
|
|
6132
|
+
if not is_valid:
|
|
6133
|
+
raise TypeError(error_str)
|
|
6134
|
+
|
|
6135
|
+
def parse_active_calibration_container(data: object):
|
|
6136
|
+
return ActiveCalibrationContainer(
|
|
6137
|
+
calibrationData=parse_calibration_data(data["calibrationData"]) if "calibrationData" in data and data.get("calibrationData") is not None else None,
|
|
6138
|
+
)
|
|
6139
|
+
|
|
6140
|
+
def serialize_active_calibration_container(data: ActiveCalibrationContainer) -> object:
|
|
6141
|
+
return {
|
|
6142
|
+
"calibrationData": None if data.calibrationData is None else serialize_calibration_data(data.calibrationData),
|
|
6143
|
+
}
|
|
6144
|
+
|
|
5735
6145
|
@dataclass
|
|
5736
6146
|
class GripperCommandRequest:
|
|
5737
6147
|
"""Control the gripper (end effector) of the robot
|
|
@@ -5875,7 +6285,7 @@ class Space:
|
|
|
5875
6285
|
kind: Union[str, None] = None
|
|
5876
6286
|
name: Union[str, None] = None
|
|
5877
6287
|
description: Union[str, None] = None
|
|
5878
|
-
|
|
6288
|
+
is_global: Union[bool, None] = None
|
|
5879
6289
|
positions: Union[SpacePositionsMap, None] = None
|
|
5880
6290
|
|
|
5881
6291
|
def validate_id(self, value: str) -> Tuple[bool, str]:
|
|
@@ -5914,12 +6324,12 @@ class Space:
|
|
|
5914
6324
|
|
|
5915
6325
|
return [True, ""]
|
|
5916
6326
|
|
|
5917
|
-
def
|
|
6327
|
+
def validate_is_global(self, value: bool) -> Tuple[bool, str]:
|
|
5918
6328
|
if value is None:
|
|
5919
6329
|
return [True, ""]
|
|
5920
6330
|
|
|
5921
6331
|
if not isinstance(value, bool):
|
|
5922
|
-
return [False, "
|
|
6332
|
+
return [False, "is_global must be of type bool for Space, got " + type(value).__name__]
|
|
5923
6333
|
|
|
5924
6334
|
return [True, ""]
|
|
5925
6335
|
|
|
@@ -5946,7 +6356,7 @@ class Space:
|
|
|
5946
6356
|
is_valid, error_str = self.validate_description(self.description)
|
|
5947
6357
|
if not is_valid:
|
|
5948
6358
|
raise TypeError(error_str)
|
|
5949
|
-
is_valid, error_str = self.
|
|
6359
|
+
is_valid, error_str = self.validate_is_global(self.is_global)
|
|
5950
6360
|
if not is_valid:
|
|
5951
6361
|
raise TypeError(error_str)
|
|
5952
6362
|
is_valid, error_str = self.validate_positions(self.positions)
|
|
@@ -5959,7 +6369,7 @@ def parse_space(data: object):
|
|
|
5959
6369
|
kind=parse_str(data["kind"]) if "kind" in data and data.get("kind") is not None else None,
|
|
5960
6370
|
name=parse_str(data["name"]) if "name" in data and data.get("name") is not None else None,
|
|
5961
6371
|
description=parse_str(data["description"]) if "description" in data and data.get("description") is not None else None,
|
|
5962
|
-
|
|
6372
|
+
is_global=parse_bool(data["is_global"]) if "is_global" in data and data.get("is_global") is not None else None,
|
|
5963
6373
|
positions=parse_space_positions_map(data["positions"]) if "positions" in data and data.get("positions") is not None else None,
|
|
5964
6374
|
)
|
|
5965
6375
|
|
|
@@ -5969,7 +6379,7 @@ def serialize_space(data: Space) -> object:
|
|
|
5969
6379
|
"kind": None if data.kind is None else serialize_str(data.kind),
|
|
5970
6380
|
"name": None if data.name is None else serialize_str(data.name),
|
|
5971
6381
|
"description": None if data.description is None else serialize_str(data.description),
|
|
5972
|
-
"
|
|
6382
|
+
"is_global": None if data.is_global is None else serialize_bool(data.is_global),
|
|
5973
6383
|
"positions": None if data.positions is None else serialize_space_positions_map(data.positions),
|
|
5974
6384
|
}
|
|
5975
6385
|
|