Map 2D

PRO
DISPLAY · 18 FIELDS · 4×3 DEFAULT

Odometry 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, not pose.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

Topictopic

The odometry or pose topic that drives the robot trail (e.g. /odom).

Message Typestring

Message type of the trail topic. Usually auto-filled when you pick the topic.

Position Fieldfield-path

Field path to the x/y position in the message (e.g. pose.pose.position).

Orientation Fieldfield-path

Field path to the orientation quaternion, used to draw the robot heading.

Nav Goal Topictopic

Where tap-to-send nav goals are published (e.g. /goal_pose). Leave blank to disable tap-to-go.

Goal Message Typestring

Message type for nav goals, usually geometry_msgs/msg/PoseStamped.

Meters per Grid Cellslider

Real-world size of one grid square, in meters. Sets the map zoom scale.

0.1 to 10, step 0.1
Max Trail Pointsslider

How many past positions the trail keeps before the oldest fade out.

50 to 1000, step 50
Show Nav PathPROboolean

Overlay a planned path from a Path topic (e.g. a Nav2 plan).

Path TopicPROtopic

The nav_msgs/msg/Path topic to draw as the planned route.

Path ColorPROselect

Color of the planned path line.

GreenBlueGoldRed
GPS Position LayerPROboolean

Overlay a second trail from GPS fixes, projected onto the map.

GPS TopicPROtopic

The sensor_msgs/msg/NavSatFix topic for the GPS trail.

GPS Trail ColorPROselect

Color of the GPS trail.

BlueGreenGoldRed
GPS Max Trail PointsPROslider

How many GPS points the trail keeps before old ones drop off.

50 to 500, step 50
Show Gridboolean

Draw the reference grid behind the map.

Show Goal Markerboolean

Show a marker where you last sent a nav goal.

Trail Colorselect

Color of the robot position trail.

GoldGreenRedBlue