param( [Parameter(Mandatory = $true)][string]$DataRoot, [Parameter(Mandatory = $true)][string]$RtkCapture, [Parameter(Mandatory = $true)][string]$ImuCapture, [Parameter(Mandatory = $true)][string]$OutputRoot, [string]$LidarObject = "frontlidar", [string]$LidarCaptureName = "h32.rscap", [Parameter(Mandatory = $true)][double]$RtkReferenceHeightAboveGroundM, [string]$Timezone = "+08:00", [ValidateSet("device_gnss", "host")][string]$TimeBasis = "device_gnss", [int]$ExpectedStations = 27, [int]$MinStations = 20, [int]$MinPairs = 20, [int]$Bootstrap = 200, # Roof-mounted H32 (~2 m). Do not reuse [-1.4, -0.4] on this vehicle. [double]$GroundZMin = -2.5, [double]$GroundZMax = -1.5, [double]$HeadingOffsetDeg = -90.0 ) $ErrorActionPreference = "Stop" $ExportRoot = Join-Path $OutputRoot "exported" $PreparedRoot = Join-Path $OutputRoot "prepared_rtk_direct" $CalibrationRoot = Join-Path $OutputRoot "calibration" & (Join-Path $PSScriptRoot "export_multisensor_stations.ps1") ` -DataRoot $DataRoot -RtkCapture $RtkCapture -ImuCapture $ImuCapture ` -OutputRoot $ExportRoot -LidarObject $LidarObject -LidarCaptureName $LidarCaptureName ` -Timezone $Timezone -TimeBasis $TimeBasis if ($LASTEXITCODE -ne 0) { throw "Raw-data export failed" } & (Join-Path $PSScriptRoot "run_direct_rtk_lidar.ps1") ` -CombinedRoot (Join-Path $ExportRoot "combined") ` -WorkRoot $PreparedRoot -OutputRoot $CalibrationRoot ` -RtkReferenceHeightAboveGroundM $RtkReferenceHeightAboveGroundM ` -HeadingOffsetDeg $HeadingOffsetDeg ` -MinStations $MinStations ` -ExpectedStations $ExpectedStations -MinPairs $MinPairs -Bootstrap $Bootstrap ` -GroundZMin $GroundZMin -GroundZMax $GroundZMax if ($LASTEXITCODE -ne 0) { throw "RTK-LiDAR calibration failed" } Write-Host "Final result: $(Join-Path $CalibrationRoot 'final_T_RTK_lidar.json')" Write-Host "Prepared frames: $(Join-Path $PreparedRoot 'frames_all')"