Range & Bearing
factors::ranging — distance and direction measurements: UWB, radar, sonar,
acoustic angle-of-arrival, and bearing-only landmark observation.
Bearing lives here rather than under visual because a direction measurement
is not camera-specific — and keeping the two bearing residuals adjacent is what
keeps them on one SE(3) convention.
Convention. Poses are body-in-world, so the body-frame direction to a world landmark is
Getting this backwards ( instead of ) produces a residual that is self-consistent with its own Jacobian, so finite differences pass and only a hand-computed value catches it.
PosePoseRangeFactor
Distance between two poses’ origins — a UWB or acoustic baseline.
Blocks — residual 1, Jacobian .
The rotation columns are exactly zero: a range between origins carries no attitude information. Below the direction is undefined and the Jacobian is zeroed rather than divided by zero.
PosePointRangeFactor
Distance from a pose to a landmark.
Blocks — residual 1, Jacobian .
One constraint per measurement, along the line of sight only — trilateration needs three non-collinear anchors.
BearingFactor
Direction-only observation, on the unit sphere .
Blocks — residual 2, Jacobian . Whitens internally.
Error
where is an orthonormal basis for the tangent plane at is a 3-vector confined to a 2-manifold, so using it directly would give a structurally rank-2 residual with three rows — a singular information block.
Jacobian
With and the normalization derivative ,
all pre-multiplied by .
BearingRangeFactor
Bearing and range together — a radar or sonar return, or a camera plus depth.
Blocks — residual 4, Jacobian . Takes an
external NoiseModel.
The three bearing rows are the raw direction difference rather than a
tangent-plane projection, so they are structurally rank 2 — give the bearing
rows a common and let the noise model handle it, or use
BearingFactor plus PosePointRangeFactor if you need a full-rank
information block.
Bearing rows share BearingFactor’s derivatives; the range row is
PosePointRangeFactor’s.