From 15238f24a78d69fb4a48cd8daf376e4a258ec2ce Mon Sep 17 00:00:00 2001 From: Julie Krasnick Date: Wed, 18 Sep 2024 16:23:05 -0400 Subject: [PATCH 1/4] changes to python --- src/viam/components/camera/service.py | 1 + tests/mocks/components.py | 1 + tests/test_camera.py | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/viam/components/camera/service.py b/src/viam/components/camera/service.py index 568f85237..965c65033 100644 --- a/src/viam/components/camera/service.py +++ b/src/viam/components/camera/service.py @@ -89,6 +89,7 @@ async def GetProperties(self, stream: Stream[GetPropertiesRequest, GetProperties intrinsic_parameters=properties.intrinsic_parameters, distortion_parameters=properties.distortion_parameters, mime_types=properties.mime_types, + frame_rate=properties.frame_rate, ) await stream.send_message(response) diff --git a/tests/mocks/components.py b/tests/mocks/components.py index def5f1421..7fd673980 100644 --- a/tests/mocks/components.py +++ b/tests/mocks/components.py @@ -372,6 +372,7 @@ def __init__(self, name: str): intrinsic_parameters=IntrinsicParameters(width_px=1, height_px=2, focal_x_px=3, focal_y_px=4, center_x_px=5, center_y_px=6), distortion_parameters=DistortionParameters(model="no_distortion"), mime_types=[CameraMimeType.PNG, CameraMimeType.JPEG], + frame_rate=10.0, ) self.timeout: Optional[float] = None ts = Timestamp() diff --git a/tests/test_camera.py b/tests/test_camera.py index ea48501b2..93e57be1c 100644 --- a/tests/test_camera.py +++ b/tests/test_camera.py @@ -62,6 +62,7 @@ def properties() -> Camera.Properties: intrinsic_parameters=IntrinsicParameters(width_px=1, height_px=2, focal_x_px=3, focal_y_px=4, center_x_px=5, center_y_px=6), distortion_parameters=DistortionParameters(model="no_distortion"), mime_types=[CameraMimeType.PNG, CameraMimeType.JPEG], + frame_rate = 10.0, ) @@ -202,6 +203,7 @@ async def test_get_properties(self, camera: MockCamera, service: CameraRPCServic assert response.supports_pcd == properties.supports_pcd assert response.intrinsic_parameters == properties.intrinsic_parameters assert response.mime_types == properties.mime_types + assert response.frame_rate == properties.frame_rate assert camera.timeout == loose_approx(5.43) @pytest.mark.asyncio From 419de457b11acd2e5947b8ecbe0296d833a31bde Mon Sep 17 00:00:00 2001 From: Julie Krasnick Date: Mon, 23 Sep 2024 16:13:55 -0400 Subject: [PATCH 2/4] update api version --- src/viam/version_metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/viam/version_metadata.py b/src/viam/version_metadata.py index 499d59341..21bcf853e 100644 --- a/src/viam/version_metadata.py +++ b/src/viam/version_metadata.py @@ -1,4 +1,4 @@ import viam -API_VERSION = "v0.1.330" +API_VERSION = "0.1.340" SDK_VERSION = viam.__version__ From 7a3a780003bb2c3c8cec54d2db694495f63b55fe Mon Sep 17 00:00:00 2001 From: Julie Krasnick Date: Tue, 24 Sep 2024 11:17:16 -0400 Subject: [PATCH 3/4] formatting --- tests/test_camera.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_camera.py b/tests/test_camera.py index 93e57be1c..563ccfcc5 100644 --- a/tests/test_camera.py +++ b/tests/test_camera.py @@ -62,7 +62,7 @@ def properties() -> Camera.Properties: intrinsic_parameters=IntrinsicParameters(width_px=1, height_px=2, focal_x_px=3, focal_y_px=4, center_x_px=5, center_y_px=6), distortion_parameters=DistortionParameters(model="no_distortion"), mime_types=[CameraMimeType.PNG, CameraMimeType.JPEG], - frame_rate = 10.0, + frame_rate=10.0, ) From 1aef190eb25fbac9bc4adf40b267e7da83d92c0f Mon Sep 17 00:00:00 2001 From: Julie Krasnick Date: Wed, 25 Sep 2024 14:10:28 -0400 Subject: [PATCH 4/4] remove all assignments --- src/viam/components/camera/service.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/viam/components/camera/service.py b/src/viam/components/camera/service.py index 965c65033..936271491 100644 --- a/src/viam/components/camera/service.py +++ b/src/viam/components/camera/service.py @@ -84,14 +84,7 @@ async def GetProperties(self, stream: Stream[GetPropertiesRequest, GetProperties camera = self.get_resource(name) timeout = stream.deadline.time_remaining() if stream.deadline else None properties = await camera.get_properties(timeout=timeout, metadata=stream.metadata) - response = GetPropertiesResponse( - supports_pcd=properties.supports_pcd, - intrinsic_parameters=properties.intrinsic_parameters, - distortion_parameters=properties.distortion_parameters, - mime_types=properties.mime_types, - frame_rate=properties.frame_rate, - ) - await stream.send_message(response) + await stream.send_message(properties) async def DoCommand(self, stream: Stream[DoCommandRequest, DoCommandResponse]) -> None: request = await stream.recv_message()