Skip to content

Map Pipeline#

The map is a surveyed model of the Purdue ACRE farm. It has the terrain tile (59 fields) and the regional ground around it (100 fields, RF001 to RF100). The map pipeline turns public survey data into the layers of Map/Layers and then into the map products that the simulators read.

The folder Map/ has the tools and the package acres_map. Map Commands gives each command. Files and Formats gives the products.

The Tile#

The tile is one 5000 ftUS tile of the IndianaMap grid EPSG:2968: easting 2975000 to 2980000 ftUS and northing 1900000 to 1905000 ftUS. Its center (2977500, 1902500) is the origin of the world. The terrain heights are the USGS 3DEP LiDAR tile on the 5 ftUS grid. Source: Map/acre_map.py, Results/Map/lanes_validation.md.

The Steps#

public sources --> Game/Raw/ACRE (local) --> Map/Layers --> Game/Content/Simulation/ACRE --> Scouting products
                                                         \--> the Unreal level --> Core scene and obstacles --/
Step Tools Output
1. Get the sources Map/fetch_sources.py, Map/rasters.py The orthophotos, the NAIP stacks and the LiDAR rasters on the tile grids, in Game/Raw/ACRE. This folder is local and not in the repository.
2. Make the layers Map/lane_edits.py, Map/field_edits.py, Map/us52.py, the regional_*.py tools and the other layer tools The vector layers in Map/Layers: lanes, roads, buildings, trees, the regional fields and surfaces. Do not edit a layer by hand.
3. Make the ground layer Map/game_layer.py, Map/game_layer_fit.py, Map/site_edits.py, Map/user_roads_game.py, Map/game_textures.py surface_polygons.json, the rasters surfaces.u8, grass-lanes.u8 and cover.u8, the fields (fields.json, field_ids.u8, field-grid.json) and the ground textures.
4. Place the level The Unreal editor, Tools/Level/*.py The level ACRE with the buildings, the trees and the crops.
5. Export the scene Tools/Level/export_core_scene.py, Game/Core/Scripts/build_scene.py, python -m acres_map.obstacles Game/Core/Data/acre_scene.json and Scouting/obstacles.json.
6. Build the scouting products python -m acres_map.build_map Scouting/scouting_map.json and Scouting/ground_classes.u8.
7. Make the variants python -m acres_map.variants, python -m acres_map.digest The map variants in Game/Content/SimulationMaps and Config/map_variants_digest.json.
8. Check Tests/Map, Map/check_runtime_data.py, Map/route_objects.py, Map/path_edges.py, Map/drive_routes.py The checks of the products and of the mission paths.
9. Drive the cost tables python -m acres_fleet.tables The cost tables of the new map hash.

Tools/Level/rebuild_scene_and_map.sh does steps 5, 6 and 8 in one command after a level export.

The Ground Layer#

Source: Game/Source/Acres/AcresSurfaceMap.h, Map/game_layer.py.

The ground layer is a list of polygons. Each polygon has a class and a priority. A point that no polygon contains is field.

Class Priority
asphalt 60
concrete 55
gravel 40
dirt 30
grass_lane 20
grass 10
field The background

The lookup rule: take the polygons that contain the point (even-odd rule, holes excluded). The highest priority wins. On equal priority, the later polygon in the file wins. The game, ACRES Core and the rasterizer of game_layer.py use the same rule. Thus the textures and the physics agree. Source of the priorities: Results/Map/game_layer.md.

The Scene#

The level ACRE of the game and the scene of ACRES Core have the same objects. Tools/Level/export_core_scene.py writes the scene of ACRES Core (Game/Core/Data/acre_scene.json). A change of the level or of its meshes needs a new export. Validation Results gives the errors against the real farm.

Part Content
Terrain heights.f32: one height for each of the 1001 x 1001 nodes of the survey grid, with two triangles for each cell. The wheels trace against one collision mesh with the same triangles. -TerrainVerify compares the mesh with the file at 441 points. It fails at an error of 1 cm. The brush of the menu tab Fields changes the ground of one field by at most ±1 m. The session folder keeps the change as terrain-edits.f32.
Fields The fields F01 to F59 of fields.json, 126.5 ha. crops_2026.json plants 28 fields with corn and 19 fields with soybean. It leaves 12 fields with no crop.
Buildings and bins 41 buildings and 26 grain bins on measured footprints (Results/Map/buildings_check.json). The identifiers are B000 to B088 on the tile and RB001 to RB200 on the regional ground. Only B055 (ICSC) and B064 (Beck's Ag Center) have a name. Results/Map/building_names.json gives the earlier names. The buildings south of US 52 are not in the level.
Trees Each tree has a trunk collider. ACRES Core uses analytic crowns. The 17 conifers of the ICSC parking row are Norway spruces of 5.4 m. The species and the height are assumptions.
Entrance avenue 21 American elms along the drive from US 52 to the Beck center. The tree positions are not surveyed. The trees have no branch below 4.37 m. This value is an assumption from the common US clearance of 4.3 m (14 ft) over a road. Tools/Level/check_entrance_drive.py checks that the middle 3 m of the drive is clear to 4 m above the ground in ACRES Core.
Lot furniture and parked cars The wheel stops and the light poles have hidden collision shapes (Map/Layers/lot_furniture.json). 42 parked cars stand in the three parking lots (Map/Layers/parked_cars.json).
Boundary fence A fence 4.0 m inside the edge of the regional ground. 468 hidden collision boxes stop a vehicle (Map/Layers/boundary_fence.json).
Named places places.json. A session without a pose starts at spawn-icsc-garage. -SpawnAt= selects a different place. Do not change the identifiers and the names of the spawn places and of the parking lots. Code uses them as keys.

The Scouting Products#

python -m acres_map.build_map makes, for each field, a scout loop around the field, the checkpoints, the entry points and the transit graph to the home pose H. The parameters are in the section map of Config/scouting.json. Source: Map/acres_map/build_map.py.

How the builder makes a loop:

  1. It simplifies the outer ring of the field with a tolerance of 0.5 m. It closes gaps narrower than the turning circle (2R = 15 m).
  2. At each sample of 1 m, it finds an outward offset from 1.0 m to 2.5 m. At this offset, the vehicle is on a lane or a verge. The offset keeps the body off the crop and the vehicle away from obstacles. Where no such offset exists, the loop goes on the edge band, 1.0 m inside the field.
  3. It smooths the offset profile so that each change has a curvature of 1/R.
  4. It closes and opens the region inside the offset line with a disc of radius R = 7.5 m. Thus the boundary turns no tighter than 0.133 1/m.
  5. It traces the boundary and resamples it each metre, anticlockwise from its northernmost point.

Tests/Map/test_scouting_map.py checks the products.

Map Variants#

A variant is one map folder with the layout of Game/Content/Simulation. The site outline, the heights, the buildings, the trees and the regional ground are those of the default map. A recipe of Config/map_variants.json gives the count of each edit: merge, split, dead_end, remove_lane, move, one_gate and wet. There are seven variants: acre-merged, acre-split, acre-detour, acre-deadend, acre-mixed, acre-sparse and acre-maze.

python -m acres_map.variants makes each variant from a seed and a recipe. The edits are merge, split, dead_end, remove_lane, move, one_gate, the crops and wet patches. A draw that breaks a rule of a valid site is rejected, and the generator draws again. Each changed field is one polygon of 0.4 ha or more. A new lane is 5.99 m wide.

The tile has 59 fields at most. Each field has an entry point and a path from the home pose. One seed gives one folder. The build of one variant uses 7.2 GB of memory.

The map hash is the first 16 hexadecimal digits of a SHA-256 of the scouting map and of the files that a drive reads (DriveFiles in Vehicle/Runtime/Source/identity.cpp, with ACRE/crops_<season>.json). Thus a change of the heights, the crops or the soil makes a new hash, and old cost tables are not used. A variant has no level crop patches, and the terrain, the pavement and the trees of the game picture stay those of the level.

Select a variant:

  • The game: -MapData=acre-mixed.
  • acres_fleet: ACRES_MAP=acre-mixed, or acres_fleet.maps.use("acre-mixed").
  • core_sim: --content Game/Content/SimulationMaps/acre-mixed.

Limits#

  • Most source data in Game/Raw/ACRE is local. A clone cannot run steps 1 and 2 without it.
  • A change of site.json, of the level, of a layer or of the route code makes the products old. Map/check_runtime_data.py refuses old products.
  • A new map gets a new map hash. The planner then refuses the cost tables of the old map.
  • The lane network is as the survey recorded it.