Skip to content

Map Commands#

This page describes the commands of the map pipeline and of the scene tools. Map Pipeline gives the sequence of the steps. Commands gives the conventions of the synopsis.

Run the commands of the package acres_map in the folder Map. Run the other scripts from the root of the repository. The packages of Map/requirements.txt are necessary.

acres_map.build_map#

Builds the map products of the scouting task for the 159 fields of the map (59 tile fields and 100 regional fields). It writes scouting_map.json and ground_classes.u8 to Game/Content/Simulation/ACRE/Scouting/.

cd Map && python -m acres_map.build_map [--fields LIST] [--out DIR] [--tile-only] [--allow-uncommitted]
--fields LIST
Field ids with commas. Default: all 159.
--out DIR
The output folder.
--tile-only
Only the 59 fields of the terrain tile, on the raster of the tile.
--allow-uncommitted
Builds from inputs that are not committed. Do not commit the products of such a build.

The build stops when an input has changes that are not committed. The parameters are in the section map of Config/scouting.json.

Caution

A new map has a new map hash. The planner then refuses the cost tables of the old map. Drive the cost tables again after a map change (python -m acres_fleet.tables).

cd Map && python -m acres_map.build_map --tile-only --out /tmp/scouting

acres_map.variants#

Makes the map variants of Config/map_variants.json from their seeds. A variant is one map folder with the layout of Game/Content/Simulation.

cd Map && python -m acres_map.variants [--config PATH] [--only LIST] [--out DIR] [--tile-only]
--config PATH
Default: Config/map_variants.json.
--only LIST
The names of the variants to make, with commas. Default: each variant.
--out DIR
The folder of the maps. Default: Game/Content/SimulationMaps.
--tile-only
Only the scouting products of the terrain tile (a test).

The edits of a recipe are merge, split, dead_end, remove_lane, move, one_gate and wet. A recipe also gives shares of harvested fields and crop swaps, and a shift of the planting days.

acres_map.digest#

Writes the digest of the maps. For each map, the digest has the identity, the structure numbers, the edits and the plans of the single-field missions. It also has the result of a sample of driven missions.

cd Map && python -m acres_map.digest --map NAME --out DIR [--sample N] [--threads N]
cd Map && python -m acres_map.digest --merge DIR [--config PATH]

The first form does one map in one process. The second form writes the digest file (Config/map_variants_digest.json).

acres_map.describe#

Writes the description of a map folder for a planner: the named places.

cd Map && python -m acres_map.describe DIR [--write]
--write
Writes named_places.json into the folder.

acres_map.obstacles#

Makes the obstacle layer: the collision geometry that a vehicle can hit, in ENU metres. It writes Game/Content/Simulation/ACRE/Scouting/obstacles.json.

cd Map && python -m acres_map.obstacles [--saved DIR] [--trees PATH] [--out PATH]
--saved DIR
The folder with structures_level.json. Default: Game/Saved.
--trees PATH
The tree dump. Default: the path in Map/Layers/tree_check.json.

check_runtime_data.py#

Refuses old road and scouting products. package.sh runs it before and after a package build.

python Map/check_runtime_data.py [--packaged]
--packaged
Also checks the data of the packaged game.

game_layer.py#

Writes the ground-surface layer of the tile as polygons (Game/Content/Simulation/ACRE/surface_polygons.json). It also writes the rasters that the game reads from the same polygons.

python Map/game_layer.py [--no-fields] [--no-verges]
--no-fields
Skips the new cut of fields.json and field_ids.u8.
--no-verges
Skips the measured road verges.

Tools/Level/rebuild_scene_and_map.sh#

Builds the Core scene and the scouting products again from a level export, applies them, and runs the route checks. Use it after a level edit and its editor export. It needs no Unreal and no GPU.

Tools/Level/rebuild_scene_and_map.sh [--staging DIR] [--level FILE] [--date YYYY-MM-DD] [--no-checks]
--staging DIR
The folder of the editor export: snapshot.json, structures_level.json and meshes/.
--level FILE
A level dump with the instance transforms, for the route checks.
--date YYYY-MM-DD
The date in the names of the result files. Default: today.
--no-checks
Builds and applies only.

Each input of the map must be committed. ACRES Core must be built (Game/Core/build.sh --no-tests).

Layer Tools#

These scripts make or check one layer of Map/Layers or one product. Most of them need local source data in Game/Raw/ACRE, which is not in the repository.

Command Function
python Map/fetch_sources.py Downloads the public sources of the lane layer into Game/Raw/ACRE and writes a manifest.
python Map/rasters.py [--only ortho\|naip\|lidar\|features] Puts each source on the tile grids.
python Map/lane_edits.py [--check] Applies the recorded edits of the lane layer to Map/Layers/lanes.geojson.
python Map/game_layer_fit.py [--no-textures] Puts the lot and building-pad polygons on the fitted meshes.
python Map/site_edits.py [--no-textures] [--no-fields] Site edits and smoothing of the ground layer.
python Map/user_roads_game.py Puts the drivable roads of Map/Layers/user_roads.json in the ground layer of the tile.
python Map/us52.py [--no-site] [--no-imaged] US 52 on its real line, for the surface layer, the road mesh and the traffic.
python Map/refresh_site_roads.py [--check] Replaces old site roads with centre lines from the surface layer.
python Map/game_textures.py [--size N] Makes the ground textures from surface_polygons.json (default size 16384).
python Map/game_textures_striped.py [--size N] [--rows N] The same with bounded memory.
python Map/field_edits.py measure\|yards\|evidence\|figure Field edits of the tile.
python Map/building_names.py [--apply\|--check] Checks or applies the one rule for the names of the buildings.
python Map/building_models.py Game models of the buildings and grain bins from the footprints and the LiDAR roofs.
python Map/fit_lots.py --geom DIR --pre-level PATH [--out PATH] Fits the parking-lot meshes onto the real lots.
python Map/fit_original_buildings.py --geom DIR --pre-level PATH --t15-level PATH [--out PATH] Fits the original building models into their footprints.
python Map/icsc_portico.py measure\|figure\|update --geom PATH Moves the ICSC portico onto the real entrance.
python Map/lot_furniture.py --geom DIR [--level PATH] [--out PATH] The furniture of the parking lots as a layer.
python Map/parked_cars.py [--share X] [--seed N] [--out PATH] The parked cars of the lots as a layer.
python Map/places.py Writes the named places of the tile as a data file.
python Map/geo.py [--session DIR] The georeference between the Polaris logs and the simulator.
python Map/expand_drive_region.py terrain\|imagery\|layers\|pack\|layout\|preview [--drive PATH] Builds the regional ground tiles around the tile.
python Map/regional_ground.py STAGE The ground surfaces of the regional ground.
python Map/regional_scene.py fetch\|canopy\|build\|validate\|preview\|shape-figures\|shape-evidence [OPTIONS] The inventory of what to place in the regional area.
python Map/regional_crops.py bake\|validate\|selftest [OPTIONS] Bakes the standing crops of the regional ground.
python Map/regional_field_products.py build\|validate [--fields PATH] [--out DIR] The field table and the field id raster of the regional fields.
python Map/regional_field_joins.py report\|apply\|validate Joins an odd regional field with a neighbour.
python Map/regional_surface_fields.py apply\|validate Makes the field soil of the regional surface layer.
python Map/regional_plot_lines.py detect\|validate The visible plot lines of the regional area.
python Map/regional_tracks.py measure\|apply\|validate [--features PATH] [--out PATH] The farm tracks between plots as lane surfaces.
python Map/regional_building_models.py build\|validate\|preview Models of the regional buildings.
python Map/regional_buildings_check.py [--state PATH] [--comparison PATH] [--report PATH] Checks the regional buildings.
python Map/regional_trees_check.py --state PATH [OPTIONS] Checks the regional trees of the saved level.
python Map/terrain_keep_out.py measure\|check\|validate [OPTIONS] The pits of the regional terrain as keep-out areas.
python Map/tree_check.py canopy\|check --dump PATH Checks the surveyed trees against recent imagery.
python Map/tree_trunk_colliders.py --level PATH [OPTIONS] Lists the trees of the level that have no trunk collider.
python Map/trees_off_surfaces.py [--level PATH] [--route-objects PATH] [--out PATH] Lists the trees that stand on or near a road or lane.
python Map/trees_near_fields.py --level PATH --map DIR [OPTIONS] Adds the far trees in or near a field to the list of removed trees.
python Map/drive_routes.py --out DIR [--fields LIST] [OPTIONS] Drives single-field missions in ACRES Core and measures the track against the objects of the level.
python Map/route_objects.py --out PATH [--fields LIST] [--margin-m X] [OPTIONS] Checks each mission path against the objects of the level.
python Map/path_edges.py --out PATH [--fields LIST] [--forward-only] [OPTIONS] Finds where a path is near the edge of its road or lane.
python Map/route_cases.py --edges PATH --objects PATH --expect flagged\|clear [OPTIONS] Checks the named places of a route against the route checks.
python Map/crop_picture.py --out DIR [--scouting DIR] [--step X] A picture of the crops and of the crop patches on roads and lanes.
python Map/drivable_picture.py --out DIR [--step X] [--route PATH] [--scouting DIR] Pictures of the drivable area.

Scene Tools#

These tools work with the Unreal level. Some of them run in the Unreal editor or in Blender.

Command Function
python Tools/Level/export_core_scene.py [--build-candidate] [--build-scouting] [--apply-candidate] [OPTIONS] Exports the editor scene and builds the Core scene and the scouting candidates.
python Tools/Level/compare_level_state.py BEFORE AFTER [OPTIONS] Compares two level dumps and fails on a change that was not asked for.
python Tools/Level/check_level_fixes.py BEFORE AFTER [--layers DIR] [--report PATH] Checks a changed level against the map layers.
python Tools/Level/export_level_crop_patches.py export\|validate Exports the crop patches of the level for ACRES Core.
python Tools/Level/bake_region_ground.py [--editor PATH] [--start N] [--count N] [--validate-only] [OPTIONS] Builds the regional ground assets with the Unreal commandlet.
python Tools/Unreal/mcp_client.py --tool NAME [--arguments JSON] [OPTIONS] A client of the local Unreal MCP server.
blender -b --python Tools/Assets/Structures/acre_footprint_buildings.py Buildings and grain bins from the footprints, in Blender.
python Tools/Assets/Vehicles/export_rig_map.py Exports the rigs of the vehicles and implements as rig maps.
blender -b --python Game/Raw/farm-equipment/scripts/validate_equipment.py Checks the saved implement assets in Blender.