Skip to content

AcresVehicle.h#

Acres/Source/Acres/AcresVehicle.h Generated

The tractor (and its trailed implement) as an Unreal pawn: the glue between the SI vehicle model and Chaos, Unreal's physics engine.

AAcresVehiclePawn owns a box-shaped rigid body. Every 120 Hz physics step (on the physics thread) it traces a ray down from each wheel mount, turns the hits into FWheelSample, runs the model in AcresVehicleModel.h, and adds the summed wheel, drag and draft forces to the Chaos body. Chaos then integrates the chassis. On the game thread, Tick reads keyboard input, moves the visual wheels, runs the farm/weather visuals and reads the latest telemetry.

Units: the model works in metres, newtons and seconds; Unreal works in centimetres. Conversions happen in AcresVehicle.cpp at the Chaos boundary. World axes in this project: X east, Y south, Z up.

Unreal terms used here: an AActor is an object placed in the world; an APawn is an actor that a player or AI can control. UCLASS(), GENERATED_BODY() and UPROPERTY() are macros read by Unreal's code generator; UPROPERTY also keeps the pointer visible to the garbage collector.

Name Type Unit Default Description
AcresImplementRigControlMax inline constexpr int 32 Most rig controls one implement publishes per step (the seed drill has 20).

FAcresImplementTelemetry#

struct FAcresImplementTelemetry

The Maxxum implement after one physics step (AcresImplementModel.h), for the HUD, tractor.csv, the RL bridge and the implement's skeletal mesh. SI units as named; Kind is -1 without an implement.

Name Type Unit Default Description
Kind int -1 AcresSim::EImplementKind, or -1 for none.
HitchMode int 0 AcresSim::EHitchMode.
bRaised, bPtoOn, bPtoActive, bSpraying, bMetering, bPickupDown, bStabilizersDown, bBaleOnFork bool Operator state: implement raised (headland / transport), PTO switched on and driving, sprayer valves open, seed meter engaged, baler pickup down, backhoe stabilizers down, bale on the loader fork.
bInSoil, bTripped, bFloating, bStall, bStarved, bPtoUnderspeed bool Model flags (FImplementOutput): tools in the soil, a tine tripped, riding on gauges/soil, hydraulic stall (relief open), seed or liquid ran out, PTO below the baler's working speed.
DepthM double m 0 Mean tool depth, m.
DepthSettingM double m 0 Operator's working-depth setting, m.
DraftN double N 0 Soil and rolling resistance against travel, N.
VerticalN double N 0 Net vertical soil force, N (positive down).
LateralN double N 0 Side force, N.
SensedDraftN double N 0 Lower-link draft the EHC senses, N.
DraftSetpointN double N 0 Draft-control set-point, N.
LiftDeg double ° 0 Lower-link lift angle, deg.
HitchLever double 0 Lever 0..1.
TripMaxDeg double ° 0 Largest tine trip angle, deg. TrippedCount: tines off their stop.
GroundOffsetM double m 0 Ground under the tools above the wheel plane, m.
PtoKW double kW 0 PTO shaft power, kW.
PtoRpm double rev/min 0 PTO shaft speed, rev/min.
HydraulicKW double kW 0 Pump shaft power, kW.
DraftKW double kW 0 Draft times ground speed, kW.
RamPressureBar double bar 0 Hitch ram (or highest working) pressure, bar.
MassKg double kg 0 Implement mass including payload, kg.
PayloadKg double kg 0 Seed, liquid, bale, bucket soil or baled crop, kg.
SeedKg, SownHa, SeedRateKgHa, TankL, SprayedHa, SprayRateLHa, BoomBar double Seed drill: seed left, kg; area sown, ha; sown rate, kg/ha. Sprayer: liquid left, L; area sprayed, ha; applied rate, L/ha; boom pressure, bar.
FormingKg, ChuteKg, ChuteXM, FlywheelRpm, PlungerKN, IntakeKgS double Baler: forming bale, kg; finished bale on the chute, kg, and its centre (baler frame X), m; bales dropped; flywheel speed, rev/min; peak plunger force, kN; intake, kg/s.
DroppedKg, NozzleLMin, BoomFold double Baler: crop in dropped bales in total, kg (a new bale's mass is the increase). Sprayer: nozzle flow, L/min per nozzle; boom fold (0 unfolded .. 1 folded).
LoaderLiftDeg, LoaderCurlDeg, BoomDeg, DipperDeg, BucketDeg, SwingDeg, BucketKg, DugKg, FootKN double Loader: lift and curl angles, deg. Backhoe: boom, dipper, bucket and swing angles, deg; soil in the bucket, kg; dug in total, kg; stabilizer foot loads (right, left), kN; bucket tip in the tractor frame (X, Y, Z), m.
ArticulationYawRad, ArticulationPitchRad, ArticulationRollRad double Trailed baler pose relative to the tractor (kinematic single-axle trailer, see AAcresVehiclePawn), about the drawbar eye in the tractor frame (FLU), rad: yaw of the baler's axis (positive counter-clockwise from above, i.e. its tail swung to the tractor's right), pitch (positive raises the tail) and roll (positive raises its left).
ControlCount int 0 Rig controls for the implement's skeletal mesh (AcresSim::ImplementRigControls): static names and values.

FAcresDbwTelemetry#

struct FAcresDbwTelemetry

Drive-by-wire state of the Polaris after one physics step, in the units of the ds_dbw_msgs 2.3.11 reports (deg, %, bar, m/s) so the RL bridge (AcresRlBridge.h) and a ROS 2 bridge can publish it field for field. Filled from AcresSim::FDbwState and FDbwCommand (AcresUtvModel.h); all zero for the tractor.

Name Type Unit Default Description
bSystemEnabled bool false The DBW system is enabled (/vehicle/enable; an automatic driver of the session counts too).
bOverride bool false The driver took over (keyboard pedal or steering while enabled), which disabled the system until the next enable.
bExternal bool false The last commands came from the bridge (not the session's own replay or script).
bSteerEnabled, bThrottleEnabled, bBrakeEnabled, bUlcEnabled bool Subsystems under DBW control this step (the reports' "enabled").
SteeringWheelDeg, SteeringCmdDeg, SteeringTargetDeg, SteeringRateDegS double SteeringReport: steering_wheel_angle, deg; cmd (the reference generator's output), deg; the target after the command-type conversion, deg; steering wheel rate, deg/s; cmd_type (SteeringCmd CMD_*).
ThrottleInputPct, ThrottleCmdPct, ThrottleOutputPct double ThrottleReport: percent_input (the driver's pedal), percent_cmd, percent_output, %; cmd_type.
BrakeInputBar, BrakeCmdBar, BrakeOutputBar, BrakeCmdPct, BrakeOutputPct double BrakeReport: pressure_input (the driver's foot), pressure_cmd, pressure_output, bar; the same as percent of the 80 bar full scale (percent_cmd, percent_output), %; cmd_type.
Gear, GearCmd, GearDriver int GearReport: gear, cmd and driver lever, ds_dbw_msgs Gear values (1 P, 2 R, 3 N, 4 H = DRIVE, 5 L = LOW).
UlcCmdType int 0 UlcReport: cmd_type; vel_ref, vel_meas, m/s; accel_ref, accel_meas, m/s2; the stop hold is active.
VelocityBrakeMps, VelocityPropulsionMps double VehicleVelocity: vehicle_velocity_brake and vehicle_velocity_propulsion, m/s (wheel speeds x the fitted 0.93 speed scale, signed by the gear).
SteerAgeS, ThrottleAgeS, BrakeAgeS, UlcAgeS double Time since the last steering, throttle, brake and ULC message, s.
DriveMode int 2 Vehicle side: AWD switch (AcresSim::EUtvDriveMode), CVT ratio, road-wheel (bicycle) angle, rad, and the engine torque request after the throttle lag, 0..1.

FAcresDbwReport#

struct FAcresDbwReport

One DBW report snapshot for the report stream (50 Hz): physics time, s, and the state.

FAcresDbwInbox#

struct FAcresDbwInbox

Drive-by-wire commands received from the bridge, in ds_dbw_msgs units. The game thread keeps the latest and queues a copy with the physics time it applies at (AcresCommandTiming.h); the physics step takes the copies due. Each message bumps its subsystem's sequence number; the physics step that sees a new number marks the command fresh (FDbwCommand's ...Fresh), which restarts the model's 0.1 s command timeout.

Name Type Unit Default Description
Command AcresSim::FDbwCommand Commands: the FDbwCommand fields of the last SteeringCmd, ThrottleCmd, BrakeCmd, GearCmd and UlcCmd (driver fields unused).
SteerSeq, ThrottleSeq, BrakeSeq, UlcSeq, GearSeq uint32 Sequence numbers per subsystem (0 = never received).
bSystemEnable bool false System enable (/vehicle/enable true, /vehicle/disable false) and the number of enable / disable messages.

FAcresBridgeControl#

struct FAcresBridgeControl

The driving controls a bridge agent (RL actions over JSON or J1939 CAN) gives, queued with the physics time they apply at (AcresCommandTiming.h). While bActive they replace the keyboard's steering, pedals, direction, gear and diff lock.

Name Type Unit Default Description
bActive bool false The agent drives (it is connected and its actions are not stale for a DBW client).
SteeringRadians, Throttle, Brake, Direction double Road wheel angle, rad (positive = left); throttle and brake, 0..1; direction, +1 forward.
Gear, DiffLock int Gear (0-based; -1 keeps the vehicle's) and differential lock (0 off, 1 rear, 2 rear + front); tractor only.

FAcresVehicleTelemetry#

struct FAcresVehicleTelemetry

One physics step's worth of vehicle state, copied out for the HUD, loggers and tests.

Written by the physics thread at the end of each step under the pawn's lock; read on the game thread through AAcresVehiclePawn::ReadTelemetry. Mixed units, as named: positions in cm (Unreal world), the rest SI.

Name Type Unit Default Description
TimeS double s 0 Physics time since spawn, s.
EpisodeTimeS double s 0 Time since the last reset, s.
Dt double 0 Step length, s.
Rpm double 0 Engine speed, rev/min.
SpeedMps double m/s 0 Forward speed along the chassis heading, m/s (negative when reversing). EngineTorqueNm,
EngineTorqueNm double N·m 0 See above.
ClutchTorqueNm double N·m 0 Engine and clutch torque, N m.
MassKg double kg 0 Current chassis mass including implement and grain, kg.
PtoKW double kW 0 Current PTO load, kW.
BunkerKg double kg 0 Grain in the harvester bunker, kg.
FarmTimeS double s 0 Farm simulation clock, s.
DraftN double N 0 Live implement draft this step (on the trailer pawn for a trailed implement; the tractor's telemetry reports the trailer's), N.
PositionCm FVector cm FVector::ZeroVector Chassis body origin in Unreal world coordinates, cm.
VelocityMps FVector m/s FVector::ZeroVector Linear velocity, m/s, world axes.
Rotation FRotator FRotator::ZeroRotator Chassis orientation as an FRotator (pitch, yaw, roll in degrees).
Orientation FQuat FQuat::Identity Chassis orientation as a quaternion.
AngularRadps FVector rad/s FVector::ZeroVector Angular velocity, rad/s, world axes.
CenterOfMassCm FVector cm FVector::ZeroVector Centre of mass offset in the body frame, cm.
SteeringRad double rad 0 Actual (delayed, rate-limited) bicycle-model steering angle, rad, positive = left.
Wheels std::array<AcresSim::FWheelState, 4> Per-wheel model state after this step (see AcresSim::FWheelState).
Input AcresSim::FVehicleInput Controls actually applied this step (after test scripts, route driver or replay overrode them).
Energy, Power AcresSim::FEnergyFlows Energy ledger (AcresSim::FVehicleState): Energy, cumulative since the last reset, J; Power, this step, W. Only the powertrain side is filled (fuel to tyre-ground work); the chassis side stays zero in the game.
FuelRateLph double L/h 0 Fuel flow, L/h.
FuelUsedL double L 0 Fuel burnt since reset, L.
FuelTankL double L 0 Fuel left, L (0 when the tank is not modelled). FuelPerKmL,
FuelPerKmL double L 0 See above.
FuelPerHaL double L 0 Fuel per km travelled and per hectare worked, L.
TractiveEfficiency double 0 Net tyre work on the chassis over axle work this step, 0..1.
Step uint64 0 Physics steps since spawn.
ResetEpoch uint64 0 Number of resets applied so far.
HandThrottle double 0 HandThrottle: hand throttle 0..1 (sets the governor speed with the pedal released). bParkBrake: park brake on.
Implement FAcresImplementTelemetry Maxxum implement (Kind -1 without one).
bUtv bool false True for the Polaris; then Dbw holds its drive-by-wire state, Input.Throttle / Brake are the emulated pedal and the line pressure over its 80 bar scale, and Input.Gear is the engaged gear (AcresSim::EUtvGear).
WheelSurface, WheelField uint8 Per wheel: surface class under the contact (AcresSurfaceMap.h ESurfaceClass) and field id (0 outside fields).
CropCrushedM2 double 0 Crop this vehicle pushed over since its last reset (tyres and body), m2.

AAcresVehiclePawn#

class AAcresVehiclePawn : public APawn

The drivable tractor, or (with bTrailer set) the trailed implement it tows.

The game mode (AAcresShellGameMode) spawns it as the player's pawn when the game starts with -VehicleDemo. BeginPlay loads Content/Simulation/tractor.json (or the file given by -VehicleConfig=), sizes the Chaos body, spawns the trailer if one is configured and optionally sets up the farm, weather, sensors and loggers.

Two tractors share the physics (tractor.json vehicle.model, -VehicleModel=):

  • "maxxum_150" (the default): the Case IH Maxxum 150 skeletal mesh posed by UAcresRigComponent from the physics state every frame (wheel spin, Ackermann steering, front-axle oscillation, hitch lift), with one of its eight implements from AcresImplementModel.h (-Implement=<id>, menu Tractor > Implement): soil forces, hitch control, PTO and hydraulic loads, mass properties and farm marks every physics step, the implement's own rig posed from the model state. The square baler is a kinematic single-axle trailer whose quasi-static drawbar load (FImplementOutput::TractorForceN) acts on the tractor.
  • "legacy": the original map-placed static-mesh tractor and the ASABE D497.7 / custom-draft implement (mounted, or trailed as a second pawn on a hitch joint; -VehicleImplement=, -VehicleDraft=), kept for regression runs.

The same pawn is the Purdue Polaris Ranger CREW XP 1000 (-Vehicle=polaris, menu New Simulation > Vehicle): then the physics step runs AcresUtvModel.h (Content/Simulation/polaris.json) on the same ground probes, soil library, farm and forces, the Dataspeed drive-by-wire layer takes commands from the keyboard (as the driver), from the session's replay / drive script (as the lab's path follower: steering angle and ULC speed commands) and from the RL bridge (ds_dbw_msgs commands, AcresRlBridge.h), and SK_polaris is posed by its rig (AcresPolaris.cpp). Its sensors are the Purdue suite (Content/Simulation/sensors_polaris.json: RoboSense Helios, Reolink camera, OxTS INS).

Several pawns can share one world (AcresAgents.h: -Vehicles=maxxum,polaris or -Agents=<file.json>): agent 0 is the game mode's pawn and owns the farm, weather and NPCs; it spawns the others (SpawnAgents), which get their own controls, sensors, bridge port and output folder. F2 moves the player (keyboard, camera, HUD) to the next agent.

After that the pawn runs itself:

  • AsyncPhysicsTickActor, physics thread, fixed 120 Hz: vehicle model, wheel ray casts, forces on Chaos.
  • Tick, game thread, once per rendered frame: keyboard controls, wheel visuals, lights, HUD labels.

The two threads share only Control (in) and Telemetry (out), guarded by a critical section. Many behaviours are switched by command-line flags (-VehicleTest=, -VehicleRoute=, -ReplayFile=, -SessionLog, -SensorRecord, -RenderBenchmark and more; see AcresVehicle.cpp).

Example

// Game thread, e.g. from the HUD:
const FAcresVehicleTelemetry T = Vehicle->ReadTelemetry();
const double Kmh = T.SpeedMps * 3.6;
Name Type Unit Default Description
SurfaceName FString TEXT("mapped") Surface under the tractor: a key of tractor.json "surfaces", or "mapped" to read it from the road mask. Set by -VehicleSurface=.
ImplementMode FString TEXT("none") Implement: "none", "mounted" (rigid, adds mass behind the rear axle) or "trailed" (separate pawn on a hitch joint). Set by -VehicleImplement= or -FarmHarvester.
ImplementMassKg double kg 1200 Empty implement mass, kg.
PayloadKg double kg 0 Load carried by the implement, kg.
HitchOverhangM double m .6 Hitch point distance behind the rear axle, m.
RatedPayloadKg double kg 2000 Maximum allowed PayloadKg, kg.
ImplementDraftN double N 0 Reference draft of a "custom" implement at ImplementDesignKmh, N (-VehicleDraft=; the live draft scales with speed, see AcresSim::ImplementDraftN).
ImplementType FString TEXT("custom") Implement type for the live draft: "custom" (ImplementDraftN, speed-scaled) or an ASABE D497.7 table id ("moldboard", "chisel", "disk", "cultivator", "planter", "potato_digger"). tractor.json implement.type or -VehicleImplementType=.
ImplementWidthM double m 3 Working width, m.
ImplementDepthCm double cm 18 Working depth, cm.
ImplementDesignKmh double 8 Speed at which a custom ImplementDraftN applies, km/h.
ImplementCgHeightM double m .9 Height of a mounted implement's (and the harvest bunker's) centre of mass above the ground, m.
SoilTextureName FString TEXT("auto") Soil texture for the draft: "auto" (from the mapped soil unit or the field's soil override under the tool), "fine", "medium" or "coarse". tractor.json implement.soil_texture or -VehicleSoilTexture=.
Parameters AcresSim::FVehicleParameters Vehicle model constants (SI). Some fields change at runtime with mounted mass and grain.
bTrailer bool false True on the trailed implement pawn spawned by the tractor.
VehicleModel FString TEXT("maxxum_150") Tractor visual and implement path: "maxxum_150" (rigged Maxxum, implement model) or "legacy" (map-placed static meshes, ASABE implement). tractor.json vehicle.model or -VehicleModel=.
ImplementId FString TEXT("none") Maxxum implement id ("none", "cultivator", "chisel_plow", "disc_harrow", "seed_drill", "mounted_sprayer", "loader_bale_fork", "backhoe_attachment", "square_baler"). tractor.json implement_model.id or -Implement=.
DepthRangeMinM, DepthRangeMaxM double Working depths the fitted implement's depth setting can reach on firm, level ground, m (both 0 when it has no depth setting: drill, sprayer, loader, backhoe, baler). See AcresSim::ImplementDepthRangeM.
PolarisFinish FString TEXT("graphite") Polaris paint (rig variant): graphite, forest_green, desert_tan or deep_blue.
Agent FAcresAgentSpec This agent's settings (AcresAgents.h) and index; agent 0 is the game mode's pawn.
bMultiAgent bool false True when the session has more than one agent.
SensorStreamPort, RlPortNumber, CanUdpPortNumber int Ports of this agent's channels (0 = closed): sensor stream, RL JSON bridge, CAN over UDP.
ReplayStepIndex uint64 0 Physics steps replayed so far (episode-log replay).

AAcresVehiclePawn::AAcresVehiclePawn#

Builds the chassis box, chase camera boom and camera, and turns on the async physics tick.

AAcresVehiclePawn();

AAcresVehiclePawn::BeginPlay#

Game-thread start-up: loads the configuration, places and sizes the body, creates wheels, visuals, the implement, farm, environment, sensors and loggers, then lets the physics tick run.

virtual void BeginPlay() override;

AAcresVehiclePawn::Tick#

Game-thread frame update: reads the keyboard into the shared controls, moves the visual wheels, switches work lights, updates farm/weather visuals and the review/replay outputs.

Argument Description
DeltaSeconds Frame time, s.
virtual void Tick(float DeltaSeconds) override;

AAcresVehiclePawn::EndPlay#

Stops the physics tick and writes pending logs, replay summaries, telemetry and farm state.

Argument Description
EndPlayReason Why the actor is leaving play (level change, quit, destroyed).
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;

AAcresVehiclePawn::AsyncPhysicsTickActor#

One fixed physics step: runs the vehicle model and applies wheel, drag and draft forces to Chaos.

Argument Description
DeltaTime Fixed step, s (1/120).
SimTime Chaos simulation time, s (unused; the pawn keeps its own PhysicsTime).

Note

Runs on the physics thread. It only reads body state through the Chaos handle, never game-thread component transforms, and exchanges controls and telemetry under a short lock.

virtual void AsyncPhysicsTickActor(float DeltaTime, float SimTime) override;

AAcresVehiclePawn::ReadTelemetry#

Returns a copy of the latest physics-step telemetry.

Returns: The telemetry written at the end of the most recent physics step.

Note

Thread safe; takes the pawn's state lock.

FAcresVehicleTelemetry ReadTelemetry() const;

AAcresVehiclePawn::GetReviewLabel#

HUD label for route review runs (route, frame, time, position); empty otherwise.

FString GetReviewLabel() const ;

AAcresVehiclePawn::GetFarmLabel#

HUD label with the farm status at the tractor position; empty when there is no farm.

FString GetFarmLabel() const ;

AAcresVehiclePawn::GetEnvironment#

Weather, sky and clock runtime, or null when not on the ACRE map.

const FAcresEnvironmentRuntime* GetEnvironment() const ;

AAcresVehiclePawn::GetSensors#

Sensor recorder (cameras, lidar, GNSS, IMU), or null on the trailer.

const FAcresSensorRecorder* GetSensors() const ;

AAcresVehiclePawn::HasFarm#

True when the farm simulation (crops, water, harvest) is running.

bool HasFarm() const ;

AAcresVehiclePawn::AreLightsOn#

True when the head and work lights are on (switched automatically at dusk, in storms and fog).

bool AreLightsOn() const ;

AAcresVehiclePawn::RlStatusText#

Live RL bridge status line for the HUD (-RlPort=), e.g. "RL: connected, episode 12, reward 48.3 | ..."; empty when the bridge is off. See AcresRlBridge.h.

FString RlStatusText() const;

AAcresVehiclePawn::RlEpisode#

Episodes the RL client has started (0 when the bridge is off).

int RlEpisode() const;

AAcresVehiclePawn::RlReward#

Latest reward / return the RL client reported for display (0 when the bridge is off).

double RlReward() const;

AAcresVehiclePawn::GetSensorLabel#

Short sensor recording status for the HUD; empty when there are no sensors.

FString GetSensorLabel() const ;

AAcresVehiclePawn::GetLiveDraftN#

Live implement draft from the latest physics step, N (0 for a pawn without a working implement).

double GetLiveDraftN() const ;

AAcresVehiclePawn::IsLegacy#

True for the legacy tractor.

bool IsLegacy() const ;

AAcresVehiclePawn::HasImplementModel#

True when a Maxxum implement is fitted.

bool HasImplementModel() const ;

AAcresVehiclePawn::GetImplementParameters#

The fitted implement's parameters (valid when HasImplementModel()).

const AcresSim::FImplementParameters& GetImplementParameters() const ;

AAcresVehiclePawn::ImplementLabel#

Display name of the fitted implement ("Chisel Plow"), empty without one.

FString ImplementLabel() const;

AAcresVehiclePawn::IsPolaris#

True for the Polaris Ranger (VehicleModel "polaris").

bool IsPolaris() const ;

AAcresVehiclePawn::GetUtvParameters#

The Polaris model's parameters (polaris.json, finalized); valid when IsPolaris().

const AcresSim::FUtvParameters& GetUtvParameters() const ;

AAcresVehiclePawn::VehicleLabel#

Display name for the HUD: "Polaris Ranger" or "Maxxum 150" (plus the agent name in a multi-agent session).

FString VehicleLabel() const;

AAcresVehiclePawn::PolarisGearName#

Gear letter of a AcresSim::EUtvGear value (P, R, N, H, L; "-" for none).

static const TCHAR* PolarisGearName(int Gear);

AAcresVehiclePawn::SessionAgents#

Every agent of the session in index order (this one included; spawned agents only after their BeginPlay).

TArray<AAcresVehiclePawn*> SessionAgents() const;

AAcresVehiclePawn::PostDbw#

Queues drive-by-wire commands from the bridge. Game thread; the physics step picks them up.

Argument Description
Update Called with the inbox under the pawn's lock; it changes the command fields and bumps the sequence number of every subsystem it wrote.
ApplyAtS Solver time the commands apply at, s (AcresCommandTiming.h; the default: the next step).
void PostDbw(TFunctionRef<void(FAcresDbwInbox&)> Update, double ApplyAtS = AcresSim::ApplyAtNextStep);

AAcresVehiclePawn::PostBridgeControl#

Queues the bridge agent's driving controls (FAcresBridgeControl). Game thread.

Argument Description
Controls The controls from then on (bActive false hands the controls back to the keyboard).
ApplyAtS Solver time they apply at, s.
bDropQueued Drop the controls still queued first (the agent disconnected).
void PostBridgeControl(const FAcresBridgeControl& Controls, double ApplyAtS, bool bDropQueued = false);

AAcresVehiclePawn::UnPossessed#

Called by Unreal when the player controller leaves this pawn (F2 moves it to another agent): the keyboard's controls are released so the vehicle stops unless another channel drives it.

virtual void UnPossessed() override;

AAcresVehiclePawn::WorldTimeS#

World time of a telemetry snapshot: its physics time plus this pawn's world-time offset (the Chaos solver clock every agent shares, as the sensor stream stamps it), s.

double WorldTimeS(const FAcresVehicleTelemetry& T) const ;

AAcresVehiclePawn::BaseFootprintFluM#

base_footprint (the ground point below the rear axle) in the chassis FLU frame, m.

FVector BaseFootprintFluM() const;

AAcresVehiclePawn::TeleportVehicle#

Moves the vehicle (and its trailer) to a pose on the ground at the next physics step, at rest or rolling forward: the RL bridge's reset and the control channel's set_entity_state. Game thread.

Argument Description
YawDeg Unreal yaw, deg (0 east, 90 south).
SpeedMps Forward start speed, m/s (0-8).

Returns: The reset request number (the telemetry's ResetEpoch reaches it once applied).

uint64 TeleportVehicle(double XM, double YM, double YawDeg, double SpeedMps);

AAcresVehiclePawn::ResetToSpawn#

Puts the vehicle back on its spawn pose at rest at the next physics step (a reset of the control channel). Game thread.

void ResetToSpawn();

AAcresVehiclePawn::SetShift#

Replaces the vehicle's hardware shift: actuator offsets from the next physics step, sensor mounts at once. The Polaris takes all of it; the Maxxum the steering offset (road wheel) and the throttle bias (pedal %). Game thread.

void SetShift(const AcresLog::FVehicleShift& Shift);

AAcresVehiclePawn::FillAgentState#

The episode-log state of this agent from a telemetry snapshot (base_footprint pose in the world grid ENU frame).

void FillAgentState(const FAcresVehicleTelemetry& T, AcresLog::FAgentState& Out) const;

AAcresVehiclePawn::FillAgentInfo#

The episode log's description of this agent.

void FillAgentInfo(AcresLog::FAgentInfo& Out) const;