feat(viewer): add recorded point colors and trajectory follow
This commit is contained in:
@@ -37,6 +37,9 @@ from k1link.device_plugins.xgrids_k1.rrd_export import (
|
||||
export_k1mqtt_to_rrd,
|
||||
recorded_blueprint_rrd,
|
||||
)
|
||||
from k1link.viewer.recorded import (
|
||||
RECORDED_SPATIAL_FOLLOW_VIEW_ID,
|
||||
)
|
||||
from k1link.viewer.recorded import (
|
||||
recorded_blueprint as viewer_recorded_blueprint,
|
||||
)
|
||||
@@ -450,6 +453,40 @@ def test_viewer_blueprint_reset_is_bounded_and_recreates_render_views() -> None:
|
||||
assert perception_behavior.visible.as_arrow_array().to_pylist() == [False]
|
||||
|
||||
|
||||
def test_recorded_follow_mode_tracks_sensor_pose_with_an_independent_orbital_eye() -> None:
|
||||
normal = viewer_recorded_blueprint(
|
||||
RerunSceneSettings(),
|
||||
include_initial_playback_state=False,
|
||||
)
|
||||
followed = viewer_recorded_blueprint(
|
||||
RerunSceneSettings(),
|
||||
include_initial_playback_state=False,
|
||||
follow_trajectory=True,
|
||||
)
|
||||
followed_again = viewer_recorded_blueprint(
|
||||
RerunSceneSettings(show_grid=False),
|
||||
include_initial_playback_state=False,
|
||||
follow_trajectory=True,
|
||||
)
|
||||
|
||||
normal_view = normal.root_container.contents[0]
|
||||
followed_view = followed.root_container.contents[0]
|
||||
followed_eye = followed_view.properties["EyeControls3D"]
|
||||
followed_components = {
|
||||
str(batch.component_descriptor()): batch.as_arrow_array().to_pylist()
|
||||
for batch in followed_eye.as_component_batches()
|
||||
}
|
||||
|
||||
assert "EyeControls3D" not in normal_view.properties
|
||||
assert followed_view.id == RECORDED_SPATIAL_FOLLOW_VIEW_ID
|
||||
assert followed_again.root_container.contents[0].id == RECORDED_SPATIAL_FOLLOW_VIEW_ID
|
||||
assert followed_view.id != normal_view.id
|
||||
assert followed_components == {
|
||||
"EyeControls3D:kind": [2],
|
||||
"EyeControls3D:tracking_entity": ["/world/sensor_pose"],
|
||||
}
|
||||
|
||||
|
||||
def test_recorded_blueprint_layer_updates_preserve_store_until_explicit_reset(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user