Skip to content

Commit bbca68b

Browse files
Initialize motor power state in mocks (#101)
Signed-off-by: Michel Hidalgo <[email protected]>
1 parent 94c7ba2 commit bbca68b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spot_wrapper/testing/mocks/power.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Copyright (c) 2024 Boston Dynamics AI Institute LLC. See LICENSE file for more info.
22

3+
from typing import Any
4+
35
import grpc
46
from bosdyn.api.power_pb2 import (
57
FanPowerCommandFeedbackRequest,
@@ -21,6 +23,10 @@
2123
class MockPowerService(PowerServiceServicer, MockRobotStateService):
2224
"""A mock Spot power service."""
2325

26+
def __init__(self, **kwargs: Any) -> None:
27+
super().__init__(**kwargs)
28+
self.robot_state.power_state.motor_power_state = PowerState.MotorPowerState.MOTOR_POWER_STATE_OFF
29+
2430
def PowerCommand(self, request: PowerCommandRequest, context: grpc.ServicerContext) -> PowerCommandResponse:
2531
response = PowerCommandResponse()
2632
if request.request == PowerCommandRequest.Request.REQUEST_ON_MOTORS:

0 commit comments

Comments
 (0)