ets2-dataset / README.md
ryangowe's picture
Add dataset card: structure, telemetry schema, collection, usage
53ded5a verified
|
Raw
History Blame Contribute Delete
9.86 kB
---
pretty_name: ETS2 Truck Self-Driving Dataset
license: other
task_categories:
- robotics
- reinforcement-learning
tags:
- autonomous-driving
- self-driving
- imitation-learning
- behavioral-cloning
- euro-truck-simulator-2
- ets2
- driving
- telemetry
- webdataset
configs:
- config_name: default
data_files:
- split: train
path: ets2-train-*.tar
- split: val
path: ets2-val-*.tar
---
# ETS2 Truck Self-Driving Dataset
Synchronized screen-capture video and vehicle telemetry recorded from human
driving in **Euro Truck Simulator 2 (ETS2)**, packaged for end-to-end driving
(imitation learning / behavioral cloning). Each frame pairs a 1080p game
screenshot with the full SCS telemetry snapshot taken at the same instant — the
control signals (steering, throttle, brake) and vehicle state needed to learn or
evaluate a driving policy.
If you want to load a single recording locally, jump to [Usage](#usage). If you
want to understand what each field means, see [Telemetry fields](#telemetry-fields).
## At a glance
- **Modalities:** RGB video + per-frame structured telemetry
- **Frame rate:** 10 FPS, video and telemetry aligned 1:1
- **Frame size:** 1920×1080 (H.264, `yuv420p`)
- **Format:** [WebDataset](https://github.com/webdataset/webdataset) — `.tar`
shards of ~1 GB each
- **Splits:** `train`, `val`
## Dataset structure
The dataset is a set of WebDataset shards named `ets2-{split}-{index}.tar`
(e.g. `ets2-train-000000.tar`). Each shard is a plain tar of complete recording
**sessions**. A session is one continuous driving clip (15–90 s) stored as three
members that share a basename (the WebDataset *key*); the extension names the
field:
| Member | Contents |
| --------------- | --------------------------------------------------------------------------------------------------------------- |
| `{key}.mp4` | H.264 video, 1920×1080, 10 FPS |
| `{key}.bin.zst` | zstd-compressed raw telemetry: a fixed **32 KiB** SCS shared-memory block per frame, concatenated in frame order |
| `{key}.json` | session meta needed to interpret the telemetry (see [Session meta](#session-meta)) |
The telemetry bin is the only compressed member. After zstd decompression it is
`32768 × N` bytes for an `N`-frame video; frame `i` corresponds to bytes
`[i*32768 : (i+1)*32768]`, the verbatim SCS plugin shared memory at that frame.
### Telemetry fields
Fields are decoded from the 32 KiB block by byte offset. The block is stored
verbatim, so it carries the entire SCS shared-memory layout; the fields below
are the ones already wired up for driving. Angles follow the SCS convention of
**turns** (1 turn = 360°).
| Field | Type | Meaning |
| ---------------------------------------------------------------------------------- | ----- | -------------------------------------------------------------- |
| `game_steer` | float | Effective steering, `[-1, 1]` |
| `game_throttle` | float | Effective throttle, `[0, 1]` |
| `game_brake` | float | Effective brake, `[0, 1]` |
| `speed` | float | Truck speed in m/s (negative when reversing) |
| `cruise_control_speed` | float | Cruise-control set speed in m/s (0 when off) |
| `angular_velocity_y` | float | Yaw rate around truck-Y in turns/s |
| `cabin_aa_z` | float | Cabin angular acceleration around truck-Z in turns/s² |
| `coordinate_x` / `coordinate_y` / `coordinate_z` | float | World position (ETS2 left-handed frame) |
| `rotation_x` / `rotation_y` / `rotation_z` | float | Heading / pitch / roll in turns (heading 0 = north) |
| `time_ms` | int | Simulation time in ms; **stops** while the game is paused |
| `simulated_time_ms` | int | Simulation time in ms; **keeps advancing** while paused |
| `sdk_active` / `paused` / `on_job` / `attached` | bool | SDK active, game paused, delivery job active, trailer attached |
| `wear_engine` / `wear_transmission` / `wear_cabin` / `wear_chassis` / `wear_wheels` | float | Component wear, `[0, 1]` |
| `cargo_damage` | float | Current cargo damage, `[0, 1]` |
| `route_distance` | float | Remaining planned route distance in m |
| `planned_distance_km` | int | Initial route length in km (constant for the trip) |
| `job_income` | int | Job payment in EUR (constant for the trip) |
| `plugin_revid` / `sdk_version_major` / `sdk_version_minor` | int | Telemetry plugin / SDK versions |
For driving you typically use the screenshot plus `speed` and pose as inputs and
`game_steer` / `game_throttle` / `game_brake` as labels.
### Session meta
`{key}.json` is a small object describing how to read the telemetry bin:
| Key | Meaning |
| ----------------------------------------- | ------------------------------------------------------- |
| `plugin_revid` | Telemetry plugin revision (struct layout version) |
| `sdk_version_major` / `sdk_version_minor` | SCS SDK version |
| `hfov_deg` | Camera horizontal field of view in degrees (default 71) |
## Data collection
Sessions are captured from a live ETS2 window, not reconstructed offline:
- **Sampling:** the game window is screen-captured at 10 Hz. Accepted window
sizes are 1920×1080, 2560×1440, and 3840×2160; every frame is normalized to
1920×1080. Each screenshot is paired with the SCS telemetry snapshot read at
the same tick.
- **Event-driven recording.** Frames are buffered with a few seconds of
look-ahead, and a clip is only kept around interesting moments rather than
recording idle time. Two triggers are active:
- *moving* — fires while the truck moves faster than 0.3 m/s, keeping a
`[-3 s, +1 s]` window around each moving frame;
- *collision* — fires when total component wear jumps between frames
(a likely impact), keeping a wider `[-3 s, +12 s]` window.
- **Clip length.** Kept sessions are 15–90 s; shorter candidate clips are
discarded and longer runs are split.
## Usage
### Stream shards directly
WebDataset shards stream without downloading the whole dataset. The telemetry
member needs zstd decompression, then slicing into 32 KiB per-frame blocks:
```python
import webdataset as wds
import zstandard as zstd
REPO = "<your-username>/<dataset-repo>" # replace with the dataset repo id
BASE = f"https://huggingface.co/datasets/{REPO}/resolve/main"
url = f"{BASE}/ets2-train-{{000000..000006}}.tar" # adjust to the shard range
FRAME_BYTES = 32 * 1024
for sample in wds.WebDataset(url):
meta = sample["json"] # bytes — session meta
video = sample["mp4"] # bytes — H.264 clip
raw = zstd.ZstdDecompressor().decompress(sample["bin.zst"])
n_frames = len(raw) // FRAME_BYTES
# frame i telemetry: raw[i*FRAME_BYTES : (i+1)*FRAME_BYTES]
```
### Decode with the recorder toolkit
This dataset is produced by the `ets2-dataset` tooling in this repository, which
can also read sessions back. Unpack a shard (plain `tar -xf`) and open any
session by pointing at one of its members:
```python
from ets2_dataset.data.session import Session
with Session("session_20260101_120000_123456.mp4") as session:
print(len(session), "frames", session.fps, "fps", session.duration, "s")
for frame in session:
image = frame.image # [H, W, 3] BGR uint8
t = frame.telemetry
steer, throttle, brake = t.game_steer, t.game_throttle, t.game_brake
```
`Session` decodes the video and telemetry together and yields frames in
recording order, with `telemetry` exposing the fields above as attributes.
## License and attribution
The video frames are screenshots of **Euro Truck Simulator 2**, whose game
content is © SCS Software. This dataset is intended for non-commercial research
and is distributed under that constraint; using it does not grant any rights to
the underlying game assets. Set the `license` field in the metadata above to the
terms you intend to release the recorded telemetry and annotations under before
publishing.