Skip to content

Conversation

hexbabe
Copy link
Member

@hexbabe hexbabe commented Sep 30, 2025

RSDK-11831

DO NOT MERGE until the breaking change to remove GetImage has been stacked on top of this PR and is also ready to merge. We should merge both together when we are ready for the breaking change December 1st.

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Sep 30, 2025
@hexbabe hexbabe marked this pull request as ready for review September 30, 2025 20:49
@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 30, 2025
@hexbabe hexbabe changed the title [RSDK-11831] — Make ReadImage call GetImages under the hood RSDK-11831 — Make ReadImage call GetImages under the hood Sep 30, 2025
@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 30, 2025
@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 Oct 1, 2025
@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 Oct 1, 2025
Copy link
Member

@dmhilly dmhilly left a comment

Choose a reason for hiding this comment

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

Left two questions! Thanks Sean!

ts := data.Timestamps{
TimeRequested: timeRequested,
TimeReceived: time.Now(),
TimeReceived: resMetadata.CapturedAt,
Copy link
Member

Choose a reason for hiding this comment

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

Can you remind me why this change?

Copy link
Member Author

@hexbabe hexbabe Oct 2, 2025

Choose a reason for hiding this comment

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

We assume CapturedAt is more accurate than time.Now() because most of the time CapturedAt is from the frame metadata itself from the underlying camera rather than when we receive the GetImages response, which is what time.Now() expresses.

Copy link
Member

Choose a reason for hiding this comment

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

Cool! Thanks for explaining.

return res, data.NewFailedToReadError(params.ComponentName, readImage.String(), err)
}

// Select the corresponding image based on requested mime type if provided
Copy link
Member

Choose a reason for hiding this comment

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

Nice! Since the requested mime type was already an argument before, I'm curious if this is how it worked previously, or is this new behavior?

Copy link
Member Author

@hexbabe hexbabe Oct 2, 2025

Choose a reason for hiding this comment

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

This is new behavior since previously we would be calling GetImage and letting the implementer of GetImage handle the mime type however it wants. Now, we are returning the requested mime type iff we find it in the GetImages response.

Copy link
Member Author

Choose a reason for hiding this comment

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

I realized this is better than always defaulting to images[0] as we discussed on Slack

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense! This SGTM.

@hexbabe hexbabe requested a review from dmhilly October 2, 2025 18:53
Copy link
Member

@dmhilly dmhilly left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks Sean :)

return res, data.NewFailedToReadError(params.ComponentName, readImage.String(), err)
}

// Select the corresponding image based on requested mime type if provided
Copy link
Member

Choose a reason for hiding this comment

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

Makes sense! This SGTM.

ts := data.Timestamps{
TimeRequested: timeRequested,
TimeReceived: time.Now(),
TimeReceived: resMetadata.CapturedAt,
Copy link
Member

Choose a reason for hiding this comment

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

Cool! Thanks for explaining.

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.

3 participants