Skip to content

Commit

Permalink
Add property for accessing SpotWrapper._lease (#83)
Browse files Browse the repository at this point in the history
* Add property for accessing `SpotWrapper._lease`

* Handle `None` case.
  • Loading branch information
ggoretkin-bdai authored Jan 23, 2024
1 parent 5bcf6d5 commit f9516d8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spot_wrapper/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from bosdyn.client.graph_nav import GraphNavClient
from bosdyn.client.gripper_camera_param import GripperCameraParamClient
from bosdyn.client.image import ImageClient
from bosdyn.client.lease import LeaseClient, LeaseKeepAlive
from bosdyn.client.lease import Lease, LeaseClient, LeaseKeepAlive
from bosdyn.client.license import LicenseClient
from bosdyn.client.manipulation_api_client import ManipulationApiClient
from bosdyn.client.map_processing import MapProcessingServiceClient
Expand Down Expand Up @@ -850,6 +850,11 @@ def lease(self) -> typing.List[lease_pb2.LeaseResource]:
"""Return latest proto from the _lease_task"""
return self._lease_task.proto

@property
def lease2(self) -> typing.Optional[Lease]:
"""Return the most recently `take`n or `acquire`d lease, or `None` if it is `release`d."""
return self._lease

@property
def spot_images(self) -> SpotImages:
"""Return SpotImages instance"""
Expand Down

0 comments on commit f9516d8

Please sign in to comment.