diff --git a/py/examples/camera_client/main.py b/py/examples/camera_client/main.py index 722b60dc..2d361aa6 100644 --- a/py/examples/camera_client/main.py +++ b/py/examples/camera_client/main.py @@ -21,7 +21,7 @@ async def main(address: str, port: int, stream_every_n: int) -> None: response_stream = client.stream_frames(every_n=stream_every_n) # start the streaming service - await client.start_service() + await client.connect_to_service() while True: # query the service state diff --git a/py/examples/camera_client_gui/main.py b/py/examples/camera_client_gui/main.py index 051ecd7c..c8872064 100644 --- a/py/examples/camera_client_gui/main.py +++ b/py/examples/camera_client_gui/main.py @@ -85,7 +85,7 @@ async def stream_camera(self, client: OakCameraClient) -> None: while True: if client.state.value != oak_pb2.OakServiceState.RUNNING: # start the streaming service - await client.start_service() + await client.connect_to_service() await asyncio.sleep(0.01) continue elif response_stream is None: diff --git a/py/examples/camera_pipeline/main.py b/py/examples/camera_pipeline/main.py index 99e98738..4f4da04c 100644 --- a/py/examples/camera_pipeline/main.py +++ b/py/examples/camera_pipeline/main.py @@ -85,7 +85,7 @@ async def forward(self): async def main(): cam = AmigaCamera("oak1") - await cam.client.start_service() + await cam.client.connect_to_service() viz1 = OpencvWindow("viz_raw") viz2 = OpencvWindow("viz_img") diff --git a/py/farm_ng/canbus/canbus_client.py b/py/farm_ng/canbus/canbus_client.py index 89f4d865..5a4eb6dd 100644 --- a/py/farm_ng/canbus/canbus_client.py +++ b/py/farm_ng/canbus/canbus_client.py @@ -83,13 +83,13 @@ async def get_state(self) -> CanbusServiceState: self.logger.debug("CanbusServiceStub: port -> %i state is: %s", self.config.port, state.name) return state - async def start_service(self) -> None: + async def connect_to_service(self) -> None: state: CanbusServiceState = await self.get_state() if state.value == canbus_pb2.CanbusServiceState.UNAVAILABLE: return await self.stub.startService(canbus_pb2.StartServiceRequest()) - async def stop_service(self) -> None: + async def disconnect_from_service(self) -> None: state: CanbusServiceState = await self.get_state() if state.value == canbus_pb2.CanbusServiceState.UNAVAILABLE: return diff --git a/py/farm_ng/controller/controller_client.py b/py/farm_ng/controller/controller_client.py index a47fa752..6eb82134 100644 --- a/py/farm_ng/controller/controller_client.py +++ b/py/farm_ng/controller/controller_client.py @@ -82,13 +82,13 @@ async def get_state(self) -> ControllerServiceState: self.logger.debug("ControllerServiceStub: port -> %i state is: %s", self.config.port, state) return state - async def start_service(self) -> None: + async def connect_to_service(self) -> None: state: ControllerServiceState = await self.get_state() if state.value == controller_pb2.ControllerServiceState.UNAVAILABLE: return await self.stub.startService(controller_pb2.StartServiceRequest()) - async def stop_service(self) -> None: + async def disconnect_from_service(self) -> None: state: controller_pb2.ControllerServiceState = await self.get_state() if state.value == controller_pb2.ControllerServiceState.UNAVAILABLE: return diff --git a/py/farm_ng/oak/camera_client.py b/py/farm_ng/oak/camera_client.py index 92691fa9..471ae1ce 100644 --- a/py/farm_ng/oak/camera_client.py +++ b/py/farm_ng/oak/camera_client.py @@ -161,7 +161,7 @@ async def get_state(self) -> OakCameraServiceState: self.logger.debug("OakServiceStub: port -> %i state is: %s", self.config.port, state.name) return state - async def start_service(self) -> None: + async def connect_to_service(self) -> None: """Start the camera streaming. The service state will go from `IDLE` to `RUNNING`. diff --git a/py/farm_ng/state_estimator/state_estimator_client.py b/py/farm_ng/state_estimator/state_estimator_client.py index 555b210a..9b27a102 100644 --- a/py/farm_ng/state_estimator/state_estimator_client.py +++ b/py/farm_ng/state_estimator/state_estimator_client.py @@ -82,13 +82,13 @@ async def get_state(self) -> StateEstimatorServiceState: self.logger.debug("StateEstimatorServiceStub: port -> %i state is: %s", self.config.port, state) return state - async def start_service(self) -> None: + async def connect_to_service(self) -> None: state: StateEstimatorServiceState = await self.get_state() if state.value == state_estimator_pb2.StateEstimatorServiceState.UNAVAILABLE: return await self.stub.startService(state_estimator_pb2.StartServiceRequest()) - async def stop_service(self) -> None: + async def disconnect_from_service(self) -> None: state: StateEstimatorServiceState = await self.get_state() if state.value == state_estimator_pb2.StateEstimatorServiceState.UNAVAILABLE: return