Set Soil and Weather#
This procedure sets the date, the weather, the rain and the soil of a session, and replays the weather of a real day. The last section shows the soil-and-weather study as an example with its measured results.
Before You Start#
- Build the packaged game. See Run the Packaged Game.
- Do all commands in the repository root.
- Make sure that no other game runs. Two games can use all the memory of the GPU.
- The commands use
-RenderOffscreen. Remove this option to see the game in a window.
Each session writes its results into the folder of -VehicleOutput=. The game log is Packaged/Linux/Acres/Saved/Logs/Acres.log.
Weather, Soil Water and Crops and Ground Classes give the models.
Make a Drive Script#
The sessions of this procedure do not need a driver. A drive script holds the Maxxum and stops the game.
-
Create the file
stand.jsonwith this content.{"frame": "spawn", "path": [[0, 0], [100, 0]], "keys": [{"t": 0, "gear": 8, "speed_kmh": 0, "brake": 1, "raise": true}, {"t": 60, "exit": true}]}Expected Result
A session with
-DriveScript=stops after 60 s of simulation time.
Set the Date, the Time and the Weather#
-
Start a session with a date, a start hour and weather options.
-
Find the start state of the weather in the game log.
-
Read the weather columns of the session log.
The table shows the same settings in the menu.
| Option | Menu Tab | Menu Setting |
|---|---|---|
-EnvDate= |
Additional | Year, Month, Day |
-EnvHour= |
Additional | Start Time |
-EnvMinute= |
Additional | Real Seconds per Game Hour (60 times the value of the option) |
-EnvLowC=, -EnvHighC= |
Weather | Daily Low, Daily High |
-EnvWind=, -EnvWindFrom= |
Weather | Mean Wind Speed (in km/h), Wind Direction |
-EnvClouds= |
Weather | Clouds |
-EnvFog= |
Weather | Fog, Visibility |
-EnvRain= |
Weather | Rain, Start Hour, End Hour, Rain Amount |
-EnvSeed= |
Additional | Weather Seed |
Note
The game ignores an option with a value that is out of range. It writes a line Ignoring -<option> into the game log.
Schedule Rain#
The option -EnvRain=start,end,total schedules one rain event. The times are hours of the start day. The total is in mm.
The option -EnvMinute=1 makes the weather and the soil water 60 times faster. The vehicle physics stays at real time.
-
Start a session on field F21 with a storm of 16.8 mm from 17:30 to 18:00.
-
Read the row of field F21 in the field report.
-
Read the summary of the water grid.
Expected Result
mean_rain_mis 0.0169 andmean_infiltrated_mis 0.0136.max_pond_mis 0.406 in the lowest point of the tile. 17 145 cells have more than 5 mm of water.total_residual_mis 2.9e-18.
In this session the rain rate in tractor.csv has a peak of 96 mm/h at 17:41. The integral of the rate is 16.80 mm.
Below the wheels, the soil wetness goes to 1.0 in the first 10 s of the storm. The water in the ruts is 14 mm deep at 17:54.
To start a session with wet soil, set the rain before the start in the environment file: rain.prior_mm and rain.prior_hours.
The menu settings are Earlier Rain and Earlier Rain Duration.
Set the Soil and the Wetness of Each Field#
A field setup changes single fields. The menu writes it from the tab Fields. You can also write the file.
-
Create the file
Fields/demo/field-setup.json.{ "schema": "acres-field-setup-1", "fields": [ {"field": 21, "crop": "empty", "soil": "loamy_sand", "wetness": 0.58}, {"field": 22, "soil": "ssurgo", "wetness": 1.3}, {"field": 25, "crop": "potato", "soil": "clay", "wetness": 1.0} ] }The wetness 0 is the wilting point, 1 is the field capacity and 2 is saturation. The key
cropchanges only a field that the crop season plants. -
Start a session with the field setup, a global wetness and the crop stage of the date.
Packaged/Linux/Acres.sh -VehicleDemo -RenderOffscreen -SessionLog \ -DriveScript="$PWD/stand.json" -VehicleOutput="$PWD/Sessions/fields" \ -VehicleSpawnU=480 -VehicleSpawnV=405 -VehicleSpawnYaw=-90 \ -FieldSetup="$PWD/Fields/demo" -FarmInitialTheta=0.3 \ -CropSeason=2026 -CropStage=date -EnvDate=2026-07-01 -
Find the soil and the crop lines in the game log.
Expected Result
Each planted field has its crop and its growth fraction on 1 July. Field F21 is not in the list, because its crop isACRES_FIELD_SOIL F21 loamy_sand Ks=150.0 sealed=61.1 mm/h theta s/fc/wp=0.437/0.125/0.055 ACRES_FIELD_SOIL F25 clay Ks=4.0 sealed=0.6 mm/h theta s/fc/wp=0.475/0.396/0.272 ACRES_CROP_SEASON_PLANTED season=2026 stage=date date=2026-07-01 culled=7677 F01:soybean:0.35 F02:soybean:0.03 ... F20:corn:0.38 F22:corn:0.13 ...empty. -
Read the water content of the three fields and of field F26, which has no setup.
Expected Result
F21 has no crop (field,kind,growth,theta F21,-1,0.00000000,0.09559531 F22,0,0.12889385,0.33796413 F25,2,0.45030903,0.39599531 F26,0,0.37900000,0.22858886kind−1) and the water content of loamy sand at the index 0.58. F25 has potato (kind2) on clay at its field capacity of 0.396. F26 uses the global value 0.3.
The table shows the options for the soil and the crops.
| Option | Effect |
|---|---|
-FieldSetup=<folder> |
Crop, soil and start wetness of single fields, and terrain edits. |
-FarmInitialTheta= |
Start wetness of all other soil, from 0 (wilting point) to 1 (field capacity). |
-FarmKsatScale= |
A factor on the conductivity of all soil. |
-FarmPreDays= |
Days that the soil water runs before the session starts. |
-CropSeason= |
2026 for the crop map of 2026, or legacy. |
-CropStage=date |
Growth of each field from its planting date to the date of -EnvDate=. |
-FarmInitialGrowth= |
The same growth fraction for all planted fields. |
In the menu, the tab Fields has one row for each field with the columns Crop, Soil, Start Wetness and Terrain. The menu limits the start wetness to 1.3. The crop season and the crop stage are on the tab Additional.
Replay the Weather of a Real Day#
The folder Calibration/Weather/Replay contains one environment file for each day with real Polaris runs.
The folders fields_w<index> contain field setups that give all fields the measured wetness index of a day.
Calibration/Weather/ground_conditions.md gives the index of each day.
-
Start a session with the weather of 18 June 2026 and a wetness index of 1.65.
Packaged/Linux/Acres.sh -VehicleDemo -RenderOffscreen -SessionLog \ -DriveScript="$PWD/stand.json" -VehicleOutput="$PWD/Sessions/replay" \ -VehicleSpawnU=480 -VehicleSpawnV=405 -VehicleSpawnYaw=-90 \ -EnvConfig="$PWD/Calibration/Weather/Replay/env_2026-06-18.json" -EnvHour=17.8 \ -FieldSetup="$PWD/Calibration/Weather/Replay/fields_w1.65"Expected Result
The game log shows the weather of the station at 17:48.
The low and the high of the day are 16.1 °C and 22.7 °C. They are inACRES_ENVIRONMENT_READY day 1 17:48 | 21.5 C RH 68% | sun 38 deg | cloud 59% | rain 0.0 mm/h (0.0 mm) | wind 5.9 m/s from 304 | vis 14.1 km | x1farm-weather.csv. -
Read the water content of the fields.
Note
A replay file sets the weather only. The station record does not contain the soil of each field.
Use the field setup of the day, or -FarmInitialTheta= for an index of 1 or less.
Change the Conditions in a Running Session#
The service acres/set_conditions changes the clock, the weather and the soil water while the session runs.
The game needs the simulator control channel, and ROS 2 needs the ROS 2 bridge.
CAUTION
The soil wetness of this service has a different scale: 0 is the wilting point and 1 is saturation. A field setup uses 1 for the field capacity and 2 for saturation.
-
Copy
stand.jsontostand-long.json. Change the time of the keyexitfrom 60 to 300. -
Start the game with the simulator control channel, the sensor stream and the vehicle bridge.
-
In a second terminal, start the ROS 2 bridge.
source ROS/Env/setup_env.sh ros2 launch acres_sim sim_bridge.launch.py vehicle:=maxxum namespace:=maxxumExpected Result
The bridge writes
simulator control: connected to 127.0.0.1:5600. The commandros2 service listshows/acres/set_conditions. -
In a third terminal, set the surface layer of field F21 to 90 % of the range to saturation.
-
Read the state of field F21.
Expected Result
The response contains
theta_mean=0.39096829070977535for F21. The value before step 4 was 0.224. -
Start a storm.
ros2 service call /acres/set_conditions acres_interfaces/srv/SetConditions \ "{set_weather: true, weather: 'storm', rain_mm_h: -1.0}"Expected Result
The message of the response is
weather storm rain -1.0 mm/h. The negative rate selects the rate of the preset. The session log showsrain_mmh30.000 andcloud_cover0.970 from that time. -
Set the clock to a new date and hour.
ros2 service call /acres/set_conditions acres_interfaces/srv/SetConditions \ "{set_clock: true, date: '2026-10-02', local_hour: 8.5}"Expected Result
The message of the response is
clock 2026-10-02 8.50 h. The columnlocal_hourof the session log continues from 8.50. The storm continues, because the clock change keeps the other settings.
Stop the ROS 2 bridge with Ctrl+C when the session ends. The same requests are available as JSON on the simulator control channel. See Simulator Control Channel.
The keys J and K change the weather from the keyboard. J starts or stops rain of 20 mm/h. K makes the clock 600 times faster.
Worked Example: The Soil-and-Weather Study#
The study drives the Maxxum with the chisel plow on field F21 under different soil states and through a real storm.
All sessions use the same drive script. The results are in Calibration/Tractor/soil_weather_results.md.
| Item | Value |
|---|---|
| Vehicle | Maxxum, gear 8, speed set to 8 km/h. |
| Implement | Chisel plow with 9 shanks, draft control at 22 kN, depth limit 25 cm. |
| Field | F21, Toronto-Millbrook silt loam, crop removed by the field setup. |
| Drive script | Demo/SoilWeather/pass.json: a straight pass of 90 m. The steady window is 12 s to 41 s. |
| Soil state | The measured wetness index of the day, from Demo/SoilWeather/Fields/<state>/field-setup.json. |
| Weather | The weather replay file of the day. |
CAUTION
The analysis of step 2 writes soil_weather_results.json and the figures into Calibration/Tractor. It replaces the committed files.
-
Run the sessions. The variable
SESSIONSselects some of the 12 sessions.Expected Result
Each session writes its session folder
Sessions/study/<session>and its game logSessions/study/<session>-game.log. The filetractor.csvhas 5401 rows fordryand 12 002 rows forrain. The field report ofrainshows 16.81 mm of rain and a tilled area of 439 m² on F21. -
Compute the tables and the figures.
Expected Result
The script prints the tables in Markdown. These are three lines of the first table.
| Scenario | Soil state | Speed, km/h | Slip front / rear, % | ... | Fuel, L/ha | Tractive eff. | | Dry silt loam | silt loam, θ 0.236, Se 0.47, CI 2.14 MPa, wet 0.00 | 7.83 | 4.4 / 2.9 | ... | 9.1 | 0.79 | | Wet silt loam | silt loam, θ 0.374, Se 0.87, CI 0.63 MPa, wet 0.02 | 7.81 | 4.8 / 3.4 | ... | 9.4 | 0.78 |
The script starts each session with these soil and weather options.
| Session | Soil Options | Weather Options |
|---|---|---|
dry |
-FarmInitialTheta=0.58, field setup dry (index 0.58) |
env_2026-07-30.json, -EnvHour=15.4 |
wet |
-FarmInitialTheta=1.0, field setup wet (index 1.64) |
env_2026-06-18.json, -EnvHour=17.8 |
saturated |
-FarmInitialTheta=1.0, field setup saturated (index 2.0) |
env_2026-06-18.json, -EnvHour=17.8 |
loamy-sand, sand |
-FarmInitialTheta=0.58, field setup with the preset |
env_2026-07-30.json, -EnvHour=15.4 |
rain |
-FarmInitialTheta=1.0, field setup rain (index 1.12) |
env_2026-06-16.json, -EnvHour=17.133, -EnvMinute=1 |
Measured Results#
The table shows the steady state of the chisel pass from the committed results.
| Session | Water Content | Cone Index | Rear Slip | Rear Rut | Draft | Depth | Fuel |
|---|---|---|---|---|---|---|---|
| Dry silt loam | 0.236 | 2.14 MPa | 2.9 % | 1.2 cm | 21.1 kN | 18.8 cm | 9.1 L/ha |
| Wet silt loam | 0.374 | 0.63 MPa | 3.4 % | 1.9 cm | 21.7 kN | 19.2 cm | 9.4 L/ha |
| Saturated silt loam | 0.417 | 0.48 MPa | 4.5 % | 3.5 cm | 22.6 kN | 22.1 cm | 9.9 L/ha |
| Dry loamy sand | 0.096 | 0.95 MPa | 3.6 % | 1.6 cm | 20.7 kN | 25.6 cm | 9.0 L/ha |
| Dry sand | 0.067 | 0.79 MPa | 3.6 % | 1.2 cm | 20.3 kN | 25.9 cm | 8.8 L/ha |
- Wet silt loam has less strength. The slip, the rut depth and the fuel for each hectare increase from dry to saturated.
- The draft control holds the draft. The tines go deeper when the soil is weaker.
- Sand has no cohesion. The tines reach the depth limit and the draft stays below the set-point.
In the session rain, the storm of 16.8 mm arrives 22 s after the start.
| Time | Water Content | Cone Index | Surface Wetness | Water at the Rear Tyres | Rear Slip | Rear Rut |
|---|---|---|---|---|---|---|
| Before the storm, 10 s to 21 s | 0.311 | 1.05 MPa | 0.01 | 0 mm | 3.2 % | 1.6 cm |
| In the storm, 27 s to 37 s | 0.325 | 0.93 MPa | 1.00 | 16.2 mm | 3.5 % | 1.6 cm |
| Second pass, 68 s to 95 s | 0.345 | 0.79 MPa | 0.98 | 11.5 mm | 3.6 % | 1.7 cm |
The surface becomes wet in one second, and the slip increases immediately. The water content of the 0.3 m layer increases in minutes. The draft and the depth do not change, because the draft control holds the draft.
The sessions dry, wet and rain ran again for this page, on 2 October 2026.
The steady-state values were the same as the committed results. The largest differences were 1 N of soil resistance and 0.1 mm of water.
Next Steps#
- Attach and Operate Implements: the chisel plow and the draft control of the study.
- Lockstep Stepping: the same soil water in each run.
- Soil Water: the equations behind the results.
- Tyre and Soil: how the water content changes the soil strength.
- Command Line: all options of the game.