bosdyn-client 3.3.2__py3-none-any.whl → 4.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. bosdyn/client/__init__.py +5 -6
  2. bosdyn/client/area_callback_region_handler_base.py +19 -4
  3. bosdyn/client/area_callback_service_servicer.py +29 -1
  4. bosdyn/client/area_callback_service_utils.py +45 -51
  5. bosdyn/client/auth.py +13 -28
  6. bosdyn/client/autowalk.py +3 -0
  7. bosdyn/client/channel.py +23 -26
  8. bosdyn/client/command_line.py +64 -13
  9. bosdyn/client/common.py +4 -4
  10. bosdyn/client/data_acquisition.py +47 -6
  11. bosdyn/client/data_acquisition_plugin.py +12 -2
  12. bosdyn/client/data_acquisition_plugin_service.py +33 -2
  13. bosdyn/client/data_acquisition_store.py +38 -0
  14. bosdyn/client/data_buffer.py +22 -8
  15. bosdyn/client/data_chunk.py +1 -0
  16. bosdyn/client/directory_registration.py +1 -14
  17. bosdyn/client/exceptions.py +0 -4
  18. bosdyn/client/frame_helpers.py +3 -1
  19. bosdyn/client/gps/NMEAParser.py +189 -0
  20. bosdyn/client/gps/__init__.py +6 -0
  21. bosdyn/client/gps/aggregator_client.py +56 -0
  22. bosdyn/client/gps/gps_listener.py +153 -0
  23. bosdyn/client/gps/registration_client.py +48 -0
  24. bosdyn/client/graph_nav.py +50 -20
  25. bosdyn/client/image.py +20 -7
  26. bosdyn/client/image_service_helpers.py +14 -14
  27. bosdyn/client/lease.py +27 -22
  28. bosdyn/client/lease_validator.py +5 -5
  29. bosdyn/client/manipulation_api_client.py +1 -1
  30. bosdyn/client/map_processing.py +10 -5
  31. bosdyn/client/math_helpers.py +21 -11
  32. bosdyn/client/metrics_logging.py +147 -0
  33. bosdyn/client/network_compute_bridge_client.py +6 -0
  34. bosdyn/client/power.py +40 -0
  35. bosdyn/client/recording.py +3 -3
  36. bosdyn/client/robot.py +15 -16
  37. bosdyn/client/robot_command.py +341 -203
  38. bosdyn/client/robot_id.py +6 -5
  39. bosdyn/client/robot_state.py +6 -0
  40. bosdyn/client/sdk.py +5 -11
  41. bosdyn/client/server_util.py +11 -11
  42. bosdyn/client/service_customization_helpers.py +776 -64
  43. bosdyn/client/signals_helpers.py +105 -0
  44. bosdyn/client/spot_cam/compositor.py +6 -2
  45. bosdyn/client/spot_cam/ptz.py +24 -14
  46. bosdyn/client/spot_check.py +160 -0
  47. bosdyn/client/time_sync.py +5 -5
  48. bosdyn/client/units_helpers.py +39 -0
  49. bosdyn/client/util.py +100 -64
  50. bosdyn/client/world_object.py +5 -5
  51. {bosdyn_client-3.3.2.dist-info → bosdyn_client-4.0.1.dist-info}/METADATA +4 -3
  52. bosdyn_client-4.0.1.dist-info/RECORD +97 -0
  53. {bosdyn_client-3.3.2.dist-info → bosdyn_client-4.0.1.dist-info}/WHEEL +1 -1
  54. bosdyn/client/log_annotation.py +0 -359
  55. bosdyn_client-3.3.2.dist-info/RECORD +0 -90
  56. {bosdyn_client-3.3.2.dist-info → bosdyn_client-4.0.1.dist-info}/top_level.txt +0 -0
bosdyn/client/robot_id.py CHANGED
@@ -8,8 +8,7 @@
8
8
 
9
9
  RobotIdClient -- Wrapper around service stub.
10
10
  """
11
-
12
- from distutils.version import StrictVersion
11
+ from deprecated.sphinx import deprecated
13
12
 
14
13
  from bosdyn.api import robot_id_pb2, robot_id_service_pb2_grpc
15
14
  from bosdyn.client.common import BaseClient, common_header_errors
@@ -49,13 +48,15 @@ def version_tuple(version):
49
48
  return version.major_version, version.minor_version, version.patch_level
50
49
 
51
50
 
51
+ @deprecated(reason='distutils is deprecated. Use version_tuple() instead.', version='4.0.0')
52
52
  def create_strict_version(robot_id):
53
53
  """Create and return a StrictVersion object, from a robot_id, which can be compared easily."""
54
- if robot_id == None:
54
+ if robot_id is None:
55
55
  return None
56
56
 
57
57
  version_string = str(robot_id.software_release.version.major_version) + '.' + \
58
- str(robot_id.software_release.version.minor_version) + '.' + \
59
- str(robot_id.software_release.version.patch_level)
58
+ str(robot_id.software_release.version.minor_version) + '.' + \
59
+ str(robot_id.software_release.version.patch_level)
60
60
 
61
+ from distutils.version import StrictVersion
61
62
  return StrictVersion(version_string)
@@ -129,10 +129,16 @@ class RobotStateClient(BaseClient):
129
129
  return robot_state_pb2.RobotLinkModelRequest(link_name=link_name)
130
130
 
131
131
 
132
+
133
+
132
134
  def _get_robot_state_value(response):
133
135
  return response.robot_state
134
136
 
135
137
 
138
+ def _get_robot_state_stream_value(response):
139
+ return response
140
+
141
+
136
142
  def _get_robot_metrics_value(response):
137
143
  return response.robot_metrics
138
144
 
bosdyn/client/sdk.py CHANGED
@@ -33,6 +33,8 @@ from .door import DoorClient
33
33
  from .estop import EstopClient
34
34
  from .exceptions import Error
35
35
  from .fault import FaultClient
36
+ from .gps.aggregator_client import AggregatorClient
37
+ from .gps.registration_client import RegistrationClient
36
38
  from .graph_nav import GraphNavClient
37
39
  from .gripper_camera_param import GripperCameraParamClient
38
40
  from .image import ImageClient
@@ -42,10 +44,10 @@ from .keepalive import KeepaliveClient
42
44
  from .lease import LeaseClient
43
45
  from .license import LicenseClient
44
46
  from .local_grid import LocalGridClient
45
- from .log_annotation import LogAnnotationClient
46
47
  from .log_status import LogStatusClient
47
48
  from .manipulation_api_client import ManipulationApiClient
48
49
  from .map_processing import MapProcessingServiceClient
50
+ from .metrics_logging import MetricsLoggingClient
49
51
  from .network_compute_bridge_client import NetworkComputeBridgeClient
50
52
  from .payload import PayloadClient
51
53
  from .payload_registration import PayloadRegistrationClient
@@ -104,6 +106,7 @@ def generate_client_name(prefix=''):
104
106
 
105
107
 
106
108
  _DEFAULT_SERVICE_CLIENTS = [
109
+ AggregatorClient,
107
110
  ArmSurfaceContactClient,
108
111
  AuthClient,
109
112
  AutoReturnClient,
@@ -126,7 +129,6 @@ _DEFAULT_SERVICE_CLIENTS = [
126
129
  LeaseClient,
127
130
  KeepaliveClient,
128
131
  LicenseClient,
129
- LogAnnotationClient,
130
132
  LogStatusClient,
131
133
  LocalGridClient,
132
134
  ManipulationApiClient,
@@ -137,6 +139,7 @@ _DEFAULT_SERVICE_CLIENTS = [
137
139
  PointCloudClient,
138
140
  PowerClient,
139
141
  RayCastClient,
142
+ RegistrationClient,
140
143
  RobotCommandClient,
141
144
  RobotIdClient,
142
145
  RobotStateClient,
@@ -200,7 +203,6 @@ class Sdk(object):
200
203
  self.max_receive_message_length = DEFAULT_MAX_MESSAGE_LENGTH
201
204
 
202
205
 
203
-
204
206
  def create_robot(
205
207
  self,
206
208
  address,
@@ -296,14 +298,6 @@ class Sdk(object):
296
298
  robot._shutdown()
297
299
  self.robots = {}
298
300
 
299
- @staticmethod
300
- @deprecated(
301
- reason='App tokens are no longer in use. Authorization is now handled via licenses.',
302
- version='2.0.1', action="always")
303
- def load_app_token(*_):
304
- """Do nothing, this method is kept only to maintain backwards compatibility."""
305
- return
306
-
307
301
 
308
302
  @deprecated(
309
303
  reason='Decoding tokens is no longer supported in the sdk. Use pyjwt directly instead.',
@@ -9,6 +9,7 @@
9
9
  import copy
10
10
  import logging
11
11
  import signal
12
+ import sys
12
13
  import time
13
14
  from concurrent import futures
14
15
 
@@ -16,7 +17,7 @@ import grpc
16
17
 
17
18
  import bosdyn.util
18
19
  from bosdyn.api import (data_acquisition_store_pb2, data_buffer_pb2, header_pb2, image_pb2,
19
- local_grid_pb2, log_annotation_pb2)
20
+ local_grid_pb2)
20
21
  from bosdyn.client.channel import generate_channel_options
21
22
 
22
23
  _LOGGER = logging.getLogger(__name__)
@@ -91,7 +92,7 @@ class GrpcServiceRunner(object):
91
92
  max_send_message_length (int): Max message length (bytes) allowed for messages sent.
92
93
  max_receive_message_length (int): Max message length (bytes) allowed for messages received.
93
94
  timeout_secs (int): Number of seconds to wait for a clean server shutdown.
94
- force_sigint_capture (bool): Re-assign the SIGINT handler to default in order to prevent
95
+ force_sigint_capture (bool): Re-assign the termination signal handlers to default in order to prevent
95
96
  other scripts from blocking a clean exit. Defaults to True.
96
97
  logger (logging.Logger): Logger to log with.
97
98
  """
@@ -127,12 +128,17 @@ class GrpcServiceRunner(object):
127
128
  shutdown_complete.wait(self.timeout_secs)
128
129
 
129
130
  def run_until_interrupt(self):
130
- """Spin the thread until a SIGINT is received and then shut down cleanly."""
131
+ """Spin the thread until a SIGINT, SIGTERM, or SIGQUIT is received and then shut down cleanly."""
131
132
  if self.force_sigint_capture:
132
133
  # Ensure that KeyboardInterrupt is raised on a SIGINT.
133
134
  signal.signal(signal.SIGINT, signal.default_int_handler)
135
+ # Included SIGTERM for "docker stop". See https://docs.docker.com/engine/reference/commandline/stop/
136
+ signal.signal(signal.SIGTERM, signal.default_int_handler)
137
+ # OS check because on Windows, signal() can only be called with SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, or SIGTERM.
138
+ if not sys.platform.startswith("win32"):
139
+ signal.signal(signal.SIGQUIT, signal.default_int_handler)
134
140
 
135
- # Monitor for SIGINT and shut down cleanly.
141
+ # Monitor for SIGINT, SIGTERM, or SIGQUIT and shut down cleanly.
136
142
  try:
137
143
  while True:
138
144
  time.sleep(1)
@@ -144,6 +150,7 @@ class GrpcServiceRunner(object):
144
150
  def populate_response_header(response, request, error_code=header_pb2.CommonError.CODE_OK,
145
151
  error_msg=None):
146
152
  """Sets the ResponseHeader header in the response.
153
+
147
154
  Args:
148
155
  response (bosdyn.api Response message): The GRPC response message to be populated.
149
156
  request (bosdyn.api Request message): The header from the request is added to the response.
@@ -181,7 +188,6 @@ def get_bytes_field_allowlist():
181
188
  data_acquisition_store_pb2.StoreImageRequest: strip_store_image_request,
182
189
  data_buffer_pb2.RecordSignalTicksRequest: strip_record_signal_tick,
183
190
  data_buffer_pb2.RecordDataBlobsRequest: strip_record_data_blob,
184
- log_annotation_pb2.AddLogAnnotationRequest: strip_log_annotation
185
191
  }
186
192
  return allowlist_map
187
193
 
@@ -223,9 +229,3 @@ def strip_record_data_blob(proto_message):
223
229
  """Removes bytes from the data_buffer_pb2.RecordDataBlobsRequest proto."""
224
230
  for blob in proto_message.blob_data:
225
231
  blob.ClearField("data")
226
-
227
-
228
- def strip_log_annotation(proto_message):
229
- """Removes bytes from the log_annotation_pb2.AddLogAnnotationRequest proto."""
230
- for blob in proto_message.annotations.blob_data:
231
- blob.ClearField("data")