bosdyn-choreography-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.
- bosdyn/choreography/client/animation_file_to_proto.py +1 -1
- bosdyn/choreography/client/choreography.py +112 -11
- {bosdyn_choreography_client-3.3.2.dist-info → bosdyn_choreography_client-4.0.1.dist-info}/METADATA +5 -6
- bosdyn_choreography_client-4.0.1.dist-info/RECORD +10 -0
- {bosdyn_choreography_client-3.3.2.dist-info → bosdyn_choreography_client-4.0.1.dist-info}/WHEEL +1 -1
- bosdyn_choreography_client-3.3.2.dist-info/RECORD +0 -10
- {bosdyn_choreography_client-3.3.2.dist-info → bosdyn_choreography_client-4.0.1.dist-info}/top_level.txt +0 -0
|
@@ -142,7 +142,7 @@ COMMENT_DELIMITERS = ["//", "#"]
|
|
|
142
142
|
|
|
143
143
|
|
|
144
144
|
class AnimationFileFormatError(Exception):
|
|
145
|
-
"""Specific Exception raised when we identify
|
|
145
|
+
"""Specific Exception raised when we identify an issue with an animation (*.cha) file."""
|
|
146
146
|
pass
|
|
147
147
|
|
|
148
148
|
|
|
@@ -183,6 +183,16 @@ class ChoreographyClient(BaseClient):
|
|
|
183
183
|
self, self.timesync_endpoint).local_seconds_from_robot_timestamp(status.validity_time)
|
|
184
184
|
return (status, client_time)
|
|
185
185
|
|
|
186
|
+
def get_choreography_status_async(self, **kwargs):
|
|
187
|
+
"""Async version of get_choreography_status."""
|
|
188
|
+
request = choreography_sequence_pb2.ChoreographyStatusRequest()
|
|
189
|
+
status = self.call_async(self._stub.ChoreographyStatus, request, value_from_response=None,
|
|
190
|
+
error_from_response=None, copy_request=False, **kwargs)
|
|
191
|
+
client_time = _TimeConverter(self,
|
|
192
|
+
self.timesync_endpoint).local_seconds_from_robot_timestamp(
|
|
193
|
+
status.result().validity_time)
|
|
194
|
+
return (status, client_time)
|
|
195
|
+
|
|
186
196
|
def choreography_log_to_animation_file(self, name, fpath, has_arm, *args):
|
|
187
197
|
"""Turn the choreography log from the proto into an animation `cha` file type.
|
|
188
198
|
|
|
@@ -342,6 +352,49 @@ class ChoreographyClient(BaseClient):
|
|
|
342
352
|
print("Animation *.cha file downloaded to: %s" % file_path)
|
|
343
353
|
return name + ".cha"
|
|
344
354
|
|
|
355
|
+
def choreography_time_adjust(self, override_client_start_time, time_difference=None,
|
|
356
|
+
validity_time=None, **kwargs):
|
|
357
|
+
"""Provide a time to execute the choreography sequence instead the value passed in by
|
|
358
|
+
execute_choreography. Useful for when multiple robots are performing a synced
|
|
359
|
+
performance, and all robots should begin dancing at the same time.
|
|
360
|
+
|
|
361
|
+
Args:
|
|
362
|
+
override_client_start_time (float): The time (in seconds) that the dance should start. This time
|
|
363
|
+
should be provided in the local clock's timeframe and the client will convert it
|
|
364
|
+
to the required robot's clock timeframe.
|
|
365
|
+
time_difference (float): The acceptable time difference in seconds between an ExecuteChoreographyRequest start
|
|
366
|
+
time and the override time where the override_client_start_time will be used instead of the start time
|
|
367
|
+
specified by the ExecuteChoreographyRequest. If not set will default to 20s. Maximum time_difference is
|
|
368
|
+
2 minutes.
|
|
369
|
+
validity_time (float): How far in the future, in seconds from the current time, can the
|
|
370
|
+
override_client_start_time be. If not set will default to 60s. Maximum validity_time is
|
|
371
|
+
5 minutes.
|
|
372
|
+
"""
|
|
373
|
+
|
|
374
|
+
req = self.build_choreography_time_adjust_request(override_client_start_time,
|
|
375
|
+
time_difference, validity_time)
|
|
376
|
+
return self.call(
|
|
377
|
+
self._stub.ChoreographyTimeAdjust,
|
|
378
|
+
req,
|
|
379
|
+
value_from_response=None, # Return the complete response message
|
|
380
|
+
error_from_response=common_header_errors,
|
|
381
|
+
copy_request=False,
|
|
382
|
+
**kwargs)
|
|
383
|
+
|
|
384
|
+
def choreography_time_adjust_async(self, override_client_start_time, time_difference=None,
|
|
385
|
+
validity_time=None, **kwargs):
|
|
386
|
+
"""Async version of choreography_time_adjust()"""
|
|
387
|
+
|
|
388
|
+
req = self.build_choreography_time_adjust_request(override_client_start_time,
|
|
389
|
+
time_difference, validity_time)
|
|
390
|
+
return self.call_async(
|
|
391
|
+
self._stub.ChoreographyTimeAdjust,
|
|
392
|
+
req,
|
|
393
|
+
value_from_response=None, # Return the complete response message
|
|
394
|
+
error_from_response=common_header_errors,
|
|
395
|
+
copy_request=False,
|
|
396
|
+
**kwargs)
|
|
397
|
+
|
|
345
398
|
def execute_choreography(self, choreography_name, client_start_time,
|
|
346
399
|
choreography_starting_slice, lease=None, **kwargs):
|
|
347
400
|
"""Execute the current choreography sequence loaded on the robot by name.
|
|
@@ -389,7 +442,7 @@ class ChoreographyClient(BaseClient):
|
|
|
389
442
|
"""Sends commands to interact with individual choreography moves.
|
|
390
443
|
|
|
391
444
|
Args:
|
|
392
|
-
command_list(list of choreography_sequence_pb2.MoveCommand protobuf): The commands. Each
|
|
445
|
+
command_list(list of choreography_sequence_pb2.MoveCommand protobuf): The commands. Each
|
|
393
446
|
command interacts with a single individual move.
|
|
394
447
|
client_end_time (float): The time (in seconds) that the command stops being valid. This time
|
|
395
448
|
should be provided in the local clock's timeframe and the client will convert it
|
|
@@ -480,10 +533,44 @@ class ChoreographyClient(BaseClient):
|
|
|
480
533
|
copy_request=False,
|
|
481
534
|
**kwargs)
|
|
482
535
|
|
|
536
|
+
def get_choreography_sequence(self, seq_name, **kwargs):
|
|
537
|
+
"""Get a sequence currently known by the robot, response includes
|
|
538
|
+
the full ChoreographySequence with the given name and any
|
|
539
|
+
Animations used in the sequence.
|
|
540
|
+
|
|
541
|
+
Args:
|
|
542
|
+
seq_name (string): the name of the sequence to return.
|
|
543
|
+
|
|
544
|
+
Returns:
|
|
545
|
+
The full GetChoreographySequenceResponse proto.
|
|
546
|
+
"""
|
|
547
|
+
|
|
548
|
+
req = choreography_sequence_pb2.GetChoreographySequenceRequest()
|
|
549
|
+
req.sequence_name = seq_name
|
|
550
|
+
return self.call(
|
|
551
|
+
self._stub.GetChoreographySequence,
|
|
552
|
+
req,
|
|
553
|
+
value_from_response=None, # Return the complete response message
|
|
554
|
+
error_from_response=common_header_errors,
|
|
555
|
+
copy_request=False,
|
|
556
|
+
**kwargs)
|
|
557
|
+
|
|
558
|
+
def get_choreography_sequence_async(self, seq_name, **kwargs):
|
|
559
|
+
"""Async version of get_choreography_sequence()."""
|
|
560
|
+
req = choreography_sequence_pb2.GetChoreographySequenceRequest()
|
|
561
|
+
req.sequence_name = seq_name
|
|
562
|
+
return self.call_async(
|
|
563
|
+
self._stub.GetChoreographySequence,
|
|
564
|
+
req,
|
|
565
|
+
value_from_response=None, # Return the complete response message
|
|
566
|
+
error_from_response=common_header_errors,
|
|
567
|
+
copy_request=False,
|
|
568
|
+
**kwargs)
|
|
569
|
+
|
|
483
570
|
def save_sequence(self, seq_name, labels=[], **kwargs):
|
|
484
|
-
"""Save an uploaded sequence to the robot. Saved sequences are
|
|
485
|
-
automatically uploaded to the robot when it boots.
|
|
486
|
-
|
|
571
|
+
"""Save an uploaded sequence to the robot. Saved sequences are
|
|
572
|
+
automatically uploaded to the robot when it boots.
|
|
573
|
+
|
|
487
574
|
Returns:
|
|
488
575
|
The full SaveSequenceResponse proto."""
|
|
489
576
|
request = self.build_save_sequence_request(seq_name, labels)
|
|
@@ -498,9 +585,9 @@ class ChoreographyClient(BaseClient):
|
|
|
498
585
|
**kwargs)
|
|
499
586
|
|
|
500
587
|
def delete_sequence(self, seq_name, **kwargs):
|
|
501
|
-
"""Delete a sequence from temporary robot memory and
|
|
502
|
-
delete any copies of the sequence saved to disk.
|
|
503
|
-
|
|
588
|
+
"""Delete a sequence from temporary robot memory and
|
|
589
|
+
delete any copies of the sequence saved to disk.
|
|
590
|
+
|
|
504
591
|
Returns:
|
|
505
592
|
The full DeleteSequenceResponse proto."""
|
|
506
593
|
request = choreography_sequence_pb2.DeleteSequenceRequest(sequence_name=seq_name)
|
|
@@ -515,9 +602,9 @@ class ChoreographyClient(BaseClient):
|
|
|
515
602
|
**kwargs)
|
|
516
603
|
|
|
517
604
|
def modify_choreography_info(self, seq_name, add_labels=[], remove_labels=[], **kwargs):
|
|
518
|
-
"""Modifies a sequence's ChoreographyInfo field to remove or
|
|
605
|
+
"""Modifies a sequence's ChoreographyInfo field to remove or
|
|
519
606
|
add any labels attached to the sequence.
|
|
520
|
-
|
|
607
|
+
|
|
521
608
|
Returns:
|
|
522
609
|
The full ModifyChoreographyInfoResponse proto."""
|
|
523
610
|
request = self.build_modify_choreography_info_request(seq_name, add_labels, remove_labels)
|
|
@@ -533,8 +620,8 @@ class ChoreographyClient(BaseClient):
|
|
|
533
620
|
|
|
534
621
|
def clear_all_sequence_files(self, **kwargs):
|
|
535
622
|
"""Completely clears all choreography files that are saved on the robot,
|
|
536
|
-
including animation proto files.
|
|
537
|
-
|
|
623
|
+
including animation proto files.
|
|
624
|
+
|
|
538
625
|
Returns:
|
|
539
626
|
The full ClearAllSequenceFilesResponse proto."""
|
|
540
627
|
request = choreography_sequence_pb2.ClearAllSequenceFilesRequest()
|
|
@@ -588,6 +675,20 @@ class ChoreographyClient(BaseClient):
|
|
|
588
675
|
copy_request=False,
|
|
589
676
|
**kwargs)
|
|
590
677
|
|
|
678
|
+
def build_choreography_time_adjust_request(self, override_client_start_time, time_difference,
|
|
679
|
+
validity_time):
|
|
680
|
+
"""Generate the ChoreographyTimeAdjustRequest rpc with the timestamp converted into robot time."""
|
|
681
|
+
# Note the client_start_time is a time expressed in the client's clock for when the choreography sequence should begin.
|
|
682
|
+
request = choreography_sequence_pb2.ChoreographyTimeAdjustRequest()
|
|
683
|
+
if override_client_start_time:
|
|
684
|
+
request.override_start_time.CopyFrom(
|
|
685
|
+
self._update_timestamp_filter(override_client_start_time, self.timesync_endpoint))
|
|
686
|
+
if time_difference:
|
|
687
|
+
request.acceptable_time_difference.CopyFrom(seconds_to_duration(time_difference))
|
|
688
|
+
if validity_time:
|
|
689
|
+
request.validity_time.CopyFrom(seconds_to_duration(validity_time))
|
|
690
|
+
return request
|
|
691
|
+
|
|
591
692
|
def build_execute_choreography_request(self, choreography_name, client_start_time,
|
|
592
693
|
choreography_starting_slice, lease=None):
|
|
593
694
|
"""Generate the ExecuteChoreographyRequest rpc with the timestamp converted into robot time."""
|
{bosdyn_choreography_client-3.3.2.dist-info → bosdyn_choreography_client-4.0.1.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: bosdyn-choreography-client
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.0.1
|
|
4
4
|
Summary: Boston Dynamics API client code and interfaces for choreography
|
|
5
5
|
Home-page: https://dev.bostondynamics.com/
|
|
6
6
|
Author: Boston Dynamics
|
|
@@ -15,10 +15,9 @@ 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 (==
|
|
19
|
-
Requires-Dist: bosdyn-core (==
|
|
20
|
-
Requires-Dist: bosdyn-client (==
|
|
21
|
-
Requires-Dist: bosdyn-choreography-protos (==3.3.2)
|
|
18
|
+
Requires-Dist: bosdyn-api (==4.0.1)
|
|
19
|
+
Requires-Dist: bosdyn-core (==4.0.1)
|
|
20
|
+
Requires-Dist: bosdyn-client (==4.0.1)
|
|
22
21
|
|
|
23
22
|
<!--
|
|
24
23
|
Copyright (c) 2023 Boston Dynamics, Inc. All rights reserved.
|
|
@@ -34,4 +33,4 @@ Development Kit License (20191101-BDSDK-SL).
|
|
|
34
33
|
<img src="https://www.bostondynamics.com/sites/default/files/2020-05/spot.png" style="max-width:50%;">
|
|
35
34
|
</p>
|
|
36
35
|
|
|
37
|
-
The bosdyn-choreography-client wheel contains client interfaces for interacting with the Boston Dynamics Choreography API. The client interfaces implement the Remote Procedure Calls (RPCs) defined in the [bosdyn-
|
|
36
|
+
The bosdyn-choreography-client wheel contains client interfaces for interacting with the Boston Dynamics Choreography API. The client interfaces implement the choreography-related Remote Procedure Calls (RPCs) defined in the [bosdyn-api wheel](https://pypi.org/project/bosdyn-api/). Full design documentation for the functionality included in this wheel can be found [here](../../../docs/concepts/choreography/readme.md)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
bosdyn/__init__.py,sha256=CMQioQKK1NlMk3kZuY49b_Aw-JyvDeOtuqOCAul1I0s,330
|
|
2
|
+
bosdyn/choreography/__init__.py,sha256=CMQioQKK1NlMk3kZuY49b_Aw-JyvDeOtuqOCAul1I0s,330
|
|
3
|
+
bosdyn/choreography/client/__init__.py,sha256=CMQioQKK1NlMk3kZuY49b_Aw-JyvDeOtuqOCAul1I0s,330
|
|
4
|
+
bosdyn/choreography/client/animation_file_conversion_helpers.py,sha256=iBEqEGAZknyh8WWxtxZrzoA-o8BDJ7a5pmft0kqNCrs,18438
|
|
5
|
+
bosdyn/choreography/client/animation_file_to_proto.py,sha256=-24pM175p2d0zExWqwpHbxwF26gkPPDsU1BvGHTAQr4,25971
|
|
6
|
+
bosdyn/choreography/client/choreography.py,sha256=xNE2IqJxlYyTMON5HNUUNnO5rFFS7C9meLkuXjjhUS0,48849
|
|
7
|
+
bosdyn_choreography_client-4.0.1.dist-info/METADATA,sha256=EhyriEu4v7FtX0T0LQNU7f77uTg1SJHvgr05v640fug,1721
|
|
8
|
+
bosdyn_choreography_client-4.0.1.dist-info/WHEEL,sha256=AtBG6SXL3KF_v0NxLf0ehyVOh0cold-JbJYXNGorC6Q,92
|
|
9
|
+
bosdyn_choreography_client-4.0.1.dist-info/top_level.txt,sha256=an2OWgx1ej2jFjmBjPWNQ68ZglvUfKhmXWW-WhTtDmA,7
|
|
10
|
+
bosdyn_choreography_client-4.0.1.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
bosdyn/__init__.py,sha256=CMQioQKK1NlMk3kZuY49b_Aw-JyvDeOtuqOCAul1I0s,330
|
|
2
|
-
bosdyn/choreography/__init__.py,sha256=CMQioQKK1NlMk3kZuY49b_Aw-JyvDeOtuqOCAul1I0s,330
|
|
3
|
-
bosdyn/choreography/client/__init__.py,sha256=CMQioQKK1NlMk3kZuY49b_Aw-JyvDeOtuqOCAul1I0s,330
|
|
4
|
-
bosdyn/choreography/client/animation_file_conversion_helpers.py,sha256=iBEqEGAZknyh8WWxtxZrzoA-o8BDJ7a5pmft0kqNCrs,18438
|
|
5
|
-
bosdyn/choreography/client/animation_file_to_proto.py,sha256=k59cAZEYWpk648BIWaNpJirs1am1p4ziKSR2Up_sWwU,25970
|
|
6
|
-
bosdyn/choreography/client/choreography.py,sha256=QMPWWkrMf6KiyPIQjqGxJFfQbSHjhtjCVYOCo4rA3rU,43561
|
|
7
|
-
bosdyn_choreography_client-3.3.2.dist-info/METADATA,sha256=MT5kyu5aAHSzr2uqhrxsrKd9Cv58G8LjCiXTXN0Gi7E,1646
|
|
8
|
-
bosdyn_choreography_client-3.3.2.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
9
|
-
bosdyn_choreography_client-3.3.2.dist-info/top_level.txt,sha256=an2OWgx1ej2jFjmBjPWNQ68ZglvUfKhmXWW-WhTtDmA,7
|
|
10
|
-
bosdyn_choreography_client-3.3.2.dist-info/RECORD,,
|
|
File without changes
|