Skip to main content

Module metric

Module metric 

Source
Expand description

Metric 3D objects from object tracks and metric camera poses (Phase 3 of docs/object_metric_slam_plan.md, static objects).

The monocular-inertial VIO’s poses are metric thanks to the IMU. So feature tracks triangulated with them are metric too, and so is an upright box fitted to those points. The pipeline:

  1. Collect the feature tracks seen inside an object’s 2D boxes.
  2. Triangulate each one from its observations (triangulate): camera poses (camera to world, from the VIO) and unit bearings (from the camera model, which this module does not need to know).
  3. Fit a gravity-aligned box to the points (fit_upright_box). The world z axis is up, as in Basalt’s gravity-aligned world frame.

Every estimate records where its scale came from (ScaleSource). Class size priors (plausible_size) are used only to flag implausible results, never to set a scale: with a wrong scale, the sizes come out wrong.

Structs§

BearingObservation
One observation of a feature: the camera pose (camera to world) and the unit bearing of the feature in the camera frame.
BoxFitParams
Robustness settings of fit_upright_box.
ObjectEstimate
A metric object estimate.
TriangulationParams
Acceptance tests of triangulate.
UprightBox
A gravity-aligned box. length (the longer side) runs along the heading yaw (radians from world x towards world y), width across it, height along world z.

Enums§

ScaleSource
Where an estimate’s metric scale comes from.

Functions§

estimate_static_object
Triangulate an object’s feature tracks and fit its upright box.
fit_upright_box
Fit an upright box to points (world z up): drop outliers far from the median point, then take the heading whose quantile rectangle has the smallest area, and the quantile extents along it, across it and up. Points on an object’s visible surfaces only cover part of it, so the box can be smaller than the object.
plausible_size
Rough size ranges of common COCO classes, in metres: the largest dimension (length, width or height) an object of the class should have. Only for flagging implausible estimates; see the module docs.
triangulate
The point closest to all the observation rays (least squares), if the rays diverge enough and the point is in front of, and close to, every ray.