Files
UA-.NETStandard/samples/Vision
Marc Schier 7e25e1a3d7 Extract remaining shared companion, rendering and packaging changes (#4806)
# Description

The shared AI deployment contracts and instance registration; DI
software-upload outcomes, digest handling and simulator; bounded
Positioning/Pumps reads; PubSub raw-data/matrix and security-provider
handling; Vision read-quality contracts; xRegistry resource writes and
instance projection; OpenUSD authoring, embedded viewport and
retained-frame capture APIs; standalone sample CLI controls; and the
generic Debug/RID package-policy and fork/Dependabot coverage-comment
fixes. The Linux native prerequisite step is retained for **Vision tests
only**.

## Related Issues

- Related tracking issue:
[#4461](https://github.com/OPCFoundation/UA-.NETStandard/issues/4461),
without automatic closure.
- Source work:
[#4462](https://github.com/OPCFoundation/UA-.NETStandard/pull/4462),
which remains intact for the coordinator's later integration.
- Immediate stacked predecessor:
[#4804](https://github.com/OPCFoundation/UA-.NETStandard/pull/4804).

## Checklist

_Put an `x` in the boxes that apply. You can complete these step by step
after opening the PR._

- [ ] I have signed the
[CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf)
and read the
[CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md)
doc.
- [ ] I have added tests that prove my fix is effective or that my
feature works and increased code coverage.
- [x] I have added all necessary documentation.
- [ ] I have verified that my changes do not introduce (new) build or
analyzer warnings.
- [ ] I ran **all** tests locally using the **UA.slnx** solution against
at least .net **framework** and .net **10**, and all passed.
- [ ] I fixed **all** failing and flaky tests in the CI pipelines and
**all** CodeQL warnings.
- [ ] I have addressed **all** PR feedback received.
2026-10-17 07:52:02 +02:00
..

Vision samples

The Vision samples show OPC UA Vision in realistic production cells rather than as isolated image-processing calls.

Sample Role
MachineVisionServer Released OPC 40100-1/-2 models in Machinery, with a shared deterministic engine for the Perception pipeline.
MachineVisionClient Secure typed discovery, recipe upload/preparation, job execution, results, and asset reads.
VisualInspectionCell Server hosting Vision, AI Model Management, ISA-95 Job Control V2, and Alarms & Conditions for a machined-bracket inspection cell.
VisualInspectionAgent External deterministic orchestrator that connects with typed clients, measures fixture images, applies the recipe, routes jobs, and records operator ground truth.

The VisualInspection pair demonstrates a safety pattern that is deliberately stronger than "ask a model whether the part is good": the model path can produce measured characteristics and confidence, but deterministic recipe code owns the quality verdict. A photographed image therefore cannot become a free-form instruction to job control.

graph TD
    Agent["VisualInspectionAgent<br/>typed OPC UA clients"]
    Cell["VisualInspectionCell<br/>OPC UA server"]
    Vision["Vision<br/>sensor, clip endpoint, pipeline, results"]
    AI["AI Model Management<br/>deployment, Invoke, learning job"]
    ISA95["ISA-95 Job Control V2<br/>inspection and rework orders"]
    Alarms["Alarms & Conditions<br/>operator dialog"]

    Agent -->|"capture and submit results"| Vision
    Agent -->|"Invoke for provenance"| AI
    Agent -->|"StoreAndStart / transitions"| ISA95
    Agent -->|"respond to dialog"| Alarms
    Cell --> Vision
    Cell --> AI
    Cell --> ISA95
    Cell --> Alarms

Running the pair

Prerequisites: .NET 10 SDK.

Start the server:

dotnet run --project samples\Vision\VisualInspectionCell\VisualInspectionCell.csproj -- --insecure

Then run the orchestrator in the unattended deterministic mode:

dotnet run --project samples\Vision\VisualInspectionAgent\VisualInspectionAgent.csproj -- --server opc.tcp://localhost:62865/VisualInspectionCell --insecure --mode scripted --cycles 3

The server publishes static PNG fixture images. The agent retrieves a fixture, measures the bracket geometry, calls the AI deployment's Invoke path so model provenance and usage are visible in the address space, applies the recipe, and routes the ISA-95 order according to the deterministic verdict.

Use --mode live-ai --ai-endpoint <uri> only when a real model endpoint is configured. live-ai fails before creating any job when no endpoint is named; it never silently falls back to the deterministic analyser, because a sample that quietly degrades appears to work while demonstrating nothing.

See also