2121from bosdyn .client .time_sync import TimeSyncEndpoint
2222from bosdyn .util import seconds_to_duration
2323
24- from spot_wrapper .wrapper_helpers import RobotState
24+ from spot_wrapper .wrapper_helpers import RobotState , ClaimAndPowerDecorator
2525
2626
2727class SpotArm :
@@ -34,13 +34,19 @@ def __init__(
3434 manipulation_api_client : ManipulationApiClient ,
3535 robot_state_client : RobotStateClient ,
3636 max_command_duration : float ,
37+ claim_and_power_decorator : ClaimAndPowerDecorator ,
3738 ) -> None :
3839 """
3940 Constructor for SpotArm class.
4041 Args:
4142 robot: Robot object
4243 logger: Logger object
44+ robot_state: Object containing the robot's state as controlled by the wrapper
45+ robot_command_client: Command client to use to send commands to the robot
46+ manipulation_api_client: Command client to send manipulation commands to the robot
47+ robot_state_client: Client to retrieve state of the robot
4348 max_command_duration: Maximum duration for commands when using the manipulation command method
49+ claim_and_power_decorator: Object to use to decorate the functions on this object
4450 """
4551 self ._robot = robot
4652 self ._logger = logger
@@ -49,6 +55,23 @@ def __init__(
4955 self ._robot_command_client = robot_command_client
5056 self ._manipulation_api_client = manipulation_api_client
5157 self ._robot_state_client = robot_state_client
58+ self ._claim_and_power_decorator = claim_and_power_decorator
59+ self ._claim_and_power_decorator .decorate_functions (
60+ self ,
61+ decorated_funcs = [
62+ self .ensure_arm_power_and_stand ,
63+ self .arm_stow ,
64+ self .arm_unstow ,
65+ self .arm_carry ,
66+ self .arm_joint_move ,
67+ self .force_trajectory ,
68+ self .gripper_open ,
69+ self .gripper_close ,
70+ self .gripper_angle_open ,
71+ self .hand_pose ,
72+ self .grasp_3d ,
73+ ],
74+ )
5275
5376 def _manipulation_request (
5477 self ,
0 commit comments