Map 2D
PROLive robot map: occupancy grid, costmaps, lidar overlay, paths, and tap-and-hold nav goals, anchored via TF
When to reach for it
Map 2D is the robot's map on your phone: the occupancy grid, the robot and its trail, with optional costmaps, planned paths, a lidar overlay and the footprint, and nav goals you place by hand, without opening RViz. For a close-range obstacle view that needs no map or TF, use Laser Scan (Pro); for a numeric readout with no pan or zoom to manage, use Pose Display (Pro).
Worked example: TurtleBot 4 with Nav2
Defaults already match a stock Nav2 setup: Topic /odom for the trail, Occupancy Grid on from /map, and Goal Mode Action on /navigate_to_pose. Hold the map where the robot should go, drag to set the direction it should face, and release to send a NavigateToPose goal. Turn on Nav Paths and the planner's route on /plan draws over the map live; add /local_plan as Local Path Topic to see the local planner too.
Watch out for
- Odometry positions live at
pose.pose.position, notpose.position. A missing trail is almost always this field path. - In Goal Mode Topic, the goal is a plain
PoseStampedon/goal_pose, and E-Stop cannot cancel it: stop the robot with its own hardware E-Stop. Action mode sends a goal E-Stop can cancel. A blank Action Name or Nav Goal Topic turns goals off. - The view auto-recenters on every pose until you pan; a crosshair button then appears and auto-follow stays off until you tap it, which reads as the map fighting your pan.
- Pure odometry drifts. If the trail diverges from reality, point Topic at a SLAM-corrected pose like
/amcl_pose, or enable GPS Position Layer.
Configuration fields
A nav_msgs/msg/Odometry or geometry_msgs/msg/PoseWithCovarianceStamped topic, usually /odom. It drives the robot trail.
Message type of the trail topic. Usually auto-filled when you pick the topic.
Field path to the x/y position in the message (e.g. pose.pose.position).
Field path to the orientation quaternion, used to draw the robot heading.
The frame the map view is fixed to, like rviz's Fixed Frame. Auto picks map, then odom, and falls back to drawing topics in their own frames.
Draw the robot's map from an OccupancyGrid topic.
A nav_msgs/msg/OccupancyGrid topic, usually /map. Its _updates topic is read automatically.
Color scheme for map cells. Tinca follows your theme. Classic uses the same colors as rviz2, so maps look the way they do on your desktop.
Overlay a costmap on the map, colored with the standard rviz costmap palette.
A nav_msgs/msg/OccupancyGrid topic, like /global_costmap/costmap. Keepout and speed masks work too.
shown when Costmap 1 is on
Opacity of this overlay.
0.05 to 1, step 0.05Overlay a costmap on the map, colored with the standard rviz costmap palette.
A nav_msgs/msg/OccupancyGrid topic, like /global_costmap/costmap. Keepout and speed masks work too.
shown when Costmap 2 is on
Opacity of this overlay.
0.05 to 1, step 0.05Overlay planned paths from Path topics, such as Nav2 global and local plans.
A nav_msgs/msg/Path topic for the planned route, like /plan.
An optional second nav_msgs/msg/Path topic, like /local_plan. Leave blank to skip it.
Color of the planned path line.
Overlay lidar points on the map, placed in the world via TF.
A sensor_msgs/msg/LaserScan topic, usually /scan.
Draw the robot's footprint polygon outline.
A geometry_msgs/msg/PolygonStamped topic, like /local_costmap/published_footprint.
Overlay a second trail from GPS fixes, projected onto the map.
A sensor_msgs/msg/NavSatFix topic, like /gps/fix.
Color of the GPS trail.
How many GPS points the trail keeps before old ones drop off.
50 to 500, step 50Draw a fading trail of past robot positions.
Color of the robot position trail.
How many past positions the trail keeps before the oldest fade out.
50 to 1000, step 50Hold the map to place a goal, drag to set the direction the robot should face, and release to send. Action sends a NavigateToPose goal that E-Stop sends a cancel to. Topic publishes a PoseStamped, which E-Stop cannot cancel.
A nav2_msgs/action/NavigateToPose action, usually /navigate_to_pose.
A geometry_msgs/msg/PoseStamped topic, usually /goal_pose. Leave blank to turn goals off. E-Stop cannot cancel a topic goal, so stop the robot with its own hardware E-Stop.
Message type for nav goals, usually geometry_msgs/msg/PoseStamped.
Frame the goal is stamped in. Auto stamps the anchor frame, or map when no TF is available. An explicit frame is transformed at publish time.
Show a marker where you last sent a nav goal.
Draw the reference grid behind the map.
Size of one reference grid square, in meters. Real maps read their scale from the map data; this only affects the reference grid.
0.1 to 10, step 0.1Rotate the map with a two-finger twist. Snaps back to north when released close to north.
Drawing order of the map layers. The base map always stays at the bottom and the robot pose on top.