Graph tuyen (Voronoi) bien dich san tu map, host day vao qua BaseNavigation::addRouteGraph.
La message cua robot_sensor_msgs du khong phai "cam bien" - kho khong phan biet. 23/25 loai
duoc dang ky san.
Sensor data entered the navigation runtime and disappeared into the costmap.
At 0.05 m with inflation the costmap has destroyed ray order and object shape,
so a dock detector fitting lines to find a V plate cannot reconstruct what the
laser saw; two 0.2 m wings on that grid are one blob. A reinforcement-learning
local planner wants the raw scan for the same reason. Neither had a route to
it: ActionContext held only TF, and LocalPlanner::initialize takes only a
costmap.
The store keeps readings raw. Anything that wants filtering filters before
publishing here; the store does not know a filter exists. That split is
deliberate - a costmap wants outliers removed, a detector wants the true
shape, and a store deciding for both would be wrong for one of them.
Sharing is by shared_ptr to an immutable reading. Producers build a new one
and swap the pointer rather than writing in place, so a reader copies the
pointer under the mutex in tens of nanoseconds and then walks a thousand
ranges with nobody able to change them underneath. Two consumers reading one
topic share one copy rather than taking one each, which is what makes a
megabyte depth cloud affordable to share. A bare pointer into the store would
instead force every reader to hold the lock for the whole read, putting the
sensor input path behind however long a detector takes. The store keeps its
own mutex for the same reason: NavigationServer's already covers five kinds of
data, and readers running at control-loop rate do not belong in that queue.
Readers order on an arrival counter, not on the stamp. A stamp can go
backwards - host restart, a switch to simulated time, a replayed bag - and a
reader filtering on stamp then treats every later reading as old and freezes
for good, silently. The stamp is still kept, for TF lookups and for age, which
are different jobs. A consumer faster than its sensor gets null on the ticks
with nothing new rather than the same reading handed back to be counted twice.
The interface is type-erased because boost::dll-loaded plugins cross it. One
virtual per message type would mean a new virtual per sensor, reshuffling the
vtable and silently breaking every .so not rebuilt in the same pass - dlsym
plus reinterpret_cast catches none of that at compile time. So identity
travels as a string, payload as shared_ptr<const void>, and five virtuals
cover every message type that exists or will. The typed sugar is a header-only
template on the caller's side. typeid is avoided deliberately: comparing
type_index across a .so depends on visibility and on how the linker merges
typeinfo, and it fails quietly. Adding a message type is one line of a list
that generates both the trait and the YAML short-name table, so a type can
never be castable without being nameable, or the reverse.
A read with the wrong identity is refused and logged once, never cast.
static_pointer_cast to the wrong type reads garbage instead of crashing and
surfaces somewhere unrelated; that check is the only thing standing between
the erasure and it.
22 of the 24 robot_sensor_msgs types are registered. Imu and TimeReference are
not, because their headers do not compile here at all - Imu.h still carries
the unported ROS tail specialising ros::message_operations::Printer, and
TimeReference.h declares its field as ros::Time. Both are faults in
robot_sensor_msgs, and fixing them makes each one line here.
Config is refused at boot rather than at first use, and an undeclared topic is
dropped rather than added on the fly: an undeclared depth cloud would
otherwise cost megabytes a frame and the config would stop describing what the
process holds. A store with nothing declared stays silent - warning once per
topic about a feature nobody switched on is how a working system starts
printing errors after an upgrade.
SensorConsumer is the side channel for a local planner: widening
LocalPlanner::initialize would break every planner in the workspace at once
for the sake of the one that wants a scan, so a planner that wants sensor data
inherits this as well and the runtime finds out with a dynamic_cast.