wandelbots-nova 0.2.0__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/PKG-INFO +1 -1
  2. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/nova/__init__.py +8 -8
  3. wandelbots_nova-0.2.0/nova/types/action.py → wandelbots_nova-0.2.2/nova/actions.py +38 -1
  4. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/nova/core/motion_group.py +5 -10
  5. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/nova/core/movement_controller.py +2 -2
  6. wandelbots_nova-0.2.2/nova/types/__init__.py +22 -0
  7. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/nova/types/collision_scene.py +0 -27
  8. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/pyproject.toml +1 -1
  9. wandelbots_nova-0.2.0/nova/types/__init__.py +0 -42
  10. wandelbots_nova-0.2.0/nova/types/movement_controller_context.py +0 -8
  11. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/LICENSE +0 -0
  12. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/README.md +0 -0
  13. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/nova/core/__init__.py +0 -0
  14. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/nova/core/controller.py +0 -0
  15. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/nova/core/exceptions.py +0 -0
  16. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/nova/core/nova.py +0 -0
  17. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/nova/gateway.py +0 -0
  18. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/nova/types/pose.py +0 -0
  19. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/nova/types/state.py +0 -0
  20. {wandelbots_nova-0.2.0 → wandelbots_nova-0.2.2}/nova/types/vector3d.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wandelbots-nova
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Official Python SDK for the Wandelbots
5
5
  Author: Wandelbots GmbH
6
6
  Requires-Python: >=3.10,<4.0
@@ -1,20 +1,20 @@
1
1
  from nova.core.nova import Nova, Cell
2
2
  from nova.core.motion_group import MotionGroup
3
3
  from nova.core.controller import Controller
4
- from nova.types.pose import Pose
5
- from nova.types.action import Action, lin, ptp, jnt, cir
4
+ from nova import types
5
+ from nova import actions
6
6
  from nova.core.movement_controller import speed_up as speed_up_movement_controller
7
7
 
8
+ # Provide autogenerated NOVA API client
9
+ import wandelbots_api_client as api
10
+
8
11
  __all__ = [
9
12
  "Nova",
10
13
  "Cell",
11
14
  "MotionGroup",
12
15
  "Controller",
13
- "lin",
14
- "ptp",
15
- "jnt",
16
- "cir",
17
- "Action",
18
- "Pose",
19
16
  "speed_up_movement_controller",
17
+ "api",
18
+ "types",
19
+ "actions",
20
20
  ]
@@ -1,6 +1,7 @@
1
1
  import pydantic
2
- from typing import Annotated, Literal, Any, Union
2
+ from typing import Annotated, Literal, Any, Union, AsyncGenerator, Callable
3
3
  from nova.types.pose import Pose
4
+ from nova.types.collision_scene import CollisionScene
4
5
  import wandelbots_api_client as wb
5
6
  from abc import ABC, abstractmethod
6
7
 
@@ -101,6 +102,29 @@ class Motion(Action, ABC):
101
102
  return isinstance(self.target, Pose)
102
103
 
103
104
 
105
+ class UnresolvedMotion(Motion, ABC):
106
+ @abstractmethod
107
+ async def resolve(
108
+ self,
109
+ initial_joints: tuple[float, ...],
110
+ collision_scene: CollisionScene | None,
111
+ configuration: dict,
112
+ moving_robot_identifier: str,
113
+ ) -> tuple[list[Motion], tuple[float, ...]] | None:
114
+ """Convert the motion to a list of motion primitives
115
+
116
+ Args:
117
+ initial_joints: Joint positions at start of motion
118
+ collision_scene: The collision scene used to check collisions
119
+ configuration: E.g. data of physical setup of robot system, cell, etc.
120
+ moving_robot_identifier: The identifier of the robot that is moving in the scene
121
+
122
+ Returns:
123
+ Tuple of resolved motions and the joint position at the end of the motions. None, if the motion can't be resolved
124
+
125
+ """
126
+
127
+
104
128
  class Linear(Motion):
105
129
  """A linear motion
106
130
 
@@ -462,3 +486,16 @@ class CombinedActions(pydantic.BaseModel):
462
486
  )
463
487
  for action in self.actions
464
488
  ]
489
+
490
+
491
+ class MovementControllerContext(pydantic.BaseModel):
492
+ combined_actions: CombinedActions
493
+ motion_id: str
494
+
495
+
496
+ ExecuteTrajectoryRequestStream = AsyncGenerator[wb.models.ExecuteTrajectoryRequest, None]
497
+ ExecuteTrajectoryResponseStream = AsyncGenerator[wb.models.ExecuteTrajectoryResponse, None]
498
+ MovementControllerFunction = Callable[
499
+ [ExecuteTrajectoryResponseStream], ExecuteTrajectoryRequestStream
500
+ ]
501
+ MovementController = Callable[[MovementControllerContext], MovementControllerFunction]
@@ -1,17 +1,12 @@
1
1
  from nova.core.exceptions import PlanTrajectoryFailed, LoadPlanFailed
2
2
  from nova.gateway import ApiGateway
3
- from nova.types.action import Action, CombinedActions
3
+ from nova.actions import Action, CombinedActions, MovementController, MovementControllerContext
4
4
  from nova.types.pose import Pose
5
- from nova.types import (
6
- MovementController,
7
- LoadPlanResponse,
8
- InitialMovementStream,
9
- InitialMovementConsumer,
10
- )
5
+ from nova.types import LoadPlanResponse, InitialMovementStream, InitialMovementConsumer
11
6
  from loguru import logger
12
7
  import wandelbots_api_client as wb
13
8
 
14
- from nova.core.movement_controller import move_forward, MovementControllerContext
9
+ from nova.core.movement_controller import move_forward
15
10
 
16
11
  MAX_JOINT_VELOCITY_PREPARE_MOVE = 0.2
17
12
  START_LOCATION_OF_MOTION = 0.0
@@ -65,7 +60,7 @@ class MotionGroup:
65
60
  raise ValueError("No actions provided")
66
61
 
67
62
  # PLAN MOTION
68
- joint_trajectory = await self._plan(actions, tcp)
63
+ joint_trajectory = await self.plan(actions, tcp)
69
64
 
70
65
  # LOAD MOTION
71
66
  load_plan_response = await self._load_planned_motion(joint_trajectory, tcp)
@@ -110,7 +105,7 @@ class MotionGroup:
110
105
  cell=self._cell, motion_group=self._motion_group_id, tcp=tcp
111
106
  )
112
107
 
113
- async def _plan(self, actions: list[Action], tcp: str) -> wb.models.JointTrajectory:
108
+ async def plan(self, actions: list[Action], tcp: str) -> wb.models.JointTrajectory:
114
109
  current_joints = await self.joints(tcp=tcp)
115
110
  robot_setup = await self._get_optimizer_setup(tcp=tcp)
116
111
  motion_commands = CombinedActions(items=actions).to_motion_command()
@@ -1,9 +1,9 @@
1
1
  from nova.core.exceptions import InitMovementFailed
2
- from nova.types.movement_controller_context import MovementControllerContext
3
- from nova.types import (
2
+ from nova.actions import (
4
3
  MovementControllerFunction,
5
4
  ExecuteTrajectoryResponseStream,
6
5
  ExecuteTrajectoryRequestStream,
6
+ MovementControllerContext,
7
7
  )
8
8
  import wandelbots_api_client as wb
9
9
  from loguru import logger
@@ -0,0 +1,22 @@
1
+ from nova.types.pose import Pose
2
+ from nova.types.vector3d import Vector3d
3
+ from nova.types.collision_scene import CollisionScene
4
+
5
+
6
+ # This is the stream of requests that is send to execute trajectory websocket
7
+ from typing import AsyncGenerator, Callable
8
+ import wandelbots_api_client as wb
9
+
10
+ LoadPlanResponse = wb.models.PlanSuccessfulResponse
11
+ InitialMovementStream = AsyncGenerator[wb.models.StreamMoveResponse, None]
12
+ InitialMovementConsumer = Callable[[wb.models.StreamMoveResponse], None]
13
+
14
+
15
+ __all__ = [
16
+ "Vector3d",
17
+ "Pose",
18
+ "CollisionScene",
19
+ "LoadPlanResponse",
20
+ "InitialMovementStream",
21
+ "InitialMovementConsumer",
22
+ ]
@@ -1,10 +1,8 @@
1
- from abc import ABC, abstractmethod
2
1
  from typing import Literal
3
2
 
4
3
  import pydantic
5
4
  import wandelbots_api_client as wb
6
5
  from nova.types.pose import Pose
7
- from nova.types.action import Motion
8
6
 
9
7
 
10
8
  class DhParameter(pydantic.BaseModel):
@@ -130,30 +128,6 @@ scene = read(arg...)
130
128
  add_static_collider(scene, "box", Box(size_x=1, size_y=1, size_z=1), Pose.from_tuple([0, 0, 0, 0, 0, 0]))
131
129
  """
132
130
 
133
-
134
- class UnresolvedMotion(Motion, ABC):
135
- @abstractmethod
136
- async def resolve(
137
- self,
138
- initial_joints: tuple[float, ...],
139
- collision_scene: CollisionScene | None,
140
- configuration: dict,
141
- moving_robot_identifier: str,
142
- ) -> tuple[list[Motion], tuple[float, ...]] | None:
143
- """Convert the motion to a list of motion primitives
144
-
145
- Args:
146
- initial_joints: Joint positions at start of motion
147
- collision_scene: The collision scene used to check collisions
148
- configuration: E.g. data of physical setup of robot system, cell, etc.
149
- moving_robot_identifier: The identifier of the robot that is moving in the scene
150
-
151
- Returns:
152
- Tuple of resolved motions and the joint position at the end of the motions. None, if the motion can't be resolved
153
-
154
- """
155
-
156
-
157
131
  __all__ = [
158
132
  "Box",
159
133
  "Capsule",
@@ -167,5 +141,4 @@ __all__ = [
167
141
  "Rectangle",
168
142
  "RectangularCapsule",
169
143
  "Sphere",
170
- "UnresolvedMotion",
171
144
  ]
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "wandelbots-nova"
3
- version = "0.2.0"
3
+ version = "0.2.2"
4
4
  description = "Official Python SDK for the Wandelbots"
5
5
  authors = [
6
6
  "Wandelbots GmbH",
@@ -1,42 +0,0 @@
1
- from wandelbots_api_client.models import * # noqa: F401, F403
2
- from nova.types.pose import Pose
3
- from nova.types.vector3d import Vector3d
4
- from nova.types.action import Action, Motion, MotionSettings, lin, spl, ptp, cir, jnt
5
-
6
-
7
- # This is the stream of requests that is send to execute trajectory websocket
8
- from typing import AsyncGenerator, Callable
9
- import wandelbots_api_client as wb
10
-
11
- from nova.types.movement_controller_context import MovementControllerContext
12
-
13
- ExecuteTrajectoryRequestStream = AsyncGenerator[wb.models.ExecuteTrajectoryRequest, None]
14
- ExecuteTrajectoryResponseStream = AsyncGenerator[wb.models.ExecuteTrajectoryResponse, None]
15
- MovementControllerFunction = Callable[
16
- [ExecuteTrajectoryResponseStream], ExecuteTrajectoryRequestStream
17
- ]
18
- LoadPlanResponse = wb.models.PlanSuccessfulResponse
19
- InitialMovementStream = AsyncGenerator[wb.models.StreamMoveResponse, None]
20
- InitialMovementConsumer = Callable[[wb.models.StreamMoveResponse], None]
21
- MovementController = Callable[[MovementControllerContext], MovementControllerFunction]
22
-
23
-
24
- __all__ = [
25
- "Vector3d",
26
- "Pose",
27
- "Motion",
28
- "MotionSettings",
29
- "lin",
30
- "spl",
31
- "ptp",
32
- "cir",
33
- "jnt",
34
- "Action",
35
- "ExecuteTrajectoryRequestStream",
36
- "ExecuteTrajectoryResponseStream",
37
- "MovementControllerFunction",
38
- "LoadPlanResponse",
39
- "InitialMovementStream",
40
- "InitialMovementConsumer",
41
- "MovementController",
42
- ]
@@ -1,8 +0,0 @@
1
- import pydantic
2
-
3
- from nova.types.action import CombinedActions
4
-
5
-
6
- class MovementControllerContext(pydantic.BaseModel):
7
- combined_actions: CombinedActions
8
- motion_id: str
File without changes