param(
    [Parameter(Mandatory = $true)][string]$Lidar,
    [Parameter(Mandatory = $true)][string]$Imu,
    [Parameter(Mandatory = $true)][string]$Summary,
    [int]$PairIndex = 0,
    [double]$Voxel = 0.12,
    [string]$SavePng = ""
)

$ErrorActionPreference = "Stop"
$Root = Split-Path -Parent $PSScriptRoot
Set-Location $Root

$args = @(
    "tools\visualize_pair_3d.py",
    "--lidar", $Lidar,
    "--imu", $Imu,
    "--summary", $Summary,
    "--pair-index", "$PairIndex",
    "--voxel", "$Voxel"
)
if ($SavePng -ne "") {
    $args += @("--save-png", $SavePng)
}

python @args
if ($LASTEXITCODE -ne 0) { throw "visualize_pair_3d failed: $LASTEXITCODE" }
