Skip to content

AcresCoreEpisodeLog.h#

Core/Source/AcresCoreEpisodeLog.h Generated

ACRES Core's episode log: the game's own writer (AcresEpisodeLog.h, the format of Documentation/Reference/episode-log.md) fed from the Core, so a Core episode is the same MCAP file the game writes and replays in Unreal with -EpisodeReplay=. Every physics step: /sim/agent_states (the agents' base_footprint poses, wheels, drive-by-wire state, energy ledger, fuel, crop) and /sim/farm_stamps (the tyre and body contacts, so the game's farm repeats them); at the start and after every reset: /sim/episode, /sim/agents, /sim/conditions, /sim/shifts. The Core also writes the ds_dbw_msgs commands as the vehicle received them (/<agent>/vehicle/{steering,throttle,brake,ulc,gear}/cmd, /<agent>/vehicle/dbw_enabled), which the format allows.

Frame "world" (the Core's ENU about the tile centre); stamps are simulation time. One environment's thread only.

FAcresEpisodeLog#

class FAcresEpisodeLog

One environment's episode log. See the file comment.

FAcresEpisodeLog::Open#

Opens the file and writes the acres_episode metadata record (source "core", map, physics_hz and the caller's keys, e.g. command_line, seed, utm_origin, grid_rotation_deg).

bool Open(const std::string& Path, const std::map<std::string, std::string>& Metadata, std::string* Error = nullptr);

FAcresEpisodeLog::Close#

Finishes the file (safe to call twice).

void Close();

FAcresEpisodeLog::AddAgent#

Adds an agent (its /sim/agents entry); returns its index.

int AddAgent(const AcresLog::FAgentInfo& Info);

FAcresEpisodeLog::BeginEpisode#

Starts an episode (the recording's start, or a reset): /sim/episode, /sim/agents, /sim/conditions, /sim/shifts.

Argument Description
TimeS Simulation time, s. Step: physics steps since the start of the world. ResetEpoch: resets so far.
Conditions The soil-water scenario as the Conditions message (weather fields empty).
Shifts Hardware shifts in force (may be empty).
void BeginEpisode(double TimeS, uint64_t Step, uint64_t ResetEpoch, const AcresLog::FConditions& Conditions, const std::vector<AcresLog::FVehicleShift>& Shifts);

FAcresEpisodeLog::WriteStep#

One physics step: the agents' states and the farm contacts of the step (stamps may be empty).

void WriteStep(double TimeS, uint64_t Step, std::vector<AcresLog::FAgentState> States, std::vector<AcresLog::FFarmStamp> Stamps);

FAcresEpisodeLog::WriteDbwCommand#

The drive-by-wire messages that arrived this step (FreshMask bit 0 steering, 1 throttle, 2 brake, 3 ULC; the gear command and the system enable when they change).

void WriteDbwCommand(int Agent, double TimeS, const AcresSim::FDbwCommand& C, unsigned FreshMask);

FAcresEpisodeLog::WriteTask#

A task status (reward terms, done) from the learner.

void WriteTask(const AcresLog::FTaskStatus& Status) ;

FAcresEpisodeLog::SchemaText#

The ros2msg definition text of a ds_dbw_msgs type as written into the file (tests).

static std::string SchemaText(const std::string& Type);