Skip to content

Commit

Permalink
RSDK-8812: Add frame_rate to flutter sdk (viamrobotics#261)
Browse files Browse the repository at this point in the history
* changes to flutter sdk

* final flutter changes

* formatting

* remove assignments

* remove all tests

* added one test
  • Loading branch information
jckras authored Sep 25, 2024
1 parent af89f35 commit a9fdd27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 1 addition & 4 deletions lib/src/components/camera/service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ class CameraService extends CameraServiceBase {
Future<GetPropertiesResponse> getProperties(ServiceCall call, GetPropertiesRequest request) async {
final camera = _fromManager(request.name);
final properties = await camera.properties();
return GetPropertiesResponse()
..supportsPcd = properties.supportsPcd
..intrinsicParameters = properties.intrinsicParameters
..distortionParameters = properties.distortionParameters;
return properties;
}

@override
Expand Down
4 changes: 3 additions & 1 deletion test/unit_test/components/camera_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class FakeCamera extends Camera {
return CameraProperties()
..supportsPcd = true
..intrinsicParameters = (IntrinsicParameters()..widthPx = 10)
..distortionParameters = (DistortionParameters()..model = 'test');
..distortionParameters = (DistortionParameters()..model = 'test')
..frameRate = 10.0;
}
}

Expand Down Expand Up @@ -80,6 +81,7 @@ void main() {
final actual = await camera.properties();
expect(actual.distortionParameters.model, 'test');
expect(actual.intrinsicParameters.widthPx, 10);
expect(actual.frameRate, 10.0);
});

test('doCommand', () async {
Expand Down

0 comments on commit a9fdd27

Please sign in to comment.