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

[python] Fix population of metadata #1578

Merged
merged 1 commit into from
Nov 17, 2024

Conversation

james-ward
Copy link
Contributor

No description provided.

@james-ward james-ward requested a review from a team as a code owner November 16, 2024 23:50
@james-ward james-ward marked this pull request as draft November 16, 2024 23:50
@james-ward james-ward force-pushed the python-fix-metadata-return branch from c902042 to 6facbbf Compare November 16, 2024 23:51
@james-ward james-ward marked this pull request as ready for review November 17, 2024 00:33
@mcm001 mcm001 merged commit f107c94 into PhotonVision:master Nov 17, 2024
34 of 35 checks passed
@mythgarr
Copy link
Contributor

mythgarr commented Jan 9, 2025

@james-ward Metadata construction args still don't align with the structure. The layout of PhotonPipelineMetadata:

@dataclass
class PhotonPipelineMetadata:
    captureTimestampMicros: int = -1
    publishTimestampMicros: int = -1
    sequenceID: int = -1
    timeSinceLastPong: int = -1
    photonStruct: ClassVar["PhotonPipelineMetadataSerde"]

..compared to the constructor call (variable names added for clarity):

        return PhotonPipelineResult(
            metadata=PhotonPipelineMetadata(
                captureTimestampMicros: self.heartbeatCounter,
                publishTimestampMicros: int(now_micros - latency * 1e6),
                sequenceID: int(now_micros),
                timeSinceLastPong: int(np.random.uniform(950, 1050)),
            ),
            targets=detectableTgts,
            multitagResult=multiTagResults,
        )

If I reorder self.heartbeatCounter locally to be the third arg rather than the first everything works as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants