mirror of
https://github.com/pollen-robotics/microduck.git
synced 2026-12-03 11:00:02 +08:00
mapd subscribes to robot.state and tof.frame like any client, feeds the maploc mapper on its own thread, keeps the map in /var/lib/mapd/map.json across reboots, and answers map.status, map.stream, map.grid and map.wipe on /run/mapd/map.sock. It commands nothing: the robot walks without it, and the head moves by robotd's own idle glances. The map file is replaced atomically, saved every autosave_s, when the pose has moved 30 cm and on shutdown; a file it cannot read is set aside as map.json.bad-<secs>, never overwritten. [map] in robotd.toml (on by default); robotctl map / map show / map wipe; routed over WebRTC by mediad, refused over BLE. Packaged in both release workflows and dev-push, named in install.sh, configd's unit list and updater.toml. docs/design/mapping-design.md owns the mechanism. Checked end to end against a recorded living-room session served over real sockets: same 21 stops as the offline replay, saved on SIGTERM, and after a restart relocalized within four stops onto the first run's nodes (2-3 cm). Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
10 lines
412 B
Plaintext
10 lines
412 B
Plaintext
# Creates the `mapd` system user and group.
|
|
#
|
|
# Install to /usr/lib/sysusers.d/mapd.conf; systemd-sysusers creates them at boot, or run
|
|
# `systemd-sysusers` once by hand.
|
|
#
|
|
# `mapd` needs nothing privileged: it reads two sockets as a member of `robot` (granted in
|
|
# mapd.service) and writes its own state directory. mapd.service will fail to start if this user
|
|
# does not exist.
|
|
u mapd - "Robot onboard map" - -
|