diff --git a/src/viam/sdk/components/camera.cpp b/src/viam/sdk/components/camera.cpp index 0858b8bab..e97ae00b3 100644 --- a/src/viam/sdk/components/camera.cpp +++ b/src/viam/sdk/components/camera.cpp @@ -231,7 +231,8 @@ Camera::properties Camera::from_proto( return {proto.supports_pcd(), from_proto(proto.intrinsic_parameters()), from_proto(proto.distortion_parameters()), - {proto.mime_types().begin(), proto.mime_types().end()}}; + {proto.mime_types().begin(), proto.mime_types().end()}, + (proto.frame_rate())}; } viam::component::camera::v1::IntrinsicParameters Camera::to_proto( @@ -282,7 +283,8 @@ bool operator==(const Camera::distortion_parameters& lhs, bool operator==(const Camera::properties& lhs, const Camera::properties& rhs) { return lhs.supports_pcd == rhs.supports_pcd && lhs.intrinsic_parameters == rhs.intrinsic_parameters && - lhs.distortion_parameters == rhs.distortion_parameters; + lhs.distortion_parameters == rhs.distortion_parameters && + lhs.frame_rate == rhs.frame_rate; } } // namespace sdk diff --git a/src/viam/sdk/components/camera.hpp b/src/viam/sdk/components/camera.hpp index 5670ba6f4..3e5a4e0fa 100644 --- a/src/viam/sdk/components/camera.hpp +++ b/src/viam/sdk/components/camera.hpp @@ -65,6 +65,9 @@ class Camera : public Component { /// @brief Contains the mime types the camera supports. Camera::mime_types mime_types; + + /// @brief Contains the camera's frame rate. + float frame_rate; }; /// @struct point_cloud diff --git a/src/viam/sdk/components/private/camera_server.cpp b/src/viam/sdk/components/private/camera_server.cpp index 885a9992c..19fd286f8 100644 --- a/src/viam/sdk/components/private/camera_server.cpp +++ b/src/viam/sdk/components/private/camera_server.cpp @@ -114,6 +114,7 @@ ::grpc::Status CameraServer::GetProperties( *response->mutable_intrinsic_parameters() = Camera::to_proto(properties.intrinsic_parameters); response->set_supports_pcd(properties.supports_pcd); + response->set_frame_rate(properties.frame_rate); }); } diff --git a/src/viam/sdk/tests/mocks/camera_mocks.cpp b/src/viam/sdk/tests/mocks/camera_mocks.cpp index 857936721..028cf6ad0 100644 --- a/src/viam/sdk/tests/mocks/camera_mocks.cpp +++ b/src/viam/sdk/tests/mocks/camera_mocks.cpp @@ -96,6 +96,7 @@ Camera::properties fake_properties() { properties.intrinsic_parameters = fake_intrinsic_parameters(); properties.distortion_parameters = fake_distortion_parameters(); properties.mime_types = fake_mime_types(); + properties.frame_rate = 10.0; return properties; }