bosdyn-client 4.0.1__py3-none-any.whl → 4.0.2__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.
@@ -149,6 +149,11 @@ class NMEAParser(object):
149
149
  self.last_failed_read_log_time = now
150
150
  continue
151
151
 
152
+ # if the message does not contain a timestamp attribute, abandon the rest of the logic
153
+ # and go to the beginning of the loop
154
+ if not hasattr(nmea_msg, 'timestamp'):
155
+ continue
156
+
152
157
  # Only use NMEA messages that have a timestamp.
153
158
  # For example, GSA and GST messages are not supported.
154
159
  if isinstance(nmea_msg.timestamp, datetime.time):
@@ -27,17 +27,21 @@ class NMEAStreamReader(object):
27
27
  # The amount of time to wait before logging another decode error.
28
28
  LOG_THROTTLE_TIME = 2.0 # seconds.
29
29
 
30
- def __init__(self, logger, stream, body_tform_gps):
30
+ def __init__(self, logger, stream, body_tform_gps, verbose):
31
31
  self.logger = logger
32
32
  self.stream = stream
33
33
  self.parser = NMEAParser(logger)
34
34
  self.body_tform_gps = body_tform_gps.to_proto()
35
35
  self.last_failed_read_log_time = None
36
+ self.verbose = verbose
36
37
 
37
38
  def read_data(self, time_converter: RobotTimeConverter) -> List[GpsDataPoint]:
38
39
  """This function returns an array of new GpsDataPoints."""
39
40
  try:
40
41
  raw_data = self.stream.readline()
42
+ # If the rawdata is a bytes or bytearray object, decode it into a string.
43
+ if type(raw_data) is not str:
44
+ raw_data = str(raw_data, "utf-8")
41
45
  except UnicodeDecodeError:
42
46
  # Throttle the logs.
43
47
  now = time.time()
@@ -53,7 +57,12 @@ class NMEAStreamReader(object):
53
57
 
54
58
  # Trim any leading characters before the NMEA sentence.
55
59
  raw_data = raw_data[raw_data.index('$'):]
56
- self.logger.info(f"Read: {raw_data}")
60
+
61
+ # If we are being verbose, print the message we received.
62
+ if self.verbose:
63
+ self.logger.info(f"Read: {raw_data}")
64
+
65
+ # Parse the received message.
57
66
  new_points = self.parser.parse(raw_data, time_converter, check=False)
58
67
 
59
68
  # Offset for the GPS
@@ -65,11 +74,11 @@ class NMEAStreamReader(object):
65
74
 
66
75
  class GpsListener:
67
76
 
68
- def __init__(self, robot, time_converter, stream, name, body_tform_gps, logger):
77
+ def __init__(self, robot, time_converter, stream, name, body_tform_gps, logger, verbose):
69
78
  self.logger = logger
70
79
  self.robot = robot
71
80
  self.time_converter = time_converter
72
- self.reader = NMEAStreamReader(logger, stream, body_tform_gps)
81
+ self.reader = NMEAStreamReader(logger, stream, body_tform_gps, verbose)
73
82
  self.gps_device = GpsDevice()
74
83
  self.gps_device.name = name
75
84
  self.aggregator_client = None
@@ -522,6 +522,21 @@ class RobotCommandClient(BaseClient):
522
522
  behavior_fault_id=behavior_fault_id)
523
523
 
524
524
 
525
+ class RobotCommandStreamingClient(BaseClient):
526
+ """Client for calling RobotCommand services.
527
+
528
+ This client is in BETA and may undergo changes in future releases.
529
+ """
530
+ default_service_name = 'robot-command-streaming'
531
+ service_type = 'bosdyn.api.RobotCommandStreamingService'
532
+
533
+ def __init__(self):
534
+ super(RobotCommandStreamingClient,
535
+ self).__init__(robot_command_service_pb2_grpc.RobotCommandStreamingServiceStub)
536
+ self._timesync_endpoint = None
537
+
538
+ def send_joint_control_commands(self, command_iterator):
539
+ return self._stub.JointControlStream(command_iterator)
525
540
 
526
541
 
527
542
  def _robot_command_value(response):
@@ -129,6 +129,26 @@ class RobotStateClient(BaseClient):
129
129
  return robot_state_pb2.RobotLinkModelRequest(link_name=link_name)
130
130
 
131
131
 
132
+ class RobotStateStreamingClient(BaseClient):
133
+ """Client for the RobotState service.
134
+
135
+ This client is in BETA and may undergo changes in future releases.
136
+ """
137
+ default_service_name = 'robot-state-streaming'
138
+ service_type = 'bosdyn.api.RobotStateStreamingService'
139
+
140
+ def __init__(self):
141
+ super(RobotStateStreamingClient,
142
+ self).__init__(robot_state_service_pb2_grpc.RobotStateStreamingServiceStub)
143
+
144
+ def get_robot_state_stream(self, **kwargs):
145
+ """Returns an iterator providing current state updates of the robot."""
146
+ req = self._get_robot_state_stream_request()
147
+ return self._stub.GetRobotStateStream(req)
148
+
149
+ @staticmethod
150
+ def _get_robot_state_stream_request():
151
+ return robot_state_pb2.RobotStateStreamRequest()
132
152
 
133
153
 
134
154
  def _get_robot_state_value(response):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bosdyn-client
3
- Version: 4.0.1
3
+ Version: 4.0.2
4
4
  Summary: Boston Dynamics API client code and interfaces
5
5
  Home-page: https://dev.bostondynamics.com/
6
6
  Author: Boston Dynamics
@@ -15,8 +15,8 @@ Classifier: Programming Language :: Python :: 3.10
15
15
  Classifier: License :: Other/Proprietary License
16
16
  Classifier: Operating System :: OS Independent
17
17
  Description-Content-Type: text/markdown
18
- Requires-Dist: bosdyn-api (==4.0.1)
19
- Requires-Dist: bosdyn-core (==4.0.1)
18
+ Requires-Dist: bosdyn-api (==4.0.2)
19
+ Requires-Dist: bosdyn-core (==4.0.2)
20
20
  Requires-Dist: grpcio
21
21
  Requires-Dist: pyjwt
22
22
  Requires-Dist: numpy
@@ -58,9 +58,9 @@ bosdyn/client/processors.py,sha256=Z-Djf_I_lhfokB-f_L0PewAY8J95LThdWVju1zJ2BaE,1
58
58
  bosdyn/client/ray_cast.py,sha256=Ca1yJo0aY6OmVAazb19fy44L-9LzcKVxr_fHt_EoQtg,4465
59
59
  bosdyn/client/recording.py,sha256=4LQidgu2uwZS-SovodA5qt12OlftbIXk2CgBIzPFG1I,26017
60
60
  bosdyn/client/robot.py,sha256=E9Gw2ntMHAI6yueev50NS7FANBymEvsh7xniF8S2jV4,30670
61
- bosdyn/client/robot_command.py,sha256=SYEKys3GyF6H-Wyxp4Ix5mStlOGG4pHlLSuBT_6GxMc,107624
61
+ bosdyn/client/robot_command.py,sha256=D6MQ8Shx8gV4IZMfzaaTgmT04FiamUkC9eN41VORrLE,108240
62
62
  bosdyn/client/robot_id.py,sha256=0VZHG9hltwTLAm1_Bt26Xq1O6EROswqNwHvjY7kaplk,2482
63
- bosdyn/client/robot_state.py,sha256=MSIIGivRY3j0mmCg_vOCCmANoQRNS-VIMTx6KXfn3fE,6284
63
+ bosdyn/client/robot_state.py,sha256=h551ke5eHdAC7NgVuLphY8FZR899Ii8_lYwuoX1w1nk,7073
64
64
  bosdyn/client/sdk.py,sha256=u-DOSF-QEERYu0hxRXmfOpRhLCD6R-b5IqgfsqUaOcY,12759
65
65
  bosdyn/client/server_util.py,sha256=nzpZijK_GclVK2Zf2g2KCe-2e49NEQbPgdz75fwafXc,10402
66
66
  bosdyn/client/service_customization_helpers.py,sha256=mi_xkCNvJE7wX64WFoMAKiJQsUvS33LY8PrhiV8-95w,48357
@@ -72,10 +72,10 @@ bosdyn/client/token_manager.py,sha256=FvDFCXKIiGXZNkagKZM41Ut8Q0ChlYHN3O61CzrqMF
72
72
  bosdyn/client/units_helpers.py,sha256=5SAmL8vsnl06oGNjzb57fUkuUbGvtbeNdg4NgW0wYAY,1084
73
73
  bosdyn/client/util.py,sha256=1Kj10p0jqS7opwDrAAx3adfIw1lJCB1OzSZYyfUlJH8,20029
74
74
  bosdyn/client/world_object.py,sha256=KbFRkG3jqQEfRN6SmSv1_D6n_9yFVYwbfCUWQ7kYpio,18695
75
- bosdyn/client/gps/NMEAParser.py,sha256=EMyEt7KJ3QvQpTqq8gwZ9ZIKV7RRGvjJnQyY067i9Q4,8048
75
+ bosdyn/client/gps/NMEAParser.py,sha256=1SSaxN1D7V5eUnqnuCpO6gFwWofurtvXg7UbxF4d3ec,8274
76
76
  bosdyn/client/gps/__init__.py,sha256=1qUAbnMKYlERYZvxtGz4ThjYef7Tx-ZBclLoVE_ecjU,265
77
77
  bosdyn/client/gps/aggregator_client.py,sha256=z5iRAYyCIez7p0EzIqZg3NTJGzxXAy297iENrhaL7CQ,2380
78
- bosdyn/client/gps/gps_listener.py,sha256=r08r1qCaLVoE1mcMOMyXWHywfKdTTNeFf7SOGpJBkl0,6181
78
+ bosdyn/client/gps/gps_listener.py,sha256=KkQsThiBgUwmsys34jGn0BrHuE6RkfcwSN7nDwfNpTA,6552
79
79
  bosdyn/client/gps/registration_client.py,sha256=LqDLl_Ezv3HNUr9R1B4n2hcMArmGwLgg1asCkGhe2WA,1901
80
80
  bosdyn/client/resources/__init__.py,sha256=1qUAbnMKYlERYZvxtGz4ThjYef7Tx-ZBclLoVE_ecjU,265
81
81
  bosdyn/client/resources/robot.pem,sha256=kWAr4xK29RtTVC_EhbwW2_NblIuecYqVudR2YIdTh84,1874
@@ -91,7 +91,7 @@ bosdyn/client/spot_cam/power.py,sha256=HS3nJF8hXq9m1JziOIwLHGLtlNMyLgewWBgs-mRZm
91
91
  bosdyn/client/spot_cam/ptz.py,sha256=8e6fA07aGnymSXV2MB_QBx0Pv4PSAMOihxq1jyoinDU,10815
92
92
  bosdyn/client/spot_cam/streamquality.py,sha256=hQzVPdKnzVT91fc8E8AmNqhAPgddt0XE2tzNQD6QefQ,6411
93
93
  bosdyn/client/spot_cam/version.py,sha256=R82eyCAY9PfZqbN8D6hNzSeZatpgpsFr995dRt1Mbe0,2856
94
- bosdyn_client-4.0.1.dist-info/METADATA,sha256=-nVCOAMJSl7H9rk0k8SI83Gf52rvbVN630HU1DnAvQ0,3938
95
- bosdyn_client-4.0.1.dist-info/WHEEL,sha256=AtBG6SXL3KF_v0NxLf0ehyVOh0cold-JbJYXNGorC6Q,92
96
- bosdyn_client-4.0.1.dist-info/top_level.txt,sha256=an2OWgx1ej2jFjmBjPWNQ68ZglvUfKhmXWW-WhTtDmA,7
97
- bosdyn_client-4.0.1.dist-info/RECORD,,
94
+ bosdyn_client-4.0.2.dist-info/METADATA,sha256=4_AUjtA0swqP4G9fZ_8UHTgq9iZFCPy_wkPdskwDn2w,3938
95
+ bosdyn_client-4.0.2.dist-info/WHEEL,sha256=AtBG6SXL3KF_v0NxLf0ehyVOh0cold-JbJYXNGorC6Q,92
96
+ bosdyn_client-4.0.2.dist-info/top_level.txt,sha256=an2OWgx1ej2jFjmBjPWNQ68ZglvUfKhmXWW-WhTtDmA,7
97
+ bosdyn_client-4.0.2.dist-info/RECORD,,