wandelbots-api-client 26.9.0.dev43__py3-none-any.whl → 26.9.0.dev45__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.
Files changed (26) hide show
  1. wandelbots_api_client/v2/__init__.py +1 -1
  2. wandelbots_api_client/v2/api_client.py +1 -1
  3. wandelbots_api_client/v2/configuration.py +1 -1
  4. wandelbots_api_client/v2/models/__init__.py +8 -1
  5. wandelbots_api_client/v2/models/anchored_kinematic_configuration.py +165 -0
  6. wandelbots_api_client/v2/models/anchored_pose.py +110 -0
  7. wandelbots_api_client/v2/models/command_routine.py +1 -2
  8. wandelbots_api_client/v2/models/configured_pose.py +3 -9
  9. wandelbots_api_client/v2/models/dataset_frame_reference.py +102 -0
  10. wandelbots_api_client/v2/models/dataset_pose.py +15 -10
  11. wandelbots_api_client/v2/models/dataset_pose_reference.py +3 -3
  12. wandelbots_api_client/v2/models/frame_reference.py +165 -0
  13. wandelbots_api_client/v2/models/{inline_pose_reference.py → inline_pose.py} +18 -15
  14. wandelbots_api_client/v2/models/local_pose_reference.py +14 -3
  15. wandelbots_api_client/v2/models/pose_ref.py +18 -20
  16. wandelbots_api_client/v2/models/specified_kinematic_configuration.py +110 -0
  17. wandelbots_api_client/v2/models/unspecified_kinematic_configuration.py +90 -0
  18. wandelbots_api_client/v2/models/world_frame_reference.py +90 -0
  19. wandelbots_api_client/v2_pydantic/__init__.py +1 -1
  20. wandelbots_api_client/v2_pydantic/api_client.py +1 -1
  21. wandelbots_api_client/v2_pydantic/configuration.py +1 -1
  22. wandelbots_api_client/v2_pydantic/models/__init__.py +16 -2
  23. wandelbots_api_client/v2_pydantic/models/models.py +117 -32
  24. {wandelbots_api_client-26.9.0.dev43.dist-info → wandelbots_api_client-26.9.0.dev45.dist-info}/METADATA +2 -2
  25. {wandelbots_api_client-26.9.0.dev43.dist-info → wandelbots_api_client-26.9.0.dev45.dist-info}/RECORD +26 -19
  26. {wandelbots_api_client-26.9.0.dev43.dist-info → wandelbots_api_client-26.9.0.dev45.dist-info}/WHEEL +0 -0
@@ -13,7 +13,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech)
13
13
  Do not edit the class manually.
14
14
  """ # noqa: E501
15
15
 
16
- __version__ = "26.9.0.dev43"
16
+ __version__ = "26.9.0.dev45"
17
17
 
18
18
  from . import api
19
19
  from . import api_client
@@ -106,7 +106,7 @@ class ApiClient:
106
106
  self.default_headers[header_name] = header_value
107
107
  self.cookie = cookie
108
108
  # Set default User-Agent.
109
- self.user_agent = "Wandelbots-Nova-API-Python-Client/26.9.0.dev43"
109
+ self.user_agent = "Wandelbots-Nova-API-Python-Client/26.9.0.dev45"
110
110
  self.client_side_validation = configuration.client_side_validation
111
111
 
112
112
  async def __aenter__(self):
@@ -557,7 +557,7 @@ class Configuration:
557
557
  "OS: {env}\n"
558
558
  "Python Version: {pyversion}\n"
559
559
  "Version of the API: 2.9.0 dev\n"
560
- "SDK Package Version: 26.9.0.dev43".format(env=sys.platform, pyversion=sys.version)
560
+ "SDK Package Version: 26.9.0.dev45".format(env=sys.platform, pyversion=sys.version)
561
561
  )
562
562
 
563
563
  def get_host_settings(self) -> List[HostSetting]:
@@ -26,6 +26,8 @@ from wandelbots_api_client.v2.models.add_trajectory_error_data import AddTraject
26
26
  from wandelbots_api_client.v2.models.add_trajectory_request import AddTrajectoryRequest
27
27
  from wandelbots_api_client.v2.models.add_trajectory_response import AddTrajectoryResponse
28
28
  from wandelbots_api_client.v2.models.add_virtual_controller_motion_group_request import AddVirtualControllerMotionGroupRequest
29
+ from wandelbots_api_client.v2.models.anchored_kinematic_configuration import AnchoredKinematicConfiguration
30
+ from wandelbots_api_client.v2.models.anchored_pose import AnchoredPose
29
31
  from wandelbots_api_client.v2.models.api_version import ApiVersion
30
32
  from wandelbots_api_client.v2.models.app import App
31
33
  from wandelbots_api_client.v2.models.at_reference import AtReference
@@ -145,6 +147,7 @@ from wandelbots_api_client.v2.models.cylinder import Cylinder
145
147
  from wandelbots_api_client.v2.models.dh_parameter import DHParameter
146
148
  from wandelbots_api_client.v2.models.dataset import Dataset
147
149
  from wandelbots_api_client.v2.models.dataset_frame import DatasetFrame
150
+ from wandelbots_api_client.v2.models.dataset_frame_reference import DatasetFrameReference
148
151
  from wandelbots_api_client.v2.models.dataset_pose import DatasetPose
149
152
  from wandelbots_api_client.v2.models.dataset_pose_reference import DatasetPoseReference
150
153
  from wandelbots_api_client.v2.models.direction import Direction
@@ -197,6 +200,7 @@ from wandelbots_api_client.v2.models.forward_kinematics_request import ForwardKi
197
200
  from wandelbots_api_client.v2.models.forward_kinematics_response import ForwardKinematicsResponse
198
201
  from wandelbots_api_client.v2.models.forward_kinematics_validation_error import ForwardKinematicsValidationError
199
202
  from wandelbots_api_client.v2.models.frame import Frame
203
+ from wandelbots_api_client.v2.models.frame_reference import FrameReference
200
204
  from wandelbots_api_client.v2.models.generated_path_motion_command import GeneratedPathMotionCommand
201
205
  from wandelbots_api_client.v2.models.get_dataset_response import GetDatasetResponse
202
206
  from wandelbots_api_client.v2.models.get_kinematic_configuration422_response import GetKinematicConfiguration422Response
@@ -235,7 +239,7 @@ from wandelbots_api_client.v2.models.initialize_jogging_response import Initiali
235
239
  from wandelbots_api_client.v2.models.initialize_movement_request import InitializeMovementRequest
236
240
  from wandelbots_api_client.v2.models.initialize_movement_request_trajectory import InitializeMovementRequestTrajectory
237
241
  from wandelbots_api_client.v2.models.initialize_movement_response import InitializeMovementResponse
238
- from wandelbots_api_client.v2.models.inline_pose_reference import InlinePoseReference
242
+ from wandelbots_api_client.v2.models.inline_pose import InlinePose
239
243
  from wandelbots_api_client.v2.models.integer_value import IntegerValue
240
244
  from wandelbots_api_client.v2.models.invalid_dof_error import InvalidDofError
241
245
  from wandelbots_api_client.v2.models.invalid_dof_error_invalid_dof import InvalidDofErrorInvalidDof
@@ -462,6 +466,7 @@ from wandelbots_api_client.v2.models.snap7_io_area import Snap7IOArea
462
466
  from wandelbots_api_client.v2.models.snap7_io_data import Snap7IOData
463
467
  from wandelbots_api_client.v2.models.snap7_io_direction import Snap7IODirection
464
468
  from wandelbots_api_client.v2.models.snap7_io_type_enum import Snap7IOTypeEnum
469
+ from wandelbots_api_client.v2.models.specified_kinematic_configuration import SpecifiedKinematicConfiguration
465
470
  from wandelbots_api_client.v2.models.sphere import Sphere
466
471
  from wandelbots_api_client.v2.models.start_movement_request import StartMovementRequest
467
472
  from wandelbots_api_client.v2.models.start_movement_response import StartMovementResponse
@@ -499,6 +504,7 @@ from wandelbots_api_client.v2.models.unitree_controller import UnitreeController
499
504
  from wandelbots_api_client.v2.models.universalrobots_controller import UniversalrobotsController
500
505
  from wandelbots_api_client.v2.models.unpause_action_chunks_request import UnpauseActionChunksRequest
501
506
  from wandelbots_api_client.v2.models.unpause_action_chunks_response import UnpauseActionChunksResponse
507
+ from wandelbots_api_client.v2.models.unspecified_kinematic_configuration import UnspecifiedKinematicConfiguration
502
508
  from wandelbots_api_client.v2.models.update_cell_version_request import UpdateCellVersionRequest
503
509
  from wandelbots_api_client.v2.models.update_nova_version_request import UpdateNovaVersionRequest
504
510
  from wandelbots_api_client.v2.models.user import User
@@ -511,6 +517,7 @@ from wandelbots_api_client.v2.models.wait_for_io_event_request import WaitForIOE
511
517
  from wandelbots_api_client.v2.models.wait_for_time_command import WaitForTimeCommand
512
518
  from wandelbots_api_client.v2.models.waypoint import Waypoint
513
519
  from wandelbots_api_client.v2.models.waypoint_coordinates import WaypointCoordinates
520
+ from wandelbots_api_client.v2.models.world_frame_reference import WorldFrameReference
514
521
  from wandelbots_api_client.v2.models.yaskawa_controller import YaskawaController
515
522
  from wandelbots_api_client.v2.models.zod_validation_error import ZodValidationError
516
523
  from wandelbots_api_client.v2.models.zod_validation_error_error import ZodValidationErrorError
@@ -0,0 +1,165 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Wandelbots NOVA API
5
+
6
+ Interact with robots in an easy and intuitive way.
7
+
8
+ The version of the OpenAPI document: 2.9.0 dev
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+ import json
16
+ import pprint
17
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
18
+ from typing import Any, List, Optional
19
+ from wandelbots_api_client.v2.models.specified_kinematic_configuration import SpecifiedKinematicConfiguration
20
+ from wandelbots_api_client.v2.models.unspecified_kinematic_configuration import UnspecifiedKinematicConfiguration
21
+ from pydantic import StrictStr, Field
22
+ from typing import Union, List, Set, Optional, Dict
23
+ from typing_extensions import Literal, Self
24
+
25
+ ANCHOREDKINEMATICCONFIGURATION_ONE_OF_SCHEMAS = ["SpecifiedKinematicConfiguration", "UnspecifiedKinematicConfiguration"]
26
+
27
+
28
+ class AnchoredKinematicConfiguration(BaseModel):
29
+ """
30
+ States the arm posture of an `AnchoredPose`. The `type` states whether a kinematic configuration is specified, so that no posture is implied by a missing or null value.
31
+ """
32
+
33
+ # data type: SpecifiedKinematicConfiguration
34
+ oneof_schema_1_validator: Optional[SpecifiedKinematicConfiguration] = None
35
+ # data type: UnspecifiedKinematicConfiguration
36
+ oneof_schema_2_validator: Optional[UnspecifiedKinematicConfiguration] = None
37
+ actual_instance: Optional[Union[SpecifiedKinematicConfiguration, UnspecifiedKinematicConfiguration]] = None
38
+ one_of_schemas: Set[str] = {"SpecifiedKinematicConfiguration", "UnspecifiedKinematicConfiguration"}
39
+
40
+ model_config = ConfigDict(
41
+ validate_assignment=True,
42
+ protected_namespaces=(),
43
+ )
44
+
45
+ discriminator_value_class_map: Dict[str, str] = {}
46
+
47
+ def __init__(self, *args, **kwargs) -> None:
48
+ if args:
49
+ if len(args) > 1:
50
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
51
+ if kwargs:
52
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
53
+ super().__init__(actual_instance=args[0])
54
+ else:
55
+ super().__init__(**kwargs)
56
+
57
+ @field_validator("actual_instance")
58
+ def actual_instance_must_validate_oneof(cls, v):
59
+ instance = AnchoredKinematicConfiguration.model_construct()
60
+ error_messages = []
61
+ match = 0
62
+ # validate data type: SpecifiedKinematicConfiguration
63
+ if not isinstance(v, SpecifiedKinematicConfiguration):
64
+ error_messages.append(f"Error! Input type `{type(v)}` is not `SpecifiedKinematicConfiguration`")
65
+ else:
66
+ match += 1
67
+ # validate data type: UnspecifiedKinematicConfiguration
68
+ if not isinstance(v, UnspecifiedKinematicConfiguration):
69
+ error_messages.append(f"Error! Input type `{type(v)}` is not `UnspecifiedKinematicConfiguration`")
70
+ else:
71
+ match += 1
72
+ if match > 1:
73
+ # more than 1 match
74
+ raise ValueError(
75
+ "Multiple matches found when setting `actual_instance` in AnchoredKinematicConfiguration with oneOf schemas: SpecifiedKinematicConfiguration, UnspecifiedKinematicConfiguration. Details: "
76
+ + ", ".join(error_messages)
77
+ )
78
+ elif match == 0:
79
+ # no match
80
+ raise ValueError(
81
+ "No match found when setting `actual_instance` in AnchoredKinematicConfiguration with oneOf schemas: SpecifiedKinematicConfiguration, UnspecifiedKinematicConfiguration. Details: "
82
+ + ", ".join(error_messages)
83
+ )
84
+ else:
85
+ return v
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
89
+ return cls.from_json(json.dumps(obj))
90
+
91
+ @classmethod
92
+ def from_json(cls, json_str: str) -> Self:
93
+ """Returns the object represented by the json string"""
94
+ instance = cls.model_construct()
95
+ error_messages = []
96
+ match = 0
97
+
98
+ # use oneOf discriminator to lookup the data type
99
+ _discriminator_property = "type"
100
+ _data_type = json.loads(json_str).get(_discriminator_property)
101
+ if not _data_type:
102
+ raise ValueError(f"Failed to lookup data type from the field `{_discriminator_property}` in the input.")
103
+
104
+ # check if data type is `SpecifiedKinematicConfiguration`
105
+ if _data_type == "specified":
106
+ instance.actual_instance = SpecifiedKinematicConfiguration.from_json(json_str)
107
+ return instance
108
+
109
+ # check if data type is `UnspecifiedKinematicConfiguration`
110
+ if _data_type == "unspecified":
111
+ instance.actual_instance = UnspecifiedKinematicConfiguration.from_json(json_str)
112
+ return instance
113
+
114
+ # deserialize data into SpecifiedKinematicConfiguration
115
+ try:
116
+ instance.actual_instance = SpecifiedKinematicConfiguration.from_json(json_str)
117
+ match += 1
118
+ except (ValidationError, ValueError) as e:
119
+ error_messages.append(str(e))
120
+ # deserialize data into UnspecifiedKinematicConfiguration
121
+ try:
122
+ instance.actual_instance = UnspecifiedKinematicConfiguration.from_json(json_str)
123
+ match += 1
124
+ except (ValidationError, ValueError) as e:
125
+ error_messages.append(str(e))
126
+
127
+ if match > 1:
128
+ # more than 1 match
129
+ raise ValueError(
130
+ "Multiple matches found when deserializing the JSON string into AnchoredKinematicConfiguration with oneOf schemas: SpecifiedKinematicConfiguration, UnspecifiedKinematicConfiguration. Details: "
131
+ + ", ".join(error_messages)
132
+ )
133
+ elif match == 0:
134
+ # no match
135
+ raise ValueError(
136
+ "No match found when deserializing the JSON string into AnchoredKinematicConfiguration with oneOf schemas: SpecifiedKinematicConfiguration, UnspecifiedKinematicConfiguration. Details: "
137
+ + ", ".join(error_messages)
138
+ )
139
+ else:
140
+ return instance
141
+
142
+ def to_json(self) -> str:
143
+ """Returns the JSON representation of the actual instance"""
144
+ if self.actual_instance is None:
145
+ return "null"
146
+
147
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
148
+ return self.actual_instance.to_json()
149
+ else:
150
+ return json.dumps(self.actual_instance)
151
+
152
+ def to_dict(self) -> Optional[Union[Dict[str, Any], SpecifiedKinematicConfiguration, UnspecifiedKinematicConfiguration]]:
153
+ """Returns the dict representation of the actual instance"""
154
+ if self.actual_instance is None:
155
+ return None
156
+
157
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
158
+ return self.actual_instance.to_dict()
159
+ else:
160
+ # primitive type
161
+ return self.actual_instance
162
+
163
+ def to_str(self) -> str:
164
+ """Returns the string representation of the actual instance"""
165
+ return pprint.pformat(self.model_dump())
@@ -0,0 +1,110 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Wandelbots NOVA API
5
+
6
+ Interact with robots in an easy and intuitive way.
7
+
8
+ The version of the OpenAPI document: 2.9.0 dev
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+ import pprint
16
+ import re # noqa: F401
17
+ import json
18
+
19
+ from pydantic import BaseModel, ConfigDict, Field
20
+ from typing import Any, ClassVar, Dict, List
21
+ from typing_extensions import Annotated
22
+ from wandelbots_api_client.v2.models.anchored_kinematic_configuration import AnchoredKinematicConfiguration
23
+ from wandelbots_api_client.v2.models.frame_reference import FrameReference
24
+ from wandelbots_api_client.v2.models.pose import Pose
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+ from pydantic_core import to_jsonable_python
28
+
29
+
30
+ class AnchoredPose(BaseModel):
31
+ """
32
+ A pose that states everything that decides where the robot goes: the frame it is expressed in, the tool it was taught with, and its arm posture. All three are required, and none of them is implied by a missing or null value. It follows its frame if the frame is re-taught. Frame and tool are resolved by name when the pose is planned. The tool default is never the active tool of the motion group. A `dataset_frame` reference is only valid for a pose stored in a dataset and names a frame of that dataset (`DatasetFrame`). With a `specified` kinematic configuration, the pose reproduces the same posture. With an `unspecified` one, the planning endpoint determines the posture.
33
+ """ # noqa: E501
34
+
35
+ pose: Pose
36
+ frame: FrameReference
37
+ tcp: Annotated[str, Field(min_length=1, strict=True)] = Field(
38
+ description="Name of the TCP the pose was taught with, as configured on the motion group."
39
+ )
40
+ kinematic_configuration: AnchoredKinematicConfiguration
41
+ __properties: ClassVar[List[str]] = ["pose", "frame", "tcp", "kinematic_configuration"]
42
+
43
+ model_config = ConfigDict(
44
+ validate_by_name=True,
45
+ validate_by_alias=True,
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+ def to_str(self) -> str:
51
+ """Returns the string representation of the model using alias"""
52
+ return pprint.pformat(self.model_dump(by_alias=True))
53
+
54
+ def to_json(self) -> str:
55
+ """Returns the JSON representation of the model using alias"""
56
+ return json.dumps(to_jsonable_python(self.to_dict()))
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Optional[Self]:
60
+ """Create an instance of AnchoredPose from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self) -> Dict[str, Any]:
64
+ """Return the dictionary representation of the model using alias.
65
+
66
+ This has the following differences from calling pydantic's
67
+ `self.model_dump(by_alias=True)`:
68
+
69
+ * `None` is only added to the output dict for nullable fields that
70
+ were set at model initialization. Other fields with value `None`
71
+ are ignored.
72
+ """
73
+ excluded_fields: Set[str] = set([])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ # override the default output from pydantic by calling `to_dict()` of pose
81
+ if self.pose:
82
+ _dict["pose"] = self.pose.to_dict()
83
+ # override the default output from pydantic by calling `to_dict()` of frame
84
+ if self.frame:
85
+ _dict["frame"] = self.frame.to_dict()
86
+ # override the default output from pydantic by calling `to_dict()` of kinematic_configuration
87
+ if self.kinematic_configuration:
88
+ _dict["kinematic_configuration"] = self.kinematic_configuration.to_dict()
89
+ return _dict
90
+
91
+ @classmethod
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
+ """Create an instance of AnchoredPose from a dict"""
94
+ if obj is None:
95
+ return None
96
+
97
+ if not isinstance(obj, dict):
98
+ return cls.model_validate(obj)
99
+
100
+ _obj = cls.model_validate(
101
+ {
102
+ "pose": Pose.from_dict(obj["pose"]) if obj.get("pose") is not None else None,
103
+ "frame": FrameReference.from_dict(obj["frame"]) if obj.get("frame") is not None else None,
104
+ "tcp": obj.get("tcp"),
105
+ "kinematic_configuration": AnchoredKinematicConfiguration.from_dict(obj["kinematic_configuration"])
106
+ if obj.get("kinematic_configuration") is not None
107
+ else None,
108
+ }
109
+ )
110
+ return _obj
@@ -53,8 +53,7 @@ class CommandRoutine(BaseModel):
53
53
  description="Specifies the baseline motion group setup or declares an I/O-only routine when set to `null`."
54
54
  )
55
55
  tcp: Optional[StrictStr] = Field(
56
- default=None,
57
- description="Specifies the routine-level tool-center-point identifier. It is absent when no motion group context exists.",
56
+ default=None, description="Specifies the routine-level TCP identifier. It is absent when no motion group context exists."
58
57
  )
59
58
  start_joint_position: Optional[List[Union[StrictFloat, StrictInt]]] = Field(
60
59
  default=None,
@@ -16,7 +16,7 @@ import pprint
16
16
  import re # noqa: F401
17
17
  import json
18
18
 
19
- from pydantic import BaseModel, ConfigDict, Field, StrictStr
19
+ from pydantic import BaseModel, ConfigDict
20
20
  from typing import Any, ClassVar, Dict, List, Optional
21
21
  from wandelbots_api_client.v2.models.kinematic_configuration import KinematicConfiguration
22
22
  from wandelbots_api_client.v2.models.pose import Pose
@@ -27,17 +27,12 @@ from pydantic_core import to_jsonable_python
27
27
 
28
28
  class ConfiguredPose(BaseModel):
29
29
  """
30
- A pose together with an optional kinematic configuration that resolves it to a unique robot posture. Optionally, the pose can be expressed relative to a frame. The kinematic configuration is optional because it is currently not supported for all robot types, e.g., cuspidal robots.
30
+ A pose together with an optional kinematic configuration that resolves it to a unique robot posture. The kinematic configuration is optional because it is currently not supported for all robot types, e.g., cuspidal robots.
31
31
  """ # noqa: E501
32
32
 
33
33
  pose: Pose
34
34
  kinematic_configuration: Optional[KinematicConfiguration] = None
35
- frame: Optional[StrictStr] = Field(
36
- default=None,
37
- description="Optional identifier of the frame the pose is expressed in. If this is null or omitted, the pose is referenced in `world`. ",
38
- json_schema_extra={"examples": ["tool-frame"]},
39
- )
40
- __properties: ClassVar[List[str]] = ["pose", "kinematic_configuration", "frame"]
35
+ __properties: ClassVar[List[str]] = ["pose", "kinematic_configuration"]
41
36
 
42
37
  model_config = ConfigDict(
43
38
  validate_by_name=True,
@@ -99,7 +94,6 @@ class ConfiguredPose(BaseModel):
99
94
  "kinematic_configuration": KinematicConfiguration.from_dict(obj["kinematic_configuration"])
100
95
  if obj.get("kinematic_configuration") is not None
101
96
  else None,
102
- "frame": obj.get("frame"),
103
97
  }
104
98
  )
105
99
  return _obj
@@ -0,0 +1,102 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Wandelbots NOVA API
5
+
6
+ Interact with robots in an easy and intuitive way.
7
+
8
+ The version of the OpenAPI document: 2.9.0 dev
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+ import pprint
16
+ import re # noqa: F401
17
+ import json
18
+
19
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
20
+ from typing import Any, ClassVar, Dict, List
21
+ from typing_extensions import Annotated
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+ from pydantic_core import to_jsonable_python
25
+
26
+
27
+ class DatasetFrameReference(BaseModel):
28
+ """
29
+ References a frame of the enclosing dataset.
30
+ """ # noqa: E501
31
+
32
+ type: StrictStr = Field(description="Identifies the dataset frame-reference variant.")
33
+ frame: Annotated[str, Field(strict=True)] = Field(
34
+ description="Unique identifier of a frame within a dataset. Must start with a letter and may only contain letters, digits, and hyphens. ",
35
+ json_schema_extra={"examples": ["tool-frame"]},
36
+ )
37
+ __properties: ClassVar[List[str]] = ["type", "frame"]
38
+
39
+ @field_validator("type")
40
+ def type_validate_enum(cls, value):
41
+ """Validates the enum"""
42
+ if value not in set(["dataset_frame"]):
43
+ raise ValueError("must be one of enum values ('dataset_frame')")
44
+ return value
45
+
46
+ @field_validator("frame")
47
+ def frame_validate_regular_expression(cls, value):
48
+ """Validates the regular expression"""
49
+ if not re.match(r"^[A-Za-z][A-Za-z0-9-]*$", value):
50
+ raise ValueError(r"must validate the regular expression /^[A-Za-z][A-Za-z0-9-]*$/")
51
+ return value
52
+
53
+ model_config = ConfigDict(
54
+ validate_by_name=True,
55
+ validate_by_alias=True,
56
+ validate_assignment=True,
57
+ protected_namespaces=(),
58
+ )
59
+
60
+ def to_str(self) -> str:
61
+ """Returns the string representation of the model using alias"""
62
+ return pprint.pformat(self.model_dump(by_alias=True))
63
+
64
+ def to_json(self) -> str:
65
+ """Returns the JSON representation of the model using alias"""
66
+ return json.dumps(to_jsonable_python(self.to_dict()))
67
+
68
+ @classmethod
69
+ def from_json(cls, json_str: str) -> Optional[Self]:
70
+ """Create an instance of DatasetFrameReference from a JSON string"""
71
+ return cls.from_dict(json.loads(json_str))
72
+
73
+ def to_dict(self) -> Dict[str, Any]:
74
+ """Return the dictionary representation of the model using alias.
75
+
76
+ This has the following differences from calling pydantic's
77
+ `self.model_dump(by_alias=True)`:
78
+
79
+ * `None` is only added to the output dict for nullable fields that
80
+ were set at model initialization. Other fields with value `None`
81
+ are ignored.
82
+ """
83
+ excluded_fields: Set[str] = set([])
84
+
85
+ _dict = self.model_dump(
86
+ by_alias=True,
87
+ exclude=excluded_fields,
88
+ exclude_none=True,
89
+ )
90
+ return _dict
91
+
92
+ @classmethod
93
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
94
+ """Create an instance of DatasetFrameReference from a dict"""
95
+ if obj is None:
96
+ return None
97
+
98
+ if not isinstance(obj, dict):
99
+ return cls.model_validate(obj)
100
+
101
+ _obj = cls.model_validate({"type": obj.get("type"), "frame": obj.get("frame")})
102
+ return _obj
@@ -20,7 +20,8 @@ from datetime import datetime
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
22
  from typing_extensions import Annotated
23
- from wandelbots_api_client.v2.models.kinematic_configuration import KinematicConfiguration
23
+ from wandelbots_api_client.v2.models.anchored_kinematic_configuration import AnchoredKinematicConfiguration
24
+ from wandelbots_api_client.v2.models.frame_reference import FrameReference
24
25
  from wandelbots_api_client.v2.models.pose import Pose
25
26
  from typing import Optional, Set
26
27
  from typing_extensions import Self
@@ -29,16 +30,15 @@ from pydantic_core import to_jsonable_python
29
30
 
30
31
  class DatasetPose(BaseModel):
31
32
  """
32
- A dataset pose is a taught pose that belongs to a dataset. It extends the shared `ConfiguredPose` with dataset-specific fields such as an identifier, human-readable name, timestamps, and metadata.
33
+ A dataset pose is a pose that belongs to a dataset. It extends `AnchoredPose` with information about the dataset, e.g., identifier, name, timestamps, and metadata. A `dataset_frame` in `frame` names a frame of this dataset.
33
34
  """ # noqa: E501
34
35
 
35
36
  pose: Pose
36
- kinematic_configuration: Optional[KinematicConfiguration] = None
37
- frame: Optional[StrictStr] = Field(
38
- default=None,
39
- description="Optional identifier of the frame the pose is expressed in. If this is null or omitted, the pose is referenced in `world`. ",
40
- json_schema_extra={"examples": ["tool-frame"]},
37
+ frame: FrameReference
38
+ tcp: Annotated[str, Field(min_length=1, strict=True)] = Field(
39
+ description="Name of the TCP the pose was taught with, as configured on the motion group."
41
40
  )
41
+ kinematic_configuration: AnchoredKinematicConfiguration
42
42
  dataset_pose: Annotated[str, Field(strict=True)] = Field(
43
43
  description="Unique identifier of the pose within the dataset. Must start with a letter and may only contain letters, digits, and hyphens. ",
44
44
  json_schema_extra={"examples": ["start-position"]},
@@ -56,8 +56,9 @@ class DatasetPose(BaseModel):
56
56
  )
57
57
  __properties: ClassVar[List[str]] = [
58
58
  "pose",
59
- "kinematic_configuration",
60
59
  "frame",
60
+ "tcp",
61
+ "kinematic_configuration",
61
62
  "dataset_pose",
62
63
  "dataset",
63
64
  "name",
@@ -121,6 +122,9 @@ class DatasetPose(BaseModel):
121
122
  # override the default output from pydantic by calling `to_dict()` of pose
122
123
  if self.pose:
123
124
  _dict["pose"] = self.pose.to_dict()
125
+ # override the default output from pydantic by calling `to_dict()` of frame
126
+ if self.frame:
127
+ _dict["frame"] = self.frame.to_dict()
124
128
  # override the default output from pydantic by calling `to_dict()` of kinematic_configuration
125
129
  if self.kinematic_configuration:
126
130
  _dict["kinematic_configuration"] = self.kinematic_configuration.to_dict()
@@ -138,10 +142,11 @@ class DatasetPose(BaseModel):
138
142
  _obj = cls.model_validate(
139
143
  {
140
144
  "pose": Pose.from_dict(obj["pose"]) if obj.get("pose") is not None else None,
141
- "kinematic_configuration": KinematicConfiguration.from_dict(obj["kinematic_configuration"])
145
+ "frame": FrameReference.from_dict(obj["frame"]) if obj.get("frame") is not None else None,
146
+ "tcp": obj.get("tcp"),
147
+ "kinematic_configuration": AnchoredKinematicConfiguration.from_dict(obj["kinematic_configuration"])
142
148
  if obj.get("kinematic_configuration") is not None
143
149
  else None,
144
- "frame": obj.get("frame"),
145
150
  "dataset_pose": obj.get("dataset_pose"),
146
151
  "dataset": obj.get("dataset"),
147
152
  "name": obj.get("name"),
@@ -20,7 +20,7 @@ from datetime import datetime
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
22
  from typing_extensions import Annotated
23
- from wandelbots_api_client.v2.models.configured_pose import ConfiguredPose
23
+ from wandelbots_api_client.v2.models.anchored_pose import AnchoredPose
24
24
  from typing import Optional, Set
25
25
  from typing_extensions import Self
26
26
  from pydantic_core import to_jsonable_python
@@ -41,7 +41,7 @@ class DatasetPoseReference(BaseModel):
41
41
  description="Unique identifier of the pose within the dataset. Must start with a letter and may only contain letters, digits, and hyphens. ",
42
42
  json_schema_extra={"examples": ["start-position"]},
43
43
  )
44
- resolved_pose: Optional[ConfiguredPose] = None
44
+ resolved_pose: Optional[AnchoredPose] = None
45
45
  resolved_at: Optional[datetime] = Field(default=None, description="Records when the cached pose was resolved.")
46
46
  source_revision: Optional[StrictStr] = Field(default=None, description="Records the source revision used to resolve the cached pose.")
47
47
  metadata: Optional[Dict[str, StrictStr]] = Field(
@@ -136,7 +136,7 @@ class DatasetPoseReference(BaseModel):
136
136
  "cell": obj.get("cell"),
137
137
  "dataset": obj.get("dataset"),
138
138
  "dataset_pose": obj.get("dataset_pose"),
139
- "resolved_pose": ConfiguredPose.from_dict(obj["resolved_pose"]) if obj.get("resolved_pose") is not None else None,
139
+ "resolved_pose": AnchoredPose.from_dict(obj["resolved_pose"]) if obj.get("resolved_pose") is not None else None,
140
140
  "resolved_at": obj.get("resolved_at"),
141
141
  "source_revision": obj.get("source_revision"),
142
142
  "metadata": obj.get("metadata"),