Files
kinect/attach/windows/scripts/Verify-KinectDevice.ps1
T
kinect-bot 9b5a0255e2
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python root tests (pytest, no tracker deps) (push) Canceled after 0s
ci / Python tracker (pytest, tracker/.venv) (push) Canceled after 0s
feat(windows): usbip-win runbook ([~]) + clean-room Kinect10.dll NUI shim (x86+x64 export-verified) (wave 9; todo 14 done, 12/13 blocked)
2026-11-25 06:00:12 -05:00

71 lines
3.5 KiB
PowerShell

#requires -Version 5.1
<#
.SYNOPSIS
Verify the attached virtual Kinect v1 enumerated and bound to the real MS Kinect driver.
.DESCRIPTION
[~] BLOCKED in the kinect build environment (no Windows). RUN THIS ON THE USER'S WINDOWS BOX,
elevated, AFTER Attach-Kinect.ps1. It checks, via PnP, that the three Kinect PIDs are present,
bound (no yellow-bang / Problem code 0), and reports the binding driver/INF. It does NOT call
the NUI API (that is C++); it tells you what to confirm with the Kinect SDK sample.
Pass criteria for plan todo 12 (acceptance, human-assisted on Windows):
* Device Manager shows the Kinect under the MS Kinect driver (this script's PnP check), AND
* the Kinect SDK's KinectExplorer / SkeletonBasics sample enumerates the sensor
(NuiGetSensorCount >= 1, NuiCreateSensorByIndex(0,...) succeeds) -- run it manually.
#>
[CmdletBinding()]
param()
$ErrorActionPreference = 'Stop'
# The three real Kinect v1 sibling PIDs (must match config\kinect-usbip.json / core/protocol).
$targets = @(
@{ Function = 'camera'; Vid = '045E'; Pid = '02AE' },
@{ Function = 'audio'; Vid = '045E'; Pid = '02AD' },
@{ Function = 'motor'; Vid = '045E'; Pid = '02B0' }
)
Write-Host '=== Virtual Kinect v1 -- PnP verification ===' -ForegroundColor Cyan
$allBound = $true
foreach ($t in $targets) {
$hwidFrag = "VID_$($t.Vid)&PID_$($t.Pid)"
$devs = Get-PnpDevice -PresentOnly -ErrorAction SilentlyContinue |
Where-Object { $_.InstanceId -match $hwidFrag }
if (-not $devs) {
Write-Warning ("{0,-6} {1}: NOT PRESENT. Did Attach-Kinect.ps1 attach busid for this function?" -f $t.Function, $hwidFrag)
$allBound = $false
continue
}
foreach ($d in $devs) {
$driver = (Get-PnpDeviceProperty -InstanceId $d.InstanceId -KeyName 'DEVPKEY_Device_DriverInfPath' -ErrorAction SilentlyContinue).Data
$service = (Get-PnpDeviceProperty -InstanceId $d.InstanceId -KeyName 'DEVPKEY_Device_Service' -ErrorAction SilentlyContinue).Data
$problem = (Get-PnpDeviceProperty -InstanceId $d.InstanceId -KeyName 'DEVPKEY_Device_ProblemCode' -ErrorAction SilentlyContinue).Data
$ok = ($d.Status -eq 'OK') -and (-not $problem -or $problem -eq 0)
$color = if ($ok) { 'Green' } else { 'Yellow' }
Write-Host ("{0,-6} {1}: status={2} problem={3} inf={4} service={5}" -f `
$t.Function, $hwidFrag, $d.Status, $problem, $driver, $service) -ForegroundColor $color
if (-not $ok) {
$allBound = $false
Write-Warning " -> not cleanly bound. If service/INF is 'usbip*' the VHCI stub bound it but the MS Kinect driver did not match -- check the device descriptors / that the real Kinect 1.8 runtime+driver are installed."
}
}
}
Write-Host ''
if ($allBound) {
Write-Host 'All three Kinect sibling devices present and bound (no Problem code).' -ForegroundColor Green
Write-Host 'Confirm the INF above is the Microsoft Kinect driver (kinect*.inf), NOT a generic/usbip stub.'
} else {
Write-Warning 'One or more Kinect devices missing or not cleanly bound -- see warnings above.'
}
Write-Host ''
Write-Host 'Now confirm the NUI runtime enumerates it:' -ForegroundColor Cyan
Write-Host ' * Launch KinectExplorer-D2D (Kinect Developer Toolkit 1.8): the sensor should appear.'
Write-Host ' * Or run SkeletonBasics-D2D: it should open the sensor (streams may be empty until todo 13 serves depth).'
Write-Host ' * Capture a Device Manager screenshot + the KinectExplorer window to .omo\evidence\task-12-webcam-kinect-emulator.*'