viam-sdk 0.41.1__py3-none-linux_armv6l.whl → 0.66.0__py3-none-linux_armv6l.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 viam-sdk might be problematic. Click here for more details.
- viam/app/app_client.py +225 -51
- viam/app/billing_client.py +47 -5
- viam/app/data_client.py +771 -234
- viam/app/ml_training_client.py +3 -5
- viam/app/provisioning_client.py +3 -5
- viam/app/viam_client.py +58 -11
- viam/components/arm/arm.py +1 -1
- viam/components/arm/service.py +1 -1
- viam/components/audio_in/__init__.py +24 -0
- viam/components/audio_in/audio_in.py +74 -0
- viam/components/audio_in/client.py +76 -0
- viam/components/audio_in/service.py +83 -0
- viam/components/audio_out/__init__.py +21 -0
- viam/components/audio_out/audio_out.py +72 -0
- viam/components/audio_out/client.py +67 -0
- viam/components/audio_out/service.py +63 -0
- viam/components/base/base.py +1 -1
- viam/components/board/board.py +8 -2
- viam/components/board/client.py +2 -1
- viam/components/board/service.py +1 -0
- viam/components/button/__init__.py +10 -0
- viam/components/button/button.py +41 -0
- viam/components/button/client.py +52 -0
- viam/components/button/service.py +46 -0
- viam/components/camera/camera.py +15 -30
- viam/components/camera/client.py +10 -21
- viam/components/camera/service.py +15 -28
- viam/components/component_base.py +2 -2
- viam/components/gantry/client.py +17 -2
- viam/components/gantry/gantry.py +32 -1
- viam/components/gantry/service.py +21 -5
- viam/components/gripper/__init__.py +2 -0
- viam/components/gripper/client.py +25 -2
- viam/components/gripper/gripper.py +76 -1
- viam/components/gripper/service.py +32 -3
- viam/components/input/input.py +1 -1
- viam/components/motor/motor.py +1 -1
- viam/components/power_sensor/power_sensor.py +1 -1
- viam/components/switch/__init__.py +10 -0
- viam/components/switch/client.py +83 -0
- viam/components/switch/service.py +72 -0
- viam/components/switch/switch.py +98 -0
- viam/gen/app/agent/v1/agent_pb2.py +1 -1
- viam/gen/app/cloudslam/v1/cloud_slam_pb2.py +1 -1
- viam/gen/app/data/v1/data_grpc.py +74 -2
- viam/gen/app/data/v1/data_pb2.py +198 -104
- viam/gen/app/data/v1/data_pb2.pyi +563 -31
- viam/gen/app/datapipelines/__init__.py +0 -0
- viam/gen/app/datapipelines/v1/__init__.py +0 -0
- viam/gen/app/datapipelines/v1/data_pipelines_grpc.py +84 -0
- viam/gen/app/datapipelines/v1/data_pipelines_pb2.py +57 -0
- viam/gen/app/datapipelines/v1/data_pipelines_pb2.pyi +387 -0
- viam/gen/app/dataset/v1/dataset_grpc.py +10 -2
- viam/gen/app/dataset/v1/dataset_pb2.py +8 -4
- viam/gen/app/dataset/v1/dataset_pb2.pyi +36 -1
- viam/gen/app/datasync/v1/data_sync_pb2.py +39 -35
- viam/gen/app/datasync/v1/data_sync_pb2.pyi +21 -8
- viam/gen/app/mlinference/v1/ml_inference_pb2.py +7 -7
- viam/gen/app/mlinference/v1/ml_inference_pb2.pyi +4 -2
- viam/gen/app/mltraining/v1/ml_training_grpc.py +10 -2
- viam/gen/app/mltraining/v1/ml_training_pb2.py +63 -43
- viam/gen/app/mltraining/v1/ml_training_pb2.pyi +112 -7
- viam/gen/app/packages/v1/packages_pb2.py +1 -1
- viam/gen/app/v1/app_grpc.py +74 -3
- viam/gen/app/v1/app_pb2.py +600 -545
- viam/gen/app/v1/app_pb2.pyi +1108 -258
- viam/gen/app/v1/billing_grpc.py +26 -2
- viam/gen/app/v1/billing_pb2.py +52 -36
- viam/gen/app/v1/billing_pb2.pyi +158 -4
- viam/gen/app/v1/end_user_pb2.py +1 -1
- viam/gen/app/v1/robot_pb2.py +95 -89
- viam/gen/app/v1/robot_pb2.pyi +121 -9
- viam/gen/common/v1/common_pb2.py +76 -58
- viam/gen/common/v1/common_pb2.pyi +186 -17
- viam/gen/component/arm/v1/arm_grpc.py +10 -2
- viam/gen/component/arm/v1/arm_pb2.py +5 -3
- viam/gen/component/audioin/__init__.py +0 -0
- viam/gen/component/audioin/v1/__init__.py +0 -0
- viam/gen/component/audioin/v1/audioin_grpc.py +54 -0
- viam/gen/component/audioin/v1/audioin_pb2.py +34 -0
- viam/gen/component/audioin/v1/audioin_pb2.pyi +94 -0
- viam/gen/component/audioinput/v1/audioinput_pb2.py +1 -1
- viam/gen/component/audioout/__init__.py +0 -0
- viam/gen/component/audioout/v1/__init__.py +0 -0
- viam/gen/component/audioout/v1/audioout_grpc.py +54 -0
- viam/gen/component/audioout/v1/audioout_pb2.py +32 -0
- viam/gen/component/audioout/v1/audioout_pb2.pyi +47 -0
- viam/gen/component/base/v1/base_pb2.py +1 -1
- viam/gen/component/board/v1/board_pb2.py +1 -1
- viam/gen/component/button/v1/button_pb2.py +1 -1
- viam/gen/component/camera/v1/camera_grpc.py +1 -0
- viam/gen/component/camera/v1/camera_pb2.py +37 -36
- viam/gen/component/camera/v1/camera_pb2.pyi +31 -4
- viam/gen/component/encoder/v1/encoder_pb2.py +1 -1
- viam/gen/component/gantry/v1/gantry_grpc.py +9 -1
- viam/gen/component/gantry/v1/gantry_pb2.py +5 -3
- viam/gen/component/generic/v1/generic_pb2.py +1 -1
- viam/gen/component/gripper/v1/gripper_grpc.py +18 -2
- viam/gen/component/gripper/v1/gripper_pb2.py +12 -4
- viam/gen/component/gripper/v1/gripper_pb2.pyi +43 -1
- viam/gen/component/inputcontroller/v1/input_controller_pb2.py +1 -1
- viam/gen/component/motor/v1/motor_pb2.py +1 -1
- viam/gen/component/movementsensor/v1/movementsensor_pb2.py +1 -1
- viam/gen/component/posetracker/v1/pose_tracker_pb2.py +1 -1
- viam/gen/component/powersensor/v1/powersensor_pb2.py +1 -1
- viam/gen/component/sensor/v1/sensor_pb2.py +1 -1
- viam/gen/component/servo/v1/servo_pb2.py +1 -1
- viam/gen/component/switch/v1/switch_pb2.py +5 -5
- viam/gen/component/switch/v1/switch_pb2.pyi +9 -2
- viam/gen/component/testecho/v1/testecho_pb2.py +1 -1
- viam/gen/module/v1/module_pb2.py +5 -5
- viam/gen/module/v1/module_pb2.pyi +7 -2
- viam/gen/opentelemetry/__init__.py +0 -0
- viam/gen/opentelemetry/proto/__init__.py +0 -0
- viam/gen/opentelemetry/proto/common/__init__.py +0 -0
- viam/gen/opentelemetry/proto/common/v1/__init__.py +0 -0
- viam/gen/opentelemetry/proto/common/v1/common_grpc.py +0 -0
- viam/gen/opentelemetry/proto/common/v1/common_pb2.py +27 -0
- viam/gen/opentelemetry/proto/common/v1/common_pb2.pyi +208 -0
- viam/gen/opentelemetry/proto/resource/__init__.py +0 -0
- viam/gen/opentelemetry/proto/resource/v1/__init__.py +0 -0
- viam/gen/opentelemetry/proto/resource/v1/resource_grpc.py +0 -0
- viam/gen/opentelemetry/proto/resource/v1/resource_pb2.py +18 -0
- viam/gen/opentelemetry/proto/resource/v1/resource_pb2.pyi +59 -0
- viam/gen/opentelemetry/proto/trace/__init__.py +0 -0
- viam/gen/opentelemetry/proto/trace/v1/__init__.py +0 -0
- viam/gen/opentelemetry/proto/trace/v1/trace_grpc.py +0 -0
- viam/gen/opentelemetry/proto/trace/v1/trace_pb2.py +37 -0
- viam/gen/opentelemetry/proto/trace/v1/trace_pb2.pyi +402 -0
- viam/gen/proto/rpc/examples/echo/v1/echo_pb2.py +1 -1
- viam/gen/proto/rpc/examples/echoresource/v1/echoresource_pb2.py +1 -1
- viam/gen/proto/rpc/v1/auth_pb2.py +1 -1
- viam/gen/proto/rpc/webrtc/v1/grpc_pb2.py +1 -1
- viam/gen/proto/rpc/webrtc/v1/signaling_pb2.py +1 -1
- viam/gen/provisioning/v1/provisioning_grpc.py +10 -2
- viam/gen/provisioning/v1/provisioning_pb2.py +32 -26
- viam/gen/provisioning/v1/provisioning_pb2.pyi +46 -5
- viam/gen/robot/v1/robot_grpc.py +51 -34
- viam/gen/robot/v1/robot_pb2.py +147 -142
- viam/gen/robot/v1/robot_pb2.pyi +153 -86
- viam/gen/service/datamanager/v1/data_manager_grpc.py +11 -2
- viam/gen/service/datamanager/v1/data_manager_pb2.py +15 -8
- viam/gen/service/datamanager/v1/data_manager_pb2.pyi +47 -1
- viam/gen/service/discovery/v1/discovery_pb2.py +1 -1
- viam/gen/service/generic/v1/generic_pb2.py +1 -1
- viam/gen/service/mlmodel/v1/mlmodel_pb2.py +1 -1
- viam/gen/service/motion/v1/motion_pb2.py +92 -62
- viam/gen/service/motion/v1/motion_pb2.pyi +130 -68
- viam/gen/service/navigation/v1/navigation_pb2.py +1 -1
- viam/gen/service/sensors/v1/sensors_pb2.py +1 -1
- viam/gen/service/shell/v1/shell_pb2.py +1 -1
- viam/gen/service/slam/v1/slam_pb2.py +1 -1
- viam/gen/service/slam/v1/slam_pb2.pyi +1 -1
- viam/gen/service/video/__init__.py +0 -0
- viam/gen/service/video/v1/__init__.py +0 -0
- viam/gen/service/video/v1/video_grpc.py +39 -0
- viam/gen/service/video/v1/video_pb2.py +29 -0
- viam/gen/service/video/v1/video_pb2.pyi +72 -0
- viam/gen/service/vision/v1/vision_pb2.py +27 -27
- viam/gen/service/vision/v1/vision_pb2.pyi +28 -3
- viam/gen/service/worldstatestore/__init__.py +0 -0
- viam/gen/service/worldstatestore/v1/__init__.py +0 -0
- viam/gen/service/worldstatestore/v1/world_state_store_grpc.py +55 -0
- viam/gen/service/worldstatestore/v1/world_state_store_pb2.py +39 -0
- viam/gen/service/worldstatestore/v1/world_state_store_pb2.pyi +171 -0
- viam/gen/stream/v1/stream_pb2.py +1 -1
- viam/gen/tagger/v1/tagger_pb2.py +1 -1
- viam/logging.py +9 -8
- viam/media/audio.py +22 -10
- viam/media/utils/pil/__init__.py +5 -1
- viam/media/video.py +54 -40
- viam/module/module.py +85 -16
- viam/module/resource_data_consumer.py +41 -0
- viam/module/service.py +9 -1
- viam/proto/app/__init__.py +68 -0
- viam/proto/app/billing.py +16 -0
- viam/proto/app/data/__init__.py +48 -0
- viam/proto/app/datapipelines/__init__.py +56 -0
- viam/proto/app/dataset/__init__.py +4 -0
- viam/proto/app/mltraining/__init__.py +6 -0
- viam/proto/app/robot.py +6 -0
- viam/proto/common/__init__.py +14 -0
- viam/proto/component/audioin/__init__.py +16 -0
- viam/proto/component/audioout/__init__.py +15 -0
- viam/proto/component/camera/__init__.py +0 -2
- viam/proto/component/gripper/__init__.py +4 -0
- viam/proto/opentelemetry/__init__.py +0 -0
- viam/proto/opentelemetry/proto/__init__.py +0 -0
- viam/proto/opentelemetry/proto/common/__init__.py +15 -0
- viam/proto/opentelemetry/proto/resource/__init__.py +10 -0
- viam/proto/opentelemetry/proto/trace/__init__.py +15 -0
- viam/proto/provisioning/__init__.py +6 -0
- viam/proto/robot/__init__.py +16 -8
- viam/proto/service/datamanager/__init__.py +8 -1
- viam/proto/service/motion/__init__.py +2 -0
- viam/proto/service/video/__init__.py +15 -0
- viam/proto/service/worldstatestore/__init__.py +32 -0
- viam/resource/easy_resource.py +5 -9
- viam/resource/manager.py +4 -3
- viam/resource/registry.py +2 -2
- viam/resource/types.py +2 -2
- viam/robot/client.py +38 -59
- viam/rpc/dial.py +48 -5
- viam/rpc/libviam_rust_utils.so +0 -0
- viam/rpc/server.py +24 -10
- viam/services/motion/client.py +8 -9
- viam/services/motion/motion.py +48 -46
- viam/services/navigation/navigation.py +2 -2
- viam/services/vision/client.py +1 -1
- viam/services/vision/service.py +5 -8
- viam/services/vision/vision.py +5 -3
- viam/services/worldstatestore/__init__.py +18 -0
- viam/services/worldstatestore/client.py +94 -0
- viam/services/worldstatestore/service.py +55 -0
- viam/services/worldstatestore/worldstatestore.py +90 -0
- viam/sessions_client.py +115 -46
- viam/version_metadata.py +2 -2
- {viam_sdk-0.41.1.dist-info → viam_sdk-0.66.0.dist-info}/METADATA +10 -6
- {viam_sdk-0.41.1.dist-info → viam_sdk-0.66.0.dist-info}/RECORD +221 -152
- {viam_sdk-0.41.1.dist-info → viam_sdk-0.66.0.dist-info}/WHEEL +1 -1
- viam/components/audio_input/__init__.py +0 -18
- viam/components/audio_input/audio_input.py +0 -81
- viam/components/audio_input/client.py +0 -70
- viam/components/audio_input/service.py +0 -114
- {viam_sdk-0.41.1.dist-info → viam_sdk-0.66.0.dist-info}/licenses/LICENSE +0 -0
viam/services/motion/motion.py
CHANGED
|
@@ -7,7 +7,7 @@ if sys.version_info >= (3, 10):
|
|
|
7
7
|
else:
|
|
8
8
|
from typing_extensions import TypeAlias
|
|
9
9
|
|
|
10
|
-
from viam.proto.common import GeoGeometry, Geometry, GeoPoint, Pose, PoseInFrame,
|
|
10
|
+
from viam.proto.common import GeoGeometry, Geometry, GeoPoint, Pose, PoseInFrame, Transform, WorldState
|
|
11
11
|
from viam.proto.service.motion import Constraints, GetPlanResponse, MotionConfiguration, PlanStatusWithID
|
|
12
12
|
from viam.resource.types import API, RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_SERVICE
|
|
13
13
|
from viam.utils import ValueTypes
|
|
@@ -33,7 +33,7 @@ class Motion(ServiceBase):
|
|
|
33
33
|
@abc.abstractmethod
|
|
34
34
|
async def move(
|
|
35
35
|
self,
|
|
36
|
-
component_name:
|
|
36
|
+
component_name: str,
|
|
37
37
|
destination: PoseInFrame,
|
|
38
38
|
world_state: Optional[WorldState] = None,
|
|
39
39
|
constraints: Optional[Constraints] = None,
|
|
@@ -44,18 +44,17 @@ class Motion(ServiceBase):
|
|
|
44
44
|
"""Plan and execute a movement to move the component specified to its goal destination.
|
|
45
45
|
|
|
46
46
|
Note: Frames designated with respect to components can also be used as the ``component_name`` when calling for a move. This
|
|
47
|
-
technique allows for planning and moving the frame itself to the ``destination``.
|
|
48
|
-
|
|
47
|
+
technique allows for planning and moving the frame itself to the ``destination``.
|
|
48
|
+
To do so, simply pass in a string into ``component_name``. Ex::
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
success = await MotionServiceClient.move(resource_name, ...)
|
|
50
|
+
success = await MotionServiceClient.move("externalFrame", ...)
|
|
52
51
|
|
|
53
52
|
::
|
|
54
53
|
|
|
55
54
|
motion = MotionClient.from_robot(robot=machine, name="builtin")
|
|
56
55
|
|
|
57
|
-
# Assumes
|
|
58
|
-
gripper_name =
|
|
56
|
+
# Assumes "my_gripper" on the machine
|
|
57
|
+
gripper_name = "my_gripper"
|
|
59
58
|
my_frame = "my_gripper_offset"
|
|
60
59
|
|
|
61
60
|
goal_pose = Pose(x=0, y=0, z=300, o_x=0, o_y=0, o_z=1, theta=0)
|
|
@@ -69,13 +68,21 @@ class Motion(ServiceBase):
|
|
|
69
68
|
extra={})
|
|
70
69
|
|
|
71
70
|
Args:
|
|
72
|
-
component_name (
|
|
71
|
+
component_name (str): Name of a component on a given robot.
|
|
73
72
|
destination (viam.proto.common.PoseInFrame): The destination to move to, expressed as a ``Pose`` and the frame in which it was
|
|
74
73
|
observed.
|
|
75
74
|
world_state (viam.proto.common.WorldState): When supplied, the motion service will create a plan that obeys any constraints
|
|
76
75
|
expressed in the WorldState message.
|
|
77
76
|
constraints (viam.proto.service.motion.Constraints): When supplied, the motion service will create a plan that obeys any
|
|
78
|
-
specified constraints.
|
|
77
|
+
specified constraints. These can include:
|
|
78
|
+
- LinearConstraint: Specifies that the component being moved should move linearly relative to its goal.
|
|
79
|
+
- OrientationConstraint: Specifies that the component being moved will not deviate its orientation beyond some threshold
|
|
80
|
+
relative to the goal.
|
|
81
|
+
- CollisionSpecification: Used to selectively apply obstacle avoidance to specific parts of the robot.
|
|
82
|
+
- PseudolinearConstraint: Specifies that the component being moved should not deviate from the straight-line path to their
|
|
83
|
+
goal by more than a factor proportional to the distance from start to goal. For example, if a component is moving 100mm,
|
|
84
|
+
then a LineToleranceFactor of 1.0 means that the component will remain within a 100mm radius of the straight-line
|
|
85
|
+
start-goal path.
|
|
79
86
|
|
|
80
87
|
Returns:
|
|
81
88
|
bool: Whether the move was successful.
|
|
@@ -87,9 +94,9 @@ class Motion(ServiceBase):
|
|
|
87
94
|
@abc.abstractmethod
|
|
88
95
|
async def move_on_globe(
|
|
89
96
|
self,
|
|
90
|
-
component_name:
|
|
97
|
+
component_name: str,
|
|
91
98
|
destination: GeoPoint,
|
|
92
|
-
movement_sensor_name:
|
|
99
|
+
movement_sensor_name: str,
|
|
93
100
|
obstacles: Optional[Sequence[GeoGeometry]] = None,
|
|
94
101
|
heading: Optional[float] = None,
|
|
95
102
|
configuration: Optional[MotionConfiguration] = None,
|
|
@@ -112,24 +119,23 @@ class Motion(ServiceBase):
|
|
|
112
119
|
|
|
113
120
|
motion = MotionClient.from_robot(robot=machine, name="builtin")
|
|
114
121
|
|
|
115
|
-
# Get the
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"my_movement_sensor")
|
|
122
|
+
# Get the names of the base and movement sensor
|
|
123
|
+
my_base_name = "my_base"
|
|
124
|
+
mvmnt_sensor_name = "my_movement_sensor"
|
|
119
125
|
# Define a destination GeoPoint at the GPS coordinates [0, 0]
|
|
120
126
|
my_destination = movement_sensor.GeoPoint(latitude=0, longitude=0)
|
|
121
127
|
|
|
122
128
|
# Move the base component to the designated geographic location, as reported by the movement sensor
|
|
123
129
|
execution_id = await motion.move_on_globe(
|
|
124
|
-
component_name=
|
|
130
|
+
component_name=my_base_name,
|
|
125
131
|
destination=my_destination,
|
|
126
|
-
movement_sensor_name=
|
|
132
|
+
movement_sensor_name=mvmnt_sensor_name)
|
|
127
133
|
|
|
128
134
|
Args:
|
|
129
|
-
component_name (
|
|
135
|
+
component_name (str): The name of the base to move.
|
|
130
136
|
destination (GeoPoint): The location of the component's destination, represented in geographic notation as a
|
|
131
137
|
GeoPoint (lat, lng).
|
|
132
|
-
movement_sensor_name (
|
|
138
|
+
movement_sensor_name (str): The name of the movement sensor that you want to use to check
|
|
133
139
|
the machine's location.
|
|
134
140
|
obstacles (Optional[Sequence[GeoGeometry]]): Obstacles to consider when planning the motion of the component,
|
|
135
141
|
with each represented as a GeoGeometry. Default: None
|
|
@@ -162,9 +168,9 @@ class Motion(ServiceBase):
|
|
|
162
168
|
@abc.abstractmethod
|
|
163
169
|
async def move_on_map(
|
|
164
170
|
self,
|
|
165
|
-
component_name:
|
|
171
|
+
component_name: str,
|
|
166
172
|
destination: Pose,
|
|
167
|
-
slam_service_name:
|
|
173
|
+
slam_service_name: str,
|
|
168
174
|
configuration: Optional[MotionConfiguration] = None,
|
|
169
175
|
obstacles: Optional[Sequence[Geometry]] = None,
|
|
170
176
|
*,
|
|
@@ -186,23 +192,23 @@ class Motion(ServiceBase):
|
|
|
186
192
|
|
|
187
193
|
motion = MotionClient.from_robot(robot=machine, name="builtin")
|
|
188
194
|
|
|
189
|
-
# Get the
|
|
190
|
-
|
|
191
|
-
my_slam_service_name =
|
|
195
|
+
# Get the names of the base component and SLAM service
|
|
196
|
+
my_base_name = "my_base"
|
|
197
|
+
my_slam_service_name = "my_slam_service"
|
|
192
198
|
|
|
193
199
|
# Define a destination pose with respect to the origin of the map from the SLAM service "my_slam_service"
|
|
194
200
|
my_pose = Pose(y=10)
|
|
195
201
|
|
|
196
202
|
# Move the base component to the destination pose of Y=10, a location of
|
|
197
203
|
# (0, 10, 0) in respect to the origin of the map
|
|
198
|
-
execution_id = await motion.move_on_map(component_name=
|
|
204
|
+
execution_id = await motion.move_on_map(component_name=my_base_name,
|
|
199
205
|
destination=my_pose,
|
|
200
206
|
slam_service_name=my_slam_service_name)
|
|
201
207
|
|
|
202
208
|
Args:
|
|
203
|
-
component_name (
|
|
209
|
+
component_name (str): The name of the base to move.
|
|
204
210
|
destination (Pose): The destination, which can be any Pose with respect to the SLAM map's origin.
|
|
205
|
-
slam_service_name (
|
|
211
|
+
slam_service_name (str): The name of the SLAM service from which the SLAM map is requested.
|
|
206
212
|
configuration (Optional[MotionConfiguration]): The configuration you want to set across this machine for this motion service.
|
|
207
213
|
This parameter and each of its fields are optional.
|
|
208
214
|
|
|
@@ -229,7 +235,7 @@ class Motion(ServiceBase):
|
|
|
229
235
|
@abc.abstractmethod
|
|
230
236
|
async def stop_plan(
|
|
231
237
|
self,
|
|
232
|
-
component_name:
|
|
238
|
+
component_name: str,
|
|
233
239
|
*,
|
|
234
240
|
extra: Optional[Mapping[str, ValueTypes]] = None,
|
|
235
241
|
timeout: Optional[float] = None,
|
|
@@ -243,11 +249,11 @@ class Motion(ServiceBase):
|
|
|
243
249
|
# Assuming a `move_on_globe()` started the execution
|
|
244
250
|
# Stop the base component which was instructed to move by `move_on_globe()`
|
|
245
251
|
# or `move_on_map()`
|
|
246
|
-
|
|
252
|
+
my_base_name = "my_base"
|
|
247
253
|
await motion.stop_plan(component_name=mvmnt_sensor)
|
|
248
254
|
|
|
249
255
|
Args:
|
|
250
|
-
component_name (
|
|
256
|
+
component_name (str): The component to stop
|
|
251
257
|
|
|
252
258
|
For more information, see `Motion service <https://docs.viam.com/dev/reference/apis/services/motion/#stopplan>`_.
|
|
253
259
|
"""
|
|
@@ -256,7 +262,7 @@ class Motion(ServiceBase):
|
|
|
256
262
|
@abc.abstractmethod
|
|
257
263
|
async def get_plan(
|
|
258
264
|
self,
|
|
259
|
-
component_name:
|
|
265
|
+
component_name: str,
|
|
260
266
|
last_plan_only: bool = False,
|
|
261
267
|
execution_id: Optional[str] = None,
|
|
262
268
|
*,
|
|
@@ -283,12 +289,12 @@ class Motion(ServiceBase):
|
|
|
283
289
|
::
|
|
284
290
|
|
|
285
291
|
motion = MotionClient.from_robot(robot=machine, name="builtin")
|
|
286
|
-
|
|
292
|
+
my_base_name = "my_base"
|
|
287
293
|
# Get the plan(s) of the base component which was instructed to move by `MoveOnGlobe()` or `MoveOnMap()`
|
|
288
|
-
resp = await motion.get_plan(component_name=
|
|
294
|
+
resp = await motion.get_plan(component_name=my_base_name)
|
|
289
295
|
|
|
290
296
|
Args:
|
|
291
|
-
component_name (
|
|
297
|
+
component_name (str): The component to stop
|
|
292
298
|
last_plan_only (Optional[bool]): If supplied, the response will only return the last plan for the component / execution.
|
|
293
299
|
execution_id (Optional[str]): If supplied, the response will only return plans with the provided execution_id.
|
|
294
300
|
|
|
@@ -335,7 +341,7 @@ class Motion(ServiceBase):
|
|
|
335
341
|
@abc.abstractmethod
|
|
336
342
|
async def get_pose(
|
|
337
343
|
self,
|
|
338
|
-
component_name:
|
|
344
|
+
component_name: str,
|
|
339
345
|
destination_frame: str,
|
|
340
346
|
supplemental_transforms: Optional[Sequence[Transform]] = None,
|
|
341
347
|
*,
|
|
@@ -347,25 +353,21 @@ class Motion(ServiceBase):
|
|
|
347
353
|
|
|
348
354
|
::
|
|
349
355
|
|
|
350
|
-
# Note that the example uses the ``
|
|
351
|
-
# (``
|
|
352
|
-
|
|
353
|
-
# Create a `component_name`:
|
|
354
|
-
component_name = Arm.get_resource_name("arm")
|
|
356
|
+
# Note that the example uses the ``Gripper`` class, but any component class that inherits from ``ComponentBase`` will work
|
|
357
|
+
# (``Arm``, ``Base``, etc).
|
|
355
358
|
|
|
356
359
|
from viam.components.gripper import Gripper
|
|
357
360
|
from viam.services.motion import MotionClient
|
|
358
361
|
|
|
359
362
|
# Assume that the connect function is written and will return a valid machine.
|
|
360
|
-
|
|
363
|
+
machine = await connect()
|
|
361
364
|
|
|
362
365
|
motion = MotionClient.from_robot(robot=machine, name="builtin")
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
destination_frame="world")
|
|
366
|
+
gripperPoseInWorld = await motion.get_pose(component_name="my_gripper",
|
|
367
|
+
destination_frame="world")
|
|
366
368
|
|
|
367
369
|
Args:
|
|
368
|
-
component_name (
|
|
370
|
+
component_name (str): Name of a component on a robot.
|
|
369
371
|
destination_frame (str): Name of the desired reference frame.
|
|
370
372
|
supplemental_transforms (Optional[List[viam.proto.common.Transform]]): Transforms used to augment the robot's frame while
|
|
371
373
|
calculating pose.
|
|
@@ -141,8 +141,8 @@ class Navigation(ServiceBase):
|
|
|
141
141
|
await my_nav.add_waypoint(point=location)
|
|
142
142
|
|
|
143
143
|
Args:
|
|
144
|
-
point (navigation.GeoPoint):
|
|
145
|
-
|
|
144
|
+
point (navigation.GeoPoint): A waypoint represented in a GeoPoint with
|
|
145
|
+
latitude and longitude values.
|
|
146
146
|
timeout (Optional[float]): An option to set how long to wait (in seconds)
|
|
147
147
|
before calling a time-out and closing the underlying RPC call.
|
|
148
148
|
|
viam/services/vision/client.py
CHANGED
|
@@ -69,7 +69,7 @@ class VisionClient(Vision, ReconfigurableResourceRPCClientBase):
|
|
|
69
69
|
result = CaptureAllResult()
|
|
70
70
|
result.extra = struct_to_dict(response.extra)
|
|
71
71
|
if return_image:
|
|
72
|
-
mime_type = CameraMimeType.
|
|
72
|
+
mime_type = CameraMimeType.from_string(response.image.mime_type)
|
|
73
73
|
img = ViamImage(response.image.image, mime_type)
|
|
74
74
|
result.image = img
|
|
75
75
|
if return_classifications:
|
viam/services/vision/service.py
CHANGED
|
@@ -26,7 +26,7 @@ from viam.utils import dict_to_struct, struct_to_dict
|
|
|
26
26
|
from .vision import Vision
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
class VisionRPCService(UnimplementedVisionServiceBase, ResourceRPCServiceBase):
|
|
29
|
+
class VisionRPCService(UnimplementedVisionServiceBase, ResourceRPCServiceBase[Vision]):
|
|
30
30
|
"""
|
|
31
31
|
gRPC service for a Vision service
|
|
32
32
|
"""
|
|
@@ -50,9 +50,8 @@ class VisionRPCService(UnimplementedVisionServiceBase, ResourceRPCServiceBase):
|
|
|
50
50
|
)
|
|
51
51
|
img = None
|
|
52
52
|
if result.image is not None:
|
|
53
|
-
fmt = result.image.mime_type.to_proto()
|
|
54
53
|
img_bytes = result.image.data
|
|
55
|
-
img = Image(source_name=request.camera_name,
|
|
54
|
+
img = Image(source_name=request.camera_name, mime_type=result.image.mime_type, image=img_bytes)
|
|
56
55
|
response = CaptureAllFromCameraResponse(
|
|
57
56
|
image=img,
|
|
58
57
|
detections=result.detections,
|
|
@@ -79,8 +78,7 @@ class VisionRPCService(UnimplementedVisionServiceBase, ResourceRPCServiceBase):
|
|
|
79
78
|
extra = struct_to_dict(request.extra)
|
|
80
79
|
timeout = stream.deadline.time_remaining() if stream.deadline else None
|
|
81
80
|
|
|
82
|
-
|
|
83
|
-
image = ViamImage(request.image, mime_type)
|
|
81
|
+
image = ViamImage(request.image, CameraMimeType.from_string(request.mime_type))
|
|
84
82
|
|
|
85
83
|
result = await vision.get_detections(image, extra=extra, timeout=timeout)
|
|
86
84
|
response = GetDetectionsResponse(detections=result)
|
|
@@ -105,8 +103,7 @@ class VisionRPCService(UnimplementedVisionServiceBase, ResourceRPCServiceBase):
|
|
|
105
103
|
extra = struct_to_dict(request.extra)
|
|
106
104
|
timeout = stream.deadline.time_remaining() if stream.deadline else None
|
|
107
105
|
|
|
108
|
-
|
|
109
|
-
image = ViamImage(request.image, mime_type)
|
|
106
|
+
image = ViamImage(request.image, CameraMimeType.from_string(request.mime_type))
|
|
110
107
|
|
|
111
108
|
result = await vision.get_classifications(image, request.n, extra=extra, timeout=timeout)
|
|
112
109
|
response = GetClassificationsResponse(classifications=result)
|
|
@@ -119,7 +116,7 @@ class VisionRPCService(UnimplementedVisionServiceBase, ResourceRPCServiceBase):
|
|
|
119
116
|
extra = struct_to_dict(request.extra)
|
|
120
117
|
timeout = stream.deadline.time_remaining() if stream.deadline else None
|
|
121
118
|
result = await vision.get_object_point_clouds(request.camera_name, extra=extra, timeout=timeout)
|
|
122
|
-
response = GetObjectPointCloudsResponse(mime_type=CameraMimeType.PCD
|
|
119
|
+
response = GetObjectPointCloudsResponse(mime_type=CameraMimeType.PCD, objects=result)
|
|
123
120
|
await stream.send_message(response)
|
|
124
121
|
|
|
125
122
|
async def GetProperties(self, stream: Stream[GetPropertiesRequest, GetPropertiesResponse]) -> None:
|
viam/services/vision/vision.py
CHANGED
|
@@ -36,7 +36,7 @@ class CaptureAllResult:
|
|
|
36
36
|
):
|
|
37
37
|
"""
|
|
38
38
|
Args:
|
|
39
|
-
image (ViamImage|None): The image from the
|
|
39
|
+
image (ViamImage|None): The image from the GetImages request of the camera, if it was requested.
|
|
40
40
|
classifications (List[Classification]|None): The classifications from GetClassifications, if it was requested.
|
|
41
41
|
detections (List[Detection]|None): The detections from GetDetections, if it was requested.
|
|
42
42
|
objects (List[PointCloudObject]|None): the object point clouds from GetObjectPointClouds, if it was requested.
|
|
@@ -168,7 +168,8 @@ class Vision(ServiceBase):
|
|
|
168
168
|
my_detector = VisionClient.from_robot(robot=machine, "my_detector")
|
|
169
169
|
|
|
170
170
|
# Get an image from the camera
|
|
171
|
-
|
|
171
|
+
images, _ = await my_camera.get_images()
|
|
172
|
+
img = images[0]
|
|
172
173
|
|
|
173
174
|
# Get detections for that image
|
|
174
175
|
detections = await my_detector.get_detections(img)
|
|
@@ -235,7 +236,8 @@ class Vision(ServiceBase):
|
|
|
235
236
|
my_classifier = VisionClient.from_robot(robot=machine, "my_classifier")
|
|
236
237
|
|
|
237
238
|
# Get an image from the camera
|
|
238
|
-
|
|
239
|
+
images, _ = await my_camera.get_images()
|
|
240
|
+
img = images[0]
|
|
239
241
|
|
|
240
242
|
# Get the 2 classifications with the highest confidence scores for the image
|
|
241
243
|
classifications = await my_classifier.get_classifications(img, 2)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from viam.proto.service.worldstatestore import StreamTransformChangesResponse, TransformChangeType
|
|
2
|
+
from viam.resource.registry import Registry, ResourceRegistration
|
|
3
|
+
|
|
4
|
+
from .client import WorldStateStoreClient
|
|
5
|
+
from .service import WorldStateStoreService
|
|
6
|
+
from .worldstatestore import WorldStateStore
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
"WorldStateStore",
|
|
10
|
+
"WorldStateStoreClient",
|
|
11
|
+
"WorldStateStoreService",
|
|
12
|
+
"StreamTransformChangesResponse",
|
|
13
|
+
"TransformChangeType",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
Registry.register_api(
|
|
17
|
+
ResourceRegistration(WorldStateStore, WorldStateStoreService, lambda name, channel: WorldStateStoreClient(name, channel))
|
|
18
|
+
)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
from typing import Any, AsyncGenerator, List, Mapping, Optional
|
|
2
|
+
|
|
3
|
+
from grpclib.client import Channel
|
|
4
|
+
|
|
5
|
+
from viam.proto.common import DoCommandRequest, DoCommandResponse, Transform
|
|
6
|
+
from viam.proto.service.worldstatestore import (
|
|
7
|
+
GetTransformRequest,
|
|
8
|
+
GetTransformResponse,
|
|
9
|
+
ListUUIDsRequest,
|
|
10
|
+
ListUUIDsResponse,
|
|
11
|
+
StreamTransformChangesRequest,
|
|
12
|
+
StreamTransformChangesResponse,
|
|
13
|
+
WorldStateStoreServiceStub,
|
|
14
|
+
)
|
|
15
|
+
from viam.resource.rpc_client_base import ReconfigurableResourceRPCClientBase
|
|
16
|
+
from viam.utils import ValueTypes, dict_to_struct, struct_to_dict
|
|
17
|
+
|
|
18
|
+
from .worldstatestore import WorldStateStore
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class WorldStateStoreClient(WorldStateStore, ReconfigurableResourceRPCClientBase):
|
|
22
|
+
"""
|
|
23
|
+
gRPC client for the WorldStateStore service.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
client: WorldStateStoreServiceStub
|
|
27
|
+
|
|
28
|
+
def __init__(self, name: str, channel: Channel):
|
|
29
|
+
self.channel = channel
|
|
30
|
+
self.client = WorldStateStoreServiceStub(channel)
|
|
31
|
+
super().__init__(name)
|
|
32
|
+
|
|
33
|
+
async def list_uuids(
|
|
34
|
+
self,
|
|
35
|
+
*,
|
|
36
|
+
extra: Optional[Mapping[str, Any]] = None,
|
|
37
|
+
timeout: Optional[float] = None,
|
|
38
|
+
**kwargs,
|
|
39
|
+
) -> List[bytes]:
|
|
40
|
+
md = kwargs.get("metadata", self.Metadata()).proto
|
|
41
|
+
request = ListUUIDsRequest(
|
|
42
|
+
name=self.name,
|
|
43
|
+
extra=dict_to_struct(extra),
|
|
44
|
+
)
|
|
45
|
+
response: ListUUIDsResponse = await self.client.ListUUIDs(request, timeout=timeout, metadata=md)
|
|
46
|
+
return list(response.uuids)
|
|
47
|
+
|
|
48
|
+
async def get_transform(
|
|
49
|
+
self,
|
|
50
|
+
uuid: bytes,
|
|
51
|
+
*,
|
|
52
|
+
extra: Optional[Mapping[str, Any]] = None,
|
|
53
|
+
timeout: Optional[float] = None,
|
|
54
|
+
**kwargs,
|
|
55
|
+
) -> "Transform":
|
|
56
|
+
md = kwargs.get("metadata", self.Metadata()).proto
|
|
57
|
+
request = GetTransformRequest(
|
|
58
|
+
name=self.name,
|
|
59
|
+
uuid=uuid,
|
|
60
|
+
extra=dict_to_struct(extra),
|
|
61
|
+
)
|
|
62
|
+
response: GetTransformResponse = await self.client.GetTransform(request, timeout=timeout, metadata=md)
|
|
63
|
+
return response.transform
|
|
64
|
+
|
|
65
|
+
async def stream_transform_changes(
|
|
66
|
+
self,
|
|
67
|
+
*,
|
|
68
|
+
extra: Optional[Mapping[str, Any]] = None,
|
|
69
|
+
timeout: Optional[float] = None,
|
|
70
|
+
**kwargs,
|
|
71
|
+
) -> AsyncGenerator[StreamTransformChangesResponse, None]:
|
|
72
|
+
md = kwargs.get("metadata", self.Metadata()).proto
|
|
73
|
+
request = StreamTransformChangesRequest(
|
|
74
|
+
name=self.name,
|
|
75
|
+
extra=dict_to_struct(extra),
|
|
76
|
+
)
|
|
77
|
+
responses = await self.client.StreamTransformChanges(request, timeout=timeout, metadata=md)
|
|
78
|
+
for response in responses:
|
|
79
|
+
yield response
|
|
80
|
+
|
|
81
|
+
async def do_command(
|
|
82
|
+
self,
|
|
83
|
+
command: Mapping[str, ValueTypes],
|
|
84
|
+
*,
|
|
85
|
+
timeout: Optional[float] = None,
|
|
86
|
+
**kwargs,
|
|
87
|
+
) -> Mapping[str, ValueTypes]:
|
|
88
|
+
md = kwargs.get("metadata", self.Metadata()).proto
|
|
89
|
+
request = DoCommandRequest(
|
|
90
|
+
name=self.name,
|
|
91
|
+
command=dict_to_struct(command),
|
|
92
|
+
)
|
|
93
|
+
response: DoCommandResponse = await self.client.DoCommand(request, timeout=timeout, metadata=md)
|
|
94
|
+
return struct_to_dict(response.result)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
from grpclib.server import Stream
|
|
2
|
+
|
|
3
|
+
from viam.proto.common import DoCommandRequest, DoCommandResponse
|
|
4
|
+
from viam.proto.service.worldstatestore import (
|
|
5
|
+
GetTransformRequest,
|
|
6
|
+
GetTransformResponse,
|
|
7
|
+
ListUUIDsRequest,
|
|
8
|
+
ListUUIDsResponse,
|
|
9
|
+
StreamTransformChangesRequest,
|
|
10
|
+
StreamTransformChangesResponse,
|
|
11
|
+
UnimplementedWorldStateStoreServiceBase,
|
|
12
|
+
)
|
|
13
|
+
from viam.resource.rpc_service_base import ResourceRPCServiceBase
|
|
14
|
+
from viam.utils import dict_to_struct, struct_to_dict
|
|
15
|
+
|
|
16
|
+
from .worldstatestore import WorldStateStore
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class WorldStateStoreService(UnimplementedWorldStateStoreServiceBase, ResourceRPCServiceBase[WorldStateStore]):
|
|
20
|
+
RESOURCE_TYPE = WorldStateStore
|
|
21
|
+
|
|
22
|
+
async def ListUUIDs(self, stream: Stream[ListUUIDsRequest, ListUUIDsResponse]) -> None:
|
|
23
|
+
request = await stream.recv_message()
|
|
24
|
+
assert request is not None
|
|
25
|
+
service = self.get_resource(request.name)
|
|
26
|
+
timeout = stream.deadline.time_remaining() if stream.deadline else None
|
|
27
|
+
uuids = await service.list_uuids(extra=struct_to_dict(request.extra), timeout=timeout)
|
|
28
|
+
await stream.send_message(ListUUIDsResponse(uuids=uuids))
|
|
29
|
+
|
|
30
|
+
async def GetTransform(self, stream: Stream[GetTransformRequest, GetTransformResponse]) -> None:
|
|
31
|
+
request = await stream.recv_message()
|
|
32
|
+
assert request is not None
|
|
33
|
+
service = self.get_resource(request.name)
|
|
34
|
+
timeout = stream.deadline.time_remaining() if stream.deadline else None
|
|
35
|
+
transform = await service.get_transform(uuid=request.uuid, extra=struct_to_dict(request.extra), timeout=timeout)
|
|
36
|
+
await stream.send_message(GetTransformResponse(transform=transform))
|
|
37
|
+
|
|
38
|
+
async def StreamTransformChanges(
|
|
39
|
+
self,
|
|
40
|
+
stream: Stream[StreamTransformChangesRequest, StreamTransformChangesResponse],
|
|
41
|
+
) -> None:
|
|
42
|
+
request = await stream.recv_message()
|
|
43
|
+
assert request is not None
|
|
44
|
+
service = self.get_resource(request.name)
|
|
45
|
+
timeout = stream.deadline.time_remaining() if stream.deadline else None
|
|
46
|
+
async for change in service.stream_transform_changes(extra=struct_to_dict(request.extra), timeout=timeout):
|
|
47
|
+
await stream.send_message(change)
|
|
48
|
+
|
|
49
|
+
async def DoCommand(self, stream: Stream[DoCommandRequest, DoCommandResponse]) -> None:
|
|
50
|
+
request = await stream.recv_message()
|
|
51
|
+
assert request is not None
|
|
52
|
+
worldstatestore = self.get_resource(request.name)
|
|
53
|
+
timeout = stream.deadline.time_remaining() if stream.deadline else None
|
|
54
|
+
result = await worldstatestore.do_command(struct_to_dict(request.command), timeout=timeout)
|
|
55
|
+
await stream.send_message(DoCommandResponse(result=dict_to_struct(result)))
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import abc
|
|
2
|
+
from typing import Any, AsyncGenerator, Final, List, Mapping, Optional
|
|
3
|
+
|
|
4
|
+
from viam.proto.common import Transform
|
|
5
|
+
from viam.proto.service.worldstatestore import (
|
|
6
|
+
StreamTransformChangesResponse,
|
|
7
|
+
)
|
|
8
|
+
from viam.resource.types import API, RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_SERVICE
|
|
9
|
+
|
|
10
|
+
from ..service_base import ServiceBase
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class WorldStateStore(ServiceBase):
|
|
14
|
+
"""WorldStateStore is a Viam service that manages world state transforms.
|
|
15
|
+
|
|
16
|
+
The WorldStateStore service provides functionality to store, retrieve, and stream
|
|
17
|
+
changes to world state transforms, which represent the pose of objects in different
|
|
18
|
+
reference frames. This functionality can be used to create custom visualizations of the world state.
|
|
19
|
+
|
|
20
|
+
For more information, see `WorldStateStore service <https://docs.viam.com/dev/reference/apis/services/world-state-store/>`_.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
API: Final = API( # pyright: ignore [reportIncompatibleVariableOverride]
|
|
24
|
+
RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_SERVICE, "world_state_store"
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
@abc.abstractmethod
|
|
28
|
+
async def list_uuids(
|
|
29
|
+
self,
|
|
30
|
+
*,
|
|
31
|
+
extra: Optional[Mapping[str, Any]] = None,
|
|
32
|
+
timeout: Optional[float] = None,
|
|
33
|
+
) -> List[bytes]:
|
|
34
|
+
"""List all world state transform UUIDs.
|
|
35
|
+
|
|
36
|
+
::
|
|
37
|
+
|
|
38
|
+
worldstatestore = WorldStateStoreClient.from_robot(robot=machine, name="builtin")
|
|
39
|
+
|
|
40
|
+
uuids = await worldstatestore.list_uuids()
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
List[bytes]: A list of transform UUIDs
|
|
44
|
+
"""
|
|
45
|
+
...
|
|
46
|
+
|
|
47
|
+
@abc.abstractmethod
|
|
48
|
+
async def get_transform(
|
|
49
|
+
self,
|
|
50
|
+
uuid: bytes,
|
|
51
|
+
*,
|
|
52
|
+
extra: Optional[Mapping[str, Any]] = None,
|
|
53
|
+
timeout: Optional[float] = None,
|
|
54
|
+
) -> Transform:
|
|
55
|
+
"""Get a world state transform by UUID.
|
|
56
|
+
|
|
57
|
+
::
|
|
58
|
+
|
|
59
|
+
worldstatestore = WorldStateStoreClient.from_robot(robot=machine, name="builtin")
|
|
60
|
+
|
|
61
|
+
transform = await worldstatestore.get_transform(uuid=b"some-uuid")
|
|
62
|
+
|
|
63
|
+
Args:
|
|
64
|
+
uuid (bytes): The UUID of the transform to retrieve
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
Transform: The requested transform
|
|
68
|
+
"""
|
|
69
|
+
...
|
|
70
|
+
|
|
71
|
+
@abc.abstractmethod
|
|
72
|
+
async def stream_transform_changes(
|
|
73
|
+
self,
|
|
74
|
+
*,
|
|
75
|
+
extra: Optional[Mapping[str, Any]] = None,
|
|
76
|
+
timeout: Optional[float] = None,
|
|
77
|
+
) -> AsyncGenerator[StreamTransformChangesResponse, None]:
|
|
78
|
+
"""Stream changes to world state transforms.
|
|
79
|
+
|
|
80
|
+
::
|
|
81
|
+
|
|
82
|
+
worldstatestore = WorldStateStoreClient.from_robot(robot=machine, name="builtin")
|
|
83
|
+
|
|
84
|
+
async for change in worldstatestore.stream_transform_changes():
|
|
85
|
+
print(f"Transform {change.transform.uuid} {change.change_type}")
|
|
86
|
+
|
|
87
|
+
Returns:
|
|
88
|
+
AsyncGenerator[StreamTransformChangesResponse, None]: A stream of transform changes
|
|
89
|
+
"""
|
|
90
|
+
...
|