计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
odometry【效率与协作】Load and validate KITTI odometry benchmark sequences with pykitti.odometry.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill for the KITTI odometry benchmark layout: a numbered
sequence under sequences/<sequence>, its calibration and timestamps, optional
benchmark ground-truth poses, and camera/Velodyne access. The package version
covered here is pykitti==0.3.1.
pykitti.odometry(base_path, sequence, **kwargs) for this layout.Detailed contracts are in API reference, dataset layout, workflows, and odometry troubleshooting. Run the safe fixture smoke script after installation from this sub-skill directory.
import pykitti
base_path = "/data/kitti/odometry/dataset"
dataset = pykitti.odometry(
base_path,
"00",
frames=[0, 5, 10], # omit for all positions; use a reusable list/range
imtype="png", # default; e.g. "jpg" if files use that extension
)
print(len(dataset), dataset.sequence)
print(dataset.timestamps[0]) # datetime.timedelta
print(dataset.calib.K_cam0) # 3x3 intrinsic matrix
left = dataset.get_cam0(0) # PIL.Image, grayscale (mode L)
scan = dataset.get_velo(0) # float32 array, shape (N, 4)
The constructor eagerly reads calib.txt, times.txt, and the optional pose
file. It discovers sensor files with sorted globs; images and scans are loaded
only when a property generator or indexed getter is consumed.
base_path/sequences/<sequence>/calib.txt and times.txt exist.P0, P1, P2, P3, and Tr records,
each with 12 values. Validate all expected sensor directories before asking
for paired streams; the loader permits absent directories.sequence as the directory name (normally a two-character string),
and pass frames as valid positional indices. Materialize a subset such as
list(range(0, 20, 5)); do not pass a one-shot iterator.len(dataset), file-list lengths, timestamp types, calibration
shapes, and pose availability before indexing.dataset.cam0, dataset.gray,
dataset.rgb, dataset.velo) or indexed methods for random access
(get_camN, get_gray, get_rgb, get_velo).T_camN_velo map Velodyne homogeneous points into camera-N coordinates;
pose matrices are T_w_cam0.From the odometry sub-skill directory (the directory containing scripts/):
python scripts/odometry_fixture_smoke.py --help
python scripts/odometry_fixture_smoke.py
len(dataset) is the number of parsed timestamps, not a guarantee that every
camera and scan list has that length. Compare len(dataset.timestamps) with
len(dataset.camN_files) and len(dataset.velo_files) before synchronized
processing. A missing pose file is a supported case: construction prints a
warning and leaves dataset.poses == []. A malformed calibration is not
silently repaired; stop and fix the source file. See the linked references for
failure-specific checks and transform examples.
A successful odometry load provides a CalibData named tuple, a list of
datetime.timedelta timestamps, and optionally a list of 4x4 NumPy poses.
Sensor properties return fresh generators, while indexed methods load one
item. The loader does not download data, reconcile mismatched stream lengths,
or infer missing frame IDs; callers own those checks.