NEORACER DOCS
These docs are public and open source.Edit on GitHub

BUILD A MAP

Drive the car slowly around a room and turns the LiDAR sweeps and wheel odometry into a 2D occupancy grid. Three backends ship on the car: pick one, watch the map form in , then save it for navigation.

slam_toolboxgmappingCartographer0.05 m/pixel grid

WHAT HAS TO BE RUNNING

Mapping is an activity, not a service. It runs in the foreground on top of two things that have to be up first, and racecar mapping warns you if either is missing.

  • The driver. It publishes /scan and /odom, which is what SLAM consumes. It starts at boot, so this is usually already true. Leave it running; do not stop the services.
  • The autonomy base. The transform tree comes from here. It is not a service yet, so start it in a terminal of its own and leave it there. See File system.
  • A bounded indoor space with walls the LiDAR can see. Glass and mirrors read as gaps, so keep them out of the run.
  • The transmitter in your hands, SWB up (manual). You drive; SLAM only watches.
bash
# terminal 1: the autonomy base. Leave this running. bash ~/ros2_ws/src/neoracer_ros2_driver/scripts/launch_autonomy.sh

START MAPPING

One command, in a second terminal. It runs in the foreground until you Ctrl-C it. With no backend named you get slam_toolbox.

bash
# terminal 2: the mapper. Ctrl-C when the map is complete. racecar mapping # slam_toolbox, the default racecar mapping gmapping racecar mapping cartographer
BackendGood for
slam_toolboxThe default. Solid pose-graph SLAM, easy to resume and refine.
gmappingClassic particle-filter SLAM. Light and familiar.
cartographerLoop-closure heavy, good on larger or repetitive spaces.

WATCH IT IN RVIZ

A third terminal opens the vendor's pre-configured mapping view, fixed frame already set to map. As you drive, the occupancy grid fills in around the car.

bash
# terminal 3: the view racecar mapping rviz racecar mapping rviz cartographer # Cartographer has its own debug view
01

The grid

Free space, walls, unknown.
Occupied cells trace the walls the LiDAR has seen; clear cells are open floor; grey is still unknown. Resolution is 0.05 m per pixel.
02

The scan

Live LaserScan over the map.
The current LiDAR return overlays the grid, so you can see the match between what the car sees now and what it has mapped.
03

The path

Where the car has been.
The odometry path and robot model show the trajectory. Slow, overlapping passes give the scan matcher the most to lock onto.

SAVE THE MAP

With the mapper still running and the space covered, save from another terminal. The same command works whichever backend you used. Name the map and that name is what you drive later.

bash
racecar mapping save lab # -> lab.pgm + lab.yaml racecar mapping save # no name given: saves as "map"

You get an image and a metadata file in the vendor workspace, at ~/osracer_ws/src/osracer/osracer_slam/maps/. That pair is what Nav2 loads, and the save prints the exact command to drive it.