Skip to content

Operator Run Workflow

Purpose

The operator workflow is the laptop-side path for configuring, starting, monitoring, and reviewing a remote perception run. It connects operator actions to the robot-side run tooling while keeping command construction, process control, and artifact handling outside the GUI. It exists to make a completed run retrievable and reviewable as evidence rather than only observable live. The operator monitor supports this by:

  • reads operator run settings from the Tk form
  • starts a robot-side run over SSH
  • streams the remote run log back into the GUI
  • requests graceful stop, then falls back to runtime-container stop when needed
  • retrieves the completed run bundle
  • builds recorded videos when the retrieved bundle contains video/source.ts
  • generates and opens the local HTML report

Implementation context

Python modules under ros_ws/src/robot_diag_control/robot_diag_control:

Module Owns
monitor_gui.py Tk widgets, callbacks, timers, log display, button state application
run_settings.py Converting GUI form values into RobotConnection, RunConfig, and artifact context
run_commands.py Stable command/path builders for remote start, stop, pull, and report
run_preparation.py Remote run directory creation and class-file upload before launch
run_lifecycle.py Process wrappers, process state checks, stop signal mechanics, run-control availability
run_manager.py Start/stop orchestration, runtime-stop fallback, completion interpretation
run_artifacts.py Pulling run bundles, generating reports, artifact paths, artifact result messages

This split keeps command construction, process lifecycle, and artifact handling separate from Tk widgets.

Run workflow

Start sequence

  1. monitor_gui.py collects current form values.
  2. run_settings.resolve_run_form(...) returns:
  3. RobotConnection
  4. RunConfig
  5. RunArtifactContext
  6. RunManager.start(...) calls prepare_remote_run(...).
  7. run_preparation.py creates the remote run directory and uploads classes.txt when operator classes are provided.
  8. run_commands.build_remote_start_command(...) builds the SSH command for the selected backend:
  9. runtime container: scripts/omni runtime record
  10. devcontainer: docker exec into the running robot devcontainer, then scripts/omni run real --profile operator ... from the container-visible workspace path
  11. run_lifecycle.start_remote_run_process(...) starts the local SSH process.
  12. The GUI starts the remote log reader and polls for completion.

Stop sequence

  1. The GUI calls RunManager.request_stop(...).
  2. run_lifecycle.request_remote_run_stop(...) writes Ctrl-C to the SSH process stdin so the robot-side recorder can finalize the run bundle.
  3. For the runtime-container backend, the GUI also calls RunManager.request_runtime_stop(...) immediately, which runs:
scripts/omni runtime stop --run-id <run_id>

A successful container stop, including the already-stopped case, moves the GUI to STOPPED and clears the stale SSH handle so the operator can start the next run without waiting on that old session. 4. For non-runtime backends, or if the runtime stop path is unavailable, the GUI starts a grace timer and then calls RunManager.force_stop(...) if the process does not exit. 5. RunManager.completion(...) converts the final exit state into a typed result: - operator-requested stop -> STOPPED - zero exit -> STOPPED - nonzero exit -> FAILED

The important invariant is that a graceful stop is preferred because the recorder needs it to write final metadata such as manifest.yaml and summary.json.

Artifact Sequence

The GUI's Retrieve & Open Report action:

  1. calls retrieve_run_artifacts(...).
  2. executes scripts/omni runs pull <run_id>.
  3. builds videos with build_run_videos(...) when the retrieved bundle contains video/source.ts.
  4. regenerates the report with generate_run_report(...).
  5. opens runs/imported/<run_id>/report/index.html when present.

Perception Scan

Perception: 360° environment scan is a bounded environment capture used to generate a controlled reference video/source.ts for offline detector comparison. It records video implicitly, starts no live detector inference, and rotates in place at the configured positive yaw rate (0.20 rad/s by default). The scan completes only after /odometry/filtered reports one full wrapped-yaw revolution, commands zero velocity, and exits so the normal RunBundle recorder finalizes the bundle. Odometry that never arrives or becomes stale ends the scan cleanly without continuing motion.

Detector Selection and Tuning

Before selecting an external detector model for autonomy or stationary profiling, copy its generated RKNN artifact to the robot repository's runs/model_artifacts/ directory. The normal Experiment controls expose Runtime default, YOLO-World v2-S/v2-M/v2-L FP choices, the recalibrated INT8 choices, and the v2-L TD01 mixed-precision choice (currently rendered by the selector as YOLO-World v2-L Hybrid). The recalibrated choices use the canonical yolo_world_v2_{s,m,l}_i8.rknn artifact names. The v2-L TD01 mixed-precision choice uses the canonical yolo_world_v2_l_hybrid_td01.rknn artifact. An explicit choice uses the staged artifact for that run; Runtime default continues to use the detector configured by the runtime image or config. The selector does not upload or discover model files.

For detector-backed experiments, the monitor exposes a shared class list, model selector, postprocessing controls, and NPU core mask selector. The core-mask values exactly match runner.core_mask (auto, each individual core, each two-core combination, and core0_1_2); it defaults to auto. The shared detector controls map to:

  • Score Threshold -> postprocess.score_threshold
  • NMS IoU -> postprocess.nms_iou_threshold
  • Max Detections -> postprocess.max_detections

The collapsed Advanced Experiment Overrides section contains only autonomy-specific framing and safety settings.

The command builder passes these as launch arguments and also records them as experiment parameters in the run manifest. Operator-started runs also record the selected Experiment dropdown label, either Perception: 360° environment scan or Autonomy: frame and capture target, so the HTML report has a clear provenance label even when no external experiment config file is used. Model paths, camera device, capture size, model input size, class padding, and runner warmup remain launch/config-file controls.

The perception scan always records video. For autonomy and profiling, select Record video before starting the run; it remains off by default. Retrieve & Open Report preserves video/source.mp4 as a stream-copy remux of raw video/source.ts, then creates the repaired presentation derivative video/source.corrected.mp4 and the approximate detection overlay video/overlay.mp4 before regenerating the report. Rockchip preview recordings have a known deterministic 8px horizontal wrap; raw evidence is not modified. Source preview and inference use separate camera paths, so the overlay is not pixel-perfect synchronized.

Select Record rosbag to add the configured ROS topic allowlist to the same RunBundle. This is also off by default and creates the standard ROS 2 bag layout:

run_id/
  rosbag/
    metadata.yaml
    ...

Stationary Perception Profiling

Stationary Perception Profiling runs native detector inference for a bounded duration (120 seconds by default) without autonomous motion. It uses the same remote execution, recorder, graceful SIGINT shutdown, and RunBundle workflow as other operator runs, on either the runtime container or devcontainer backend. The command explicitly sets start_autonomy:=false, start_perception_scan:=false, and start_nav:=false; it therefore cannot start the command-producing autonomy, scan, or navigation nodes. Video and rosbag remain opt-in.

The selected experiment label, model provenance, runner.core_mask, duration, classes, and postprocessing values are recorded in the existing experiment configuration and parameter fields of the RunBundle manifest.

When the configured duration elapses, the timeout sends SIGINT so the recorder can finalize the RunBundle; the operator monitor presents this expected bounded completion as Stopped, rather than a failed run.

Autonomy Run Type

The monitor can launch the bounded perception scan or the bounded autonomy run type labeled Autonomy: frame and capture target in the Experiment dropdown. The matching command-line helper is:

scripts/omni run autonomy --classes <class[,class...]>
scripts/omni run autonomy --target <class>

The monitor uses the runtime-container recording path for this run type and appends launch arguments that start omniseer_autonomy/target_centering_node, set the target to the first configured class in the operator Class List, pass the full class list to native vision and run metadata, and write autonomy.jsonl into the run bundle. When target centering reaches success or failure, the autonomy node stops commanding motion, completes terminal logging and capture handling, and exits cleanly; real launch then shuts down so the recorder can finalize the run bundle without an operator Stop Run.

The bounded autonomy run type is summarized in the Runtime Overview. It performs an in-place visual target-acquisition and framing loop for a configured class, records autonomy.jsonl, and stops once it reaches a terminal success or failure state.

The node publishes TwistStamped commands to /cmd_vel_autonomy, relies on twist_mux arbitration, and records terminal state into the bundle for the HTML report. During scan, the target-centering node subscribes to /odometry/filtered and stops with scan_complete_no_target after one observed revolution by default. Navigation, SLAM, tracking packages, and camera servo control remain out of scope for this run type.

The robot-side console log, retained in recorded bundles as logs/bringup.log, includes each newly reached autonomy state and a terminal summary with the final state, reason, states reached, target-loss count, timing milestones, final centering error, and final confidence. The structured autonomy.jsonl stream remains the canonical machine-readable event record.

Verification

Local documentation and unit-test coverage can verify behavior that does not require robot hardware:

  • command construction
  • form normalization
  • pre-launch preparation ordering
  • start/stop manager decisions
  • runtime-stop fallback message formatting
  • completion interpretation
  • artifact pull/report result handling
  • compact GUI-facing gRPC error messages

Full hardware acceptance requires a real operator run:

  1. launch the monitor from the laptop
  2. start a runtime-container run on the robot
  3. stop it from the GUI
  4. verify the run bundle finalizes
  5. retrieve it
  6. generate and open the report

For the operator profile, a robot-side acceptance check can be run against an existing graph:

OMNISEER_REQUIRE_DETECTIONS=1 scripts/omni run real verify

This check requires live encoder, wheel-odometry, LiDAR, vision, and detection messages; healthy gateway status; and zero vision errors. It also starts and stops preview, runs a short headless overlay viewer smoke when laptop-side dependencies are available, enables teleop, sends only a zero command, verifies that the stamped controller reference receives it, and disables teleop.