feat(observatory): ship modular AI inference labs
This commit is contained in:
@@ -499,6 +499,30 @@ def test_recorded_follow_mode_tracks_sensor_pose_with_the_same_orbital_eye() ->
|
||||
}
|
||||
|
||||
|
||||
def test_recorded_layer_blueprint_can_carry_the_operator_eye() -> None:
|
||||
blueprint = viewer_recorded_blueprint(
|
||||
RerunSceneSettings(),
|
||||
include_initial_playback_state=False,
|
||||
unified_perception=True,
|
||||
update_eye_controls=False,
|
||||
eye_position=(3.0, 4.0, 5.0),
|
||||
eye_look_target=(1.0, 2.0, 0.0),
|
||||
eye_up=(0.0, 0.0, 1.0),
|
||||
)
|
||||
eye = blueprint.root_container.contents[1].properties["EyeControls3D"]
|
||||
components = {
|
||||
str(batch.component_descriptor()): batch.as_arrow_array().to_pylist()
|
||||
for batch in eye.as_component_batches()
|
||||
}
|
||||
assert components == {
|
||||
"EyeControls3D:kind": [2],
|
||||
"EyeControls3D:position": [[3.0, 4.0, 5.0]],
|
||||
"EyeControls3D:look_target": [[1.0, 2.0, 0.0]],
|
||||
"EyeControls3D:eye_up": [[0.0, 0.0, 1.0]],
|
||||
"EyeControls3D:tracking_entity": [""],
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("reactivate_updates", [False, True])
|
||||
def test_recorded_blueprint_updates_reuse_source_store_and_opt_in_to_activation(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
@@ -601,9 +625,10 @@ def test_recorded_blueprint_updates_reuse_source_store_and_opt_in_to_activation(
|
||||
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
|
||||
]
|
||||
# Reactivating a blueprint clone is required for visible layer changes, but
|
||||
# those changes must not write position/look-target/eye-up and reset the
|
||||
# operator's camera. Only the follow transition writes a spatial preset.
|
||||
assert explicit_presets == [False, False, True, False, False]
|
||||
assert [activation[1:] for activation in activations] == [
|
||||
(True, False),
|
||||
(reactivate_updates, False),
|
||||
@@ -644,18 +669,21 @@ def test_viewer_blueprint_unifies_original_video_and_independent_ai_layers() ->
|
||||
RerunSceneSettings(accumulation_seconds=12.0),
|
||||
include_initial_playback_state=False,
|
||||
unified_perception=True,
|
||||
unified_camera_share=0.73,
|
||||
show_camera_image=False,
|
||||
show_detections_2d=True,
|
||||
show_segmentation=True,
|
||||
show_cuboids_3d=False,
|
||||
)
|
||||
|
||||
assert type(blueprint.root_container).__name__ == "Horizontal"
|
||||
assert blueprint.root_container.column_shares == pytest.approx([0.73, 0.27])
|
||||
camera_view, spatial_view = blueprint.root_container.contents
|
||||
assert camera_view.origin == "/perception/camera"
|
||||
assert spatial_view.origin == "/world"
|
||||
assert camera_view.visualizer_overrides[
|
||||
"/perception/camera/image"
|
||||
].visible.as_arrow_array().to_pylist() == [True]
|
||||
].visible.as_arrow_array().to_pylist() == [False]
|
||||
assert camera_view.visualizer_overrides[
|
||||
"/perception/camera/detections"
|
||||
].visible.as_arrow_array().to_pylist() == [True]
|
||||
|
||||
Reference in New Issue
Block a user