viam-sdk 0.45.2__py3-none-win_amd64.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.

Files changed (476) hide show
  1. viam/__init__.py +71 -0
  2. viam/app/__init__.py +0 -0
  3. viam/app/_logs.py +34 -0
  4. viam/app/app_client.py +2525 -0
  5. viam/app/billing_client.py +143 -0
  6. viam/app/data_client.py +1715 -0
  7. viam/app/ml_training_client.py +251 -0
  8. viam/app/provisioning_client.py +95 -0
  9. viam/app/viam_client.py +260 -0
  10. viam/components/__init__.py +0 -0
  11. viam/components/arm/__init__.py +16 -0
  12. viam/components/arm/arm.py +223 -0
  13. viam/components/arm/client.py +124 -0
  14. viam/components/arm/service.py +123 -0
  15. viam/components/audio_input/__init__.py +18 -0
  16. viam/components/audio_input/audio_input.py +81 -0
  17. viam/components/audio_input/client.py +70 -0
  18. viam/components/audio_input/service.py +114 -0
  19. viam/components/base/__init__.py +13 -0
  20. viam/components/base/base.py +260 -0
  21. viam/components/base/client.py +153 -0
  22. viam/components/base/service.py +138 -0
  23. viam/components/board/__init__.py +9 -0
  24. viam/components/board/board.py +414 -0
  25. viam/components/board/client.py +241 -0
  26. viam/components/board/service.py +223 -0
  27. viam/components/button/__init__.py +10 -0
  28. viam/components/button/button.py +41 -0
  29. viam/components/button/client.py +52 -0
  30. viam/components/button/service.py +46 -0
  31. viam/components/camera/__init__.py +22 -0
  32. viam/components/camera/camera.py +138 -0
  33. viam/components/camera/client.py +98 -0
  34. viam/components/camera/service.py +105 -0
  35. viam/components/component_base.py +65 -0
  36. viam/components/encoder/__init__.py +18 -0
  37. viam/components/encoder/client.py +83 -0
  38. viam/components/encoder/encoder.py +118 -0
  39. viam/components/encoder/service.py +72 -0
  40. viam/components/gantry/__init__.py +11 -0
  41. viam/components/gantry/client.py +115 -0
  42. viam/components/gantry/gantry.py +156 -0
  43. viam/components/gantry/service.py +113 -0
  44. viam/components/generic/__init__.py +18 -0
  45. viam/components/generic/client.py +62 -0
  46. viam/components/generic/generic.py +76 -0
  47. viam/components/generic/service.py +40 -0
  48. viam/components/gripper/__init__.py +11 -0
  49. viam/components/gripper/client.py +85 -0
  50. viam/components/gripper/gripper.py +114 -0
  51. viam/components/gripper/service.py +81 -0
  52. viam/components/input/__init__.py +15 -0
  53. viam/components/input/client.py +194 -0
  54. viam/components/input/input.py +297 -0
  55. viam/components/input/service.py +175 -0
  56. viam/components/motor/__init__.py +11 -0
  57. viam/components/motor/client.py +168 -0
  58. viam/components/motor/motor.py +301 -0
  59. viam/components/motor/service.py +150 -0
  60. viam/components/movement_sensor/__init__.py +21 -0
  61. viam/components/movement_sensor/client.py +161 -0
  62. viam/components/movement_sensor/movement_sensor.py +253 -0
  63. viam/components/movement_sensor/service.py +146 -0
  64. viam/components/pose_tracker/__init__.py +17 -0
  65. viam/components/pose_tracker/client.py +50 -0
  66. viam/components/pose_tracker/pose_tracker.py +40 -0
  67. viam/components/pose_tracker/service.py +45 -0
  68. viam/components/power_sensor/__init__.py +17 -0
  69. viam/components/power_sensor/client.py +86 -0
  70. viam/components/power_sensor/power_sensor.py +104 -0
  71. viam/components/power_sensor/service.py +72 -0
  72. viam/components/sensor/__init__.py +18 -0
  73. viam/components/sensor/client.py +49 -0
  74. viam/components/sensor/sensor.py +48 -0
  75. viam/components/sensor/service.py +51 -0
  76. viam/components/servo/__init__.py +11 -0
  77. viam/components/servo/client.py +86 -0
  78. viam/components/servo/service.py +80 -0
  79. viam/components/servo/servo.py +114 -0
  80. viam/components/switch/__init__.py +10 -0
  81. viam/components/switch/client.py +83 -0
  82. viam/components/switch/service.py +72 -0
  83. viam/components/switch/switch.py +95 -0
  84. viam/errors.py +105 -0
  85. viam/gen/__init__.py +0 -0
  86. viam/gen/app/__init__.py +0 -0
  87. viam/gen/app/agent/__init__.py +0 -0
  88. viam/gen/app/agent/v1/__init__.py +0 -0
  89. viam/gen/app/agent/v1/agent_grpc.py +29 -0
  90. viam/gen/app/agent/v1/agent_pb2.py +47 -0
  91. viam/gen/app/agent/v1/agent_pb2.pyi +280 -0
  92. viam/gen/app/cloudslam/__init__.py +0 -0
  93. viam/gen/app/cloudslam/v1/__init__.py +0 -0
  94. viam/gen/app/cloudslam/v1/cloud_slam_grpc.py +70 -0
  95. viam/gen/app/cloudslam/v1/cloud_slam_pb2.py +54 -0
  96. viam/gen/app/cloudslam/v1/cloud_slam_pb2.pyi +384 -0
  97. viam/gen/app/data/__init__.py +0 -0
  98. viam/gen/app/data/v1/__init__.py +0 -0
  99. viam/gen/app/data/v1/data_grpc.py +206 -0
  100. viam/gen/app/data/v1/data_pb2.py +178 -0
  101. viam/gen/app/data/v1/data_pb2.pyi +1485 -0
  102. viam/gen/app/datapipelines/__init__.py +0 -0
  103. viam/gen/app/datapipelines/v1/__init__.py +0 -0
  104. viam/gen/app/datapipelines/v1/data_pipelines_grpc.py +84 -0
  105. viam/gen/app/datapipelines/v1/data_pipelines_pb2.py +56 -0
  106. viam/gen/app/datapipelines/v1/data_pipelines_pb2.pyi +370 -0
  107. viam/gen/app/dataset/__init__.py +0 -0
  108. viam/gen/app/dataset/v1/__init__.py +0 -0
  109. viam/gen/app/dataset/v1/dataset_grpc.py +60 -0
  110. viam/gen/app/dataset/v1/dataset_pb2.py +40 -0
  111. viam/gen/app/dataset/v1/dataset_pb2.pyi +179 -0
  112. viam/gen/app/datasync/__init__.py +0 -0
  113. viam/gen/app/datasync/v1/__init__.py +0 -0
  114. viam/gen/app/datasync/v1/data_sync_grpc.py +47 -0
  115. viam/gen/app/datasync/v1/data_sync_pb2.py +70 -0
  116. viam/gen/app/datasync/v1/data_sync_pb2.pyi +425 -0
  117. viam/gen/app/mlinference/__init__.py +0 -0
  118. viam/gen/app/mlinference/v1/__init__.py +0 -0
  119. viam/gen/app/mlinference/v1/ml_inference_grpc.py +28 -0
  120. viam/gen/app/mlinference/v1/ml_inference_pb2.py +23 -0
  121. viam/gen/app/mlinference/v1/ml_inference_pb2.pyi +63 -0
  122. viam/gen/app/mltraining/__init__.py +0 -0
  123. viam/gen/app/mltraining/v1/__init__.py +0 -0
  124. viam/gen/app/mltraining/v1/ml_training_grpc.py +78 -0
  125. viam/gen/app/mltraining/v1/ml_training_pb2.py +124 -0
  126. viam/gen/app/mltraining/v1/ml_training_pb2.pyi +415 -0
  127. viam/gen/app/packages/__init__.py +0 -0
  128. viam/gen/app/packages/v1/__init__.py +0 -0
  129. viam/gen/app/packages/v1/packages_grpc.py +54 -0
  130. viam/gen/app/packages/v1/packages_pb2.py +52 -0
  131. viam/gen/app/packages/v1/packages_pb2.pyi +311 -0
  132. viam/gen/app/v1/__init__.py +0 -0
  133. viam/gen/app/v1/app_grpc.py +863 -0
  134. viam/gen/app/v1/app_pb2.py +649 -0
  135. viam/gen/app/v1/app_pb2.pyi +5279 -0
  136. viam/gen/app/v1/billing_grpc.py +76 -0
  137. viam/gen/app/v1/billing_pb2.py +92 -0
  138. viam/gen/app/v1/billing_pb2.pyi +463 -0
  139. viam/gen/app/v1/end_user_grpc.py +59 -0
  140. viam/gen/app/v1/end_user_pb2.py +55 -0
  141. viam/gen/app/v1/end_user_pb2.pyi +181 -0
  142. viam/gen/app/v1/robot_grpc.py +55 -0
  143. viam/gen/app/v1/robot_pb2.py +127 -0
  144. viam/gen/app/v1/robot_pb2.pyi +1202 -0
  145. viam/gen/common/__init__.py +0 -0
  146. viam/gen/common/v1/__init__.py +0 -0
  147. viam/gen/common/v1/common_grpc.py +0 -0
  148. viam/gen/common/v1/common_pb2.py +78 -0
  149. viam/gen/common/v1/common_pb2.pyi +687 -0
  150. viam/gen/component/__init__.py +0 -0
  151. viam/gen/component/arm/__init__.py +0 -0
  152. viam/gen/component/arm/v1/__init__.py +0 -0
  153. viam/gen/component/arm/v1/arm_grpc.py +102 -0
  154. viam/gen/component/arm/v1/arm_pb2.py +74 -0
  155. viam/gen/component/arm/v1/arm_pb2.pyi +344 -0
  156. viam/gen/component/audioinput/__init__.py +0 -0
  157. viam/gen/component/audioinput/v1/__init__.py +0 -0
  158. viam/gen/component/audioinput/v1/audioinput_grpc.py +63 -0
  159. viam/gen/component/audioinput/v1/audioinput_pb2.py +45 -0
  160. viam/gen/component/audioinput/v1/audioinput_pb2.pyi +179 -0
  161. viam/gen/component/base/__init__.py +0 -0
  162. viam/gen/component/base/v1/__init__.py +0 -0
  163. viam/gen/component/base/v1/base_grpc.py +94 -0
  164. viam/gen/component/base/v1/base_pb2.py +66 -0
  165. viam/gen/component/base/v1/base_pb2.pyi +258 -0
  166. viam/gen/component/board/__init__.py +0 -0
  167. viam/gen/component/board/v1/__init__.py +0 -0
  168. viam/gen/component/board/v1/board_grpc.py +127 -0
  169. viam/gen/component/board/v1/board_pb2.py +103 -0
  170. viam/gen/component/board/v1/board_pb2.pyi +496 -0
  171. viam/gen/component/button/__init__.py +0 -0
  172. viam/gen/component/button/v1/__init__.py +0 -0
  173. viam/gen/component/button/v1/button_grpc.py +38 -0
  174. viam/gen/component/button/v1/button_pb2.py +28 -0
  175. viam/gen/component/button/v1/button_pb2.pyi +39 -0
  176. viam/gen/component/camera/__init__.py +0 -0
  177. viam/gen/component/camera/v1/__init__.py +0 -0
  178. viam/gen/component/camera/v1/camera_grpc.py +79 -0
  179. viam/gen/component/camera/v1/camera_pb2.py +67 -0
  180. viam/gen/component/camera/v1/camera_pb2.pyi +373 -0
  181. viam/gen/component/encoder/__init__.py +0 -0
  182. viam/gen/component/encoder/v1/__init__.py +0 -0
  183. viam/gen/component/encoder/v1/encoder_grpc.py +62 -0
  184. viam/gen/component/encoder/v1/encoder_pb2.py +44 -0
  185. viam/gen/component/encoder/v1/encoder_pb2.pyi +147 -0
  186. viam/gen/component/gantry/__init__.py +0 -0
  187. viam/gen/component/gantry/v1/__init__.py +0 -0
  188. viam/gen/component/gantry/v1/gantry_grpc.py +86 -0
  189. viam/gen/component/gantry/v1/gantry_pb2.py +62 -0
  190. viam/gen/component/gantry/v1/gantry_pb2.pyi +239 -0
  191. viam/gen/component/generic/__init__.py +0 -0
  192. viam/gen/component/generic/v1/__init__.py +0 -0
  193. viam/gen/component/generic/v1/generic_grpc.py +37 -0
  194. viam/gen/component/generic/v1/generic_pb2.py +23 -0
  195. viam/gen/component/generic/v1/generic_pb2.pyi +6 -0
  196. viam/gen/component/gripper/__init__.py +0 -0
  197. viam/gen/component/gripper/v1/__init__.py +0 -0
  198. viam/gen/component/gripper/v1/gripper_grpc.py +70 -0
  199. viam/gen/component/gripper/v1/gripper_pb2.py +48 -0
  200. viam/gen/component/gripper/v1/gripper_pb2.pyi +137 -0
  201. viam/gen/component/inputcontroller/__init__.py +0 -0
  202. viam/gen/component/inputcontroller/v1/__init__.py +0 -0
  203. viam/gen/component/inputcontroller/v1/input_controller_grpc.py +71 -0
  204. viam/gen/component/inputcontroller/v1/input_controller_pb2.py +55 -0
  205. viam/gen/component/inputcontroller/v1/input_controller_pb2.pyi +243 -0
  206. viam/gen/component/motor/__init__.py +0 -0
  207. viam/gen/component/motor/v1/__init__.py +0 -0
  208. viam/gen/component/motor/v1/motor_grpc.py +118 -0
  209. viam/gen/component/motor/v1/motor_pb2.py +86 -0
  210. viam/gen/component/motor/v1/motor_pb2.pyi +368 -0
  211. viam/gen/component/movementsensor/__init__.py +0 -0
  212. viam/gen/component/movementsensor/v1/__init__.py +0 -0
  213. viam/gen/component/movementsensor/v1/movementsensor_grpc.py +110 -0
  214. viam/gen/component/movementsensor/v1/movementsensor_pb2.py +78 -0
  215. viam/gen/component/movementsensor/v1/movementsensor_pb2.pyi +384 -0
  216. viam/gen/component/posetracker/__init__.py +0 -0
  217. viam/gen/component/posetracker/v1/__init__.py +0 -0
  218. viam/gen/component/posetracker/v1/pose_tracker_grpc.py +46 -0
  219. viam/gen/component/posetracker/v1/pose_tracker_pb2.py +34 -0
  220. viam/gen/component/posetracker/v1/pose_tracker_pb2.pyi +79 -0
  221. viam/gen/component/powersensor/__init__.py +0 -0
  222. viam/gen/component/powersensor/v1/__init__.py +0 -0
  223. viam/gen/component/powersensor/v1/powersensor_grpc.py +62 -0
  224. viam/gen/component/powersensor/v1/powersensor_pb2.py +42 -0
  225. viam/gen/component/powersensor/v1/powersensor_pb2.pyi +124 -0
  226. viam/gen/component/sensor/__init__.py +0 -0
  227. viam/gen/component/sensor/v1/__init__.py +0 -0
  228. viam/gen/component/sensor/v1/sensor_grpc.py +45 -0
  229. viam/gen/component/sensor/v1/sensor_pb2.py +25 -0
  230. viam/gen/component/sensor/v1/sensor_pb2.pyi +6 -0
  231. viam/gen/component/servo/__init__.py +0 -0
  232. viam/gen/component/servo/v1/__init__.py +0 -0
  233. viam/gen/component/servo/v1/servo_grpc.py +70 -0
  234. viam/gen/component/servo/v1/servo_pb2.py +50 -0
  235. viam/gen/component/servo/v1/servo_pb2.pyi +150 -0
  236. viam/gen/component/switch/__init__.py +0 -0
  237. viam/gen/component/switch/v1/__init__.py +0 -0
  238. viam/gen/component/switch/v1/switch_grpc.py +54 -0
  239. viam/gen/component/switch/v1/switch_pb2.py +40 -0
  240. viam/gen/component/switch/v1/switch_pb2.pyi +109 -0
  241. viam/gen/component/testecho/__init__.py +0 -0
  242. viam/gen/component/testecho/v1/__init__.py +0 -0
  243. viam/gen/component/testecho/v1/testecho_grpc.py +52 -0
  244. viam/gen/component/testecho/v1/testecho_pb2.py +36 -0
  245. viam/gen/component/testecho/v1/testecho_pb2.pyi +114 -0
  246. viam/gen/module/__init__.py +0 -0
  247. viam/gen/module/v1/__init__.py +0 -0
  248. viam/gen/module/v1/module_grpc.py +61 -0
  249. viam/gen/module/v1/module_pb2.py +43 -0
  250. viam/gen/module/v1/module_pb2.pyi +211 -0
  251. viam/gen/proto/__init__.py +0 -0
  252. viam/gen/proto/rpc/__init__.py +0 -0
  253. viam/gen/proto/rpc/examples/__init__.py +0 -0
  254. viam/gen/proto/rpc/examples/echo/__init__.py +0 -0
  255. viam/gen/proto/rpc/examples/echo/v1/__init__.py +0 -0
  256. viam/gen/proto/rpc/examples/echo/v1/echo_grpc.py +44 -0
  257. viam/gen/proto/rpc/examples/echo/v1/echo_pb2.py +32 -0
  258. viam/gen/proto/rpc/examples/echo/v1/echo_pb2.pyi +87 -0
  259. viam/gen/proto/rpc/examples/echoresource/__init__.py +0 -0
  260. viam/gen/proto/rpc/examples/echoresource/v1/__init__.py +0 -0
  261. viam/gen/proto/rpc/examples/echoresource/v1/echoresource_grpc.py +43 -0
  262. viam/gen/proto/rpc/examples/echoresource/v1/echoresource_pb2.py +29 -0
  263. viam/gen/proto/rpc/examples/echoresource/v1/echoresource_pb2.pyi +93 -0
  264. viam/gen/proto/rpc/v1/__init__.py +0 -0
  265. viam/gen/proto/rpc/v1/auth_grpc.py +47 -0
  266. viam/gen/proto/rpc/v1/auth_pb2.py +34 -0
  267. viam/gen/proto/rpc/v1/auth_pb2.pyi +92 -0
  268. viam/gen/proto/rpc/webrtc/__init__.py +0 -0
  269. viam/gen/proto/rpc/webrtc/v1/__init__.py +0 -0
  270. viam/gen/proto/rpc/webrtc/v1/grpc_grpc.py +0 -0
  271. viam/gen/proto/rpc/webrtc/v1/grpc_pb2.py +43 -0
  272. viam/gen/proto/rpc/webrtc/v1/grpc_pb2.pyi +304 -0
  273. viam/gen/proto/rpc/webrtc/v1/signaling_grpc.py +54 -0
  274. viam/gen/proto/rpc/webrtc/v1/signaling_pb2.py +70 -0
  275. viam/gen/proto/rpc/webrtc/v1/signaling_pb2.pyi +496 -0
  276. viam/gen/provisioning/__init__.py +0 -0
  277. viam/gen/provisioning/v1/__init__.py +0 -0
  278. viam/gen/provisioning/v1/provisioning_grpc.py +51 -0
  279. viam/gen/provisioning/v1/provisioning_pb2.py +39 -0
  280. viam/gen/provisioning/v1/provisioning_pb2.pyi +188 -0
  281. viam/gen/robot/__init__.py +0 -0
  282. viam/gen/robot/v1/__init__.py +0 -0
  283. viam/gen/robot/v1/robot_grpc.py +208 -0
  284. viam/gen/robot/v1/robot_pb2.py +188 -0
  285. viam/gen/robot/v1/robot_pb2.pyi +1020 -0
  286. viam/gen/service/__init__.py +0 -0
  287. viam/gen/service/datamanager/__init__.py +0 -0
  288. viam/gen/service/datamanager/v1/__init__.py +0 -0
  289. viam/gen/service/datamanager/v1/data_manager_grpc.py +38 -0
  290. viam/gen/service/datamanager/v1/data_manager_pb2.py +28 -0
  291. viam/gen/service/datamanager/v1/data_manager_pb2.pyi +39 -0
  292. viam/gen/service/discovery/__init__.py +0 -0
  293. viam/gen/service/discovery/v1/__init__.py +0 -0
  294. viam/gen/service/discovery/v1/discovery_grpc.py +39 -0
  295. viam/gen/service/discovery/v1/discovery_pb2.py +29 -0
  296. viam/gen/service/discovery/v1/discovery_pb2.pyi +51 -0
  297. viam/gen/service/generic/__init__.py +0 -0
  298. viam/gen/service/generic/v1/__init__.py +0 -0
  299. viam/gen/service/generic/v1/generic_grpc.py +29 -0
  300. viam/gen/service/generic/v1/generic_pb2.py +21 -0
  301. viam/gen/service/generic/v1/generic_pb2.pyi +6 -0
  302. viam/gen/service/mlmodel/__init__.py +0 -0
  303. viam/gen/service/mlmodel/v1/__init__.py +0 -0
  304. viam/gen/service/mlmodel/v1/mlmodel_grpc.py +37 -0
  305. viam/gen/service/mlmodel/v1/mlmodel_pb2.py +83 -0
  306. viam/gen/service/mlmodel/v1/mlmodel_pb2.pyi +480 -0
  307. viam/gen/service/motion/__init__.py +0 -0
  308. viam/gen/service/motion/v1/__init__.py +0 -0
  309. viam/gen/service/motion/v1/motion_grpc.py +87 -0
  310. viam/gen/service/motion/v1/motion_pb2.py +97 -0
  311. viam/gen/service/motion/v1/motion_pb2.pyi +838 -0
  312. viam/gen/service/navigation/__init__.py +0 -0
  313. viam/gen/service/navigation/v1/__init__.py +0 -0
  314. viam/gen/service/navigation/v1/navigation_grpc.py +102 -0
  315. viam/gen/service/navigation/v1/navigation_pb2.py +84 -0
  316. viam/gen/service/navigation/v1/navigation_pb2.pyi +419 -0
  317. viam/gen/service/sensors/__init__.py +0 -0
  318. viam/gen/service/sensors/v1/__init__.py +0 -0
  319. viam/gen/service/sensors/v1/sensors_grpc.py +46 -0
  320. viam/gen/service/sensors/v1/sensors_pb2.py +68 -0
  321. viam/gen/service/sensors/v1/sensors_pb2.pyi +137 -0
  322. viam/gen/service/shell/__init__.py +0 -0
  323. viam/gen/service/shell/v1/__init__.py +0 -0
  324. viam/gen/service/shell/v1/shell_grpc.py +55 -0
  325. viam/gen/service/shell/v1/shell_pb2.py +45 -0
  326. viam/gen/service/shell/v1/shell_pb2.pyi +307 -0
  327. viam/gen/service/slam/__init__.py +0 -0
  328. viam/gen/service/slam/v1/__init__.py +0 -0
  329. viam/gen/service/slam/v1/slam_grpc.py +61 -0
  330. viam/gen/service/slam/v1/slam_pb2.py +51 -0
  331. viam/gen/service/slam/v1/slam_pb2.pyi +213 -0
  332. viam/gen/service/vision/__init__.py +0 -0
  333. viam/gen/service/vision/v1/__init__.py +0 -0
  334. viam/gen/service/vision/v1/vision_grpc.py +87 -0
  335. viam/gen/service/vision/v1/vision_pb2.py +69 -0
  336. viam/gen/service/vision/v1/vision_pb2.pyi +454 -0
  337. viam/gen/stream/__init__.py +0 -0
  338. viam/gen/stream/v1/__init__.py +0 -0
  339. viam/gen/stream/v1/stream_grpc.py +59 -0
  340. viam/gen/stream/v1/stream_pb2.py +39 -0
  341. viam/gen/stream/v1/stream_pb2.pyi +161 -0
  342. viam/gen/tagger/__init__.py +0 -0
  343. viam/gen/tagger/v1/__init__.py +0 -0
  344. viam/gen/tagger/v1/tagger_grpc.py +0 -0
  345. viam/gen/tagger/v1/tagger_pb2.py +16 -0
  346. viam/gen/tagger/v1/tagger_pb2.pyi +15 -0
  347. viam/logging.py +216 -0
  348. viam/media/__init__.py +0 -0
  349. viam/media/audio.py +16 -0
  350. viam/media/utils/__init__.py +0 -0
  351. viam/media/utils/pil/__init__.py +51 -0
  352. viam/media/utils/pil/viam_rgba_plugin.py +73 -0
  353. viam/media/viam_rgba.py +10 -0
  354. viam/media/video.py +217 -0
  355. viam/module/__init__.py +5 -0
  356. viam/module/module.py +281 -0
  357. viam/module/service.py +66 -0
  358. viam/module/types.py +23 -0
  359. viam/operations.py +124 -0
  360. viam/proto/__init__.py +0 -0
  361. viam/proto/app/__init__.py +554 -0
  362. viam/proto/app/agent/__init__.py +28 -0
  363. viam/proto/app/billing.py +58 -0
  364. viam/proto/app/cloudslam/__init__.py +48 -0
  365. viam/proto/app/data/__init__.py +138 -0
  366. viam/proto/app/datapipelines/__init__.py +56 -0
  367. viam/proto/app/dataset/__init__.py +36 -0
  368. viam/proto/app/datasync/__init__.py +44 -0
  369. viam/proto/app/end_user.py +34 -0
  370. viam/proto/app/mlinference/__init__.py +15 -0
  371. viam/proto/app/mltraining/__init__.py +52 -0
  372. viam/proto/app/packages/__init__.py +38 -0
  373. viam/proto/app/robot.py +84 -0
  374. viam/proto/common/__init__.py +66 -0
  375. viam/proto/component/__init__.py +0 -0
  376. viam/proto/component/arm/__init__.py +48 -0
  377. viam/proto/component/audioinput/__init__.py +30 -0
  378. viam/proto/component/base/__init__.py +42 -0
  379. viam/proto/component/board/__init__.py +62 -0
  380. viam/proto/component/button/__init__.py +15 -0
  381. viam/proto/component/camera/__init__.py +46 -0
  382. viam/proto/component/encoder/__init__.py +28 -0
  383. viam/proto/component/gantry/__init__.py +40 -0
  384. viam/proto/component/generic/__init__.py +12 -0
  385. viam/proto/component/gripper/__init__.py +30 -0
  386. viam/proto/component/inputcontroller/__init__.py +38 -0
  387. viam/proto/component/motor/__init__.py +56 -0
  388. viam/proto/component/movementsensor/__init__.py +50 -0
  389. viam/proto/component/posetracker/__init__.py +19 -0
  390. viam/proto/component/powersensor/__init__.py +30 -0
  391. viam/proto/component/sensor/__init__.py +12 -0
  392. viam/proto/component/servo/__init__.py +32 -0
  393. viam/proto/component/switch/__init__.py +26 -0
  394. viam/proto/component/testecho/__init__.py +30 -0
  395. viam/proto/module/__init__.py +38 -0
  396. viam/proto/provisioning/__init__.py +36 -0
  397. viam/proto/robot/__init__.py +130 -0
  398. viam/proto/rpc/__init__.py +0 -0
  399. viam/proto/rpc/auth.py +34 -0
  400. viam/proto/rpc/examples/__init__.py +0 -0
  401. viam/proto/rpc/examples/echo/__init__.py +26 -0
  402. viam/proto/rpc/examples/echoresource/__init__.py +30 -0
  403. viam/proto/rpc/webrtc/__init__.py +0 -0
  404. viam/proto/rpc/webrtc/grpc.py +36 -0
  405. viam/proto/rpc/webrtc/signaling.py +58 -0
  406. viam/proto/service/__init__.py +0 -0
  407. viam/proto/service/datamanager/__init__.py +19 -0
  408. viam/proto/service/discovery/__init__.py +15 -0
  409. viam/proto/service/generic/__init__.py +12 -0
  410. viam/proto/service/mlmodel/__init__.py +54 -0
  411. viam/proto/service/motion/__init__.py +68 -0
  412. viam/proto/service/navigation/__init__.py +58 -0
  413. viam/proto/service/sensors/__init__.py +18 -0
  414. viam/proto/service/shell/__init__.py +36 -0
  415. viam/proto/service/slam/__init__.py +36 -0
  416. viam/proto/service/vision/__init__.py +46 -0
  417. viam/proto/stream/__init__.py +36 -0
  418. viam/proto/tagger/__init__.py +6 -0
  419. viam/py.typed +0 -0
  420. viam/resource/__init__.py +0 -0
  421. viam/resource/base.py +123 -0
  422. viam/resource/easy_resource.py +153 -0
  423. viam/resource/manager.py +126 -0
  424. viam/resource/registry.py +199 -0
  425. viam/resource/rpc_client_base.py +65 -0
  426. viam/resource/rpc_service_base.py +48 -0
  427. viam/resource/types.py +213 -0
  428. viam/robot/__init__.py +0 -0
  429. viam/robot/client.py +909 -0
  430. viam/robot/service.py +69 -0
  431. viam/rpc/__init__.py +0 -0
  432. viam/rpc/dial.py +420 -0
  433. viam/rpc/libviam_rust_utils.dll +0 -0
  434. viam/rpc/server.py +201 -0
  435. viam/rpc/signaling.py +29 -0
  436. viam/rpc/types.py +22 -0
  437. viam/services/__init__.py +0 -0
  438. viam/services/discovery/__init__.py +12 -0
  439. viam/services/discovery/client.py +55 -0
  440. viam/services/discovery/discovery.py +52 -0
  441. viam/services/discovery/service.py +43 -0
  442. viam/services/generic/__init__.py +18 -0
  443. viam/services/generic/client.py +58 -0
  444. viam/services/generic/generic.py +58 -0
  445. viam/services/generic/service.py +29 -0
  446. viam/services/mlmodel/__init__.py +24 -0
  447. viam/services/mlmodel/client.py +37 -0
  448. viam/services/mlmodel/mlmodel.py +78 -0
  449. viam/services/mlmodel/service.py +38 -0
  450. viam/services/mlmodel/utils.py +101 -0
  451. viam/services/motion/__init__.py +17 -0
  452. viam/services/motion/client.py +215 -0
  453. viam/services/motion/motion.py +378 -0
  454. viam/services/motion/service.py +132 -0
  455. viam/services/navigation/__init__.py +11 -0
  456. viam/services/navigation/client.py +99 -0
  457. viam/services/navigation/navigation.py +250 -0
  458. viam/services/navigation/service.py +137 -0
  459. viam/services/service_base.py +78 -0
  460. viam/services/service_client_base.py +46 -0
  461. viam/services/slam/__init__.py +17 -0
  462. viam/services/slam/client.py +62 -0
  463. viam/services/slam/service.py +75 -0
  464. viam/services/slam/slam.py +111 -0
  465. viam/services/vision/__init__.py +15 -0
  466. viam/services/vision/client.py +206 -0
  467. viam/services/vision/service.py +146 -0
  468. viam/services/vision/vision.py +315 -0
  469. viam/sessions_client.py +245 -0
  470. viam/streams.py +44 -0
  471. viam/utils.py +365 -0
  472. viam/version_metadata.py +4 -0
  473. viam_sdk-0.45.2.dist-info/METADATA +157 -0
  474. viam_sdk-0.45.2.dist-info/RECORD +476 -0
  475. viam_sdk-0.45.2.dist-info/WHEEL +4 -0
  476. viam_sdk-0.45.2.dist-info/licenses/LICENSE +202 -0
@@ -0,0 +1,17 @@
1
+ from viam.proto.service.motion import Constraints, MotionConfiguration
2
+ from viam.resource.registry import Registry, ResourceRegistration
3
+
4
+ from .client import MotionClient
5
+ from .motion import Motion
6
+ from .service import MotionRPCService
7
+
8
+ __all__ = ["Motion", "MotionClient", "MotionConfiguration", "Constraints"]
9
+
10
+
11
+ Registry.register_api(
12
+ ResourceRegistration(
13
+ Motion,
14
+ MotionRPCService,
15
+ lambda name, channel: MotionClient(name, channel),
16
+ )
17
+ )
@@ -0,0 +1,215 @@
1
+ from typing import Any, Mapping, Optional, Sequence
2
+
3
+ from grpclib.client import Channel
4
+
5
+ from viam.proto.common import (
6
+ DoCommandRequest,
7
+ DoCommandResponse,
8
+ GeoGeometry,
9
+ Geometry,
10
+ GeoPoint,
11
+ Pose,
12
+ PoseInFrame,
13
+ ResourceName,
14
+ Transform,
15
+ WorldState,
16
+ )
17
+ from viam.proto.service.motion import (
18
+ Constraints,
19
+ GetPlanRequest,
20
+ GetPlanResponse,
21
+ GetPoseRequest,
22
+ GetPoseResponse,
23
+ ListPlanStatusesRequest,
24
+ ListPlanStatusesResponse,
25
+ MotionConfiguration,
26
+ MotionServiceStub,
27
+ MoveOnGlobeRequest,
28
+ MoveOnGlobeResponse,
29
+ MoveOnMapRequest,
30
+ MoveOnMapResponse,
31
+ MoveRequest,
32
+ MoveResponse,
33
+ PlanStatusWithID,
34
+ StopPlanRequest,
35
+ StopPlanResponse,
36
+ )
37
+ from viam.resource.rpc_client_base import ReconfigurableResourceRPCClientBase
38
+ from viam.utils import ValueTypes, dict_to_struct, struct_to_dict
39
+
40
+ from .motion import Motion
41
+
42
+
43
+ class MotionClient(Motion, ReconfigurableResourceRPCClientBase):
44
+ """
45
+ gRPC client for the Motion service.
46
+ """
47
+
48
+ client: MotionServiceStub
49
+
50
+ def __init__(self, name: str, channel: Channel):
51
+ self.channel = channel
52
+ self.client = MotionServiceStub(channel)
53
+ super().__init__(name)
54
+
55
+ async def move(
56
+ self,
57
+ component_name: ResourceName,
58
+ destination: PoseInFrame,
59
+ world_state: Optional[WorldState] = None,
60
+ constraints: Optional[Constraints] = None,
61
+ *,
62
+ extra: Optional[Mapping[str, Any]] = None,
63
+ timeout: Optional[float] = None,
64
+ **kwargs,
65
+ ) -> bool:
66
+ md = kwargs.get("metadata", self.Metadata()).proto
67
+ request = MoveRequest(
68
+ name=self.name,
69
+ destination=destination,
70
+ component_name=component_name,
71
+ world_state=world_state,
72
+ constraints=constraints,
73
+ extra=dict_to_struct(extra),
74
+ )
75
+ response: MoveResponse = await self.client.Move(request, timeout=timeout, metadata=md)
76
+ return response.success
77
+
78
+ async def move_on_globe(
79
+ self,
80
+ component_name: ResourceName,
81
+ destination: GeoPoint,
82
+ movement_sensor_name: ResourceName,
83
+ obstacles: Optional[Sequence[GeoGeometry]] = None,
84
+ heading: Optional[float] = None,
85
+ configuration: Optional[MotionConfiguration] = None,
86
+ *,
87
+ bounding_regions: Optional[Sequence[GeoGeometry]] = None,
88
+ extra: Optional[Mapping[str, ValueTypes]] = None,
89
+ timeout: Optional[float] = None,
90
+ **kwargs,
91
+ ) -> str:
92
+ md = kwargs.get("metadata", self.Metadata()).proto
93
+ request = MoveOnGlobeRequest(
94
+ name=self.name,
95
+ component_name=component_name,
96
+ destination=destination,
97
+ movement_sensor_name=movement_sensor_name,
98
+ obstacles=obstacles,
99
+ heading=heading,
100
+ motion_configuration=configuration,
101
+ bounding_regions=bounding_regions,
102
+ extra=dict_to_struct(extra),
103
+ )
104
+ response: MoveOnGlobeResponse = await self.client.MoveOnGlobe(request, timeout=timeout, metadata=md)
105
+ return response.execution_id
106
+
107
+ async def move_on_map(
108
+ self,
109
+ component_name: ResourceName,
110
+ destination: Pose,
111
+ slam_service_name: ResourceName,
112
+ configuration: Optional[MotionConfiguration] = None,
113
+ obstacles: Optional[Sequence[Geometry]] = None,
114
+ *,
115
+ extra: Optional[Mapping[str, ValueTypes]] = None,
116
+ timeout: Optional[float] = None,
117
+ **kwargs,
118
+ ) -> str:
119
+ md = kwargs.get("metadata", self.Metadata()).proto
120
+ request = MoveOnMapRequest(
121
+ name=self.name,
122
+ destination=destination,
123
+ component_name=component_name,
124
+ slam_service_name=slam_service_name,
125
+ motion_configuration=configuration,
126
+ obstacles=obstacles,
127
+ extra=dict_to_struct(extra),
128
+ )
129
+ response: MoveOnMapResponse = await self.client.MoveOnMap(request, timeout=timeout, metadata=md)
130
+ return response.execution_id
131
+
132
+ async def stop_plan(
133
+ self,
134
+ component_name: ResourceName,
135
+ *,
136
+ extra: Optional[Mapping[str, ValueTypes]] = None,
137
+ timeout: Optional[float] = None,
138
+ **kwargs,
139
+ ):
140
+ md = kwargs.get("metadata", self.Metadata()).proto
141
+
142
+ request = StopPlanRequest(
143
+ name=self.name,
144
+ component_name=component_name,
145
+ extra=dict_to_struct(extra),
146
+ )
147
+ _: StopPlanResponse = await self.client.StopPlan(request, timeout=timeout, metadata=md)
148
+ return
149
+
150
+ async def get_plan(
151
+ self,
152
+ component_name: ResourceName,
153
+ last_plan_only: bool = False,
154
+ execution_id: Optional[str] = None,
155
+ *,
156
+ extra: Optional[Mapping[str, ValueTypes]] = None,
157
+ timeout: Optional[float] = None,
158
+ **kwargs,
159
+ ) -> GetPlanResponse:
160
+ md = kwargs.get("metadata", self.Metadata()).proto
161
+
162
+ request = GetPlanRequest(
163
+ name=self.name,
164
+ component_name=component_name,
165
+ last_plan_only=last_plan_only,
166
+ execution_id=execution_id,
167
+ extra=dict_to_struct(extra),
168
+ )
169
+ response: GetPlanResponse = await self.client.GetPlan(request, timeout=timeout, metadata=md)
170
+ return response
171
+
172
+ async def list_plan_statuses(
173
+ self,
174
+ only_active_plans: bool = False,
175
+ *,
176
+ extra: Optional[Mapping[str, ValueTypes]] = None,
177
+ timeout: Optional[float] = None,
178
+ **kwargs,
179
+ ) -> Sequence[PlanStatusWithID]:
180
+ md = kwargs.get("metadata", self.Metadata()).proto
181
+
182
+ request = ListPlanStatusesRequest(
183
+ name=self.name,
184
+ only_active_plans=only_active_plans,
185
+ extra=dict_to_struct(extra),
186
+ )
187
+ response: ListPlanStatusesResponse = await self.client.ListPlanStatuses(request, timeout=timeout, metadata=md)
188
+ return response.plan_statuses_with_ids
189
+
190
+ async def get_pose(
191
+ self,
192
+ component_name: ResourceName,
193
+ destination_frame: str,
194
+ supplemental_transforms: Optional[Sequence[Transform]] = None,
195
+ *,
196
+ extra: Optional[Mapping[str, Any]] = None,
197
+ timeout: Optional[float] = None,
198
+ **kwargs,
199
+ ) -> PoseInFrame:
200
+ md = kwargs.get("metadata", self.Metadata()).proto
201
+ request = GetPoseRequest(
202
+ name=self.name,
203
+ component_name=component_name,
204
+ destination_frame=destination_frame,
205
+ supplemental_transforms=supplemental_transforms,
206
+ extra=dict_to_struct(extra),
207
+ )
208
+ response: GetPoseResponse = await self.client.GetPose(request, timeout=timeout, metadata=md)
209
+ return response.pose
210
+
211
+ async def do_command(self, command: Mapping[str, ValueTypes], *, timeout: Optional[float] = None, **kwargs) -> Mapping[str, ValueTypes]:
212
+ md = kwargs.get("metadata", self.Metadata()).proto
213
+ request = DoCommandRequest(name=self.name, command=dict_to_struct(command))
214
+ response: DoCommandResponse = await self.client.DoCommand(request, timeout=timeout, metadata=md)
215
+ return struct_to_dict(response.result)
@@ -0,0 +1,378 @@
1
+ import abc
2
+ import sys
3
+ from typing import Any, Final, Mapping, Optional, Sequence
4
+
5
+ if sys.version_info >= (3, 10):
6
+ from typing import TypeAlias
7
+ else:
8
+ from typing_extensions import TypeAlias
9
+
10
+ from viam.proto.common import GeoGeometry, Geometry, GeoPoint, Pose, PoseInFrame, ResourceName, Transform, WorldState
11
+ from viam.proto.service.motion import Constraints, GetPlanResponse, MotionConfiguration, PlanStatusWithID
12
+ from viam.resource.types import API, RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_SERVICE
13
+ from viam.utils import ValueTypes
14
+
15
+ from ..service_base import ServiceBase
16
+
17
+
18
+ class Motion(ServiceBase):
19
+ """Motion is a Viam service that coordinates motion planning across all of the components in a given robot.
20
+
21
+ The motion planning service calculates a valid path that avoids self collision by default. If additional constraints are supplied in the
22
+ ``world_state`` message, the motion planning service will also account for those.
23
+
24
+ For more information, see `Motion service <https://docs.viam.com/dev/reference/apis/services/motion/>`_.
25
+ """
26
+
27
+ Plan: "TypeAlias" = GetPlanResponse
28
+
29
+ API: Final = API( # pyright: ignore [reportIncompatibleVariableOverride]
30
+ RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_SERVICE, "motion"
31
+ )
32
+
33
+ @abc.abstractmethod
34
+ async def move(
35
+ self,
36
+ component_name: ResourceName,
37
+ destination: PoseInFrame,
38
+ world_state: Optional[WorldState] = None,
39
+ constraints: Optional[Constraints] = None,
40
+ *,
41
+ extra: Optional[Mapping[str, Any]] = None,
42
+ timeout: Optional[float] = None,
43
+ ) -> bool:
44
+ """Plan and execute a movement to move the component specified to its goal destination.
45
+
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``. To do so, simply create a resource name with
48
+ originating ReferenceFrame's name. Then pass in the resource name into ``component_name``. Ex::
49
+
50
+ resource_name = Gripper.get_resource_name("externalFrame")
51
+ success = await MotionServiceClient.move(resource_name, ...)
52
+
53
+ ::
54
+
55
+ motion = MotionClient.from_robot(robot=machine, name="builtin")
56
+
57
+ # Assumes a gripper configured with name "my_gripper" on the machine
58
+ gripper_name = Gripper.get_resource_name("my_gripper")
59
+ my_frame = "my_gripper_offset"
60
+
61
+ goal_pose = Pose(x=0, y=0, z=300, o_x=0, o_y=0, o_z=1, theta=0)
62
+
63
+ # Move the gripper
64
+ moved = await motion.move(component_name=gripper_name,
65
+ destination=PoseInFrame(reference_frame="myFrame",
66
+ pose=goal_pose),
67
+ world_state=worldState,
68
+ constraints={},
69
+ extra={})
70
+
71
+ Args:
72
+ component_name (viam.proto.common.ResourceName): Name of a component on a given robot.
73
+ destination (viam.proto.common.PoseInFrame): The destination to move to, expressed as a ``Pose`` and the frame in which it was
74
+ observed.
75
+ world_state (viam.proto.common.WorldState): When supplied, the motion service will create a plan that obeys any constraints
76
+ expressed in the WorldState message.
77
+ constraints (viam.proto.service.motion.Constraints): When supplied, the motion service will create a plan that obeys any
78
+ specified constraints.
79
+
80
+ Returns:
81
+ bool: Whether the move was successful.
82
+
83
+ For more information, see `Motion service <https://docs.viam.com/dev/reference/apis/services/motion/#move>`_.
84
+ """
85
+ ...
86
+
87
+ @abc.abstractmethod
88
+ async def move_on_globe(
89
+ self,
90
+ component_name: ResourceName,
91
+ destination: GeoPoint,
92
+ movement_sensor_name: ResourceName,
93
+ obstacles: Optional[Sequence[GeoGeometry]] = None,
94
+ heading: Optional[float] = None,
95
+ configuration: Optional[MotionConfiguration] = None,
96
+ *,
97
+ bounding_regions: Optional[Sequence[GeoGeometry]] = None,
98
+ extra: Optional[Mapping[str, ValueTypes]] = None,
99
+ timeout: Optional[float] = None,
100
+ ) -> str:
101
+ """Move a component to a specific latitude and longitude, using a ``MovementSensor`` to check the location.
102
+
103
+ ``move_on_globe()`` is non blocking, meaning the motion service will move the component to the destination
104
+ GPS point after ``move_on_globe()`` returns.
105
+
106
+ Each successful ``move_on_globe()`` call returns a unique ExecutionID which you can use to identify all plans
107
+ generated during the ``move_on_globe()`` call.
108
+
109
+ You can monitor the progress of the ``move_on_globe()`` call by querying ``get_plan()`` and ``list_plan_statuses()``.
110
+
111
+ ::
112
+
113
+ motion = MotionClient.from_robot(robot=machine, name="builtin")
114
+
115
+ # Get the ResourceNames of the base and movement sensor
116
+ my_base_resource_name = Base.get_resource_name("my_base")
117
+ mvmnt_sensor_resource_name = MovementSensor.get_resource_name(
118
+ "my_movement_sensor")
119
+ # Define a destination GeoPoint at the GPS coordinates [0, 0]
120
+ my_destination = movement_sensor.GeoPoint(latitude=0, longitude=0)
121
+
122
+ # Move the base component to the designated geographic location, as reported by the movement sensor
123
+ execution_id = await motion.move_on_globe(
124
+ component_name=my_base_resource_name,
125
+ destination=my_destination,
126
+ movement_sensor_name=mvmnt_sensor_resource_name)
127
+
128
+ Args:
129
+ component_name (ResourceName): The ResourceName of the base to move.
130
+ destination (GeoPoint): The location of the component's destination, represented in geographic notation as a
131
+ GeoPoint (lat, lng).
132
+ movement_sensor_name (ResourceName): The ResourceName of the movement sensor that you want to use to check
133
+ the machine's location.
134
+ obstacles (Optional[Sequence[GeoGeometry]]): Obstacles to consider when planning the motion of the component,
135
+ with each represented as a GeoGeometry. Default: None
136
+ heading (Optional[float]): The compass heading, in degrees, that the machine's movement sensor should report
137
+ at the destination point. Range: [0-360) 0: North, 90: East, 180: South, 270: West. Default: None
138
+ configuration (Optional[MotionConfiguration]): The configuration you want to set across this machine for this
139
+ motion service. This parameter and each of its fields are optional.
140
+
141
+ - obstacle_detectors (Sequence[ObstacleDetector]): The names of each vision service and camera resource pair
142
+ you want to use for transient obstacle avoidance.
143
+
144
+ - position_polling_frequency_hz (float): The frequency in Hz to poll the position of the machine.
145
+ - obstacle_polling_frequency_hz (float): The frequency in Hz to poll the vision service for new obstacles.
146
+ - plan_deviation_m (float): The distance in meters that the machine can deviate from the motion plan.
147
+ - linear_m_per_sec (float): Linear velocity this machine should target when moving.
148
+ - angular_degs_per_sec (float): Angular velocity this machine should target when turning.
149
+ bounding_regions (Optional[Sequence[GeoGeometry]]): Set of obstacles which the robot must remain within while navigating
150
+ extra (Optional[Dict[str, Any]]): Extra options to pass to the underlying RPC call.
151
+ timeout (Optional[float]): An option to set how long to wait (in seconds) before calling a time-out and closing
152
+ the underlying RPC call.
153
+
154
+
155
+ Returns:
156
+ str: ExecutionID of the ``move_on_globe()`` call, which can be used to track execution progress.
157
+
158
+ For more information, see `Motion service <https://docs.viam.com/dev/reference/apis/services/motion/#moveonglobe>`_.
159
+ """
160
+ ...
161
+
162
+ @abc.abstractmethod
163
+ async def move_on_map(
164
+ self,
165
+ component_name: ResourceName,
166
+ destination: Pose,
167
+ slam_service_name: ResourceName,
168
+ configuration: Optional[MotionConfiguration] = None,
169
+ obstacles: Optional[Sequence[Geometry]] = None,
170
+ *,
171
+ extra: Optional[Mapping[str, ValueTypes]] = None,
172
+ timeout: Optional[float] = None,
173
+ ) -> str:
174
+ """
175
+ Move a component to a specific pose, using a ``SlamService`` for the SLAM map, using a ``SLAM Service`` to check the location.
176
+
177
+ ``move_on_map()`` is non blocking, meaning the motion service will move the component to the destination
178
+ Pose point after ``move_on_map()`` returns.
179
+
180
+ Each successful ``move_on_map()`` call returns a unique ExecutionID which you can use to identify all plans
181
+ generated during the ``move_on_map()`` call.
182
+
183
+ You can monitor the progress of the ``move_on_map()`` call by querying ``get_plan()`` and ``list_plan_statuses()``.
184
+
185
+ ::
186
+
187
+ motion = MotionClient.from_robot(robot=machine, name="builtin")
188
+
189
+ # Get the ResourceNames of the base component and SLAM service
190
+ my_base_resource_name = Base.get_resource_name("my_base")
191
+ my_slam_service_name = SLAMClient.get_resource_name("my_slam_service")
192
+
193
+ # Define a destination pose with respect to the origin of the map from the SLAM service "my_slam_service"
194
+ my_pose = Pose(y=10)
195
+
196
+ # Move the base component to the destination pose of Y=10, a location of
197
+ # (0, 10, 0) in respect to the origin of the map
198
+ execution_id = await motion.move_on_map(component_name=my_base_resource_name,
199
+ destination=my_pose,
200
+ slam_service_name=my_slam_service_name)
201
+
202
+ Args:
203
+ component_name (ResourceName): The ResourceName of the base to move.
204
+ destination (Pose): The destination, which can be any Pose with respect to the SLAM map's origin.
205
+ slam_service_name (ResourceName): The ResourceName of the SLAM service from which the SLAM map is requested.
206
+ configuration (Optional[MotionConfiguration]): The configuration you want to set across this machine for this motion service.
207
+ This parameter and each of its fields are optional.
208
+
209
+ - obstacle_detectors (Sequence[ObstacleDetector]): The names of each vision service and camera resource pair you want to use
210
+ for transient obstacle avoidance.
211
+
212
+ - position_polling_frequency_hz (float): The frequency in hz to poll the position of the machine.
213
+ - obstacle_polling_frequency_hz (float): The frequency in hz to poll the vision service for new obstacles.
214
+ - plan_deviation_m (float): The distance in meters that the machine can deviate from the motion plan.
215
+ - linear_m_per_sec (float): Linear velocity this machine should target when moving.
216
+ - angular_degs_per_sec (float): Angular velocity this machine should target when turning.
217
+ obstacles (Optional[Sequence[Geometry]]): Obstacles to be considered for motion planning.
218
+ extra (Optional[Dict[str, Any]]): Extra options to pass to the underlying RPC call.
219
+ timeout (Optional[float]): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying
220
+ RPC call.
221
+
222
+ Returns:
223
+ str: ExecutionID of the ``move_on_map()`` call, which can be used to track execution progress.
224
+
225
+ For more information, see `Motion service <https://docs.viam.com/dev/reference/apis/services/motion/#moveonmap>`_.
226
+ """
227
+ ...
228
+
229
+ @abc.abstractmethod
230
+ async def stop_plan(
231
+ self,
232
+ component_name: ResourceName,
233
+ *,
234
+ extra: Optional[Mapping[str, ValueTypes]] = None,
235
+ timeout: Optional[float] = None,
236
+ ):
237
+ """Stop a component being moved by an in progress ``move_on_globe()`` or ``move_on_map()`` call.
238
+
239
+ ::
240
+
241
+ motion = MotionClient.from_robot(robot=machine, name="builtin")
242
+
243
+ # Assuming a `move_on_globe()` started the execution
244
+ # Stop the base component which was instructed to move by `move_on_globe()`
245
+ # or `move_on_map()`
246
+ my_base_resource_name = Base.get_resource_name("my_base")
247
+ await motion.stop_plan(component_name=mvmnt_sensor)
248
+
249
+ Args:
250
+ component_name (ResourceName): The component to stop
251
+
252
+ For more information, see `Motion service <https://docs.viam.com/dev/reference/apis/services/motion/#stopplan>`_.
253
+ """
254
+ ...
255
+
256
+ @abc.abstractmethod
257
+ async def get_plan(
258
+ self,
259
+ component_name: ResourceName,
260
+ last_plan_only: bool = False,
261
+ execution_id: Optional[str] = None,
262
+ *,
263
+ extra: Optional[Mapping[str, ValueTypes]] = None,
264
+ timeout: Optional[float] = None,
265
+ ) -> Plan:
266
+ """By default: returns the plan history of the most recent ``move_on_globe()`` or ``move_on_map()`` call to move a component.
267
+
268
+ The plan history for executions before the most recent can be requested by providing an ExecutionID in the request.
269
+
270
+ Returns a result if both of the following conditions are met:
271
+
272
+ - the execution (call to ``move_on_globe()`` or ``move_on_map()``) is still executing **or** changed state within the last 24 hours
273
+ - the robot has not reinitialized
274
+
275
+ Plans never change.
276
+
277
+ Replans always create new plans.
278
+
279
+ Replans share the ExecutionID of the previously executing plan.
280
+
281
+ All repeated fields are in time ascending order.
282
+
283
+ ::
284
+
285
+ motion = MotionClient.from_robot(robot=machine, name="builtin")
286
+ my_base_resource_name = Base.get_resource_name("my_base")
287
+ # 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=my_base_resource_name)
289
+
290
+ Args:
291
+ component_name (ResourceName): The component to stop
292
+ last_plan_only (Optional[bool]): If supplied, the response will only return the last plan for the component / execution.
293
+ execution_id (Optional[str]): If supplied, the response will only return plans with the provided execution_id.
294
+
295
+ Returns:
296
+ ``GetPlanResponse`` (GetPlanResponse): The current PlanWithStatus & replan history which matches the request
297
+
298
+ For more information, see `Motion service <https://docs.viam.com/dev/reference/apis/services/motion/#getplan>`_.
299
+ """
300
+ ...
301
+
302
+ @abc.abstractmethod
303
+ async def list_plan_statuses(
304
+ self,
305
+ only_active_plans: bool = False,
306
+ *,
307
+ extra: Optional[Mapping[str, ValueTypes]] = None,
308
+ timeout: Optional[float] = None,
309
+ ) -> Sequence[PlanStatusWithID]:
310
+ """Returns the statuses of plans created by `move_on_globe()` or ``move_on_map()`` calls that meet at least one of the following
311
+ conditions since the motion service initialized:
312
+
313
+ - the plan's status is in progress
314
+ - the plan's status changed state within the last 24 hours
315
+
316
+ All repeated fields are in chronological order.
317
+
318
+ ::
319
+
320
+ motion = MotionClient.from_robot(robot=machine, name="builtin")
321
+ # List the plan statuses of the motion service within the TTL
322
+ resp = await motion.list_plan_statuses()
323
+
324
+ Args:
325
+ only_active_plans (Optional[bool]): If supplied, the response will filter out any plans that are not executing.
326
+
327
+ Returns:
328
+ ``ListPlanStatusesResponse`` (ListPlanStatusesResponse): List of last known statuses with the
329
+ associated IDs of all plans within the TTL ordered by timestamp in ascending order.
330
+
331
+ For more information, see `Motion service <https://docs.viam.com/dev/reference/apis/services/motion/#listplanstatuses>`_.
332
+ """
333
+ ...
334
+
335
+ @abc.abstractmethod
336
+ async def get_pose(
337
+ self,
338
+ component_name: ResourceName,
339
+ destination_frame: str,
340
+ supplemental_transforms: Optional[Sequence[Transform]] = None,
341
+ *,
342
+ extra: Optional[Mapping[str, Any]] = None,
343
+ timeout: Optional[float] = None,
344
+ ) -> PoseInFrame:
345
+ """
346
+ Get the Pose and observer frame for any given component on a robot.
347
+
348
+ ::
349
+
350
+ # Note that the example uses the ``Gripper`` class, but any component class that inherits from ``ComponentBase`` will work
351
+ # (``Arm``, ``Base``, etc).
352
+
353
+ # Create a `component_name`:
354
+ component_name = Gripper.get_resource_name("my_gripper")
355
+
356
+ from viam.components.gripper import Gripper
357
+ from viam.services.motion import MotionClient
358
+
359
+ # Assume that the connect function is written and will return a valid machine.
360
+ robot = await connect()
361
+
362
+ motion = MotionClient.from_robot(robot=machine, name="builtin")
363
+ gripperName = Gripper.get_resource_name("my_gripper")
364
+ gripperPoseInWorld = await motion.get_pose(component_name=gripperName,
365
+ destination_frame="world")
366
+
367
+ Args:
368
+ component_name (viam.proto.common.ResourceName): Name of a component on a robot.
369
+ destination_frame (str): Name of the desired reference frame.
370
+ supplemental_transforms (Optional[List[viam.proto.common.Transform]]): Transforms used to augment the robot's frame while
371
+ calculating pose.
372
+
373
+ Returns:
374
+ ``Pose`` (PoseInFrame): Pose of the given component and the frame in which it was observed.
375
+
376
+ For more information, see `Motion service <https://docs.viam.com/dev/reference/apis/services/motion/#getpose>`_.
377
+ """
378
+ ...