Skip to content

Add RGB-Depth sync test#14168

Closed
ymodlin wants to merge 14 commits intorealsenseai:developmentfrom
ymodlin:development
Closed

Add RGB-Depth sync test#14168
ymodlin wants to merge 14 commits intorealsenseai:developmentfrom
ymodlin:development

Conversation

@ymodlin
Copy link
Collaborator

@ymodlin ymodlin commented Jul 28, 2025

Add test-sync.py: Streaming Synchronization Functional Test
Overview
This PR introduces a new functional test, test-sync.py, to the streaming folder. The test validates the synchronization and reliability of simultaneous color and depth streaming across a comprehensive set of RealSense camera configurations.

Key Features

Functional Test Pattern:

Uses the standard RealSense test framework (rspy.test, rspy.log)
Each configuration is a separate test case with pass/fail status
Synchronization Validation:

check that color and depth stream are synchronized by testing the diff of the timestamp in the metadata.
Device Reset Between Runs:

Resets the device between each configuration to ensure a clean state and reliable results
Context-Aware Test Sets:

Robust Error Handling:

Handles missing profiles and device errors gracefully
Provides detailed debug logging for troubleshooting

@ymodlin ymodlin requested a review from Copilot July 28, 2025 08:53
@ymodlin ymodlin added the ai-assist AI was used to develop this feature label Jul 28, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a comprehensive functional test for verifying synchronization between RGB and depth streams across multiple RealSense camera configurations. The test validates that color and depth streams can operate simultaneously with proper timestamp synchronization.

  • Implements systematic testing across 20+ configuration combinations (resolution, fps)
  • Validates frame delivery rates and timestamp synchronization between streams
  • Provides context-aware test execution (reduced set for CI, full set for nightly)

and p.as_video_stream_profile().height() == h)
except StopIteration:
log.d(f"Color profile not found for {w}x{h}@{fps}fps")
return False, 0, 0
Copy link

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

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

The return statement has 3 values but other return statements in the function (lines 95, 117, 132) have 4 values. This inconsistency will cause unpacking errors when the function result is used.

Suggested change
return False, 0, 0
return False, 0, 0, []

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@ymodlin ymodlin requested a review from Nir-Az July 28, 2025 11:52
log.d(f"Received frames - Color: {color_frames}, Depth: {depth_frames}")

# Test passes if both streams received reasonable number of frames
color_ok = color_frames >= min_expected_frames
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is too strict no?
I think the frame max count is fps * frame duration no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm streaming for 3 seconds but expect only 2 seconds of frames to arrive.
Maybe this is even to loose.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh now it's changed.
Maybe better to use the define like TEST_SLEEP_DURATION/2 or something?

It's even a bit risky as we have some time to first frame so 3 seconds can be even 1-2 seconds of frames

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok fixed

@Nir-Az
Copy link
Collaborator

Nir-Az commented Jul 29, 2025

Close and reopen to trigger CI

@Nir-Az Nir-Az closed this Jul 29, 2025
@Nir-Az Nir-Az reopened this Jul 29, 2025
@ymodlin ymodlin closed this Jul 31, 2025
@ymodlin ymodlin reopened this Jul 31, 2025
@ymodlin ymodlin requested a review from Nir-Az July 31, 2025 15:07
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2025 RealSense Inc. All Rights Reserved.

# test:device D455
Copy link
Collaborator

Choose a reason for hiding this comment

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

Test failed as Win & Linux does not have a D457 device.
So instead of these 2 lines
change to

# test:device each(D400*) 

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ymodlin
Copy link
Collaborator Author

ymodlin commented Aug 3, 2025

RetriggerCI

@ymodlin ymodlin closed this Aug 3, 2025
@ymodlin ymodlin reopened this Aug 3, 2025
ymodlin and others added 11 commits August 3, 2025 10:41
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ymodlin ymodlin closed this Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assist AI was used to develop this feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants