Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSDK-8790: Add frame_rate to Go SDK #4377

Merged
merged 9 commits into from
Sep 24, 2024
Merged

Conversation

jckras
Copy link
Member

@jckras jckras commented Sep 20, 2024

Blocked by the API changes being merged (API PR #553)

  • Add frame_rate to the properties struct
  • Add frame_rate to camera_test.go and tested for when frame_rate is set vs not set (since it is optional)
  • Add frame_rate to the client and server files for go SDK
  • Add frame_rate to camera's client_test.go and server_test.go to test for when frame_rate is set vs not set

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Sep 20, 2024
Copy link
Contributor

Warning your change may break code samples. If your change modifies any of the following functions please contact @viamrobotics/fleet-management. Thanks!

component function
base IsMoving
board GPIOPinByName
camera Properties
encoder Properties
motor IsMoving
sensor Readings
servo Position
arm EndPosition
audio MediaProperties
gantry Lengths
gripper IsMoving
input_controller Controls
movement_sensor LinearAcceleration
power_sensor Power
pose_tracker Poses
motion GetPose
vision GetProperties

@jckras jckras marked this pull request as ready for review September 23, 2024 15:30
Copy link
Member

@randhid randhid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nits, generally looking really good! You will need to bump the api version once your API change is merged into the API repo. Also, because none of the cameras broke, modules should not break either. Caveat: this is true for python and go, I don't see a reason for an additive change to break a C++ module, but we'll keep an eye on the intelrealsense when we bump the sdk version there.

components/camera/camera_test.go Show resolved Hide resolved
components/camera/camera_test.go Outdated Show resolved Hide resolved
components/camera/server_test.go Outdated Show resolved Hide resolved
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Sep 23, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Sep 23, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Sep 23, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Sep 23, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Sep 23, 2024
@jckras jckras requested a review from randhid September 23, 2024 19:23
components/camera/camera.go Show resolved Hide resolved
components/camera/server_test.go Show resolved Hide resolved
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Sep 23, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Sep 23, 2024
Copy link
Member

@seanavery seanavery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

components/camera/camera_test.go Show resolved Hide resolved
@@ -316,6 +316,11 @@ func (c *client) Properties(ctx context.Context) (Properties, error) {
}
result.MimeTypes = resp.MimeTypes
result.SupportsPCD = resp.SupportsPcd

// Check if the optional frame_rate is present and set it if it exists
if resp.FrameRate != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this check because if we attempt dereference the pointer when nil we will get a panic?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - we will get undefined behavior if we dereference a null pointer so that is why i put that check in place.

Copy link
Member

@randhid randhid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much cleaner tests! LGTM

@jckras jckras merged commit 6b6f773 into viamrobotics:main Sep 24, 2024
19 checks passed
@jckras jckras deleted the go_sdk_changes branch September 24, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test This pull request is marked safe to test from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants