A site floor plan in metres, drawn in SVG with no map library: a ROS occupancy grid and costmap as the floor, laser scans, zones as outlines with icon and name, planned and travelled routes, robots as status shapes with heading and name, selection, pan and zoom by drag, wheel, pinch, buttons and keys, a scale bar and an optional north arrow; goal, waypoint and zone editing by pointer and keys; RobotMapList shows the same robots as text.
North site
Arrow keys move the map, plus and minus zoom, 0 shows the whole site. The robot list beside the map has the same robots as text. 4 robots.
Robot map site
npx shadcn add @syncrobotic/robot-map Also installs: lucide-react, @syncrobotic/cn, @syncrobotic/status-glyph, @syncrobotic/skeleton, @syncrobotic/button, @syncrobotic/button-group, @syncrobotic/robot-icons
Overview
A site's floor plan in metres with its zones, routes and robots, panned and zoomed in place, and a list with the same robots as text.
When to use
- Where the fleet is on a site right now: the map page of a fleet console, a robot's detail beside its position.
- A mission's route over the floor: planned (dashed) and travelled (solid).
- Zones people must know about: no entry, slow, charging.
Use something else
- Robots across many sites, or outdoors on GPS: a map library with tiles.
- Time spent per zone: a heatmap (
heatmap-zones). - A camera picture with boxes: Annotated image.
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Arrow keys move the map, plus and minus zoom, 0 shows the whole site. The robot list beside the map has the same robots as text. 4 robots. Selected: AMR-07, On mission. North is 30° clockwise from the top.
Robot map selected
Arrow keys move the map, plus and minus zoom, 0 shows the whole site. The robot list beside the map has the same robots as text. No robots on this site right now..
No robots on this site right now.
No robots on this site right now.
Robot map empty
Loading the map
Loading the map
Robot map loading
The map of North site could not be loaded. The fleet server did not answer.
Robot positions could not be loaded.
Robot map error
North site, as mapped
Arrow keys move the map, plus and minus zoom, 0 shows the whole site. The robot list beside the map has the same robots as text. 3 robots.
Robot map occupancy grid
North site, as mapped
Arrow keys move the map, plus and minus zoom, 0 shows the whole site. The robot list beside the map has the same robots as text. 3 robots.
Costlowlethal
Robot map costmap
Arrow keys move the map, plus and minus zoom, 0 shows the whole site. The robot list beside the map has the same robots as text. 3 robots.
Robot map laser scans
Arrow keys move the map, plus and minus zoom, 0 shows the whole site. The robot list beside the map has the same robots as text. 4 robots. Press to place the goal, drag to point it. Esc cancels.. Arrow keys move the crosshair, Shift for bigger steps; Enter or Space places, Esc cancels. Right-drag or two fingers move the map..
Press to place the goal, drag to point it. Esc cancels.Right-drag or two fingers move the map.
Goal for AMR-07: 52.0, 31.0 m, facing 90°
Robot map goal mode
Arrow keys move the map, plus and minus zoom, 0 shows the whole site. The robot list beside the map has the same robots as text. 4 robots. Click to add a waypoint, drag one to move it. Delete removes the selected one.. Arrow keys move the crosshair, Shift for bigger steps; Enter or Space places, Esc cancels. Right-drag or two fingers move the map..
Click to add a waypoint, drag one to move it. Delete removes the selected one.Right-drag or two fingers move the map.
4 waypoints, not sent.
Robot map waypoints mode
Arrow keys move the map, plus and minus zoom, 0 shows the whole site. The robot list beside the map has the same robots as text. 4 robots. Click to place a new zone's first corner.. Arrow keys move the crosshair, Shift for bigger steps; Enter or Space places, Esc cancels. Right-drag or two fingers move the map..
Click to place a new zone's first corner.Right-drag or two fingers move the map.
3 zones on this site.
Robot map zone drawing
Arrow keys move the map, plus and minus zoom, 0 shows the whole site. The robot list beside the map has the same robots as text. 4 robots. Click to start a new zone, or drag a corner to move it.. Arrow keys move the crosshair, Shift for bigger steps; Enter or Space places, Esc cancels. Right-drag or two fingers move the map..
Click to start a new zone, or drag a corner to move it.Right-drag or two fingers move the map.
3 zones on this site.
Robot map editable zones
Usage rules
- Offer RobotMapList beside every RobotMap, as a chart offers its table: a Map / List switch, the two side by side on a wide screen, or a Robots sheet over a full-screen map. The map is one Tab stop; the list is where each robot is reached by keyboard and screen reader.
lint:rulesasks for it in a block. - Each layer keeps one job (Data visualisation, Maps and robot tracks): the floor and grid grey, zones as hairline outlines with an icon and a name and never a fill, the route being driven dashed blue (the one blue on the map), the track travelled solid grey.
- Robots are their status shape and name, as in every list; colour and the status word only for a robot that needs someone. Selection is a ring in the focus ring's ink and a bold name, never colour alone.
- Coordinates are metres from the plan's top-left corner, x to the right and y down, as the plan image is drawn. Convert from your map frame (ROS: y up, origin anywhere) before passing them.
- Bottom left holds zoom and the scale bar, so the emergency stop keeps the bottom right. Show the north arrow (
northDeg) only when the plan is not drawn north up and people need it. - No robots is said on the map, with the plan still shown; loading keeps the frame's size; an error says what failed and offers to reload.
- An occupancy grid is the floor, in greys: free is the surface, occupied the ink, unknown the no-data hatch, never a colour that means a state. A costmap is the accent's ramp under the walls, with its legend in words.
- Laser scans are small dots in a neutral ink (the accent over a grid), never a status colour; they show what a robot sees, so a scan beside the walls says its localisation has drifted.
- Editing (
mode) is controlled: the app keeps the goal, waypoints and zones and the map reports changes. One rule for panning while editing: the primary pointer edits, the right or middle button and two fingers pan. Every edit has its keys (a crosshair, Enter, Esc, Delete) and is said in words. - A route still being drawn is grey; only the route a robot is driving is blue (
waypointsPlanned). - Up to a few hundred robots and zones: everything is redrawn on each pan. A city-scale map, tiles or GPS belong to a map library.
Changelog
- 0.24.12026-11-21Fixes for live data and editing. A plan whose size arrives after the first render (a
gridloaded later) is fitted again, unless someone has already panned or zoomed. A cancelled drag of a waypoint or zone corner (Esc, a second finger, pointercancel) sends the original back through onWaypointsChange / onZonesChange and says "Move cancelled". The selected or carried waypoint is followed by its value, so when the app changes the list (drops waypoint 1 as the robot reaches it) Delete and Esc act on that waypoint, or on none if it is gone. A fast costmap now shows: one encode at a time, the one in flight finishes and only updates between are skipped. With a floorplan the costmap is drawn over it. The keyboard crosshair's position (and a turning goal's heading) is announced once the arrows rest for 400 ms. Smaller: snap at a plan edge off the snap grid stays on the grid, the crosshair is drawn snapped where Enter places it, a new mode starts the crosshair at the centre, Enter during a pointer press sets the goal once, and a removed grid frees its image at once. Public API unchanged. - 0.24.02026-11-21Layers from ROS and editing.
griddraws a nav_msgs/OccupancyGrid as the floor (free the map surface, occupied a muted grey at its probability, unknown the no-data hatch), rasterised once per new data array; with no width and height the grid is the plan.costmaplays the accent's ramp over it with a legend in words.scansdraws sensor_msgs/LaserScans as small neutral dots from each robot's pose, one path per scan, skipping invalid readings.mode(view, goal, waypoints, zone) places a goal and points it, adds, moves and removes numbered waypoints (grey, blue only with waypointsPlanned) and draws zones corner by corner (editableZonesdrags existing corners), all controlled, with optionalsnap. The primary pointer edits and the right or middle button or two fingers pan; a keyboard crosshair, Enter, Esc and Delete do the same, a banner says what a click does, and each edit is announced. New helpersgridToPlan,rosToPlan,rasteriseGridandscanToPoints. - 0.23.22026-11-21Compiles with noUncheckedIndexedAccess, as strict products build it; behaviour unchanged.