feat(observatory): share native result replay and expose saved TGS layers
This commit is contained in:
@@ -499,11 +499,14 @@ def test_recorded_follow_mode_tracks_sensor_pose_with_the_same_orbital_eye() ->
|
||||
}
|
||||
|
||||
|
||||
def test_recorded_blueprint_layer_updates_preserve_store_until_explicit_reset(
|
||||
@pytest.mark.parametrize("reactivate_updates", [False, True])
|
||||
def test_recorded_blueprint_updates_reuse_source_store_and_opt_in_to_activation(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
reactivate_updates: bool,
|
||||
) -> None:
|
||||
activations: list[tuple[object, bool, bool]] = []
|
||||
eye_control_updates: list[bool] = []
|
||||
explicit_presets: list[bool] = []
|
||||
send_blueprint = viewer_recorded_module.bindings.send_blueprint
|
||||
make_blueprint = viewer_recorded_module.recorded_blueprint
|
||||
|
||||
@@ -524,6 +527,7 @@ def test_recorded_blueprint_layer_updates_preserve_store_until_explicit_reset(
|
||||
|
||||
def capture_eye_control_update(*args: object, **kwargs: object) -> object:
|
||||
eye_control_updates.append(bool(kwargs["update_eye_controls"]))
|
||||
explicit_presets.append(bool(kwargs["explicit_spatial_preset"]))
|
||||
return make_blueprint(*args, **kwargs)
|
||||
|
||||
monkeypatch.setattr(
|
||||
@@ -537,6 +541,7 @@ def test_recorded_blueprint_layer_updates_preserve_store_until_explicit_reset(
|
||||
recording_id="stable-camera",
|
||||
blueprint_session_id=session_id,
|
||||
unified_perception=True,
|
||||
reactivate_updates=reactivate_updates,
|
||||
)
|
||||
layers_enabled = viewer_recorded_blueprint_rrd(
|
||||
RerunSceneSettings(accumulation_seconds=12.0),
|
||||
@@ -546,6 +551,7 @@ def test_recorded_blueprint_layer_updates_preserve_store_until_explicit_reset(
|
||||
show_detections_2d=True,
|
||||
show_segmentation=True,
|
||||
show_cuboids_3d=True,
|
||||
reactivate_updates=reactivate_updates,
|
||||
)
|
||||
follow_enabled = viewer_recorded_blueprint_rrd(
|
||||
RerunSceneSettings(accumulation_seconds=12.0),
|
||||
@@ -556,6 +562,7 @@ def test_recorded_blueprint_layer_updates_preserve_store_until_explicit_reset(
|
||||
show_segmentation=True,
|
||||
show_cuboids_3d=True,
|
||||
follow_trajectory=True,
|
||||
reactivate_updates=reactivate_updates,
|
||||
)
|
||||
layer_disabled_while_following = viewer_recorded_blueprint_rrd(
|
||||
RerunSceneSettings(accumulation_seconds=12.0),
|
||||
@@ -566,6 +573,7 @@ def test_recorded_blueprint_layer_updates_preserve_store_until_explicit_reset(
|
||||
show_segmentation=True,
|
||||
show_cuboids_3d=True,
|
||||
follow_trajectory=True,
|
||||
reactivate_updates=reactivate_updates,
|
||||
)
|
||||
reset = viewer_recorded_blueprint_rrd(
|
||||
RerunSceneSettings(accumulation_seconds=12.0),
|
||||
@@ -577,6 +585,7 @@ def test_recorded_blueprint_layer_updates_preserve_store_until_explicit_reset(
|
||||
show_segmentation=True,
|
||||
show_cuboids_3d=True,
|
||||
follow_trajectory=True,
|
||||
reactivate_updates=reactivate_updates,
|
||||
)
|
||||
|
||||
store_pattern = rb"rec_[0-9a-f]{32}"
|
||||
@@ -592,11 +601,14 @@ def test_recorded_blueprint_layer_updates_preserve_store_until_explicit_reset(
|
||||
assert len(reset_store_ids) == 1
|
||||
assert reset_store_ids.isdisjoint(initial_store_ids)
|
||||
assert eye_control_updates == [True, False, True, False, True]
|
||||
assert explicit_presets == [
|
||||
False, reactivate_updates, reactivate_updates, reactivate_updates, False
|
||||
]
|
||||
assert [activation[1:] for activation in activations] == [
|
||||
(True, False),
|
||||
(False, False),
|
||||
(False, False),
|
||||
(False, False),
|
||||
(reactivate_updates, False),
|
||||
(reactivate_updates, False),
|
||||
(reactivate_updates, False),
|
||||
(True, False),
|
||||
]
|
||||
assert activations[0][0] is activations[1][0]
|
||||
@@ -610,6 +622,23 @@ def test_recorded_blueprint_layer_updates_preserve_store_until_explicit_reset(
|
||||
assert len(reset) < 350_000
|
||||
|
||||
|
||||
def test_portable_replay_has_distinct_explicit_3d_and_plan_presets() -> None:
|
||||
eyes = []
|
||||
for plan in [False, True]:
|
||||
blueprint = viewer_recorded_blueprint(
|
||||
RerunSceneSettings(),
|
||||
include_initial_playback_state=False,
|
||||
explicit_spatial_preset=True,
|
||||
follow_trajectory=True,
|
||||
plan_view=plan,
|
||||
)
|
||||
eyes.append(blueprint.root_container.contents[0].properties["EyeControls3D"])
|
||||
assert eyes[0].position.as_arrow_array().to_pylist() == [[16.0, -16.0, 18.0]]
|
||||
assert eyes[1].position.as_arrow_array().to_pylist() == [[0.0, 0.0, 30.0]]
|
||||
assert eyes[0].eye_up.as_arrow_array().to_pylist() == [[0.0, 0.0, 1.0]]
|
||||
assert eyes[1].eye_up.as_arrow_array().to_pylist() == [[0.0, 1.0, 0.0]]
|
||||
|
||||
|
||||
def test_viewer_blueprint_unifies_original_video_and_independent_ai_layers() -> None:
|
||||
blueprint = viewer_recorded_blueprint(
|
||||
RerunSceneSettings(accumulation_seconds=12.0),
|
||||
|
||||
Reference in New Issue
Block a user