From d0e5f909522ef5a2c89b3f4fec0344a21e695107 Mon Sep 17 00:00:00 2001 From: DCCONSTRUCTIONS Date: Thu, 8 Oct 2026 09:59:51 +0300 Subject: [PATCH] Preserve installed operator workspace before consolidation Local preservation snapshot, not a new deployment or simulation acceptance. --- README.md | 6 + apps/control-station/package-lock.json | 12 +- apps/control-station/package.json | 3 +- .../public/rover-scene/dcd006-v020-motion.glb | 3 + .../rover-scene/dcd006-v020-motion.json | 174 + apps/control-station/simulation-stream.html | 4 + .../LaboratoryMetricEvidenceScene.tsx | 8 +- .../observation/ObservationDeck.tsx | 17 + .../ObservationLayoutSaveWindow.tsx | 16 + .../observation/ObservationPanelHeader.tsx | 13 + .../components/observation/observation.css | 54 + .../simulation/AiCompositionFields.tsx | 14 +- .../components/simulation/AiConfiguration.tsx | 58 + .../components/simulation/AiEditorRuntime.ts | 175 + .../simulation/AiInferencePreview.tsx | 42 + .../components/simulation/AiLocalPlanner.tsx | 156 + .../simulation/AiPlanSaveWindow.tsx | 16 + .../components/simulation/AiProfileWindow.tsx | 18 + .../components/simulation/AiRouteOverlay.tsx | 140 + .../components/simulation/AiRunActions.tsx | 6 +- .../src/components/simulation/AiRunReport.tsx | 73 + .../src/components/simulation/AiRunView.tsx | 50 +- .../simulation/AiSessionSection.tsx | 27 + .../simulation/AiSpatialPreview.tsx | 11 + .../components/simulation/AiTaskSelect.tsx | 39 + .../components/simulation/AiWorldSetup.tsx | 12 +- .../components/simulation/AiWorldStream.tsx | 124 +- .../src/components/simulation/EditorCamera.ts | 100 + .../components/simulation/EditorTerrain.ts | 63 + .../simulation/LocalManualScene.tsx | 55 + .../components/simulation/PlannerMarkers.ts | 99 + .../components/simulation/PlannerSettings.tsx | 96 + .../simulation/PlayCanvasRuntime.ts | 42 +- .../simulation/RoverSettingsWindow.tsx | 33 + .../components/simulation/RoverTrackMotion.ts | 36 + .../simulation/SimulationObservationDeck.tsx | 56 + .../simulation/SimulationSourceImport.tsx | 53 + .../simulation/SimulationUgvController.ts | 59 +- .../simulation/SimulationViewTools.tsx | 30 + .../src/components/simulation/WorkerVideo.tsx | 29 + .../src/components/simulation/localScene.ts | 20 + .../src/components/simulation/streamFrame.css | 5 + .../src/components/simulation/streamFrame.ts | 47 + .../simulation/useAiPlanningControls.ts | 99 + .../components/simulation/useLocalScene.ts | 23 + .../components/simulation/useObserverInput.ts | 59 + .../simulation/usePlannerPreferences.ts | 20 + .../simulation/useSimulationFullscreen.ts | 1 + .../src/core/fleet/observationLayout.ts | 29 +- .../src/core/fleet/observationPresets.ts | 71 + .../src/core/fleet/useObservationPresets.ts | 28 + .../src/core/simulation/aiEditor.ts | 17 + .../core/simulation/aiEditorCoordinates.ts | 3 + .../src/core/simulation/aiPolygon.ts | 76 +- .../src/core/simulation/aiProfiles.ts | 20 + .../src/core/simulation/editorNavigation.ts | 25 + .../src/core/simulation/editorZoom.ts | 4 + .../src/core/simulation/gaussianQuality.ts | 18 + .../src/core/simulation/planDraft.ts | 8 + .../src/core/simulation/plannerPreferences.ts | 42 + .../src/core/simulation/roverMotion.ts | 20 + .../src/core/simulation/roverSettings.ts | 32 + .../src/core/simulation/runConfiguration.ts | 36 + .../src/core/simulation/streamRecovery.ts | 5 + .../src/core/simulation/useAiSelection.ts | 20 + .../src/core/simulation/useRoverSettings.ts | 20 + .../src/core/simulation/viewedAiRun.ts | 8 + .../src/core/simulation/waypointDrag.ts | 17 + .../src/core/simulation/waypointEditing.ts | 34 + .../src/core/simulation/waypointHit.ts | 16 + .../control-station/src/styles/ai-polygon.css | 150 +- .../observation/BoardObservationCenter.tsx | 23 +- .../fleet/observation/ObservationDeck.tsx | 19 +- .../observation/ObservationPanelHeader.tsx | 14 +- .../fleet/observation/observation.css | 51 +- .../simulation/AiPolygonWorkspace.tsx | 242 +- .../simulation/SimulationWorkspace.tsx | 426 +- .../test/aiEditorCoordinates.test.mjs | 23 + .../test/editorInteraction.test.mjs | 84 + apps/control-station/test/planDraft.test.mjs | 20 + .../test/plannerPreferences.test.mjs | 51 + .../test/roverSettings.test.mjs | 24 + .../test/simulationMotion.test.mjs | 56 + .../test/simulationRunConfiguration.test.mjs | 43 + .../test/simulationWorkspace.test.mjs | 20 +- apps/control-station/vite.config.ts | 1 + docs/12_SIMULATION_POLYGON_PRODUCT_AND_SRS.md | 53 +- docs/20_SIMULATION_WORLD_SURFACE_BRIEF.md | 14 + docs/AI_POLYGON_ROUTE_PLANNING.md | 70 + docs/AI_POLYGON_WORKFLOW.md | 222 + docs/SIMULATION_WORKFLOW.md | 204 + ...ibuted-product-edge-and-worker-topology.md | 16 + ...eutral-simulation-and-unreal-evaluation.md | 19 +- docs/audits/2026-10-02-local-route-editor.md | 129 + .../2026-10-02-planner-settings-and-launch.md | 84 + .../2026-10-02-route-planner-and-rover.md | 134 + ...2026-10-02-simulation-editor-navigation.md | 101 + .../2026-10-02-simulation-state-review.md | 105 + .../2026-10-02-simulation-task-library.md | 66 + docs/audits/2026-10-02-unified-simulation.md | 84 + .../2026-10-02-waypoints-and-rover-motion.md | 90 + ...-03-dcd006-simulation-and-driving-rules.md | 100 + .../2026-10-03-mission-core-ops-index.json | 707 + ...26-10-03-observer-cameras-and-inference.md | 127 + ...2026-10-03-session-layout-and-road-stop.md | 124 + ...2026-10-03-simulation-architecture-plan.md | 109 + ...2026-10-03-surface-sequence-and-latency.md | 185 + docs/runbooks/AI_POLYGON_WORKER_006.md | 72 +- simulation/ai-polygon/build_bundle.py | 6 + .../ai-polygon/clipseg-research/model.json | 16 + .../ai-polygon/clipseg-research/prepare.py | 49 + .../ai-polygon/clipseg-research/qualify.py | 74 + .../clipseg-research/run_qualification.py | 57 + simulation/ai-polygon/compose.models.yaml | 72 + .../ai-polygon/continuous_composition.py | 186 + simulation/ai-polygon/continuous_pipeline.py | 409 + .../ai-polygon/control_qualification.py | 157 + simulation/ai-polygon/core_client.py | 55 +- simulation/ai-polygon/ddrnet_server.py | 53 +- simulation/ai-polygon/decode_collision.cjs | 71 + simulation/ai-polygon/editor-sources.json | 6 + simulation/ai-polygon/editor_assets.py | 193 + .../ai-polygon/eomt-research/model.json | 10 + .../ai-polygon/eomt-research/qualify.py | 62 + .../eomt-research/run_qualification.py | 60 + simulation/ai-polygon/episode_failure.py | 20 + simulation/ai-polygon/fetch_lod.py | 2 +- simulation/ai-polygon/fetch_sog.py | 2 +- simulation/ai-polygon/gaussian_cache.py | 128 + simulation/ai-polygon/gaussian_usd.py | 65 + simulation/ai-polygon/inference_preview.py | 199 + simulation/ai-polygon/local_state.py | 34 + simulation/ai-polygon/mapillary/model.json | 12 + simulation/ai-polygon/mapillary/prepare.py | 49 + simulation/ai-polygon/mapillary/qualify.py | 70 + .../ai-polygon/mapillary/run_qualification.py | 59 + simulation/ai-polygon/mapillary/server.py | 84 + simulation/ai-polygon/mobility_fixtures.py | 43 + simulation/ai-polygon/model_stack.py | 113 +- simulation/ai-polygon/models.worker-006.json | 43 +- simulation/ai-polygon/motion_control.py | 185 +- simulation/ai-polygon/motion_metrics.py | 37 + simulation/ai-polygon/mounted_sensors.py | 315 + simulation/ai-polygon/nav2/build.py | 108 + simulation/ai-polygon/nav2/build.sh | 37 + .../ai-polygon/nav2/check_ground_screen.py | 82 + .../ai-polygon/nav2/check_http_integration.py | 241 + .../ai-polygon/nav2/check_native_adapter.py | 177 + .../ai-polygon/nav2/check_pcl_ground.py | 62 + .../ai-polygon/nav2/check_ros_integration.py | 232 + .../nav2/check_terrain_integration.py | 110 + simulation/ai-polygon/nav2/configuration.py | 161 + simulation/ai-polygon/nav2/entrypoint.sh | 6 + simulation/ai-polygon/nav2/nodes.py | 47 + .../ai-polygon/nav2/observed_collision.py | 54 + simulation/ai-polygon/nav2/prepare_kernels.py | 80 + .../ai-polygon/nav2/replay_observations.py | 148 + simulation/ai-polygon/nav2/ros_navigation.py | 291 + .../nav2/rover_critics/CMakeLists.txt | 14 + .../ai-polygon/nav2/rover_critics/critics.xml | 5 + .../nav2/rover_critics/forward_tracks.cpp | 40 + .../ai-polygon/nav2/rover_critics/package.xml | 11 + .../ai-polygon/nav2/runtime_entrypoint.sh | 7 + simulation/ai-polygon/nav2/server.py | 324 + simulation/ai-polygon/nav2/source.lock.json | 9 + .../ai-polygon/nav2/terrain_entrypoint.sh | 5 + simulation/ai-polygon/nav2/terrain_node.py | 98 + .../ai-polygon/nav2/terrain_observation.py | 147 + simulation/ai-polygon/nav2/terrain_process.py | 71 + .../navigation/Dockerfile.clearance | 9 + .../Dockerfile.clearance-refinement | 6 + .../navigation/Dockerfile.continuous | 8 + .../navigation/Dockerfile.dense-footprint | 8 + .../navigation/Dockerfile.direction | 9 + .../navigation/Dockerfile.prefix-goal | 7 + .../ai-polygon/navigation/Dockerfile.pursuit | 9 + .../ai-polygon/navigation/Dockerfile.snapshot | 8 + .../ai-polygon/navigation/Dockerfile.support | 8 + .../Prepare-ClearanceNavigation.ps1 | 18 + .../Prepare-ClearanceRefinement.ps1 | 18 + .../navigation/Prepare-Connectivity.ps1 | 4 +- .../Prepare-ContinuousNavigation.ps1 | 18 + .../navigation/Prepare-DenseFootprint.ps1 | 18 + .../navigation/Prepare-Direction.ps1 | 17 + .../Prepare-PrefixGoalNavigation.ps1 | 18 + .../navigation/Prepare-PursuitNavigation.ps1 | 18 + .../navigation/Prepare-SnapshotNavigation.ps1 | 19 + .../navigation/Prepare-SupportNavigation.ps1 | 18 + .../ai-polygon/navigation/arrival_approach.py | 255 + .../ai-polygon/navigation/arrival_search.py | 54 + .../ai-polygon/navigation/build_support.py | 44 + .../ai-polygon/navigation/command_status.py | 23 + .../ai-polygon/navigation/contact_support.py | 106 + .../navigation/continuous_control.py | 223 + .../navigation/detection_obstacles.py | 70 + simulation/ai-polygon/navigation/footprint.py | 631 +- .../navigation/local_velocity_search.py | 87 + .../navigation/missioncore_clearance.hpp | 54 + .../navigation/missioncore_footprint.hpp | 4 + .../navigation/missioncore_prefix.hpp | 18 + .../navigation/missioncore_pursuit.hpp | 14 + .../ai-polygon/navigation/observed_goals.py | 199 + .../ai-polygon/navigation/observed_ground.py | 46 + .../ai-polygon/navigation/observed_space.py | 175 + .../navigation/patch_clearance_preference.py | 35 + .../ai-polygon/navigation/patch_continuous.py | 38 + .../navigation/patch_dense_footprint.py | 51 + .../ai-polygon/navigation/patch_direction.py | 39 + .../navigation/patch_prefix_goal.py | 38 + .../ai-polygon/navigation/patch_pursuit.py | 46 + .../ai-polygon/navigation/patch_snapshot.py | 43 + .../ai-polygon/navigation/pcl_ground.cmake | 10 + .../ai-polygon/navigation/pcl_ground.cpp | 36 + .../ai-polygon/navigation/pcl_ground.py | 48 + .../navigation/qualify_connectivity.py | 53 +- .../navigation/qualify_direction.py | 121 + .../ai-polygon/navigation/qualify_latency.py | 98 + .../ai-polygon/navigation/range_image.py | 100 + .../navigation/route_observation.py | 21 + .../ai-polygon/navigation/semantic_surface.py | 133 + simulation/ai-polygon/navigation/server.py | 779 +- .../ai-polygon/navigation/support_native.cpp | 168 + .../ai-polygon/navigation/support_native.py | 63 + .../navigation/support_obstacles.py | 167 + .../ai-polygon/navigation/support_policy.py | 313 + .../ai-polygon/navigation/support_surface.py | 304 + .../navigation/terrain_connectivity.cpp | 56 + .../ai-polygon/navigation/terrain_costs.py | 71 +- .../ai-polygon/navigation/turn_staging.py | 171 + simulation/ai-polygon/navigation_client.py | 925 +- simulation/ai-polygon/observer_camera.py | 104 + .../oneformer-research/ade20k_panoptic.json | 152 + .../oneformer-research/metadata-source.json | 4 + .../ai-polygon/oneformer-research/model.json | 16 + .../ai-polygon/oneformer-research/prepare.py | 49 + .../ai-polygon/oneformer-research/qualify.py | 69 + .../oneformer-research/run_qualification.py | 57 + simulation/ai-polygon/process_pipeline.py | 187 + simulation/ai-polygon/project_assets.py | 231 + simulation/ai-polygon/qualification_assets.py | 100 + simulation/ai-polygon/qualification_report.py | 198 + .../ai-polygon/qualification_scenarios.py | 167 + simulation/ai-polygon/qualification_scene.py | 68 + simulation/ai-polygon/qualify_city_views.py | 50 + .../ai-polygon/qualify_contact_sweep.py | 104 + .../ai-polygon/qualify_control_matrix.py | 318 + .../ai-polygon/qualify_gaussian_episode.py | 464 + simulation/ai-polygon/qualify_gaussian_usd.py | 55 + simulation/ai-polygon/qualify_mobility.py | 129 + .../ai-polygon/qualify_navigation_replay.py | 153 + .../ai-polygon/qualify_route_contract.py | 114 + .../ai-polygon/qualify_scene_contact.py | 53 +- .../ai-polygon/qualify_support_policy.py | 312 + .../ai-polygon/qualify_surface_sequence.py | 153 + .../ai-polygon/qualify_track_contact.py | 245 + simulation/ai-polygon/qualify_track_hold.py | 238 + .../ai-polygon/qualify_two_side_drive.py | 220 + simulation/ai-polygon/realtime_ai.py | 201 +- simulation/ai-polygon/realtime_worker.py | 265 +- simulation/ai-polygon/rig_collision.py | 72 + .../robots/colliders/dcd006-v020.json | 90627 ++++++++++++++++ simulation/ai-polygon/robots/dcd006-v020.json | 389 + .../ai-polygon/robots/history/README.md | 20 + .../challenge-qualification-20261003.json | 1188 + .../closed-loop-refinement-20261003.json | 530 + .../history/dcd006-v020.2a5b3cdc38f753e2.json | 361 + .../history/dcd006-v020.3842f7e9b7c59ae6.json | 372 + .../history/dcd006-v020.8730aee10f5f0519.json | 382 + .../history/dcd006-v020.974cfdf1d644800a.json | 383 + .../history/dcd006-v020.cfc01c99ad6733f0.json | 383 + .../history/dcd006-v020.d2e6ba840a2bb761.json | 371 + .../gaussian-qualification-20261003.json | 359 + .../robots/history/qualification-index.json | 121 + simulation/ai-polygon/route_view.py | 295 + simulation/ai-polygon/rover_motion.py | 131 + simulation/ai-polygon/rover_profile.py | 130 +- simulation/ai-polygon/rover_visual.py | 110 + .../ai-polygon/run_mobility_qualification.py | 52 + simulation/ai-polygon/run_realtime.py | 1310 +- simulation/ai-polygon/run_report.py | 275 + simulation/ai-polygon/run_scene.py | 4 +- .../ai-polygon/sam3-research/Dockerfile | 9 + .../ai-polygon/sam3-research/large-model.json | 10 + .../ai-polygon/sam3-research/model.json | 9 + .../ai-polygon/sam3-research/prepare.py | 51 + simulation/ai-polygon/sam3-research/probe.py | 13 + .../ai-polygon/sam3-research/qualify.py | 109 + .../ai-polygon/sam3-research/requirements.txt | 10 + .../sam3-research/run_qualification.py | 65 + .../ai-polygon/sam3-research/source.json | 5 + simulation/ai-polygon/sam3/Dockerfile | 10 + simulation/ai-polygon/sam3/build.py | 63 + simulation/ai-polygon/sam3/model.json | 17 + simulation/ai-polygon/sam3/server.py | 106 + simulation/ai-polygon/scene_capacity.py | 39 + simulation/ai-polygon/scheduling_policy.py | 69 + .../segformer/Prepare-Cityscapes.ps1 | 26 + .../ai-polygon/segformer/cityscapes.json | 10 + simulation/ai-polygon/segformer/server.py | 22 +- .../ai-polygon/sidewalk-research/models.json | 38 + .../ai-polygon/sidewalk-research/prepare.py | 53 + .../ai-polygon/sidewalk-research/qualify.py | 90 + .../sidewalk-research/run_qualification.py | 57 + simulation/ai-polygon/spawn_clearance.py | 13 +- simulation/ai-polygon/sweep_qualification.py | 89 + simulation/ai-polygon/terrain.py | 180 +- simulation/ai-polygon/terrain_picker.py | 79 + simulation/ai-polygon/track_dynamics.py | 233 + simulation/ai-polygon/tracked_rover.py | 499 + simulation/ai-polygon/urban_crossing.py | 116 + simulation/ai-polygon/worker.py | 3 +- src/k1link/fleet/differential_drive.py | 114 + src/k1link/observatory/recorded_jobs.py | 2 +- .../simulation/ai_polygon/ai_profiles.py | 58 + .../simulation/ai_polygon/camera_optics.py | 273 + .../simulation/ai_polygon/composition.py | 211 +- .../simulation/ai_polygon/concept_surfaces.py | 33 + src/k1link/simulation/ai_polygon/contracts.py | 279 +- .../simulation/ai_polygon/corridor_control.py | 28 + .../simulation/ai_polygon/detection_range.py | 37 + .../simulation/ai_polygon/driving_profiles.py | 60 + .../simulation/ai_polygon/editor_cache.py | 190 + .../simulation/ai_polygon/evidence_arrays.py | 18 + src/k1link/simulation/ai_polygon/inference.py | 63 +- src/k1link/simulation/ai_polygon/library.py | 39 + .../simulation/ai_polygon/mission_policy.py | 193 +- .../ai_polygon/observed_recovery.py | 231 + src/k1link/simulation/ai_polygon/plans.py | 124 + src/k1link/simulation/ai_polygon/policy.py | 2 +- .../simulation/ai_polygon/project_worlds.py | 119 + src/k1link/simulation/ai_polygon/robots.py | 28 + .../simulation/ai_polygon/route_feedback.py | 139 + .../simulation/ai_polygon/route_graph.py | 277 + .../simulation/ai_polygon/route_mission.py | 547 + .../simulation/ai_polygon/run_inputs.py | 349 + src/k1link/simulation/ai_polygon/run_robot.py | 104 + src/k1link/simulation/ai_polygon/runs.py | 342 +- .../simulation/ai_polygon/sensor_mounts.py | 70 + .../ai_polygon/source_projection.py | 228 + .../simulation/ai_polygon/terrain_contract.py | 6 +- src/k1link/simulation/ai_polygon/worlds.py | 12 +- src/k1link/web/ai_polygon_api.py | 173 +- src/k1link/web/ai_profile_api.py | 49 + tests/test_ai_polygon_body.py | 273 + tests/test_ai_polygon_contact_support.py | 157 + tests/test_ai_polygon_editor_cache.py | 248 + tests/test_ai_polygon_mission.py | 107 +- tests/test_ai_polygon_motion.py | 212 +- tests/test_ai_polygon_navigation.py | 185 +- tests/test_ai_polygon_planning.py | 180 + tests/test_ai_polygon_realtime.py | 107 + tests/test_ai_polygon_reports.py | 122 + tests/test_ai_polygon_run_inputs.py | 258 + tests/test_ai_polygon_spawn.py | 18 + tests/test_ai_polygon_support.py | 117 + tests/test_control_qualification.py | 79 + .../test_gaussian_candidate_qualification.py | 97 + tests/test_rover_motion.py | 51 + tests/test_simulation_library.py | 157 + tests/test_simulation_location_library.py | 89 + tests/test_simulation_observer_profiles.py | 221 + tests/test_sweep_qualification.py | 29 + tests/test_tracked_rover_dynamics.py | 289 + tools/rover-scene/export_motion.py | 280 + tools/rover-scene/export_rover.py | 31 +- tools/rover-scene/materials.py | 30 + tools/rover-scene/source/track_detail.py | 176 + tools/rover-scene/source/track_path.py | 45 + 368 files changed, 129172 insertions(+), 1856 deletions(-) create mode 100644 apps/control-station/public/rover-scene/dcd006-v020-motion.glb create mode 100644 apps/control-station/public/rover-scene/dcd006-v020-motion.json create mode 100644 apps/control-station/simulation-stream.html create mode 100644 apps/control-station/src/components/observation/ObservationDeck.tsx create mode 100644 apps/control-station/src/components/observation/ObservationLayoutSaveWindow.tsx create mode 100644 apps/control-station/src/components/observation/ObservationPanelHeader.tsx create mode 100644 apps/control-station/src/components/observation/observation.css create mode 100644 apps/control-station/src/components/simulation/AiConfiguration.tsx create mode 100644 apps/control-station/src/components/simulation/AiEditorRuntime.ts create mode 100644 apps/control-station/src/components/simulation/AiInferencePreview.tsx create mode 100644 apps/control-station/src/components/simulation/AiLocalPlanner.tsx create mode 100644 apps/control-station/src/components/simulation/AiPlanSaveWindow.tsx create mode 100644 apps/control-station/src/components/simulation/AiProfileWindow.tsx create mode 100644 apps/control-station/src/components/simulation/AiRouteOverlay.tsx create mode 100644 apps/control-station/src/components/simulation/AiRunReport.tsx create mode 100644 apps/control-station/src/components/simulation/AiSessionSection.tsx create mode 100644 apps/control-station/src/components/simulation/AiSpatialPreview.tsx create mode 100644 apps/control-station/src/components/simulation/AiTaskSelect.tsx create mode 100644 apps/control-station/src/components/simulation/EditorCamera.ts create mode 100644 apps/control-station/src/components/simulation/EditorTerrain.ts create mode 100644 apps/control-station/src/components/simulation/LocalManualScene.tsx create mode 100644 apps/control-station/src/components/simulation/PlannerMarkers.ts create mode 100644 apps/control-station/src/components/simulation/PlannerSettings.tsx create mode 100644 apps/control-station/src/components/simulation/RoverSettingsWindow.tsx create mode 100644 apps/control-station/src/components/simulation/RoverTrackMotion.ts create mode 100644 apps/control-station/src/components/simulation/SimulationObservationDeck.tsx create mode 100644 apps/control-station/src/components/simulation/SimulationSourceImport.tsx create mode 100644 apps/control-station/src/components/simulation/SimulationViewTools.tsx create mode 100644 apps/control-station/src/components/simulation/WorkerVideo.tsx create mode 100644 apps/control-station/src/components/simulation/localScene.ts create mode 100644 apps/control-station/src/components/simulation/streamFrame.css create mode 100644 apps/control-station/src/components/simulation/streamFrame.ts create mode 100644 apps/control-station/src/components/simulation/useAiPlanningControls.ts create mode 100644 apps/control-station/src/components/simulation/useLocalScene.ts create mode 100644 apps/control-station/src/components/simulation/useObserverInput.ts create mode 100644 apps/control-station/src/components/simulation/usePlannerPreferences.ts create mode 100644 apps/control-station/src/core/fleet/observationPresets.ts create mode 100644 apps/control-station/src/core/fleet/useObservationPresets.ts create mode 100644 apps/control-station/src/core/simulation/aiEditor.ts create mode 100644 apps/control-station/src/core/simulation/aiEditorCoordinates.ts create mode 100644 apps/control-station/src/core/simulation/aiProfiles.ts create mode 100644 apps/control-station/src/core/simulation/editorNavigation.ts create mode 100644 apps/control-station/src/core/simulation/editorZoom.ts create mode 100644 apps/control-station/src/core/simulation/gaussianQuality.ts create mode 100644 apps/control-station/src/core/simulation/planDraft.ts create mode 100644 apps/control-station/src/core/simulation/plannerPreferences.ts create mode 100644 apps/control-station/src/core/simulation/roverMotion.ts create mode 100644 apps/control-station/src/core/simulation/roverSettings.ts create mode 100644 apps/control-station/src/core/simulation/runConfiguration.ts create mode 100644 apps/control-station/src/core/simulation/streamRecovery.ts create mode 100644 apps/control-station/src/core/simulation/useAiSelection.ts create mode 100644 apps/control-station/src/core/simulation/useRoverSettings.ts create mode 100644 apps/control-station/src/core/simulation/viewedAiRun.ts create mode 100644 apps/control-station/src/core/simulation/waypointDrag.ts create mode 100644 apps/control-station/src/core/simulation/waypointEditing.ts create mode 100644 apps/control-station/src/core/simulation/waypointHit.ts create mode 100644 apps/control-station/test/aiEditorCoordinates.test.mjs create mode 100644 apps/control-station/test/editorInteraction.test.mjs create mode 100644 apps/control-station/test/planDraft.test.mjs create mode 100644 apps/control-station/test/plannerPreferences.test.mjs create mode 100644 apps/control-station/test/roverSettings.test.mjs create mode 100644 apps/control-station/test/simulationMotion.test.mjs create mode 100644 apps/control-station/test/simulationRunConfiguration.test.mjs create mode 100644 docs/AI_POLYGON_ROUTE_PLANNING.md create mode 100644 docs/AI_POLYGON_WORKFLOW.md create mode 100644 docs/SIMULATION_WORKFLOW.md create mode 100644 docs/audits/2026-10-02-local-route-editor.md create mode 100644 docs/audits/2026-10-02-planner-settings-and-launch.md create mode 100644 docs/audits/2026-10-02-route-planner-and-rover.md create mode 100644 docs/audits/2026-10-02-simulation-editor-navigation.md create mode 100644 docs/audits/2026-10-02-simulation-state-review.md create mode 100644 docs/audits/2026-10-02-simulation-task-library.md create mode 100644 docs/audits/2026-10-02-unified-simulation.md create mode 100644 docs/audits/2026-10-02-waypoints-and-rover-motion.md create mode 100644 docs/audits/2026-10-03-dcd006-simulation-and-driving-rules.md create mode 100644 docs/audits/2026-10-03-mission-core-ops-index.json create mode 100644 docs/audits/2026-10-03-observer-cameras-and-inference.md create mode 100644 docs/audits/2026-10-03-session-layout-and-road-stop.md create mode 100644 docs/audits/2026-10-03-simulation-architecture-plan.md create mode 100644 docs/audits/2026-10-03-surface-sequence-and-latency.md create mode 100644 simulation/ai-polygon/clipseg-research/model.json create mode 100644 simulation/ai-polygon/clipseg-research/prepare.py create mode 100644 simulation/ai-polygon/clipseg-research/qualify.py create mode 100644 simulation/ai-polygon/clipseg-research/run_qualification.py create mode 100644 simulation/ai-polygon/continuous_composition.py create mode 100644 simulation/ai-polygon/continuous_pipeline.py create mode 100644 simulation/ai-polygon/control_qualification.py create mode 100644 simulation/ai-polygon/decode_collision.cjs create mode 100644 simulation/ai-polygon/editor-sources.json create mode 100644 simulation/ai-polygon/editor_assets.py create mode 100644 simulation/ai-polygon/eomt-research/model.json create mode 100644 simulation/ai-polygon/eomt-research/qualify.py create mode 100644 simulation/ai-polygon/eomt-research/run_qualification.py create mode 100644 simulation/ai-polygon/episode_failure.py create mode 100644 simulation/ai-polygon/gaussian_cache.py create mode 100644 simulation/ai-polygon/gaussian_usd.py create mode 100644 simulation/ai-polygon/inference_preview.py create mode 100644 simulation/ai-polygon/mapillary/model.json create mode 100644 simulation/ai-polygon/mapillary/prepare.py create mode 100644 simulation/ai-polygon/mapillary/qualify.py create mode 100644 simulation/ai-polygon/mapillary/run_qualification.py create mode 100644 simulation/ai-polygon/mapillary/server.py create mode 100644 simulation/ai-polygon/mobility_fixtures.py create mode 100644 simulation/ai-polygon/motion_metrics.py create mode 100644 simulation/ai-polygon/mounted_sensors.py create mode 100644 simulation/ai-polygon/nav2/build.py create mode 100644 simulation/ai-polygon/nav2/build.sh create mode 100644 simulation/ai-polygon/nav2/check_ground_screen.py create mode 100644 simulation/ai-polygon/nav2/check_http_integration.py create mode 100644 simulation/ai-polygon/nav2/check_native_adapter.py create mode 100644 simulation/ai-polygon/nav2/check_pcl_ground.py create mode 100644 simulation/ai-polygon/nav2/check_ros_integration.py create mode 100644 simulation/ai-polygon/nav2/check_terrain_integration.py create mode 100644 simulation/ai-polygon/nav2/configuration.py create mode 100644 simulation/ai-polygon/nav2/entrypoint.sh create mode 100644 simulation/ai-polygon/nav2/nodes.py create mode 100644 simulation/ai-polygon/nav2/observed_collision.py create mode 100644 simulation/ai-polygon/nav2/prepare_kernels.py create mode 100644 simulation/ai-polygon/nav2/replay_observations.py create mode 100644 simulation/ai-polygon/nav2/ros_navigation.py create mode 100644 simulation/ai-polygon/nav2/rover_critics/CMakeLists.txt create mode 100644 simulation/ai-polygon/nav2/rover_critics/critics.xml create mode 100644 simulation/ai-polygon/nav2/rover_critics/forward_tracks.cpp create mode 100644 simulation/ai-polygon/nav2/rover_critics/package.xml create mode 100644 simulation/ai-polygon/nav2/runtime_entrypoint.sh create mode 100644 simulation/ai-polygon/nav2/server.py create mode 100644 simulation/ai-polygon/nav2/source.lock.json create mode 100644 simulation/ai-polygon/nav2/terrain_entrypoint.sh create mode 100644 simulation/ai-polygon/nav2/terrain_node.py create mode 100644 simulation/ai-polygon/nav2/terrain_observation.py create mode 100644 simulation/ai-polygon/nav2/terrain_process.py create mode 100644 simulation/ai-polygon/navigation/Dockerfile.clearance create mode 100644 simulation/ai-polygon/navigation/Dockerfile.clearance-refinement create mode 100644 simulation/ai-polygon/navigation/Dockerfile.continuous create mode 100644 simulation/ai-polygon/navigation/Dockerfile.dense-footprint create mode 100644 simulation/ai-polygon/navigation/Dockerfile.direction create mode 100644 simulation/ai-polygon/navigation/Dockerfile.prefix-goal create mode 100644 simulation/ai-polygon/navigation/Dockerfile.pursuit create mode 100644 simulation/ai-polygon/navigation/Dockerfile.snapshot create mode 100644 simulation/ai-polygon/navigation/Dockerfile.support create mode 100644 simulation/ai-polygon/navigation/Prepare-ClearanceNavigation.ps1 create mode 100644 simulation/ai-polygon/navigation/Prepare-ClearanceRefinement.ps1 create mode 100644 simulation/ai-polygon/navigation/Prepare-ContinuousNavigation.ps1 create mode 100644 simulation/ai-polygon/navigation/Prepare-DenseFootprint.ps1 create mode 100644 simulation/ai-polygon/navigation/Prepare-Direction.ps1 create mode 100644 simulation/ai-polygon/navigation/Prepare-PrefixGoalNavigation.ps1 create mode 100644 simulation/ai-polygon/navigation/Prepare-PursuitNavigation.ps1 create mode 100644 simulation/ai-polygon/navigation/Prepare-SnapshotNavigation.ps1 create mode 100644 simulation/ai-polygon/navigation/Prepare-SupportNavigation.ps1 create mode 100644 simulation/ai-polygon/navigation/arrival_approach.py create mode 100644 simulation/ai-polygon/navigation/arrival_search.py create mode 100644 simulation/ai-polygon/navigation/build_support.py create mode 100644 simulation/ai-polygon/navigation/command_status.py create mode 100644 simulation/ai-polygon/navigation/contact_support.py create mode 100644 simulation/ai-polygon/navigation/continuous_control.py create mode 100644 simulation/ai-polygon/navigation/detection_obstacles.py create mode 100644 simulation/ai-polygon/navigation/local_velocity_search.py create mode 100644 simulation/ai-polygon/navigation/missioncore_clearance.hpp create mode 100644 simulation/ai-polygon/navigation/missioncore_prefix.hpp create mode 100644 simulation/ai-polygon/navigation/missioncore_pursuit.hpp create mode 100644 simulation/ai-polygon/navigation/observed_goals.py create mode 100644 simulation/ai-polygon/navigation/observed_ground.py create mode 100644 simulation/ai-polygon/navigation/observed_space.py create mode 100644 simulation/ai-polygon/navigation/patch_clearance_preference.py create mode 100644 simulation/ai-polygon/navigation/patch_continuous.py create mode 100644 simulation/ai-polygon/navigation/patch_dense_footprint.py create mode 100644 simulation/ai-polygon/navigation/patch_direction.py create mode 100644 simulation/ai-polygon/navigation/patch_prefix_goal.py create mode 100644 simulation/ai-polygon/navigation/patch_pursuit.py create mode 100644 simulation/ai-polygon/navigation/patch_snapshot.py create mode 100644 simulation/ai-polygon/navigation/pcl_ground.cmake create mode 100644 simulation/ai-polygon/navigation/pcl_ground.cpp create mode 100644 simulation/ai-polygon/navigation/pcl_ground.py create mode 100644 simulation/ai-polygon/navigation/qualify_direction.py create mode 100644 simulation/ai-polygon/navigation/qualify_latency.py create mode 100644 simulation/ai-polygon/navigation/range_image.py create mode 100644 simulation/ai-polygon/navigation/route_observation.py create mode 100644 simulation/ai-polygon/navigation/semantic_surface.py create mode 100644 simulation/ai-polygon/navigation/support_native.cpp create mode 100644 simulation/ai-polygon/navigation/support_native.py create mode 100644 simulation/ai-polygon/navigation/support_obstacles.py create mode 100644 simulation/ai-polygon/navigation/support_policy.py create mode 100644 simulation/ai-polygon/navigation/support_surface.py create mode 100644 simulation/ai-polygon/navigation/turn_staging.py create mode 100644 simulation/ai-polygon/observer_camera.py create mode 100644 simulation/ai-polygon/oneformer-research/ade20k_panoptic.json create mode 100644 simulation/ai-polygon/oneformer-research/metadata-source.json create mode 100644 simulation/ai-polygon/oneformer-research/model.json create mode 100644 simulation/ai-polygon/oneformer-research/prepare.py create mode 100644 simulation/ai-polygon/oneformer-research/qualify.py create mode 100644 simulation/ai-polygon/oneformer-research/run_qualification.py create mode 100644 simulation/ai-polygon/process_pipeline.py create mode 100644 simulation/ai-polygon/project_assets.py create mode 100644 simulation/ai-polygon/qualification_assets.py create mode 100644 simulation/ai-polygon/qualification_report.py create mode 100644 simulation/ai-polygon/qualification_scenarios.py create mode 100644 simulation/ai-polygon/qualification_scene.py create mode 100644 simulation/ai-polygon/qualify_city_views.py create mode 100644 simulation/ai-polygon/qualify_contact_sweep.py create mode 100644 simulation/ai-polygon/qualify_control_matrix.py create mode 100644 simulation/ai-polygon/qualify_gaussian_episode.py create mode 100644 simulation/ai-polygon/qualify_gaussian_usd.py create mode 100644 simulation/ai-polygon/qualify_mobility.py create mode 100644 simulation/ai-polygon/qualify_navigation_replay.py create mode 100644 simulation/ai-polygon/qualify_route_contract.py create mode 100644 simulation/ai-polygon/qualify_support_policy.py create mode 100644 simulation/ai-polygon/qualify_surface_sequence.py create mode 100644 simulation/ai-polygon/qualify_track_contact.py create mode 100644 simulation/ai-polygon/qualify_track_hold.py create mode 100644 simulation/ai-polygon/qualify_two_side_drive.py create mode 100644 simulation/ai-polygon/rig_collision.py create mode 100644 simulation/ai-polygon/robots/colliders/dcd006-v020.json create mode 100644 simulation/ai-polygon/robots/dcd006-v020.json create mode 100644 simulation/ai-polygon/robots/history/README.md create mode 100644 simulation/ai-polygon/robots/history/challenge-qualification-20261003.json create mode 100644 simulation/ai-polygon/robots/history/closed-loop-refinement-20261003.json create mode 100644 simulation/ai-polygon/robots/history/dcd006-v020.2a5b3cdc38f753e2.json create mode 100644 simulation/ai-polygon/robots/history/dcd006-v020.3842f7e9b7c59ae6.json create mode 100644 simulation/ai-polygon/robots/history/dcd006-v020.8730aee10f5f0519.json create mode 100644 simulation/ai-polygon/robots/history/dcd006-v020.974cfdf1d644800a.json create mode 100644 simulation/ai-polygon/robots/history/dcd006-v020.cfc01c99ad6733f0.json create mode 100644 simulation/ai-polygon/robots/history/dcd006-v020.d2e6ba840a2bb761.json create mode 100644 simulation/ai-polygon/robots/history/gaussian-qualification-20261003.json create mode 100644 simulation/ai-polygon/robots/history/qualification-index.json create mode 100644 simulation/ai-polygon/route_view.py create mode 100644 simulation/ai-polygon/rover_motion.py create mode 100644 simulation/ai-polygon/rover_visual.py create mode 100644 simulation/ai-polygon/run_mobility_qualification.py create mode 100644 simulation/ai-polygon/run_report.py create mode 100644 simulation/ai-polygon/sam3-research/Dockerfile create mode 100644 simulation/ai-polygon/sam3-research/large-model.json create mode 100644 simulation/ai-polygon/sam3-research/model.json create mode 100644 simulation/ai-polygon/sam3-research/prepare.py create mode 100644 simulation/ai-polygon/sam3-research/probe.py create mode 100644 simulation/ai-polygon/sam3-research/qualify.py create mode 100644 simulation/ai-polygon/sam3-research/requirements.txt create mode 100644 simulation/ai-polygon/sam3-research/run_qualification.py create mode 100644 simulation/ai-polygon/sam3-research/source.json create mode 100644 simulation/ai-polygon/sam3/Dockerfile create mode 100644 simulation/ai-polygon/sam3/build.py create mode 100644 simulation/ai-polygon/sam3/model.json create mode 100644 simulation/ai-polygon/sam3/server.py create mode 100644 simulation/ai-polygon/scene_capacity.py create mode 100644 simulation/ai-polygon/scheduling_policy.py create mode 100644 simulation/ai-polygon/segformer/Prepare-Cityscapes.ps1 create mode 100644 simulation/ai-polygon/segformer/cityscapes.json create mode 100644 simulation/ai-polygon/sidewalk-research/models.json create mode 100644 simulation/ai-polygon/sidewalk-research/prepare.py create mode 100644 simulation/ai-polygon/sidewalk-research/qualify.py create mode 100644 simulation/ai-polygon/sidewalk-research/run_qualification.py create mode 100644 simulation/ai-polygon/sweep_qualification.py create mode 100644 simulation/ai-polygon/terrain_picker.py create mode 100644 simulation/ai-polygon/track_dynamics.py create mode 100644 simulation/ai-polygon/tracked_rover.py create mode 100644 simulation/ai-polygon/urban_crossing.py create mode 100644 src/k1link/fleet/differential_drive.py create mode 100644 src/k1link/simulation/ai_polygon/ai_profiles.py create mode 100644 src/k1link/simulation/ai_polygon/camera_optics.py create mode 100644 src/k1link/simulation/ai_polygon/concept_surfaces.py create mode 100644 src/k1link/simulation/ai_polygon/corridor_control.py create mode 100644 src/k1link/simulation/ai_polygon/detection_range.py create mode 100644 src/k1link/simulation/ai_polygon/driving_profiles.py create mode 100644 src/k1link/simulation/ai_polygon/editor_cache.py create mode 100644 src/k1link/simulation/ai_polygon/evidence_arrays.py create mode 100644 src/k1link/simulation/ai_polygon/library.py create mode 100644 src/k1link/simulation/ai_polygon/observed_recovery.py create mode 100644 src/k1link/simulation/ai_polygon/plans.py create mode 100644 src/k1link/simulation/ai_polygon/project_worlds.py create mode 100644 src/k1link/simulation/ai_polygon/robots.py create mode 100644 src/k1link/simulation/ai_polygon/route_feedback.py create mode 100644 src/k1link/simulation/ai_polygon/route_graph.py create mode 100644 src/k1link/simulation/ai_polygon/route_mission.py create mode 100644 src/k1link/simulation/ai_polygon/run_inputs.py create mode 100644 src/k1link/simulation/ai_polygon/run_robot.py create mode 100644 src/k1link/simulation/ai_polygon/sensor_mounts.py create mode 100644 src/k1link/simulation/ai_polygon/source_projection.py create mode 100644 src/k1link/web/ai_profile_api.py create mode 100644 tests/test_ai_polygon_body.py create mode 100644 tests/test_ai_polygon_contact_support.py create mode 100644 tests/test_ai_polygon_editor_cache.py create mode 100644 tests/test_ai_polygon_planning.py create mode 100644 tests/test_ai_polygon_reports.py create mode 100644 tests/test_ai_polygon_run_inputs.py create mode 100644 tests/test_ai_polygon_support.py create mode 100644 tests/test_control_qualification.py create mode 100644 tests/test_gaussian_candidate_qualification.py create mode 100644 tests/test_rover_motion.py create mode 100644 tests/test_simulation_library.py create mode 100644 tests/test_simulation_location_library.py create mode 100644 tests/test_simulation_observer_profiles.py create mode 100644 tests/test_sweep_qualification.py create mode 100644 tests/test_tracked_rover_dynamics.py create mode 100644 tools/rover-scene/export_motion.py create mode 100644 tools/rover-scene/materials.py create mode 100644 tools/rover-scene/source/track_detail.py create mode 100644 tools/rover-scene/source/track_path.py diff --git a/README.md b/README.md index 636b5a11..d4240f4e 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,12 @@ See [the Dataset Gateway plan](docs/14_LIDAR_DATASET_GATEWAY.md), ## Simulation Polygon +Current AI Polygon purpose, architecture, measured status and experiment plan: +[AI Polygon workflow](docs/AI_POLYGON_WORKFLOW.md), reconciled 2026-10-02. +It uses Isaac and shared AI modules entirely on Worker006, with operator video +on the Mac. The Gazebo/PX4 S0/S1 account below is a historical profile with its +own evidence; it must not be read as the current AI Polygon implementation. + Mission Core now has a parallel Polygon product branch for reproducible autonomy qualification. Mission Core owns scenarios, qualification-run lifecycle, authority, canonical contracts, provenance and reports; Gazebo, PX4 diff --git a/apps/control-station/package-lock.json b/apps/control-station/package-lock.json index 454cfc4f..eac33007 100644 --- a/apps/control-station/package-lock.json +++ b/apps/control-station/package-lock.json @@ -21,7 +21,8 @@ "playcanvas": "2.21.4", "react": "^19.1.0", "react-dom": "^19.1.0", - "three": "0.185.1" + "three": "0.185.1", + "three-mesh-bvh": "0.9.15" }, "devDependencies": { "@types/node": "^24.0.0", @@ -1893,6 +1894,15 @@ "integrity": "sha512-5aojFCXKwnjBRZvUnt3WFfEcvUJgkN5LlijRFN95hMy8WVkG4I0QNcJE+OuWvuJ0bOdStrbfXn0pkd6/QyiAlg==", "license": "MIT" }, + "node_modules/three-mesh-bvh": { + "version": "0.9.15", + "resolved": "https://registry.npmjs.org/three-mesh-bvh/-/three-mesh-bvh-0.9.15.tgz", + "integrity": "sha512-9xdEDkCzFoT8VPFH9DznwFSdbaIEjMvM106Iqq7TJurrIheUKDcdW4prfJTCxryih4XS/UxWs0H3K4MLMRFyOQ==", + "license": "MIT", + "peerDependencies": { + "three": ">= 0.159.0" + } + }, "node_modules/tinyglobby": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", diff --git a/apps/control-station/package.json b/apps/control-station/package.json index 233a0f67..e4963858 100644 --- a/apps/control-station/package.json +++ b/apps/control-station/package.json @@ -25,7 +25,8 @@ "playcanvas": "2.21.4", "react": "^19.1.0", "react-dom": "^19.1.0", - "three": "0.185.1" + "three": "0.185.1", + "three-mesh-bvh": "0.9.15" }, "devDependencies": { "@types/node": "^24.0.0", diff --git a/apps/control-station/public/rover-scene/dcd006-v020-motion.glb b/apps/control-station/public/rover-scene/dcd006-v020-motion.glb new file mode 100644 index 00000000..08ceb003 --- /dev/null +++ b/apps/control-station/public/rover-scene/dcd006-v020-motion.glb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a3892f019b29a40b95ca302e3411053d9532da21e571ff190aeda76bf83836e +size 53447724 diff --git a/apps/control-station/public/rover-scene/dcd006-v020-motion.json b/apps/control-station/public/rover-scene/dcd006-v020-motion.json new file mode 100644 index 00000000..2a95ada9 --- /dev/null +++ b/apps/control-station/public/rover-scene/dcd006-v020-motion.json @@ -0,0 +1,174 @@ +{ + "schema_version": "missioncore.rover-motion/v1", + "source_scene": "DCD-006_rover_v020.blend", + "source_sha256": "c49a0470974bbe65b4e65b4b5c06cb887730715a1ddfa231b86426fed6de8f79", + "source_saved": false, + "visual_sha256": "4a3892f019b29a40b95ca302e3411053d9532da21e571ff190aeda76bf83836e", + "forward_axis": "+X", + "up_axis": "Y", + "track_centres_m": { + "L": 0.3425, + "R": -0.3425 + }, + "track_width_m": 0.685, + "shift_m": [ + -0.05350000038743019, + 0.0, + 0.0 + ], + "length_m": 2.222, + "pitch_m": 0.0505, + "phase_m": 0.03069696662739778, + "segments": [ + [ + "arc", + 0, + 0.060539054924808725, + [ + -0.16593354688111153, + 0.32184557191629776, + 0.0655, + 2.3390854961098873 + ] + ], + [ + "line", + 0.060539054924808725, + 0.5760464371429339, + [ + -0.15575880346026824, + 0.3865504758751169, + 0.9878611291422765, + -0.1553395942113481, + 0.15533959421134813, + 0.9878611291422766 + ] + ], + [ + "arc", + 0.6365854920677426, + 0.15172294911931034, + [ + 0.40182697, + 0.22413776, + 0.07382606110411796, + 1.4148251155784564 + ] + ], + [ + "line", + 0.7883084411870529, + 0.1629407568053742, + [ + 0.46102862009488454, + 0.18003048254840684, + -0.5974486081464921, + -0.8019072020027126, + 0.8019072020027126, + -0.5974486081464921 + ] + ], + [ + "arc", + 0.9512491979924271, + 0.06094648310379254, + [ + 0.31115497, + 0.0885, + 0.0655, + -0.6403156687217281 + ] + ], + [ + "line", + 1.0121956810962196, + 0.7185584980197575, + [ + 0.31115497, + 0.022999999999999993, + -1.0, + 0.0, + -0.0, + -1.0 + ] + ], + [ + "arc", + 1.730754179115977, + 0.15545137821999958, + [ + -0.40740352801975754, + 0.0885, + 0.0655, + -1.5707963267948966 + ] + ], + [ + "line", + 1.8862055573359766, + 0.33579444266402353, + [ + -0.45291987081346463, + 0.1356010885085021, + 0.719100587916063, + 0.6949059968504895, + -0.6949059968504895, + 0.719100587916063 + ] + ] + ], + "link_count": 44, + "wheels": [ + { + "node": "R_SPIN_rear_lower", + "radius_m": 0.0625 + }, + { + "node": "R_SPIN_middle_lower", + "radius_m": 0.0625 + }, + { + "node": "R_SPIN_rear_upper", + "radius_m": 0.0625 + }, + { + "node": "R_SPIN_front_lower", + "radius_m": 0.0625 + }, + { + "node": "R_SPIN_DRIVE", + "radius_m": 0.07233592163526643 + }, + { + "node": "L_SPIN_rear_lower", + "radius_m": 0.0625 + }, + { + "node": "L_SPIN_middle_lower", + "radius_m": 0.0625 + }, + { + "node": "L_SPIN_rear_upper", + "radius_m": 0.0625 + }, + { + "node": "L_SPIN_front_lower", + "radius_m": 0.0625 + }, + { + "node": "L_SPIN_DRIVE", + "radius_m": 0.07233592163526643 + } + ], + "dimensions_m": [ + 1.1630001068115234, + 0.9049999713897705, + 0.7378441095352173 + ], + "minimum_m": [ + -0.5814999938011169, + -0.45249998569488525, + -0.003844098187983036 + ], + "method": "44 rigid visual pitches per belt; rolling assemblies retain original CAD pivots; no track contact dynamics" +} diff --git a/apps/control-station/simulation-stream.html b/apps/control-station/simulation-stream.html new file mode 100644 index 00000000..33652857 --- /dev/null +++ b/apps/control-station/simulation-stream.html @@ -0,0 +1,4 @@ + +Worker video + + diff --git a/apps/control-station/src/components/laboratory/LaboratoryMetricEvidenceScene.tsx b/apps/control-station/src/components/laboratory/LaboratoryMetricEvidenceScene.tsx index a4bb6bd1..cd9eb57c 100644 --- a/apps/control-station/src/components/laboratory/LaboratoryMetricEvidenceScene.tsx +++ b/apps/control-station/src/components/laboratory/LaboratoryMetricEvidenceScene.tsx @@ -265,6 +265,8 @@ LaboratoryMetricEvidenceSceneHandle, showCurrentIncrement: boolean; showLocalSurface: boolean; showRollingMap: boolean; + showReferenceGeometry?: boolean; + showRenderStats?: boolean; showLowStep?: boolean; pointSemanticClassIds?: readonly (number | null)[]; semanticClasses?: readonly RecordedEvidenceSemanticClass[]; @@ -287,6 +289,8 @@ LaboratoryMetricEvidenceSceneHandle, showLocalSurface, showRollingMap, showLowStep = true, + showReferenceGeometry = true, + showRenderStats = true, pointSemanticClassIds, semanticClasses, semanticPalette, @@ -746,6 +750,7 @@ LaboratoryMetricEvidenceSceneHandle, if (!host || !content) return; clearGroup(content); + if (!showReferenceGeometry) { requestRenderRef.current(); return; } const corridorLength = rig.lengthM / 2 + corridor.forwardLengthM + corridor.rearMarginM; const corridorCenterX = (rig.lengthM / 2 + corridor.forwardLengthM - corridor.rearMarginM) / 2; const corridorMesh = new THREE.Mesh( @@ -806,6 +811,7 @@ LaboratoryMetricEvidenceSceneHandle, content.add(grid); requestRenderRef.current(); }, [ + showReferenceGeometry, corridor.forwardLengthM, corridor.halfWidthM, corridor.rearMarginM, @@ -912,7 +918,7 @@ LaboratoryMetricEvidenceSceneHandle, {renderError ?

{renderError}

: null}
- {renderStats ? ( + {showRenderStats && renderStats ? ( (null); + useLayoutEffect(()=>{const host=ref.current!;host.append(element);return()=>{if(element.parentElement===host)element.remove();};},[element]); + return
; +} +export function ObservationDeck({ids,mounts,layout,onTreeChange,labels,focusedId,children}:{ + ids:string[];mounts:Map;layout:ObservationLayout;onTreeChange:(tree:DockTree)=>void; + labels:Record;focusedId?:string|null;children:ReactNode; +}){ + return ({id,label:labels[id]??id}))} + renderPanel={id=>}>{children}; +} diff --git a/apps/control-station/src/components/observation/ObservationLayoutSaveWindow.tsx b/apps/control-station/src/components/observation/ObservationLayoutSaveWindow.tsx new file mode 100644 index 00000000..a6a7a20b --- /dev/null +++ b/apps/control-station/src/components/observation/ObservationLayoutSaveWindow.tsx @@ -0,0 +1,16 @@ +import {useState} from 'react'; +import {Button,Icon,TextField,Window,WindowFooterActions} from '@nodedc/ui-react'; + +export function ObservationLayoutSaveWindow({onClose,onSave,initialName='',onRemove}:{onClose:()=>void;onSave:(name:string)=>boolean;initialName?:string;onRemove?:()=>boolean}) { + const [name,setName]=useState(initialName); + const save=()=>{if(name.trim()&&onSave(name))onClose();}; + return + {onRemove&&} + + }> + setName(event.target.value)} + onKeyDown={event=>{if(event.key==='Enter'&&!event.nativeEvent.isComposing){event.preventDefault();save();}}} + description={onRemove?undefined:'Сохраняются выбранные камеры, слои и расположение окон. Недоступные устройства появятся при подключении.'}/> + ; +} diff --git a/apps/control-station/src/components/observation/ObservationPanelHeader.tsx b/apps/control-station/src/components/observation/ObservationPanelHeader.tsx new file mode 100644 index 00000000..356dd74d --- /dev/null +++ b/apps/control-station/src/components/observation/ObservationPanelHeader.tsx @@ -0,0 +1,13 @@ +import {useLayoutEffect,useRef,type ReactNode} from 'react'; + +/** Reserve the actual overlay height for text/status content, including wrapped controls. */ +export function ObservationPanelHeader({children}:{children:ReactNode}) { + const ref=useRef(null); + useLayoutEffect(()=>{ + const header=ref.current!; + const measure=()=>header.parentElement?.style.setProperty('--observation-overlay-header-space',`${header.getBoundingClientRect().height}px`); + measure();const observer=new ResizeObserver(measure);observer.observe(header); + return()=>observer.disconnect(); + },[]); + return
{children}
; +} diff --git a/apps/control-station/src/components/observation/observation.css b/apps/control-station/src/components/observation/observation.css new file mode 100644 index 00000000..98ebb763 --- /dev/null +++ b/apps/control-station/src/components/observation/observation.css @@ -0,0 +1,54 @@ +.observation-center { display:flex; flex-direction:column; gap:var(--nodedc-space-3); padding:var(--nodedc-space-4); min-width:0; height:max(600px, calc(100dvh - 260px)); } +.observation-center--expanded { position:fixed; inset:0; z-index:var(--nodedc-layer-overlay); background:var(--nodedc-canvas); height:100dvh; box-sizing:border-box; } +.observation-toolbar, .observation-summary, .observation-actions { display:flex; align-items:center; gap:var(--nodedc-space-2); } +.observation-toolbar { justify-content:space-between; flex-wrap:wrap; } +.observation-toolbar h2, .observation-panel h3 { margin:0; } +.observation-toolbar span { color:var(--nodedc-text-muted); font-size:var(--nodedc-font-size-sm); } +.observation-actions { flex-shrink:0; } +.observation-deck { flex:1; min-height:0; min-width:0; } +.observation-layout { position:relative; height:100%; min-height:0; min-width:0; } +.observation-layout__slot { height:100%; min-height:0; } +.observation-layout__panel { position:absolute; min-height:0; min-width:0; } +.observation-layout__panel:has(.is-dragging) { z-index:var(--nodedc-layer-panel); } +.observation-mount, .observation-panel-mount, .observation-media-mount, .observation-panel, .observation-split { height:100%; min-height:0; min-width:0; } +.observation-panel__surface { display:flex; flex-direction:column; height:100%; overflow:hidden; container-type:inline-size; } +.observation-panel__surface > .observation-mount { flex:1; } +.observation-panel__surface--overlay { position:relative; --observation-overlay-header-space:62px; } +.observation-panel__surface--overlay > .observation-panel__header { position:absolute; inset:0 0 auto; z-index:1; background:transparent; pointer-events:none; } +.observation-panel__surface--overlay > .observation-panel__header > * { pointer-events:auto; } +.observation-panel__header { display:flex; align-items:center; gap:var(--nodedc-space-2); padding:var(--nodedc-space-2); flex-shrink:0; } +.observation-panel__header h3 { min-width:0; font-size:var(--nodedc-font-size-sm); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } +.observation-source { position:relative; display:flex; flex-direction:column; height:100%; min-height:0; } +.observation-panel__title { display:flex; align-items:center; gap:var(--nodedc-space-2); flex:1; min-width:0; } +.observation-header-slot, .observation-header-slot > div { display:flex; align-items:center; gap:var(--nodedc-space-2); flex-shrink:0; } +.observation-header-slot:has(> div:empty) { display:none; } +.observation-layer-select { min-width:0; max-width:120px; } +.observation-layer-select button { max-width:100%; } +.observation-layer-select button > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } +.observation-source__media { position:relative; flex:1; min-height:0; overflow:hidden; display:flex; align-items:center; justify-content:center; } +.observation-source__media video, .observation-source__media canvas { width:100%; height:100%; object-fit:contain; } +.observation-source__media[data-live="false"] > *, .observation-source__media [data-live="false"] { visibility:hidden; } +.observation-source__notice { position:absolute; inset:max(30%, calc(var(--observation-overlay-header-space, 0px) + var(--nodedc-space-3))) var(--nodedc-space-4) auto; text-align:center; color:var(--nodedc-text-secondary); font-size:calc(var(--nodedc-font-size-lg) * .7); } +.observation-rerun, .observation-rerun > div, .observation-map > div { width:100%; height:100%; } +.observation-settings { display:flex; flex-direction:column; gap:var(--nodedc-space-4); } +.observation-layer { display:grid; grid-template-columns:minmax(0, 1fr) 50%; align-items:center; gap:var(--nodedc-space-3); } +.observation-layer > * { min-width:0; width:100%; } +.observation-layer > .nodedc-switch { text-align:left; } +.observation-empty { display:grid; place-content:center; height:100%; text-align:center; } +.observation-decoder { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; } +@media(max-width:700px) { .observation-toolbar .observation-actions { flex-wrap:wrap; } .observation-center { height:max(650px, calc(100dvh - 200px)); } .observation-center--expanded { height:100dvh; } } + +.observation-map[data-available="false"] > [data-nodedc-map-renderer] { visibility:hidden; } + +/* Transform the live panel as one item; reveal it across nested split boundaries. */ +.observation-panel-drag { position:relative; height:100%; min-height:0; } +.observation-panel-drag.is-dragging { z-index:var(--nodedc-layer-panel); } +.observation-split:has(.observation-panel-drag.is-dragging), +.observation-split > .nodedc-split-pane__panel:has(.observation-panel-drag.is-dragging) { position:relative; overflow:visible; z-index:var(--nodedc-layer-panel); } +@container (max-width:340px) { + .observation-panel__header { flex-wrap:wrap; } + .observation-panel__title { min-width:80px; } + .observation-panel__header > .observation-actions { max-width:100%; flex-wrap:wrap; justify-content:flex-end; margin-left:auto; } +} + +.observation-panel__surface--overlay .rover-telemetry { padding-top:calc(var(--observation-overlay-header-space) + var(--nodedc-space-3)); } diff --git a/apps/control-station/src/components/simulation/AiCompositionFields.tsx b/apps/control-station/src/components/simulation/AiCompositionFields.tsx index bd8e9fc1..14fe20d3 100644 --- a/apps/control-station/src/components/simulation/AiCompositionFields.tsx +++ b/apps/control-station/src/components/simulation/AiCompositionFields.tsx @@ -1,4 +1,4 @@ -import { FieldFrame, Select } from "@nodedc/ui-react"; +import { InspectorSelectField } from "@nodedc/ui-react"; import type { AiModules, AiSelection } from "../../core/simulation/aiPolygon"; const labels = { segmentation: "Поверхность", detection: "Объекты", geometry: "Рельеф", @@ -8,10 +8,13 @@ export function AiCompositionFields({ modules, selection, disabled, onChange }: modules: AiModules; selection: AiSelection; disabled: boolean; onChange: (value: AiSelection) => void; }) { return
-

Модули AI

+ {selection.selections.some(s=>s.module_id==="simulation-waypoint-mission")?<> + s.module_id==="simulation-waypoint-mission")?.parameters.environment??"park")} + options={[{value:"natural",label:"Природа · пересечённая местность"},{value:"park",label:"Парк · дорожки"},{value:"urban",label:"Город · тротуары"}]} + onChange={environment=>onChange({...selection,selections:selection.selections.map(s=>s.module_id==="simulation-waypoint-mission"?{...s,parameters:{...s.parameters,environment}}:s)})}/> + :null} {modules.catalog.groups.filter(({ modules: options }) => options.length > 0).map(({ group, modules: options }) => - - + {section === "pivot" ? <> + {range("pivot","pixels","Размер осей",50,220,5,"px")} + {range("pivot","diameter","Диаметр стержня",2,16,1,"px")} + {range("pivot","cone","Размер конусов",10,40,1,"px")} + {range("pivot","opacity","Непрозрачность",.15,1,.05,"")} + {(["x","y","z"] as const).map((axis)=>set("pivot",axis,v)}/>)} + : section === "waypoint" ? <> + {range("waypoint","diameter","Диаметр",.05,3,.05,"м")} + {range("waypoint","height","Высота",.2,50,.1,"м")} + set("waypoint","color",v)}/> + {range("waypoint","opacity","Непрозрачность",.1,1,.05,"")} + {range("waypoint","frequency","Пульсация",0,3,.1,"Гц")} + Свечение + {range("waypoint","emission","Сила эмиссии",0,5,.1,"")} + set("waypoint","emissionColor",v)}/> + : <> + Сдвиг камеры +

Расстояние до поверхности под курсором. Чувствительность плавно меняется между двумя границами.

+ {range("navigation","nearDistance","Ближнее расстояние",.5,50,.5,"м")} + {range("navigation","nearPan","Чувствительность вблизи",.1,5,.1,"×")} + {range("navigation","farDistance","Дальнее расстояние",Math.max(2,value.navigation.nearDistance+1),500,1,"м")} + {range("navigation","farPan","Чувствительность вдали",.1,5,.1,"×")} + Зум + {range("navigation","zoom","Скорость зума",.1,3,.1,"×")} + Центр вращения +

Шарик появляется в точке нажатия на время вращения.

+ {range("navigation","centroidPixels","Размер центра на экране",6,64,1,"px")} + set("navigation","centroidColor",v)}/> + {range("navigation","centroidOpacity","Непрозрачность центра",.1,1,.05,"")} + } + {error?setError(null)}/>:null} +
+ ; +} diff --git a/apps/control-station/src/components/simulation/PlayCanvasRuntime.ts b/apps/control-station/src/components/simulation/PlayCanvasRuntime.ts index 52f1bb3b..d9e68e46 100644 --- a/apps/control-station/src/components/simulation/PlayCanvasRuntime.ts +++ b/apps/control-station/src/components/simulation/PlayCanvasRuntime.ts @@ -1,3 +1,4 @@ +import { QUALITY_PROFILES } from "../../core/simulation/gaussianQuality"; import { Application, Asset, @@ -18,6 +19,7 @@ import { type ModelComponent, type ScriptType, } from "playcanvas"; +import type { AiRobot } from "../../core/simulation/aiPolygon"; import { CameraControls } from "playcanvas/scripts/esm/camera-controls.mjs"; import { @@ -76,24 +78,10 @@ const HOME_POSITION = new Vec3(0, 1, 0); const HOME_FOCUS = new Vec3(1, 1, 0); const DRACO_DECODER_ROOT = "/vendor/playcanvas/draco/1.5.7"; -const QUALITY_PROFILES: Record = { - low: { lodBaseDistance: 5, lodMultiplier: 2, lodRangeMin: 3, lodRangeMax: 5, pixelRatio: 0.75, splatBudget: 350_000, targetFps: 30 }, - medium: { lodBaseDistance: 5, lodMultiplier: 2, lodRangeMin: 2, lodRangeMax: 5, pixelRatio: 1, splatBudget: 700_000, targetFps: 45 }, - high: { lodBaseDistance: 5, lodMultiplier: 3, lodRangeMin: 1, lodRangeMax: 5, pixelRatio: 1.25, splatBudget: 1_200_000, targetFps: 60 }, - ultra: { lodBaseDistance: 7, lodMultiplier: 3, lodRangeMin: 0, lodRangeMax: 5, pixelRatio: 1.5, splatBudget: 2_500_000, targetFps: 60 }, - maximum: { lodBaseDistance: 7, lodMultiplier: 3, lodRangeMin: 0, lodRangeMax: 5, pixelRatio: 2, splatBudget: 4_000_000, targetFps: 60 }, -}; export class PlayCanvasRuntime implements SimulationRuntime { private app: Application | null = null; + private robotAsset: Asset | null = null; private canvas: HTMLCanvasElement | null = null; private camera: Entity | null = null; private cameraController: CameraController | null = null; @@ -155,7 +143,7 @@ export class PlayCanvasRuntime implements SimulationRuntime { antialias: true, alpha: false, preserveDrawingBuffer: false, - powerPreference: "high-performance", + powerPreference: "default", }, }); this.app = app; @@ -306,6 +294,27 @@ export class PlayCanvasRuntime implements SimulationRuntime { } } + async setRobot(robot: AiRobot, ground: number[], headingDegrees: number, maxSpeedMps = .5): Promise { + const app = this.requiredApp(); + const publicRoot = "apps/control-station/public/"; + if (!robot.visual.source.startsWith(publicRoot)) throw new Error("Модель ровера недоступна."); + const asset = new Asset(robot.name,"container",{ url: "/"+robot.visual.source.slice(publicRoot.length) }); + this.robotAsset = asset; app.assets.add(asset); + await new Promise((resolve,reject) => { + asset.ready(()=>resolve()); asset.once("error",()=>reject(new Error("Модель ровера не загрузилась."))); + app.assets.load(asset); + }); + if (this.disposed) { asset.unload(); return; } + const resource = asset.resource as ContainerResource; + this.setUgvPreset({ presetName: robot.name, massKg: robot.physics.mass_kg, + dimensionsMeters: { length:robot.physics.length_m, width:robot.physics.width_m, + height:robot.physics.height_m, groundClearance: .15 }, + maxSpeedMetersPerSecond: maxSpeedMps, maxTurnRateDegrees: 45, invertSteering: false }); + this.ugvController!.setRobot(()=>resource.instantiateRenderEntity(),new Vec3(...ground),headingDegrees,robot.visual.motion); + } + + get speed(): number { return this.ugvController?.speed ?? 0; } + setQuality(quality: SimulationQuality): void { this.quality = quality; this.applyQuality(); @@ -380,6 +389,7 @@ export class PlayCanvasRuntime implements SimulationRuntime { this.unloadWorld(); this.ugvController?.dispose(); this.ugvController = null; + this.robotAsset?.unload(); this.robotAsset = null; if (this.app) { this.app.autoRender = false; this.app.renderNextFrame = false; diff --git a/apps/control-station/src/components/simulation/RoverSettingsWindow.tsx b/apps/control-station/src/components/simulation/RoverSettingsWindow.tsx new file mode 100644 index 00000000..67e23a2e --- /dev/null +++ b/apps/control-station/src/components/simulation/RoverSettingsWindow.tsx @@ -0,0 +1,33 @@ +import { useState } from "react"; +import { Button, TextField, Window, WindowFooterActions } from "@nodedc/ui-react"; +import type { AiRobot } from "../../core/simulation/aiPolygon"; +import { defaultRoverSettings, validRoverSettings, type RoverSettings } from "../../core/simulation/roverSettings"; + +export function RoverSettingsWindow({robot,value,manual,onApply,onClose}:{ + robot:AiRobot; value:RoverSettings; manual:boolean; + onApply:(value:RoverSettings)=>void; onClose:()=>void; +}) { + const [draft,setDraft] = useState(value); + const field = (key:Exclude, label:string, min:number, max:number|undefined, step:number) => + setDraft({...draft,[key]:e.target.value===""?NaN:Number(e.target.value)})}/>; + const valid=validRoverSettings(draft,robot); + return + + + }> +
+ {field("max_speed_mps","Скорость до, м/с",.05,undefined,.01)} + {field("base_mass_kg","Масса ровера без груза, кг",10,1000,1)} + {field("payload_mass_kg","Дополнительный груз, кг",0,500,1)} + {field("payload_height_m","Высота центра груза над грунтом, м",.1,3,.01)} +

Общая масса: {Number.isFinite(draft.base_mass_kg+draft.payload_mass_kg)?draft.base_mass_kg+draft.payload_mass_kg:"—"} кг.

+

Груз расположен по центру ровера. Масса и высота влияют на центр тяжести и инерцию; мощность моторов остаётся прежней.

+ {manual?

В ручном режиме учитываются скорость и общая масса. Высота груза применяется в заезде на Worker.

:null} +

Изменения применяются к следующему заезду. Его результат сохраняет использованные настройки.

+ {!valid?

Допустимо: конечная скорость от 0.05 м/с, масса 10–1000 кг, груз 0–500 кг, высота 0.1–3 м.

:null} +
+
; +} diff --git a/apps/control-station/src/components/simulation/RoverTrackMotion.ts b/apps/control-station/src/components/simulation/RoverTrackMotion.ts new file mode 100644 index 00000000..d31b4667 --- /dev/null +++ b/apps/control-station/src/components/simulation/RoverTrackMotion.ts @@ -0,0 +1,36 @@ +import { Entity } from "playcanvas"; +import { beltPose, type RoverMotion } from "../../core/simulation/roverMotion"; + +export class RoverTrackMotion { + private distance = { L:0, R:0 }; + private links: { node:Entity; side:"L"|"R"; index:number }[] = []; + private wheels: { node:Entity; side:"L"|"R"; radius:number; angle:number }[] = []; + constructor(root: Entity, private motion: RoverMotion) { + const requireNode = (name: string) => { + const node = root.findByName(name) as Entity | null; + if (!node) throw new Error(`В модели отсутствует узел анимации ${name}`); + return node; + }; + for (const side of ["L","R"] as const) { + for (let index=0;index ({node:requireNode(w.node),side:w.node[0] as "L"|"R",radius:w.radius_m,angle:0})); + } + update(dt: number, forwardSpeed: number, yawRate: number) { + // Local controller uses +Z forward, +Y up: positive yaw turns right. + const speed={L:forwardSpeed+yawRate*this.motion.track_width_m/2,R:forwardSpeed-yawRate*this.motion.track_width_m/2}; + const step=Math.min(.1,Math.max(0,dt)); + for (const side of ["L","R"] as const) this.distance[side]=(this.distance[side]+speed[side]*step)%this.motion.length_m; + for (const w of this.wheels) { + w.angle=(w.angle-speed[w.side]*step/w.radius)%(2*Math.PI); + w.node.setLocalEulerAngles(0,0,w.angle*180/Math.PI); + } + for (const link of this.links) { + const pose=beltPose(this.motion,this.distance[link.side],link.side,link.index); + link.node.setLocalPosition(pose.position[0],pose.position[1],pose.position[2]); + link.node.setLocalEulerAngles(0,0,pose.angle*180/Math.PI); + } + } +} diff --git a/apps/control-station/src/components/simulation/SimulationObservationDeck.tsx b/apps/control-station/src/components/simulation/SimulationObservationDeck.tsx new file mode 100644 index 00000000..609293fc --- /dev/null +++ b/apps/control-station/src/components/simulation/SimulationObservationDeck.tsx @@ -0,0 +1,56 @@ +import {useEffect,useRef,useState,type ReactNode} from 'react'; +import {createPortal} from 'react-dom'; +import {Button,Checker,DockHandle,Dropdown,GlassSurface,Icon,IconButton,Select,ToastStack} from '@nodedc/ui-react'; +import {withObservationTree,orderedObservationIDs,observationTree} from '../../core/fleet/observationLayout'; +import {useObservationPresets} from '../../core/fleet/useObservationPresets'; +import {observationArrangements,retainDormantObservationTree} from '../../core/fleet/observationPresets'; +import {ObservationLayoutSaveWindow} from '../observation/ObservationLayoutSaveWindow'; +import {ObservationDeck} from '../observation/ObservationDeck'; +import {ObservationPanelHeader} from '../observation/ObservationPanelHeader'; +import {AiInferencePreview,type InferencePreview} from './AiInferencePreview'; +import '../observation/observation.css'; + +const storageKey='missioncore.simulation.observation.v1'; +export function SimulationObservationDeck({video,videoActions,toolbar,preview}:{video:ReactNode;videoActions:ReactNode;toolbar:ReactNode;preview:null|InferencePreview}){ + const presets=useObservationPresets('missioncore.simulation.observation-presets.v1',storageKey); + const {layout,setLayout}=presets; + const [saving,setSaving]=useState(false); + const [editing,setEditing]=useState(null); + const edited=presets.presets.find(p=>p.id===editing); + const [full,setFull]=useState(null); + const mounts=useRef(new Map()); + const sources=[{id:'video',label:'Симуляция'},...(preview?.layers??[])]; + for(const source of sources)if(!mounts.current.has(source.id)){const element=document.createElement('div');element.className='observation-panel-mount';mounts.current.set(source.id,element);} + const ids=orderedObservationIDs(layout,sources.map(source=>source.id)); + const visible=ids.filter(id=>!layout.hidden.includes(id)&&(id==='video'||layout.catalogVisible?.includes(id))); + const effectiveFull=full&&visible.includes(full)?full:null; + const show=(id:string,checked:boolean)=>setLayout(value=>({...value,catalogVisible:checked?[...new Set([...(value.catalogVisible??[]),id])]:(value.catalogVisible??[]).filter(key=>key!==id),hidden:checked?value.hidden.filter(key=>key!==id):[...new Set([...value.hidden,id])]})); + useEffect(()=>{const escape=(event:KeyboardEvent)=>{if(document.querySelector('[data-docking="true"]'))return;if(event.key==='Escape'&&effectiveFull&&!document.querySelector('[role=dialog],[role=listbox]')){setFull(null);event.stopImmediatePropagation();}};window.addEventListener('keydown',escape,true);return()=>window.removeEventListener('keydown',escape,true);},[effectiveFull]); + return
+
+ {effectiveFull&&} + }> + {({close})=>
+ {try {update({...prefs,quality});}catch{setError("Не удалось сохранить качество.");}}}/> + setHelp(true)}> + {planning?setSettings(true)}>:null} + +
+ {settings?setSettings(false)}/>:null} + setHelp(false)} title="Управление сценой"> +
{planning?<> +

ЛКМ — вращение вокруг точки нажатия. ПКМ или клик двумя пальцами с движением — сдвиг.

+

Прокрутка — зум к курсору, в том числе в режиме добавления точек.

+

WASD / стрелки — перемещение. Q / E — вниз / вверх. Shift — быстрее.

+

Waypoint по клику — установка точки на поверхности. Выберите точку и перемещайте её за стрелки X, Y, Z. Delete — удалить, Ctrl/Cmd+Z — отменить. Клик по пустому месту в обзоре снимает выделение.

+ :<>

WASD / стрелки — движение. Пробел — тормоз. R — к старту.

Мышь — обзор.

}
+
+ {error?setError(null)}/>:null} + ; +} diff --git a/apps/control-station/src/components/simulation/WorkerVideo.tsx b/apps/control-station/src/components/simulation/WorkerVideo.tsx new file mode 100644 index 00000000..f3d59722 --- /dev/null +++ b/apps/control-station/src/components/simulation/WorkerVideo.tsx @@ -0,0 +1,29 @@ +import { useEffect, useRef, useState } from "react"; +import type { AiStreamEndpoint } from "../../core/simulation/aiPolygon"; +import { streamRecovery } from "../../core/simulation/streamRecovery"; +export type WorkerVideoState="connecting"|"live"|"failed"; +export function WorkerVideo({endpoint,onState}:{endpoint:AiStreamEndpoint;onState:(state:WorkerVideoState,fps:number|null)=>void}){ + const frame=useRef(null),callback=useRef(onState);callback.current=onState; + const [attempt,setAttempt]=useState(0); + useEffect(()=>{ + const started=performance.now();let lastFrame:number|null=null,failedAt:number|null=null,finished=false; + callback.current("connecting",null); + const receive=(e:MessageEvent)=>{ + if(finished||e.origin!==location.origin||e.source!==frame.current?.contentWindow||e.data?.type!=="missioncore-worker-video")return; + if(e.data.state==="live"&&Number.isFinite(e.data.fps)){ + lastFrame=performance.now();failedAt=null;callback.current("live",e.data.fps); + }else if(e.data.state==="failed")failedAt??=performance.now(); + }; + const timer=setInterval(()=>{ + const action=streamRecovery(performance.now(),started,lastFrame,failedAt,attempt); + if(finished||action==="wait")return; + finished=true; + if(action==="retry")setAttempt(n=>n+1);else callback.current("failed",null); + },500); + window.addEventListener("message",receive); + return ()=>{finished=true;clearInterval(timer);window.removeEventListener("message",receive);}; + },[attempt]); + return