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.
| 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.
| 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_softractor.csv,vehicle.csvanddbw.csvis the physics time of the vehicle from its spawn.time_sof a sensor stream is the time from the start of the episode.simulation_time_sdoes not start again in a new episode.sample_time_sis the sample time of a sensor,available_time_sadds the delay of the sensor,delivery_time_sis 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_degis in radians.heading_degis clockwise from north. A positive curvature is a turn to the left. ue_x_mpoints east andue_y_mpoints south.quaternion_flu_to_enu_xyzwrotates a vector from FLU to ENU.tractor.csvgives NAD83(HARN) latitude and longitude, and the GNSS stream gives WGS84(G2139) and NAD83.altitude_navd88_mis 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.
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 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 operationrecordof the control channel, the service/acres/record, orBatch.start_logofacres_core. - Replay:
-EpisodeReplay=FILE.mcapor the operationreplay.
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,uint8andbool. - 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:
- It writes the next number into
Vehicle/Runtime/Reference/sim_version.txtand builds the library with it. - It records sets S, F and R into
<reference>.new. - It prints the change against the old record (
Vehicle/Runtime/Reference/compare_reference.py). - It drives a short baseline with the new cost tables and prints the regression against the old golden file.
- It makes the references of the vehicle node (
Vehicle/ROS/acres_vehicle/scripts/node_reference.sh). The option--no-nodeskips this step. - 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:
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.