The charger goal heading always pointed out of the station, so only robots
that reverse onto the charger were supported. Front-charging robots now set
`entry_direction: forward` (goal yaw + pi, position unchanged) together with
a front `scan_topic`. The default stays `backward`, so existing configs keep
their behaviour.
Once per run the handler looks up base_link <- scan frame and:
- fails the action if the scan plane is tilted more than 5 deg;
- fails the action if the lidar faces the side opposite to entry_direction,
instead of writing a reversed goal;
- mirrors the bearings when the lidar is mounted upside down (roll pi),
as the trolley handler does. No config key is needed for that.
Tests: forward vs backward, direction mismatch, upside-down V / taped V /
arc, tilted scan plane, invalid entry_direction.
Read v_shape per profile and fail loud on an unknown value. The start log now prints the loaded v_shape so it can be checked without opening the YAML on the robot. Add doc/MEASURE_AND_CONFIGURE.md with figures and link it from the README.
The tape gate reads intensity by ray index, so it is only correct when the
intensity array and the ranges array come from the same scan and have the same
length. The handler hands scan->intensities straight across - not rebuilt, not
buffered, not remembered from an earlier scan.
That is a joint, and joints are what the unit tests below cannot see, so it has
its own coverage: ATapeProfileOnAScanWithoutIntensitiesSaysWhy feeds the exact
plate being looked for on a scan that carries no intensities and requires the
handler to say "no intensity data". A handler that passed a fabricated array
would never produce that line.
One log line per action run, on the first detection that matches, and only when
the tape check is on: how many bright rays each wing returned, the measured
spacing and widths, each against the profile value and tolerance. This is the
number whoever installs a dock needs - tape stuck a few centimetres off still
detects today and then fails outright once it is dusty or damp, and without
this line nobody knows it was already at the edge. Once, because it is a
commissioning number and not a heartbeat.
This is the layer that turns the geometry into something the robot actually
runs. It pulls a raw scan from the shared store, extracts lines, matches the
dock pattern, transforms into the global frame and writes the result as a
static transform - the same output contract FrameSampler has, so the charge
sequence keeps working and nothing in move_base2, dock_planner or
mission_adapters changes. Swapping detectors is one word in the YAML.
It is also the only place in the chain allowed to know about TF, actions and
the sensor store. The three packages beneath it stay free of all that, which
is what lets their tests build a world, cast rays and finish in a millisecond
with no runtime around them.
Three things only break once the pieces are joined, and no core test can see
them:
The scan cursor. A 30 Hz control loop reading a 29 Hz lidar ticks more often
than scans arrive. Without the cursor the same scan counts as several samples,
min_samples stops meaning anything, and the handler commits on one measurement.
TF arriving after the scan. The two come from different sources, so TF running
a few milliseconds behind is routine. The store's cursor has already moved past
that scan, so dropping the sample loses a detection outright every time TF is
late. The detection is now held and transformed on a later tick, without
re-running the match - the shape was already found, only the transform was
missing. The regression test fails without that, which is how it earned its
place.
Transforming at the scan's own stamp rather than at the latest. The pose just
computed belongs to the moment the scan was taken; looking up at another moment
mixes two instants into one measurement. The error from "latest" is small but
nobody knows how small, and a stamp on the wrong clock shows up exactly here.
Rejections happen at boot, not at detection time: no sensor store, a scan_topic
the store does not carry (listing the ones it does - a mistyped topic looks
exactly like a dead sensor), no profiles, a pattern that is not implemented,
a default_profile that does not exist. Every profile is validated, not just the
default one, because a typo in the fifth profile that only surfaces at four in
the afternoon is the worst kind.
An order asking for a profile that does not exist fails and says which ones do.
It does not quietly fall back to the default: using the wrong geometry means
docking in the wrong place, not being slightly slower.
The timeout message says which gate failed. Nothing matched, matched too
rarely, or matched but never settled need opposite responses, and one failure
line cannot carry that.