Map 2D
PROOdometry trail map with pan/zoom and tap-to-send nav goals
When to reach for it
Map 2D gives a visual sense of where the robot has been and a way to drop a goal without opening RViz. It draws a trail, not an occupancy grid or a raw scan: for the scan, use Laser Scan (Pro); for a numeric readout with no pan or zoom to manage, Pose Display (Pro) is lighter.
Worked example: TurtleBot 4 with Nav2
Defaults already match a stock Nav2 setup: Topic /odom, Position Field pose.pose.position, Nav Goal Topic /goal_pose publishing geometry_msgs/msg/PoseStamped, which Nav2's bt_navigator turns into a NavigateToPose goal. With Show Nav Path(Pro) on, the planner's route on /plan draws over the trail live.
Watch out for
- Odometry positions live at
pose.pose.position, notpose.position. A missing trail is almost always this field path. - Show Goal Marker, not Nav Goal Topic, gates tap-to-send. A blank topic still drops a marker and still tries to publish; it just has nowhere valid to go.
- 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 (Pro).
Configuration fields
The odometry or pose topic that drives the robot trail (e.g. /odom).
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.
Where tap-to-send nav goals are published (e.g. /goal_pose). Leave blank to disable tap-to-go.
Message type for nav goals, usually geometry_msgs/msg/PoseStamped.
Real-world size of one grid square, in meters. Sets the map zoom scale.
0.1 to 10, step 0.1How many past positions the trail keeps before the oldest fade out.
50 to 1000, step 50Overlay a planned path from a Path topic (e.g. a Nav2 plan).
The nav_msgs/msg/Path topic to draw as the planned route.
Color of the planned path line.
Overlay a second trail from GPS fixes, projected onto the map.
The sensor_msgs/msg/NavSatFix topic for the GPS trail.
Color of the GPS trail.
How many GPS points the trail keeps before old ones drop off.
50 to 500, step 50Draw the reference grid behind the map.
Show a marker where you last sent a nav goal.
Color of the robot position trail.