- ActionStatus::kCancelled (new, string "CANCELLED"): the missing "stopped
on request" terminal status — previously a cancelled action only had
Running/Succeeded/Failed to report through, so move_base2's state
machine couldn't tell a cancelled action from a failed one.
- ActionHandler::cancelNeedsTicks() (default false), pause(now) and
resume(now) (default no-ops): lets a handler opt into "I need more
ticks to actually stop" (device handshake) instead of being torn down
immediately, and gives handlers a real pause/resume contract instead of
move_base2 having to freeze/unfreeze them from outside.
- action_abi.h (new) + ACTION_CORE_EXPORT_HANDLER macro, same pattern as
recovery_core commit 254c7fc: exports a version symbol next to the
factory alias; action_registry.cpp refuses a handler .so whose version
doesn't match instead of dlsym+reinterpret_cast blindly onto a grown
vtable.
- frame_sampler / wait / noop handlers implement pause/resume via
paused_at_ / started_at_ += (now - paused_at_) so their own internal
timers don't count paused time; paused_ is reset on start() so a reused
handler instance can't come up already paused.
- test/plugins/stale_abi_action_handler.cpp (new) for the registry refusal
test.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The handler was 1114 lines, of which roughly 200 were "read a pose from TF".
The rest was the filter: a sliding window, cluster rejection for localization
jumps, robust spread, a hold timer, and the diagnostics that make a failed
detection explainable. A detector that finds a dock plate in a laser scan
produces a pose per scan and needs all of that too, and writing it twice is
worse than the duplication - the two copies drift, and a fix lands in one.
PoseSampleFilter now owns the window, the clustering, the spread measurement,
the hold clock, the best-window record and the throttled progress log. The
handler keeps what is actually specific to being a TF source: the lookup and
its stamp-based dedupe, goal_frame, settle_delay and timeout, the simulated
goal path, writing the result back as a static transform, and the three
distinct timeout messages.
The line between them is source versus filtering. last_stamp_ stays with the
handler for that reason - deduplicating on a TF stamp is a property of that
source, and a detector reading from the shared sensor store will dedupe on an
arrival counter instead.
filter_enabled moves into the filter's config rather than staying with the
handler, because it decides whether the cluster keys are validated at all.
Split across two owners, that is one rule two places have to remember, and the
first time they disagree a config that used to load stops loading.
The filter validates its own keys and logs them with the instance name, so the
messages an operator has learned to read come out identical.
Behaviour is unchanged and the test files are untouched: 22 of 22 frame sampler
tests pass as they are. That is the point of doing it this way - the tests
cover exactly the code that moved, so passing them without editing them is what
distinguishes a refactor from a rewrite.
Both detectors now read the same YAML keys, so sample_window, max_spread_xy and
jump_threshold are learned once rather than once per detector.
A handler that samples through TF only ever sees what perception already
decided. One that detects for itself - picking the V plate of a charging dock
out of a laser scan - needs the ranges array in ray order, and the costmap at
0.05 m has inflated that away beyond reconstruction. ActionContext carried no
way to reach sensor data at all, so that handler could not be written.
It now carries a read-only port onto the store in robot_sensor_ports. Null
when the host provides none, and a handler that needs sensor data is expected
to refuse in configure() rather than discover it mid-shift, the same contract
the tf pointer already has.
The struct is crossed by boost::dll, so its layout is an ABI. Adding a field
changes that layout and dlsym plus reinterpret_cast catches none of it at
compile time - an old .so reads the old offsets off new data and returns
garbage. The field goes at the end and the warning now says so in the doc, but
the rule stands: every handler .so is rebuilt in the same pass.