Skip to content

Files and Formats#

This page gives the input files, the output files and the coordinate frames of ACRES.

Coordinate Frames#

Source: Map/acres_map/acre.py, Map/acre_map.py.

The coordinate frames of ACRES: base_footprint, world ENU, Unreal world and survey grid on the left, the geodetic chain from EPSG:2968 through NAD83 to UTM zone 16N and WGS84 on the right, with the conversion constants. LOCAL FRAMES OF THE GAME AND ACRES CORE GEODETIC CHAIN OF THE SURVEY frame of the simulation datum of the survey frame that an interface reports base_footprint Forward, left, up; m. Rear-axle midpoint on the ground. pose in world: (x, y, z), yaw ψ from east compass heading H = 90° − ψ Unreal yaw = H − 90° = −ψ World ENU (frame world) x east, y north, z up; m. Origin: tile centre. Grid north. x = X / 100, y = −Y / 100, z = Z / 100 X = 100 x, Y = −100 y, Z = 100 z Unreal world X east, Y south, Z up; cm. Origin: tile centre. X = 100 (x0 + u s), Y = 100 (y0 + v s) x0 = y0 = −762.001524 m s = 1.524003048 m (5 ftUS) Survey grid u east, v south; cells. (0, 0): north-west corner. E = 2977500 + x / f, N = 1902500 + y / f H = 705 f + z (NAVD88 height, m) f = 1200 / 3937 m (US survey foot) EPSG:2968 NAD83(HARN) / Indiana West. E, N in US survey feet. transverse Mercator on GRS80 lat0 37.5°, lon0 −87.083333°, k0 0.999966667 false E 900000 m, false N 250000 m NAD83(HARN) latitude, longitude Tile centre: 40.47157654° N, 86.99437399° W. + (−7.742258e−9°, +2.4261007e−7°) h = H + N, N = −33.627 m at the centre (GEOID12B plane, sensors.json) NAD83(2011) latitude, longitude, height The frame of an RTK fix of the Polaris. Krüger series k0 0.9996, CM −87° false E 500000 m Helmert, 14 parameters, at the epoch UTM zone 16N Easting, northing; m. WGS84(G2139) Latitude, longitude. Affine map of the simulator control channel E = E0 + x cos α + y sin α N = N0 − x sin α + y cos α E0 = 500476.935 m, N0 = 4480099.755 m α = 0.05409°. Error: 0.39 m maximum on the tile.
The local frames of the game and of ACRES Core, and the geodetic chain of the survey. Open the diagram
Frame Definition
Survey cells u east, v south. One cell is 1.524003048 m (5 ftUS). Cell (500, 500) is the world origin at the tile center.
World metres X east, Y south: X = (u - 500) * 1.524003048. The physics frame of the game.
Unreal Centimetres: X_cm = 100 X, Y_cm = 100 Y. Z up.
ENU East, north, up about the tile center: east = X, north = -Y. Grid north, not true north. The Python tools and ACRES Core use ENU.
Projected grid EPSG:2968 (NAD83(HARN) / Indiana West, ftUS). The tile is easting 2975000 to 2980000 and northing 1900000 to 1905000. The origin is (2977500, 1902500).
Vehicle base_footprint: FLU (x forward, y left, z up), on the ground below the center of the rear axle.

Simulation Parameters#

The folder Game/Content/Simulation has the parameters that the game and ACRES Core read at the start of a session. A map variant has the same layout in Game/Content/SimulationMaps/<name>.

A setting can come from more than one place. The menu replaces the value of a file for one session. A command-line option or a Python argument replaces both. The game copies the files and the options of each session into the session folder. Thus you can run a session again.

Configuration flow: the menu reads its defaults from the shipped files, writes copies into the session folder and adds options to the command line. The models read the copies, the shipped files without a copy and the options for single values. The precedence is: agents file key, option for one value, sensor overlay, selected file, shipped file, default in the source code. SOURCES SESSION FOLDER READERS AT THE START Shipped files Acres/Content/Simulation tractor.json, sensors.json, environment.json, farm.json, ... Menu the edits of the user presets in Saved/Configs validation before the start Command line -EnvConfig= -VehicleConfig= -EnvHour= -Implement= ... -Agents=<file> 1 default values 3 adds options Session folder environment.json tractor.json sensors.json session-config.json field-setup.json copies with the menu values 2 writes copies Vehicle models tractor.json, polaris.json Implement model implements/<id>.json Sensor recorder sensors.json and overlay Environment environment.json Farm and fields farm.json, field-setup.json files without a copy: polaris.json, farm.json, implements, rigs 4 read 5 options select the files and change single values PRECEDENCE, HIGHEST FIRST 1 agents file key 2 option for one value 3 sensor overlay 4 selected file 5 shipped file 6 default in the code
The menu writes copies into the session folder. The models read the copies, the shipped files and the options. Open the diagram
File Content Option
tractor.json The Maxxum, the soil, the surfaces and the implement settings. -VehicleConfig=
polaris.json The Polaris and its drive-by-wire. Each fitted value has its provenance. -PolarisConfig=, -PolarisSet=
implements/*.json The eight implements of the Maxxum and their soils. -ImplementSet=
sensors.json The sensor suite of the session. -SensorConfig=
sensors_polaris.json The sensors of the Polaris, put on top of sensors.json. -PolarisSensorConfig=
environment.json The clock and the weather. -EnvConfig=
farm.json The crops, the harvester, the weather link and the hydrology of the farm.
soil_library.json The soil library.
named_places.json, npc_cars.json, grass_mask.json, road_mask.bin The places, the traffic cars, the grass and road masks.
ACRE/ The map products. -MapData=
rigs/ The rig maps of the vehicles and implements.

Map Products#

The folder Game/Content/Simulation/ACRE has the map of the farm. Map Pipeline gives the tools that make these files.

File Content
site.json The site: the origin, the frames, the grid and the roads.
fields.json, field_ids.u8, field-grid.json The fields of the tile and their raster.
surface_polygons.json The ground-surface layer: one polygon for each road, lot, yard, lane, lawn and verge. Each other place is field.
surfaces.u8, grass-lanes.u8, cover.u8 Rasters of the same layer.
heights.f32 The terrain heights of the tile.
soils.json, soil_units.u8 The soil units.
crops_2026.json, crop_patches.bin, crop_patches.json The crop of each field and the crop patches of the level.
places.json The named places and the spawn points.
vegetation.json, scene_identity.json The vegetation, and the identity of the scene.
DriveRegion/ The regional ground around the tile: region.bin, the regional fields and crops.
Scouting/scouting_map.json The scouting task: the field outlines and the scout loops with a class and a speed limit for each point. It also has the checkpoints, the entry points, the transit graph and the home pose H. Schema acres-scouting-map-2.
Scouting/ground_classes.u8 The ground class of each 0.5 m cell: crop, lane, verge, edge_band, obstacle, other.
Scouting/obstacles.json The collision geometry that a vehicle can hit, in ENU metres. Schema acres-obstacles-1.

The map hash identifies the map products. The planner refuses cost tables of a different map hash.

Configuration of the Vehicle Program#

The folder Config has the configuration of the run-time library, the vehicle node and the simulators. A change of a value changes the behavior of the vehicle. Test it in the simulators first.

File Content
scouting.json The scouting task: the vehicle, the map build (section map), the control and the actions.
control.json The default driver, the shield and the corridor.
trajectory.json The corridor and the limits of the trajectory checker.
envelope.json The speed envelope for each grip level.
scan_filter.json The scan filter of the LiDAR for the shield: the ground, the height band and the body mask.
first_test.json, reverse_test.json, kturn_test.json The limits of a vehicle run: the speed cap, the lateral acceleration cap, reverse.
path_objects.json The scenarios of other actors on the path of a mission.
map_variants.json, map_variants_digest.json The recipes of the map variants and their digest.
splits.json The fields of the train, validation and test splits.
scouting_reference.json A reference of the scouting missions.
schemas/ JSON schemas of the observation, the events, the clock and the skills.

Session Folder#

A session that the menu starts writes into Saved/Sessions/<YYYYMMDD-HHMMSS>-<mode>/ of the game project. A session from a command line writes into the folder of -VehicleOutput= (default Saved/Vehicle). A session with more than one agent has one folder for each agent.

File When Content
tractor.csv, session-summary.json -SessionLog One row for each physics step (120 Hz), and a summary at the end.
vehicle.csv -VehicleRecord or a test The vehicle record.
dbw.csv The Polaris with -SessionLog, -VehicleRecord or -DbwLog The drive-by-wire reports at 50 Hz.
sensors/episode-NNN/ -SensorRecord One folder for each sensor episode: <stream>.jsonl for each stream, the LiDAR scans, the camera images, episode.json and sensors-config.json.
farm-*.json, farm-*.csv The farm The farm configuration, events, fields, weather and state.
npc-events.csv Farm traffic The incidents with workers.

Conventions of the session files:

  • time_s of tractor.csv, vehicle.csv and dbw.csv is the physics time of the vehicle from its spawn. time_s of a sensor stream is the time from the start of the episode. simulation_time_s does not start again in a new episode.
  • sample_time_s is the sample time of a sensor, available_time_s adds the delay of the sensor, delivery_time_s is the time of the write.
  • The name of a column or a key ends with its unit (_m, _mps, _n, _kpa, _kw, _deg). An angle without _deg is in radians. heading_deg is clockwise from north. A positive curvature is a turn to the left.
  • ue_x_m points east and ue_y_m points south. quaternion_flu_to_enu_xyzw rotates a vector from FLU to ENU. tractor.csv gives NAD83(HARN) latitude and longitude, and the GNSS stream gives WGS84(G2139) and NAD83. altitude_navd88_m is a NAVD88 height.

The streams of a sensor episode are truth, actions, gnss, imu, ins, can, lidar, camera and camera_rear. The world quantities are in ENU. The sensor quantities are in the body frame FLU. The units are SI. The images are camera/front_<microseconds>.png.

The LiDAR scans are lidar/scan_<microseconds>.pcd (binary PCD with the fields x y z intensity). The number in a file name is the episode time.

The four kinds of recording: the session log, the sensor episodes, the episode log and the ROS 2 bag, each with its source, its rates and its file format. The render-later loop replays an episode log in the game to make the images and the scans. SOURCE RECORDING FILES Vehicle physics game, each vehicle, each physics step Session log -SessionLog vehicle state at 120 Hz, Polaris: drive-by-wire reports at 50 Hz tractor.csv dbw.csv session-summary.json text files in the session folder Sensor models game, each vehicle, with the renderer Sensor episodes -SensorRecord, key F6 camera, LiDAR and GNSS at 10 Hz, IMU, truth and actions at 120 Hz sensors/episode-NNN/ camera/*.png lidar/*.ply or *.pcd *.jsonl episode.json World state game or ACRES Core, all agents, the farm, the conditions Episode log -EpisodeLog=, request record states of all agents at 120 Hz, farm events, conditions at 1 Hz episode-NNNN.mcap one MCAP file, no images render-later: an episode replay (-EpisodeReplay=) moves the vehicles and the sensors record again ROS 2 bridge topics of the sensor stream, the vehicle bridge and the simulator control channel ROS 2 bag ros2 bag record -s mcap each topic at its rate, inside the DDS loopback fence <bag>/<bag>_0.mcap <bag>/metadata.yaml MCAP bag with ROS 2 messages
The session log, the sensor episodes, the episode log and the ROS 2 bag. Open the diagram

Episode Log#

The episode log is an MCAP file of ROS 2 messages (CDR). It has the state of each agent at the physics rate, the farm events, the conditions, the hardware shifts and the episode clock. The game and ACRES Core write the same format. The channels are on ROS 2 Topics.

Source: Game/Source/Acres/AcresEpisodeLog.h.

The flow of the episode log: the game and ACRES Core give agent states, farm contacts and session messages to the same episode writer, the writer puts the messages into the chunks of an MCAP file, and ROS 2 tools or an episode replay in the game read the file. SOURCES WRITER AND READER FILE AND TOOLS ACRES Core Core step agent states and farm stamps DBW commands that the vehicle received Game Physics thread the state of each agent after each physics step goes into a queue Farm farm stamps: tyre and body contacts farm events: crop, field work, ruts Session episode and agents: start and reset conditions: each second and on change shifts: start and on change Vehicles and farm in a replay each vehicle follows its logged state the farm repeats the stamps and the events no physics model runs Episode writer the same C++ file in the game and in ACRES Core ROS 2 messages as CDR time = simulation time game: at the end of each frame AcresEpisodeLog.cpp Episode log episode.mcap magic, header: profile ros2 schemas, channels, metadata chunk: 1 MiB of messages message indexes of the chunk more chunks and indexes summary: statistics, indexes footer with CRC, magic chunks ROS 2 and MCAP tools ros2 bag info ros2 bag play Python mcap, Foxglove Episode reader -EpisodeReplay= reads the file at the start all messages
The channels of an episode log and the programs that write and read it. Open the diagram

The file has one metadata record, the schemas of the messages, and one channel for each topic. The log time of a message is its physics time. Tools/SimControl/compare_episodes.py compares the agent trajectories of two logs, and Tests/Game/EpisodeLog/build.sh builds the tests of the writer. A log needs no ROS 2 installation to read (mcap_ros2.reader).

  • Record: -EpisodeLog=FILE.mcap, the operation record of the control channel, the service /acres/record, or Batch.start_log of acres_core.
  • Replay: -EpisodeReplay=FILE.mcap or the operation replay.

Replay File#

-ReplayFile= takes a CSV file, a tractor.csv of a session log, or the session folder that contains it. Source: Game/Source/Acres/AcresVehicle.cpp.

Quantity Column Names Unit Necessary
Time time_s, t s Yes. The time must increase.
Speed speed_mps, v_forward_mps, v m/s Yes. A negative value is reverse.
Curvature curvature_1pm, curvature_command_1pm, curvature_measured_1pm, kappa 1/m Yes. Positive is left.
Position east_m and north_m, or ue_x_m and ue_y_m m For -ReplayMode=path
Heading heading_deg deg No. Clockwise from north. It sets the start pose.
Implement implement, harvest No. 1 lowers the implement, 0 lifts it.
Gear gear No. A Maxxum gear from 1 to 16. 0 lets the replay select the gear.

The game ignores a row that is less than 0.05 s after the last row that it kept. It refuses a file with a speed above 20 m/s or a curvature above 1 1/m, and writes ACRES_REPLAY_REJECTED with the cause. A command replay has no position feedback. A path replay follows the positions with a pure-pursuit controller (look-ahead 2.5 m + 0.6 s x speed, at most 8 m). The game writes replay-tracking.csv and replay-summary.json into the session folder.

Drive Script#

-DriveScript= takes a JSON file of timed keys. The top level has keys (necessary), frame (spawn: metres forward and left of the spawn pose, or world: x east and y south), path, bales and windrow. A key has the time t and one or more fields. A field keeps its value until a later key sets it again.

Group Fields
Drive speed_kmh, pedal, hand_throttle, brake, park, gear, direction, steer (deg, or path), diff_lock
Implement raise, pto, transport, hitch_mode, depth_m, lever, draft_setpoint_kn, spray, meter, pickup, stabilizers, boom_fold, windrow_kg_m, mower_side, cut_height_m, wing_left and wing_right (down, raised, folded), tailgate (hold, auto), unload, cart_fill_kg_s
Loader and backhoe loader_lift, loader_curl, swing, boom, dipper, bucket, grab
View camera (yaw deg, pitch deg, distance m), camera_blend_s, cab, cab_look, view
Session exit

LiDAR Data Set#

The package acres_data writes one format for simulated and real scans. Source: Data/acres_data/format.py.

<root>/<set>/index.json                       the sequences: name, split, source, scans, layers
<root>/<set>/<sequence>/meta.json             source, identity, calibration, split, layers, counts
<root>/<set>/<sequence>/scans.npy             one row for each scan: time, pose, quality, motion
<root>/<set>/<sequence>/range-00000.npy       uint16 (scans, rings, columns): range / 0.0025 m, 0 for no return
<root>/<set>/<sequence>/intensity-00000.npy   uint8: the reflectivity byte of the sensor
<root>/<set>/<sequence>/body_mask.npy         bool (rings, columns): the cells that see the vehicle body
<root>/<set>/<sequence>/labels/...            layers

The root is the folder of ACRES_DATA, else ~/data/acres/lidar.

Recorded Reference#

The recorded reference is a record of the compiled command chain on a known commit. It has the inputs and the outputs of each unit in each control step. The tests of Tests/Runtime and the regression read it. It is not in Git. The default folder is Game/Saved/work/runtime-reference/ (ACRES_RUNTIME_REFERENCE). A test that needs it skips (exit code 77) when it is not there.

Each mission has its own batch of ACRES Core with one environment and one thread.

Set Missions Content
S 12 missions of the acceptance run on the validation fields (Config/splits.json) Each control step with all unit inputs and outputs, the planar scan and the state row of ACRES Core
F The missions of the acceptance run (default driver, condition set dry, grip level unknown) Each control step without the scan and the state row
R The single-field missions in the condition sets dry, wet and shift The summary, the trace and the path of each mission. The commands of 12 missions.

The acceptance run is the full command chain: the default driver, the launch hold, the shield and the gear logic. The missions of set R have the default driver and the gear logic.

Format#

The file manifest.json has the schema acres-runtime-reference-1:

Key Content
identity The map hash, the simulation version, the scan of the shield (shield_scan: planar or sweep) and the reference identity
commit The Git commit of the recorder
codes The numbers of the failures, skills, phases and event bits, and the scan materials that are not obstacles
sets For each set, the number of missions, control steps and bytes
files One entry for each binary file

An entry of files has the keys set, mission, condition, fields, steps, plan, summary, sha256, bytes, arrays and columns. arrays gives the type, the shape and the byte offset of each array. columns gives the column names of a two-dimensional array.

One binary file has the arrays of one mission, one after the other:

  • An array starts at a multiple of 64 bytes. The bytes between two arrays are zero.
  • An array is in C order, little endian.
  • The types are float64, float32, int64, int32, uint8 and bool.
  • A file has no time and no machine name. Two records of one mission and one identity are equal byte for byte.

The Python reader is Vehicle/Runtime/Reference/reference_format.py (Reference). The C++ reader is Tests/Runtime/harness.h (FReference).

from reference_format import Reference

ref = Reference("Game/Saved/work/runtime-reference")
f = ref.load("S/single-F56.bin")
f["state"].shape, f.entry["steps"], f.column("command", "ulc_mps")

Row t of each array of a control step is control step t. Set F has the arrays with "Yes" in the last column.

Array Shape Content F
pose (T, 4) x, y, yaw and forward speed before the step Yes
state (T, 49) The ACRES Core state row before the step No
state_after, wheels_after, energy_step, zone_step (T, 49), (T, 4, 13), (T, 24), (T, 6) The ACRES Core arrays after the step No
scan_raw, scan_material, scan_ranges, shield_scan (T, 360) The planar scan and its hit codes, the scan after the range limit, and the scan of the shield No
base_in, driver_before, driver_after, base (T, 4), (T, 5), (T, 5), (T, 3) The default driver: input, state before and after, and the base command Yes
projection_in, projection (T, 6), (T, 7) The tracker projection before the command Yes
gear_before, gear_after (T, 4) The state of the launch hold and of the gear logic Yes
shield_limits, obstacle_m, shield_out (T, 4), (T, 5), (T, 4) The class limits, the obstacle distances, and the shield output Yes
command, command_rows (T, 13), (T, 18) The command and the command row to ACRES Core Yes
tracker_in, tracker_out, coverage (T, 19), (T, 35), (T, fields) The tracker arguments, its state after the step, and the coverage of each field Yes
tracks, returned, scouted (T, legs, 3), (T, fields) The progress of each leg and the flags of each field No

A distance of obstacle_m that the chain did not measure is NaN. A distance with no return is inf.

Array of a Mission Content
path_xy, path_s, path_v_max, path_direction, path_cls, path_leg, path_ends The joined path
path_speeds, path_caps, path_limits, path_curvature, path_first The prepared products of the path
leg_first_point, leg_skill, leg_field, leg_uturns The legs. Leg k has the points leg_first_point[k] to leg_first_point[k + 1] - 1.
leg_xy, leg_s, leg_v_max, leg_direction, leg_cls, leg_corridor The points of the legs, with the corridor half widths
field_first_checkpoint, checkpoints_xy, home, bounds The map data of the tracker
covered_step The first control step that covered each checkpoint, or -1

A file of set R has trace (T, 9): the time, x, y, yaw, speed, leg, cross-track error, crop and gear changes. Twelve missions also have commands (T, 3): the curvature, the ULC velocity and the gear.

Record the Reference#

The program acres_runtime_record_reference (Vehicle/Runtime/Tools/record_reference.cpp) writes the record.

Vehicle/Runtime/Build/acres_runtime_record_reference --root . --out <folder> --threads 8 --commit $(git rev-parse HEAD)
Option Function
--sets S,F,R The sets to write. The default is each set.
--fields F56,F04 Only the missions of these fields
--tables <folder> Read the cost tables there. By default the program drives the tables into <folder>/costs.
--commit <text> The value of the key commit of the manifest

The program uses the plans and paths of acres_runtime_baseline_run. The program writes a mission of set S two times from one drive: with the scan in set S, and without it in set F. Two records of one tree are equal byte for byte, also with different numbers of threads.

Vehicle/Runtime/Reference/refresh.sh makes the record again after a change of the chain (Build and Test Commands). It is an optional user tool and takes about 5 hours. No test and no CI step runs it. The gate of a change is the short regression (ctest -L runtime -L e2e: the test baseline_regression, about 1 minute).

The script does these steps:

  1. It writes the next number into Vehicle/Runtime/Reference/sim_version.txt and builds the library with it.
  2. It records sets S, F and R into <reference>.new.
  3. It prints the change against the old record (Vehicle/Runtime/Reference/compare_reference.py).
  4. It drives a short baseline with the new cost tables and prints the regression against the old golden file.
  5. It makes the references of the vehicle node (Vehicle/ROS/acres_vehicle/scripts/node_reference.sh). The option --no-node skips this step.
  6. When a drive changed, it replaces the record and the golden file, and the cache gets the new cost tables. Else it writes the old number back and replaces nothing.
Line of the Report Effect
A DRIVE OR SENSOR INPUT CHANGED: the simulation version 1 becomes 2 The new number is in the cost tables, the record, the golden file and the library. Commit sim_version.txt and the golden file.
NO DRIVE CHANGED: the simulation version stays 1 Nothing is replaced. The cost tables and each data set stay valid.

After the refresh, commit the new golden file and the simulation version:

git add Tests/Runtime/baseline_golden.json Vehicle/Runtime/Reference/sim_version.txt
git commit

Warning

No hash of the sources protects a cost table or a data set. The regression test Tests/Runtime/baseline_regression.py is the guard. It fails when a drive changed and nobody ran the refresh.

Cost Tables#

The planner reads the cost tables of a condition set (dry, wet, shift). A file is <condition>.npz. The cache is Game/Saved/Costs/<map hash>/v<simulation version>/. python -m acres_fleet.tables drives them.