viam-sdk 0.25.2__py3-none-linux_armv7l.whl → 0.62.0__py3-none-linux_armv7l.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 (328) hide show
  1. viam/app/_logs.py +3 -6
  2. viam/app/app_client.py +606 -262
  3. viam/app/billing_client.py +60 -18
  4. viam/app/data_client.py +1086 -315
  5. viam/app/ml_training_client.py +51 -48
  6. viam/app/provisioning_client.py +3 -5
  7. viam/app/viam_client.py +105 -11
  8. viam/components/arm/__init__.py +1 -25
  9. viam/components/arm/arm.py +21 -22
  10. viam/components/arm/client.py +27 -30
  11. viam/components/arm/service.py +3 -3
  12. viam/components/audio_in/__init__.py +24 -0
  13. viam/components/audio_in/audio_in.py +74 -0
  14. viam/components/audio_in/client.py +76 -0
  15. viam/components/audio_in/service.py +83 -0
  16. viam/components/audio_input/__init__.py +1 -1
  17. viam/components/audio_input/audio_input.py +4 -3
  18. viam/components/audio_input/client.py +19 -8
  19. viam/components/audio_input/service.py +10 -0
  20. viam/components/audio_out/__init__.py +21 -0
  21. viam/components/audio_out/audio_out.py +72 -0
  22. viam/components/audio_out/client.py +67 -0
  23. viam/components/audio_out/service.py +63 -0
  24. viam/components/base/__init__.py +2 -10
  25. viam/components/base/base.py +20 -20
  26. viam/components/base/client.py +27 -30
  27. viam/components/board/__init__.py +2 -25
  28. viam/components/board/board.py +39 -77
  29. viam/components/board/client.py +39 -73
  30. viam/components/button/__init__.py +10 -0
  31. viam/components/button/button.py +41 -0
  32. viam/components/button/client.py +52 -0
  33. viam/components/button/service.py +46 -0
  34. viam/components/camera/__init__.py +1 -1
  35. viam/components/camera/camera.py +31 -22
  36. viam/components/camera/client.py +30 -20
  37. viam/components/camera/service.py +14 -12
  38. viam/components/component_base.py +10 -7
  39. viam/components/encoder/__init__.py +1 -1
  40. viam/components/encoder/client.py +15 -16
  41. viam/components/encoder/encoder.py +9 -9
  42. viam/components/gantry/__init__.py +1 -13
  43. viam/components/gantry/client.py +41 -28
  44. viam/components/gantry/gantry.py +48 -17
  45. viam/components/gantry/service.py +21 -5
  46. viam/components/generic/__init__.py +1 -1
  47. viam/components/generic/client.py +11 -7
  48. viam/components/generic/generic.py +3 -3
  49. viam/components/gripper/__init__.py +3 -12
  50. viam/components/gripper/client.py +43 -20
  51. viam/components/gripper/gripper.py +87 -12
  52. viam/components/gripper/service.py +32 -3
  53. viam/components/input/__init__.py +1 -14
  54. viam/components/input/client.py +22 -23
  55. viam/components/input/input.py +18 -12
  56. viam/components/motor/__init__.py +1 -21
  57. viam/components/motor/client.py +36 -42
  58. viam/components/motor/motor.py +24 -24
  59. viam/components/movement_sensor/__init__.py +1 -1
  60. viam/components/movement_sensor/client.py +33 -40
  61. viam/components/movement_sensor/movement_sensor.py +12 -12
  62. viam/components/pose_tracker/__init__.py +1 -1
  63. viam/components/pose_tracker/client.py +9 -8
  64. viam/components/pose_tracker/pose_tracker.py +2 -2
  65. viam/components/power_sensor/__init__.py +1 -1
  66. viam/components/power_sensor/client.py +15 -18
  67. viam/components/power_sensor/power_sensor.py +12 -12
  68. viam/components/sensor/__init__.py +1 -1
  69. viam/components/sensor/client.py +9 -8
  70. viam/components/sensor/sensor.py +5 -5
  71. viam/components/servo/__init__.py +1 -13
  72. viam/components/servo/client.py +18 -18
  73. viam/components/servo/servo.py +12 -12
  74. viam/components/switch/__init__.py +10 -0
  75. viam/components/switch/client.py +83 -0
  76. viam/components/switch/service.py +72 -0
  77. viam/components/switch/switch.py +95 -0
  78. viam/gen/app/agent/v1/agent_pb2.py +40 -29
  79. viam/gen/app/agent/v1/agent_pb2.pyi +73 -11
  80. viam/gen/app/cloudslam/v1/cloud_slam_pb2.py +45 -42
  81. viam/gen/app/data/v1/data_grpc.py +98 -2
  82. viam/gen/app/data/v1/data_pb2.py +238 -119
  83. viam/gen/app/data/v1/data_pb2.pyi +804 -34
  84. viam/gen/app/datapipelines/v1/data_pipelines_grpc.py +84 -0
  85. viam/gen/app/datapipelines/v1/data_pipelines_pb2.py +57 -0
  86. viam/gen/app/datapipelines/v1/data_pipelines_pb2.pyi +387 -0
  87. viam/gen/app/dataset/v1/dataset_grpc.py +10 -2
  88. viam/gen/app/dataset/v1/dataset_pb2.py +38 -31
  89. viam/gen/app/dataset/v1/dataset_pb2.pyi +36 -1
  90. viam/gen/app/datasync/v1/data_sync_grpc.py +1 -1
  91. viam/gen/app/datasync/v1/data_sync_pb2.py +61 -51
  92. viam/gen/app/datasync/v1/data_sync_pb2.pyi +52 -12
  93. viam/gen/app/mlinference/__init__.py +0 -0
  94. viam/gen/app/mlinference/v1/__init__.py +0 -0
  95. viam/gen/app/mlinference/v1/ml_inference_grpc.py +28 -0
  96. viam/gen/app/mlinference/v1/ml_inference_pb2.py +23 -0
  97. viam/gen/app/mlinference/v1/ml_inference_pb2.pyi +63 -0
  98. viam/gen/app/mltraining/v1/ml_training_grpc.py +18 -2
  99. viam/gen/app/mltraining/v1/ml_training_pb2.py +134 -101
  100. viam/gen/app/mltraining/v1/ml_training_pb2.pyi +193 -7
  101. viam/gen/app/packages/v1/packages_pb2.py +43 -40
  102. viam/gen/app/v1/app_grpc.py +290 -2
  103. viam/gen/app/v1/app_pb2.py +670 -453
  104. viam/gen/app/v1/app_pb2.pyi +3133 -947
  105. viam/gen/app/v1/billing_grpc.py +34 -2
  106. viam/gen/app/v1/billing_pb2.py +94 -35
  107. viam/gen/app/v1/billing_pb2.pyi +314 -61
  108. viam/gen/app/v1/end_user_pb2.py +50 -29
  109. viam/gen/app/v1/robot_pb2.py +120 -111
  110. viam/gen/app/v1/robot_pb2.pyi +137 -15
  111. viam/gen/common/v1/common_pb2.py +86 -66
  112. viam/gen/common/v1/common_pb2.pyi +184 -8
  113. viam/gen/component/arm/v1/arm_grpc.py +18 -2
  114. viam/gen/component/arm/v1/arm_pb2.py +68 -55
  115. viam/gen/component/arm/v1/arm_pb2.pyi +73 -3
  116. viam/gen/component/audioin/__init__.py +0 -0
  117. viam/gen/component/audioin/v1/__init__.py +0 -0
  118. viam/gen/component/audioin/v1/audioin_grpc.py +54 -0
  119. viam/gen/component/audioin/v1/audioin_pb2.py +34 -0
  120. viam/gen/component/audioin/v1/audioin_pb2.pyi +94 -0
  121. viam/gen/component/audioinput/v1/audioinput_pb2.py +35 -32
  122. viam/gen/component/audioout/__init__.py +0 -0
  123. viam/gen/component/audioout/v1/__init__.py +0 -0
  124. viam/gen/component/audioout/v1/audioout_grpc.py +54 -0
  125. viam/gen/component/audioout/v1/audioout_pb2.py +32 -0
  126. viam/gen/component/audioout/v1/audioout_pb2.pyi +47 -0
  127. viam/gen/component/base/v1/base_pb2.py +57 -54
  128. viam/gen/component/board/v1/board_pb2.py +93 -90
  129. viam/gen/component/button/__init__.py +0 -0
  130. viam/gen/component/button/v1/__init__.py +0 -0
  131. viam/gen/component/button/v1/button_grpc.py +38 -0
  132. viam/gen/component/button/v1/button_pb2.py +28 -0
  133. viam/gen/component/button/v1/button_pb2.pyi +39 -0
  134. viam/gen/component/camera/v1/camera_pb2.py +58 -55
  135. viam/gen/component/camera/v1/camera_pb2.pyi +31 -7
  136. viam/gen/component/encoder/v1/encoder_pb2.py +35 -32
  137. viam/gen/component/gantry/v1/gantry_grpc.py +9 -1
  138. viam/gen/component/gantry/v1/gantry_pb2.py +56 -51
  139. viam/gen/component/generic/v1/generic_pb2.py +15 -12
  140. viam/gen/component/gripper/v1/gripper_grpc.py +18 -2
  141. viam/gen/component/gripper/v1/gripper_pb2.py +48 -37
  142. viam/gen/component/gripper/v1/gripper_pb2.pyi +43 -1
  143. viam/gen/component/inputcontroller/v1/input_controller_pb2.py +45 -42
  144. viam/gen/component/motor/v1/motor_pb2.py +77 -74
  145. viam/gen/component/movementsensor/v1/movementsensor_pb2.py +69 -66
  146. viam/gen/component/posetracker/v1/pose_tracker_pb2.py +25 -22
  147. viam/gen/component/powersensor/v1/powersensor_pb2.py +33 -30
  148. viam/gen/component/sensor/v1/sensor_pb2.py +17 -14
  149. viam/gen/component/servo/v1/servo_pb2.py +41 -38
  150. viam/gen/component/switch/__init__.py +0 -0
  151. viam/gen/component/switch/v1/__init__.py +0 -0
  152. viam/gen/component/switch/v1/switch_grpc.py +54 -0
  153. viam/gen/component/switch/v1/switch_pb2.py +40 -0
  154. viam/gen/component/switch/v1/switch_pb2.pyi +116 -0
  155. viam/gen/component/testecho/v1/testecho_pb2.py +29 -26
  156. viam/gen/module/v1/module_pb2.py +36 -33
  157. viam/gen/module/v1/module_pb2.pyi +7 -2
  158. viam/gen/proto/rpc/examples/echo/v1/echo_pb2.py +26 -23
  159. viam/gen/proto/rpc/examples/echoresource/v1/echoresource_pb2.py +23 -20
  160. viam/gen/proto/rpc/v1/auth_pb2.py +27 -24
  161. viam/gen/proto/rpc/webrtc/v1/grpc_pb2.py +35 -32
  162. viam/gen/proto/rpc/webrtc/v1/signaling_pb2.py +62 -57
  163. viam/gen/proto/rpc/webrtc/v1/signaling_pb2.pyi +18 -4
  164. viam/gen/provisioning/v1/provisioning_grpc.py +10 -2
  165. viam/gen/provisioning/v1/provisioning_pb2.py +38 -31
  166. viam/gen/provisioning/v1/provisioning_pb2.pyi +20 -2
  167. viam/gen/robot/v1/robot_grpc.py +61 -29
  168. viam/gen/robot/v1/robot_pb2.py +186 -155
  169. viam/gen/robot/v1/robot_pb2.pyi +278 -59
  170. viam/gen/service/datamanager/v1/data_manager_grpc.py +11 -2
  171. viam/gen/service/datamanager/v1/data_manager_pb2.py +27 -17
  172. viam/gen/service/datamanager/v1/data_manager_pb2.pyi +47 -1
  173. viam/gen/service/discovery/__init__.py +0 -0
  174. viam/gen/service/discovery/v1/__init__.py +0 -0
  175. viam/gen/service/discovery/v1/discovery_grpc.py +39 -0
  176. viam/gen/service/discovery/v1/discovery_pb2.py +29 -0
  177. viam/gen/service/discovery/v1/discovery_pb2.pyi +51 -0
  178. viam/gen/service/generic/v1/generic_pb2.py +13 -10
  179. viam/gen/service/mlmodel/v1/mlmodel_pb2.py +75 -72
  180. viam/gen/service/motion/v1/motion_pb2.py +118 -85
  181. viam/gen/service/motion/v1/motion_pb2.pyi +130 -68
  182. viam/gen/service/navigation/v1/navigation_pb2.py +75 -72
  183. viam/gen/service/sensors/v1/sensors_pb2.py +59 -56
  184. viam/gen/service/shell/v1/shell_pb2.py +35 -32
  185. viam/gen/service/slam/v1/slam_pb2.py +43 -40
  186. viam/gen/service/slam/v1/slam_pb2.pyi +1 -1
  187. viam/gen/service/video/__init__.py +0 -0
  188. viam/gen/service/video/v1/__init__.py +0 -0
  189. viam/gen/service/video/v1/video_grpc.py +39 -0
  190. viam/gen/service/video/v1/video_pb2.py +29 -0
  191. viam/gen/service/video/v1/video_pb2.pyi +72 -0
  192. viam/gen/service/vision/v1/vision_pb2.py +60 -57
  193. viam/gen/service/vision/v1/vision_pb2.pyi +28 -3
  194. viam/gen/service/worldstatestore/__init__.py +0 -0
  195. viam/gen/service/worldstatestore/v1/__init__.py +0 -0
  196. viam/gen/service/worldstatestore/v1/world_state_store_grpc.py +55 -0
  197. viam/gen/service/worldstatestore/v1/world_state_store_pb2.py +39 -0
  198. viam/gen/service/worldstatestore/v1/world_state_store_pb2.pyi +171 -0
  199. viam/gen/stream/v1/stream_grpc.py +17 -1
  200. viam/gen/stream/v1/stream_pb2.py +34 -21
  201. viam/gen/stream/v1/stream_pb2.pyi +79 -1
  202. viam/gen/tagger/v1/tagger_pb2.py +9 -8
  203. viam/logging.py +77 -18
  204. viam/media/audio.py +28 -0
  205. viam/media/utils/pil/__init__.py +7 -3
  206. viam/media/video.py +80 -17
  207. viam/module/module.py +111 -38
  208. viam/module/resource_data_consumer.py +41 -0
  209. viam/module/service.py +9 -1
  210. viam/module/types.py +2 -4
  211. viam/proto/app/__init__.py +199 -0
  212. viam/proto/app/agent/__init__.py +5 -2
  213. viam/proto/app/billing.py +31 -4
  214. viam/proto/app/cloudslam/__init__.py +1 -0
  215. viam/proto/app/data/__init__.py +63 -0
  216. viam/proto/app/datapipelines/__init__.py +56 -0
  217. viam/proto/app/dataset/__init__.py +5 -0
  218. viam/proto/app/datasync/__init__.py +3 -0
  219. viam/proto/app/end_user.py +1 -0
  220. viam/proto/app/mlinference/__init__.py +15 -0
  221. viam/proto/app/mltraining/__init__.py +13 -0
  222. viam/proto/app/packages/__init__.py +1 -0
  223. viam/proto/app/robot.py +7 -0
  224. viam/proto/common/__init__.py +15 -0
  225. viam/proto/component/arm/__init__.py +7 -0
  226. viam/proto/component/audioin/__init__.py +16 -0
  227. viam/proto/component/audioinput/__init__.py +1 -0
  228. viam/proto/component/audioout/__init__.py +15 -0
  229. viam/proto/component/base/__init__.py +1 -0
  230. viam/proto/component/board/__init__.py +1 -0
  231. viam/proto/component/button/__init__.py +15 -0
  232. viam/proto/component/camera/__init__.py +1 -0
  233. viam/proto/component/encoder/__init__.py +1 -0
  234. viam/proto/component/gantry/__init__.py +1 -0
  235. viam/proto/component/generic/__init__.py +1 -0
  236. viam/proto/component/gripper/__init__.py +5 -0
  237. viam/proto/component/inputcontroller/__init__.py +1 -0
  238. viam/proto/component/motor/__init__.py +1 -0
  239. viam/proto/component/movementsensor/__init__.py +1 -0
  240. viam/proto/component/posetracker/__init__.py +1 -0
  241. viam/proto/component/powersensor/__init__.py +1 -0
  242. viam/proto/component/sensor/__init__.py +1 -0
  243. viam/proto/component/servo/__init__.py +1 -0
  244. viam/proto/component/switch/__init__.py +26 -0
  245. viam/proto/component/testecho/__init__.py +1 -0
  246. viam/proto/module/__init__.py +1 -0
  247. viam/proto/provisioning/__init__.py +5 -0
  248. viam/proto/robot/__init__.py +29 -8
  249. viam/proto/rpc/auth.py +1 -0
  250. viam/proto/rpc/examples/echo/__init__.py +1 -0
  251. viam/proto/rpc/examples/echoresource/__init__.py +1 -0
  252. viam/proto/rpc/webrtc/grpc.py +1 -0
  253. viam/proto/rpc/webrtc/signaling.py +3 -0
  254. viam/proto/service/datamanager/__init__.py +9 -1
  255. viam/proto/service/discovery/__init__.py +15 -0
  256. viam/proto/service/generic/__init__.py +1 -0
  257. viam/proto/service/mlmodel/__init__.py +1 -0
  258. viam/proto/service/motion/__init__.py +3 -0
  259. viam/proto/service/navigation/__init__.py +1 -0
  260. viam/proto/service/sensors/__init__.py +1 -0
  261. viam/proto/service/shell/__init__.py +1 -0
  262. viam/proto/service/slam/__init__.py +1 -0
  263. viam/proto/service/video/__init__.py +15 -0
  264. viam/proto/service/vision/__init__.py +1 -0
  265. viam/proto/service/worldstatestore/__init__.py +32 -0
  266. viam/proto/stream/__init__.py +11 -0
  267. viam/py.typed +0 -0
  268. viam/resource/base.py +12 -8
  269. viam/resource/easy_resource.py +24 -13
  270. viam/resource/manager.py +6 -5
  271. viam/resource/registry.py +39 -51
  272. viam/resource/rpc_client_base.py +33 -1
  273. viam/resource/types.py +13 -14
  274. viam/robot/client.py +190 -122
  275. viam/robot/service.py +2 -50
  276. viam/rpc/dial.py +54 -4
  277. viam/rpc/libviam_rust_utils.so +0 -0
  278. viam/rpc/server.py +25 -11
  279. viam/rpc/types.py +2 -4
  280. viam/services/discovery/__init__.py +12 -0
  281. viam/services/discovery/client.py +55 -0
  282. viam/services/discovery/discovery.py +52 -0
  283. viam/services/discovery/service.py +43 -0
  284. viam/services/generic/__init__.py +1 -1
  285. viam/services/generic/client.py +8 -5
  286. viam/services/generic/generic.py +2 -2
  287. viam/services/mlmodel/__init__.py +1 -1
  288. viam/services/mlmodel/client.py +17 -7
  289. viam/services/mlmodel/mlmodel.py +23 -12
  290. viam/services/mlmodel/service.py +5 -2
  291. viam/services/mlmodel/utils.py +11 -1
  292. viam/services/motion/__init__.py +2 -2
  293. viam/services/motion/client.py +32 -32
  294. viam/services/motion/motion.py +66 -62
  295. viam/services/navigation/__init__.py +1 -1
  296. viam/services/navigation/client.py +30 -20
  297. viam/services/navigation/navigation.py +23 -23
  298. viam/services/service_base.py +13 -9
  299. viam/services/service_client_base.py +3 -3
  300. viam/services/slam/__init__.py +1 -1
  301. viam/services/slam/client.py +15 -10
  302. viam/services/slam/slam.py +11 -11
  303. viam/services/vision/__init__.py +1 -1
  304. viam/services/vision/client.py +31 -24
  305. viam/services/vision/service.py +8 -8
  306. viam/services/vision/vision.py +36 -53
  307. viam/services/worldstatestore/__init__.py +18 -0
  308. viam/services/worldstatestore/client.py +94 -0
  309. viam/services/worldstatestore/service.py +55 -0
  310. viam/services/worldstatestore/worldstatestore.py +90 -0
  311. viam/sessions_client.py +115 -46
  312. viam/streams.py +3 -6
  313. viam/utils.py +44 -14
  314. viam/version_metadata.py +4 -0
  315. {viam_sdk-0.25.2.dist-info → viam_sdk-0.62.0.dist-info}/METADATA +27 -28
  316. viam_sdk-0.62.0.dist-info/RECORD +514 -0
  317. {viam_sdk-0.25.2.dist-info → viam_sdk-0.62.0.dist-info}/WHEEL +1 -1
  318. viam/gen/proto/rpc/examples/fileupload/v1/fileupload_grpc.py +0 -27
  319. viam/gen/proto/rpc/examples/fileupload/v1/fileupload_pb2.py +0 -18
  320. viam/gen/proto/rpc/examples/fileupload/v1/fileupload_pb2.pyi +0 -45
  321. viam/proto/rpc/examples/fileupload/__init__.py +0 -18
  322. viam/services/sensors/__init__.py +0 -5
  323. viam/services/sensors/client.py +0 -65
  324. viam_sdk-0.25.2.dist-info/LICENSE +0 -202
  325. viam_sdk-0.25.2.dist-info/RECORD +0 -442
  326. /viam/gen/{proto/rpc/examples/fileupload → app/datapipelines}/__init__.py +0 -0
  327. /viam/gen/{proto/rpc/examples/fileupload → app/datapipelines}/v1/__init__.py +0 -0
  328. /LICENSE → /viam_sdk-0.62.0.dist-info/licenses/LICENSE +0 -0
viam/robot/client.py CHANGED
@@ -1,4 +1,5 @@
1
1
  import asyncio
2
+ import sys
2
3
  from dataclasses import dataclass
3
4
  from datetime import datetime
4
5
  from threading import RLock
@@ -16,23 +17,25 @@ from viam.proto.common import LogEntry, PoseInFrame, ResourceName, Transform
16
17
  from viam.proto.robot import (
17
18
  BlockForOperationRequest,
18
19
  CancelOperationRequest,
19
- DiscoverComponentsRequest,
20
- DiscoverComponentsResponse,
21
- Discovery,
22
- DiscoveryQuery,
23
20
  FrameSystemConfig,
24
21
  FrameSystemConfigRequest,
25
22
  FrameSystemConfigResponse,
26
23
  GetCloudMetadataRequest,
27
24
  GetCloudMetadataResponse,
25
+ GetMachineStatusRequest,
26
+ GetMachineStatusResponse,
27
+ GetModelsFromModulesRequest,
28
+ GetModelsFromModulesResponse,
28
29
  GetOperationsRequest,
29
30
  GetOperationsResponse,
30
- GetStatusRequest,
31
- GetStatusResponse,
31
+ GetVersionRequest,
32
+ GetVersionResponse,
32
33
  LogRequest,
34
+ ModuleModel,
33
35
  Operation,
34
36
  ResourceNamesRequest,
35
37
  ResourceNamesResponse,
38
+ RestartModuleRequest,
36
39
  RobotServiceStub,
37
40
  ShutdownRequest,
38
41
  StopAllRequest,
@@ -44,8 +47,8 @@ from viam.resource.base import ResourceBase
44
47
  from viam.resource.manager import ResourceManager
45
48
  from viam.resource.registry import Registry
46
49
  from viam.resource.rpc_client_base import ReconfigurableResourceRPCClientBase, ResourceRPCClientBase
47
- from viam.resource.types import RESOURCE_TYPE_COMPONENT, RESOURCE_TYPE_SERVICE, Subtype
48
- from viam.rpc.dial import DialOptions, ViamChannel, dial
50
+ from viam.resource.types import API, RESOURCE_TYPE_COMPONENT, RESOURCE_TYPE_SERVICE
51
+ from viam.rpc.dial import DialOptions, ViamChannel, _dial_inner, dial
49
52
  from viam.services.service_base import ServiceBase
50
53
  from viam.sessions_client import SessionsClient
51
54
  from viam.utils import datetime_to_timestamp, dict_to_struct
@@ -54,7 +57,7 @@ LOGGER = logging.getLogger(__name__)
54
57
 
55
58
 
56
59
  class RobotClient:
57
- """gRPC client for a Robot. This class should be used for all interactions with a robot.
60
+ """gRPC client for a machine. This class should be used for all interactions with a machine.
58
61
 
59
62
  There are 2 ways to instantiate a robot client::
60
63
 
@@ -63,12 +66,12 @@ class RobotClient:
63
66
 
64
67
  You can use the client standalone or within a context::
65
68
 
66
- robot = await RobotClient.at_address(...)
67
- async with await RobotClient.with_channel(...) as robot: ...
69
+ machine = await RobotClient.at_address(...)
70
+ async with await RobotClient.with_channel(...) as machine: ...
68
71
 
69
- You must ``close()`` the robot to release resources.
72
+ You must ``close()`` the machine to release resources.
70
73
 
71
- Note: Robots used within a context are automatically closed UNLESS created with a channel. Robots created using ``with_channel`` are
74
+ Note: Machines used within a context are automatically closed UNLESS created with a channel. Machines created using ``with_channel`` are
72
75
  not automatically closed.
73
76
 
74
77
  Establish a Connection::
@@ -91,10 +94,10 @@ class RobotClient:
91
94
 
92
95
  async def main():
93
96
  # Make a RobotClient
94
- robot = await connect()
97
+ machine = await connect()
95
98
  print('Resources:')
96
- print(robot.resource_names)
97
- await robot.close()
99
+ print(machine.resource_names)
100
+ await machine.close()
98
101
 
99
102
  if __name__ == '__main__':
100
103
  asyncio.run(main())
@@ -106,8 +109,8 @@ class RobotClient:
106
109
  class Options:
107
110
  refresh_interval: int = 0
108
111
  """
109
- How often to refresh the status/parts of the robot in seconds.
110
- If not set, the robot will not be refreshed automatically
112
+ How often to refresh the status of the parts of the machine in seconds.
113
+ If not set, the machine will not be refreshed automatically
111
114
  """
112
115
 
113
116
  dial_options: Optional[DialOptions] = None
@@ -122,12 +125,12 @@ class RobotClient:
122
125
 
123
126
  check_connection_interval: int = 10
124
127
  """
125
- The frequency (in seconds) at which to check if the robot is still connected. 0 (zero) signifies no connection checks
128
+ The frequency (in seconds) at which to check if the machine is still connected. 0 (zero) signifies no connection checks
126
129
  """
127
130
 
128
131
  attempt_reconnect_interval: int = 1
129
132
  """
130
- The frequency (in seconds) at which to attempt to reconnect a disconnected robot. 0 (zero) signifies no reconnection attempts
133
+ The frequency (in seconds) at which to attempt to reconnect a disconnected machine. 0 (zero) signifies no reconnection attempts
131
134
  """
132
135
 
133
136
  disable_sessions: bool = False
@@ -149,7 +152,7 @@ class RobotClient:
149
152
 
150
153
  opts = RobotClient.Options.with_api_key(api_key, api_key_id)
151
154
 
152
- robot = await RobotClient.at_address('<ADDRESS-FROM-THE-VIAM-APP>', opts)
155
+ machine = await RobotClient.at_address('<ADDRESS-FROM-THE-VIAM-APP>', opts)
153
156
 
154
157
  Args:
155
158
  api_key (str): your API key
@@ -170,7 +173,7 @@ class RobotClient:
170
173
 
171
174
  @classmethod
172
175
  async def at_address(cls, address: str, options: Options) -> Self:
173
- """Create a robot client that is connected to the robot at the provided address.
176
+ """Create a robot client that is connected to the machine at the provided address.
174
177
 
175
178
  ::
176
179
 
@@ -182,15 +185,15 @@ class RobotClient:
182
185
  # Replace "<API-KEY-ID>" (including brackets) with your machine's API key ID
183
186
  api_key_id='<API-KEY-ID>'
184
187
  )
185
- return await RobotClient.at_address('ADDRESS FROM THE VIAM APP', opts)
188
+ return await RobotClient.at_address('MACHINE ADDRESS', opts)
186
189
 
187
190
 
188
191
  async def main():
189
192
  # Make a RobotClient
190
- robot = await connect()
193
+ machine = await connect()
191
194
 
192
195
  Args:
193
- address (str): Address of the robot (IP address, URL, etc.)
196
+ address (str): Address of the machine (IP address, URL, etc.)
194
197
  options (Options): Options for connecting and refreshing
195
198
 
196
199
  Returns:
@@ -200,15 +203,15 @@ class RobotClient:
200
203
  """
201
204
  logging.setLevel(options.log_level)
202
205
  channel = await dial(address, options.dial_options)
203
- robot = await cls._with_channel(channel, options, True)
204
- robot._address = address
205
- return robot
206
+ machine = await cls._with_channel(channel, options, True, robot_addr=address)
207
+ machine._address = address
208
+ return machine
206
209
 
207
210
  @classmethod
208
211
  async def with_channel(cls, channel: Union[Channel, ViamChannel], options: Options) -> Self:
209
- """Create a robot that is connected to a robot over the given channel.
212
+ """Create a machine that is connected to a machine over the given channel.
210
213
 
211
- Any robots created using this method will *NOT* automatically close the channel upon exit.
214
+ Any machines created using this method will *NOT* automatically close the channel upon exit.
212
215
 
213
216
  ::
214
217
 
@@ -220,10 +223,10 @@ class RobotClient:
220
223
  async with await dial('ADDRESS', DialOptions()) as channel:
221
224
  return await RobotClient.with_channel(channel, RobotClient.Options())
222
225
 
223
- robot = await connect_with_channel()
226
+ machine = await connect_with_channel()
224
227
 
225
228
  Args:
226
- channel (ViamChannel): The channel that is connected to a robot, obtained by ``viam.rpc.dial``
229
+ channel (ViamChannel): The channel that is connected to a machine, obtained by ``viam.rpc.dial``
227
230
  options (Options): Options for refreshing. Any connection options will be ignored.
228
231
 
229
232
  Returns:
@@ -235,7 +238,9 @@ class RobotClient:
235
238
  return await cls._with_channel(channel, options, False)
236
239
 
237
240
  @classmethod
238
- async def _with_channel(cls, channel: Union[Channel, ViamChannel], options: Options, close_channel: bool):
241
+ async def _with_channel(
242
+ cls, channel: Union[Channel, ViamChannel], options: Options, close_channel: bool, robot_addr: Optional[str] = None
243
+ ):
239
244
  """INTERNAL USE ONLY"""
240
245
 
241
246
  self = cls()
@@ -256,15 +261,15 @@ class RobotClient:
256
261
  self._options = options
257
262
  self._address = self._channel._path if self._channel._path else f"{self._channel._host}:{self._channel._port}"
258
263
  self._sessions_client = SessionsClient(
259
- self._channel, self._address, self._options.dial_options, disabled=self._options.disable_sessions
264
+ self._channel, self._address, self._options.dial_options, disabled=self._options.disable_sessions, robot_addr=robot_addr
260
265
  )
261
266
 
262
267
  try:
263
268
  await self.refresh()
264
269
  except Exception:
265
- LOGGER.error("Unable to establish a connection to the robot. Ensure the robot is online and reachable and try again.")
270
+ LOGGER.error("Unable to establish a connection to the machine. Ensure the machine is online and reachable and try again.")
266
271
  await self.close()
267
- raise ConnectionError("Unable to establish a connection to the robot.")
272
+ raise ConnectionError("Unable to establish a connection to the machine.")
268
273
 
269
274
  if options.refresh_interval > 0:
270
275
  self._refresh_task = asyncio.create_task(
@@ -296,11 +301,11 @@ class RobotClient:
296
301
 
297
302
  async def refresh(self):
298
303
  """
299
- Manually refresh the underlying parts of this robot
304
+ Manually refresh the underlying parts of this machine.
300
305
 
301
306
  ::
302
307
 
303
- await robot.refresh()
308
+ await machine.refresh()
304
309
 
305
310
  For more information, see `Machine Management API <https://docs.viam.com/appendix/apis/robot/>`_.
306
311
  """
@@ -337,12 +342,12 @@ class RobotClient:
337
342
  else:
338
343
  await self._manager.remove_resource(resourceName)
339
344
  self._manager.register(
340
- Registry.lookup_subtype(Subtype.from_resource_name(resourceName)).create_rpc_client(resourceName.name, self._channel)
345
+ Registry.lookup_api(API.from_resource_name(resourceName)).create_rpc_client(resourceName.name, self._channel)
341
346
  )
342
347
  else:
343
348
  try:
344
349
  self._manager.register(
345
- Registry.lookup_subtype(Subtype.from_resource_name(resourceName)).create_rpc_client(resourceName.name, self._channel)
350
+ Registry.lookup_api(API.from_resource_name(resourceName)).create_rpc_client(resourceName.name, self._channel)
346
351
  )
347
352
  except ResourceNotFoundError:
348
353
  pass
@@ -375,7 +380,7 @@ class RobotClient:
375
380
  connection_error = e
376
381
  await asyncio.sleep(0.1)
377
382
  if connection_error:
378
- msg = "Lost connection to robot."
383
+ msg = "Lost connection to machine."
379
384
  if reconnect_every > 0:
380
385
  msg += (
381
386
  f" Attempting to reconnect to {self._address} every {reconnect_every} second{'s' if reconnect_every != 1 else ''}"
@@ -396,7 +401,7 @@ class RobotClient:
396
401
  try:
397
402
  self._sessions_client.reset()
398
403
 
399
- channel = await dial(self._address, self._options.dial_options)
404
+ channel = await _dial_inner(self._address, self._options.dial_options)
400
405
 
401
406
  client: RobotServiceStub
402
407
  if isinstance(channel, Channel):
@@ -418,17 +423,21 @@ class RobotClient:
418
423
  direct_dial_address=direct_dial_address,
419
424
  dial_options=self._options.dial_options,
420
425
  disabled=self._options.disable_sessions,
426
+ robot_addr=self._address,
421
427
  )
422
428
 
423
429
  await self.refresh()
424
430
  self._connected = True
425
- LOGGER.debug("Successfully reconnected robot")
431
+ LOGGER.debug("Successfully reconnected machine")
426
432
  break
427
433
  except Exception as e:
428
434
  LOGGER.error(f"Failed to reconnect, trying again in {reconnect_every}sec", exc_info=e)
429
435
  self._sessions_client.reset()
430
436
  self._close_channel()
431
437
  await asyncio.sleep(reconnect_every)
438
+ if not self._connected:
439
+ # We failed to reconnect, sys.exit() so that this thread doesn't stick around forever.
440
+ sys.exit()
432
441
 
433
442
  def get_component(self, name: ResourceName) -> ComponentBase:
434
443
  """Get a component using its ResourceName.
@@ -437,7 +446,7 @@ class RobotClient:
437
446
  method for obtaining components.
438
447
  ::
439
448
 
440
- arm = Arm.from_robot(robot=robot, name="my_arm")
449
+ arm = Arm.from_robot(robot=machine, name="my_arm")
441
450
 
442
451
  Because this function returns a generic ``ComponentBase`` rather than the specific
443
452
  component type, it will be necessary to cast the returned component to the desired component. This can be done using a few
@@ -445,14 +454,14 @@ class RobotClient:
445
454
 
446
455
  - Assertion::
447
456
 
448
- arm = robot.get_component(Arm.get_resource_name("my_arm"))
457
+ arm = machine.get_component(Arm.get_resource_name("my_arm"))
449
458
  assert isinstance(arm, Arm)
450
459
  end_pos = await arm.get_end_position()
451
460
 
452
461
  - Explicit cast::
453
462
 
454
463
  from typing import cast
455
- arm = robot.get_component(Arm.get_resource_name("my_arm"))
464
+ arm = machine.get_component(Arm.get_resource_name("my_arm"))
456
465
  arm = cast(Arm, arm)
457
466
  end_pos = await arm.get_end_position()
458
467
 
@@ -461,7 +470,7 @@ class RobotClient:
461
470
  - Note: If using an IDE, a type error may be shown which can be ignored.
462
471
  ::
463
472
 
464
- arm: Arm = robot.get_component(Arm.get_resource_name("my_arm")) # type: ignore
473
+ arm: Arm = machine.get_component(Arm.get_resource_name("my_arm")) # type: ignore
465
474
  end_pos = await arm.get_end_position()
466
475
 
467
476
  Args:
@@ -488,20 +497,20 @@ class RobotClient:
488
497
  method for obtaining services.
489
498
  ::
490
499
 
491
- service = MyService.from_robot(robot=robot, name="my_service")
500
+ service = MyService.from_robot(robot=machine, name="my_service")
492
501
 
493
502
  Because this function returns a generic ``ServiceBase`` rather than a specific service type, it will be necessary to cast the
494
503
  returned service to the desired service. This can be done using a few methods:
495
504
 
496
505
  - Assertion::
497
506
 
498
- service = robot.get_service(MyService.get_resource_name("my_service"))
507
+ service = machine.get_service(MyService.get_resource_name("my_service"))
499
508
  assert isinstance(service, MyService)
500
509
 
501
510
  - Explicit cast::
502
511
 
503
512
  from typing import cast
504
- service = robot.get_service(MyService.get_resource_name("my_service"))
513
+ service = machine.get_service(MyService.get_resource_name("my_service"))
505
514
  service = cast(MyService, my_service)
506
515
 
507
516
  - Declare type on variable assignment
@@ -509,7 +518,7 @@ class RobotClient:
509
518
  - Note: If using an IDE, a type error may be shown which can be ignored.
510
519
  ::
511
520
 
512
- service: MyService = robot.get_service(MyService.get_resource_name("my_service")) # type: ignore
521
+ service: MyService = machine.get_service(MyService.get_resource_name("my_service")) # type: ignore
513
522
 
514
523
  Args:
515
524
  name (viam.proto.common.ResourceName): The service's ResourceName
@@ -535,7 +544,7 @@ class RobotClient:
535
544
 
536
545
  ::
537
546
 
538
- resource_names = robot.resource_names
547
+ resource_names = machine.resource_names
539
548
 
540
549
  Returns:
541
550
  List[viam.proto.common.ResourceName]: The list of resource names
@@ -560,7 +569,7 @@ class RobotClient:
560
569
 
561
570
  ::
562
571
 
563
- await robot.close()
572
+ await machine.close()
564
573
 
565
574
  For more information, see `Machine Management API <https://docs.viam.com/appendix/apis/robot/>`_.
566
575
  """
@@ -596,44 +605,20 @@ class RobotClient:
596
605
  async def __aexit__(self, exc_type, exc_value, traceback):
597
606
  await self.close()
598
607
 
599
- ##########
600
- # STATUS #
601
- ##########
602
- async def get_status(self, components: Optional[List[ResourceName]] = None):
603
- """
604
- Get the status of the robot's components. You can optionally
605
- provide a list of ``ResourceName`` for which you want statuses.
606
-
607
- ::
608
-
609
- # Get the status of the resources on the machine.
610
- statuses = await robot.get_status()
611
-
612
- Args:
613
- components (Optional[List[viam.proto.common.ResourceName]]): Optional list of
614
- ``ResourceName`` for components you want statuses.
615
-
616
- For more information, see `Machine Management API <https://docs.viam.com/appendix/apis/robot/>`_.
617
- """
618
- names = components if components is not None else []
619
- request = GetStatusRequest(resource_names=names)
620
- response: GetStatusResponse = await self._client.GetStatus(request)
621
- return list(response.status)
622
-
623
608
  ##############
624
609
  # OPERATIONS #
625
610
  ##############
626
611
 
627
612
  async def get_operations(self) -> List[Operation]:
628
613
  """
629
- Get the list of operations currently running on the robot.
614
+ Get the list of operations currently running on the machine.
630
615
 
631
616
  ::
632
617
 
633
- operations = await robot.get_operations()
618
+ operations = await machine.get_operations()
634
619
 
635
620
  Returns:
636
- List[viam.proto.robot.Operation]: The list of operations currently running on a given robot.
621
+ List[viam.proto.robot.Operation]: The list of operations currently running on a given machine.
637
622
 
638
623
  For more information, see `Machine Management API <https://docs.viam.com/appendix/apis/robot/>`_.
639
624
  """
@@ -643,11 +628,11 @@ class RobotClient:
643
628
 
644
629
  async def cancel_operation(self, id: str):
645
630
  """
646
- Cancels the specified operation on the robot.
631
+ Cancels the specified operation on the machine.
647
632
 
648
633
  ::
649
634
 
650
- await robot.cancel_operation("INSERT OPERATION ID")
635
+ await machine.cancel_operation("INSERT OPERATION ID")
651
636
 
652
637
  Args:
653
638
  id (str): ID of operation to cancel.
@@ -659,12 +644,12 @@ class RobotClient:
659
644
 
660
645
  async def block_for_operation(self, id: str):
661
646
  """
662
- Blocks on the specified operation on the robot. This function will only return when the specific operation
647
+ Blocks on the specified operation on the machine. This function will only return when the specific operation
663
648
  has finished or has been cancelled.
664
649
 
665
650
  ::
666
651
 
667
- await robot.block_for_operation("INSERT OPERATION ID")
652
+ await machine.block_for_operation("INSERT OPERATION ID")
668
653
 
669
654
  Args:
670
655
  id (str): ID of operation to block on.
@@ -680,16 +665,16 @@ class RobotClient:
680
665
 
681
666
  async def get_frame_system_config(self, additional_transforms: Optional[List[Transform]] = None) -> List[FrameSystemConfig]:
682
667
  """
683
- Get the configuration of the frame system of a given robot.
668
+ Get the configuration of the frame system of a given machine.
684
669
 
685
670
  ::
686
671
 
687
672
  # Get a list of each of the reference frames configured on the machine.
688
- frame_system = await robot.get_frame_system_config()
673
+ frame_system = await machine.get_frame_system_config()
689
674
  print(f"frame system configuration: {frame_system}")
690
675
 
691
676
  Returns:
692
- List[viam.proto.robot.FrameSystemConfig]: The configuration of a given robot's frame system.
677
+ List[viam.proto.robot.FrameSystemConfig]: The configuration of a given machine's frame system.
693
678
 
694
679
  For more information, see `Machine Management API <https://docs.viam.com/appendix/apis/robot/>`_.
695
680
  """
@@ -705,7 +690,24 @@ class RobotClient:
705
690
 
706
691
  ::
707
692
 
708
- pose = await robot.transform_pose(PoseInFrame(), "origin")
693
+ from viam.proto.common import Pose, PoseInFrame
694
+
695
+ pose = Pose(
696
+ x=1.0, # X coordinate in mm
697
+ y=2.0, # Y coordinate in mm
698
+ z=3.0, # Z coordinate in mm
699
+ o_x=0.0, # X component of orientation vector
700
+ o_y=0.0, # Y component of orientation vector
701
+ o_z=0.0, # Z component of orientation vector
702
+ theta=0.0 # Orientation angle in degrees
703
+ )
704
+
705
+ pose_in_frame = PoseInFrame(
706
+ reference_frame="world",
707
+ pose=pose
708
+ )
709
+
710
+ transformed_pose = await machine.transform_pose(pose_in_frame, "world")
709
711
 
710
712
  Args:
711
713
 
@@ -724,40 +726,30 @@ class RobotClient:
724
726
  async def transform_point_cloud(self):
725
727
  raise NotImplementedError()
726
728
 
727
- #######################
728
- # COMPONENT DISCOVERY #
729
- #######################
729
+ #################
730
+ # MODULE MODELS #
731
+ #################
730
732
 
731
- async def discover_components(
733
+ async def get_models_from_modules(
732
734
  self,
733
- queries: List[DiscoveryQuery],
734
- ) -> List[Discovery]:
735
+ ) -> List[ModuleModel]:
735
736
  """
736
- Get the list of discovered component configurations.
737
+ Get a list of all models provided by local and registry modules on the machine.
738
+ This includes models that are not currently configured on the machine.
737
739
 
738
740
  ::
739
741
 
740
- # Define a new discovery query.
741
- q = robot.DiscoveryQuery(subtype=acme.API, model="some model")
742
-
743
- # Define a list of discovery queries.
744
- qs = [q]
745
-
746
- # Get component configurations with these queries.
747
- component_configs = await robot.discover_components(qs)
742
+ # Get module models
743
+ module_models = await machine.get_models_from_modules(qs)
748
744
 
749
745
  Args:
750
746
 
751
- queries (List[viam.proto.robot.DiscoveryQuery]): The list of component models to lookup configurations for.
752
-
753
747
  Returns:
754
- List[Discovery]: A list of discovered component configurations.
755
-
756
- For more information, see `Machine Management API <https://docs.viam.com/appendix/apis/robot/>`_.
748
+ List[ModuleModel]: A list of discovered models.
757
749
  """
758
- request = DiscoverComponentsRequest(queries=queries)
759
- response: DiscoverComponentsResponse = await self._client.DiscoverComponents(request)
760
- return list(response.discovery)
750
+ request = GetModelsFromModulesRequest()
751
+ response: GetModelsFromModulesResponse = await self._client.GetModelsFromModules(request)
752
+ return list(response.models)
761
753
 
762
754
  ############
763
755
  # STOP ALL #
@@ -765,16 +757,12 @@ class RobotClient:
765
757
 
766
758
  async def stop_all(self, extra: Dict[ResourceName, Dict[str, Any]] = {}):
767
759
  """
768
- Cancel all current and outstanding operations for the robot and stop all actuators and movement.
760
+ Cancel all current and outstanding operations for the machine and stop all actuators and movement.
769
761
 
770
762
  ::
771
763
 
772
- # Cancel all current and outstanding operations for the robot and stop all actuators and movement.
773
- await robot.stop_all()
774
-
775
- ::
776
-
777
- await robot.stop_all()
764
+ # Cancel all current and outstanding operations for the machine and stop all actuators and movement.
765
+ await machine.stop_all()
778
766
 
779
767
  Args:
780
768
  extra (Dict[viam.proto.common.ResourceName, Dict[str, Any]]): Any extra parameters to pass to the resources' ``stop`` methods,
@@ -817,11 +805,11 @@ class RobotClient:
817
805
 
818
806
  async def get_cloud_metadata(self) -> GetCloudMetadataResponse:
819
807
  """
820
- Get app-related information about the robot.
808
+ Get app-related information about the machine.
821
809
 
822
810
  ::
823
811
 
824
- metadata = machine.get_cloud_metadata()
812
+ metadata = await machine.get_cloud_metadata()
825
813
  print(metadata.machine_id)
826
814
  print(metadata.machine_part_id)
827
815
  print(metadata.primary_org_id)
@@ -844,10 +832,14 @@ class RobotClient:
844
832
  """
845
833
  Shutdown shuts down the machine.
846
834
 
835
+ ::
836
+
837
+ await machine.shutdown()
838
+
847
839
  Raises:
848
840
  GRPCError: Raised with DeadlineExceeded status if shutdown request times out, or if
849
- robot server shuts down before having a chance to send a response. Raised with
850
- status Unavailable if server is unavailable, or if robot server is in the process of
841
+ the machine server shuts down before having a chance to send a response. Raised with
842
+ status Unavailable if server is unavailable, or if machine server is in the process of
851
843
  shutting down when response is ready.
852
844
 
853
845
  For more information, see `Machine Management API <https://docs.viam.com/appendix/apis/robot/>`_.
@@ -867,3 +859,79 @@ class RobotClient:
867
859
  raise e
868
860
  else:
869
861
  raise e
862
+
863
+ ######################
864
+ # Get Version #
865
+ ######################
866
+
867
+ async def get_version(self) -> GetVersionResponse:
868
+ """
869
+ Get version information about the machine.
870
+
871
+ ::
872
+
873
+ result = await machine.get_version()
874
+ print(result.platform)
875
+ print(result.version)
876
+ print(result.api_version)
877
+
878
+ Returns:
879
+ viam.proto.robot.GetVersionResponse: Machine version related information.
880
+
881
+ For more information, see `Machine Management API <https://docs.viam.com/appendix/apis/robot/>`_.
882
+ """
883
+
884
+ request = GetVersionRequest()
885
+ return await self._client.GetVersion(request)
886
+
887
+ ######################
888
+ # Get Machine Status #
889
+ ######################
890
+
891
+ async def get_machine_status(self) -> GetMachineStatusResponse:
892
+ """
893
+ Get status information about the machine's resources and configuration.
894
+
895
+ ::
896
+
897
+ machine_status = await machine.get_machine_status()
898
+ machine_state = machine_status.state
899
+ resource_statuses = machine_status.resources
900
+ cloud_metadata = machine_status.resources[0].cloud_metadata
901
+ config_status = machine_status.config
902
+
903
+ Returns:
904
+ viam.proto.robot.GetMachineStatusResponse: current status of the machine (initializing or running), current status of the resources (List[ResourceStatus]) and the revision of the config of the machine.
905
+
906
+ For more information, see `Machine Management API <https://docs.viam.com/appendix/apis/robot/>`_.
907
+ """
908
+
909
+ request = GetMachineStatusRequest()
910
+ return await self._client.GetMachineStatus(request)
911
+
912
+ ##################
913
+ # Restart Module #
914
+ ##################
915
+
916
+ async def restart_module(self, id: Optional[str] = None, name: Optional[str] = None):
917
+ """
918
+ Restarts a module running on the machine with the given id or name.
919
+
920
+ ::
921
+
922
+ await machine.restart_module(id="namespace:module:model", name="my_model")
923
+
924
+ Args:
925
+ id (str): The id matching the module_id field of the registry module in your part configuration.
926
+ name (str): The name matching the name field of the local/registry module in your part configuration.
927
+
928
+ Raises:
929
+ GRPCError: If a module can't be found matching the provided ID or name.
930
+
931
+ For more information, see `Machine Management API <https://docs.viam.com/appendix/apis/robot/>`_.
932
+ """
933
+
934
+ id = id if id else ""
935
+ name = name if name else ""
936
+ request = RestartModuleRequest(module_id=id, module_name=name)
937
+ await self._client.RestartModule(request)