Skip to content

Revlog v2 - #10

Open
rylanmoseley wants to merge 4 commits into
mainfrom
revlog-v2
Open

rylanmoseley wants to merge 4 commits into
mainfrom
revlog-v2

Conversation

@rylanmoseley

Copy link
Copy Markdown
Member

No description provided.

Adds node:test tests (npm test) with helpers that build REVLOG files byte by
byte and read WPILOG output back. test/fixtures/v1-baseline.json holds what
converter 1.0.5 produces for a representative format v1 file, so later
changes can be checked against it.
Adds a reader for REVLOG format v2:

- The first record decides the format; a v2 header with a newer major
  version is rejected with a message to update the converter.
- Frame records: microsecond timestamps, real frame lengths (CAN FD), and
  entries named by bus, for example REV/CAN_S0/Spark-3/... v1 files keep
  their REV/Spark-3/... names.
- Devices are looked up by manufacturer and device type. The A301
  (manufacturer 3) shares the SPARK's device type; its status frames are
  decoded with the new A301 DBC as REV/<bus>/A301-<number>/..., and frames
  from unknown manufacturers are skipped.
- Robot state becomes DS:controlWord/enabled (boolean) and
  DS:controlWord/robotMode (string), the entries AdvantageScope uses to
  align logs and shade enabled periods. Match info becomes DS:matchInfo/*.
- Logger events become REV/StatusLogger/Event, and diagnostics become
  REV/StatusLogger/<bus>/DroppedFrames running totals.

Fixes for v1 files too:

- FIRMWARE entries are written only when they change. Logs from older
  REVLib releases repeat the firmware table every loop, which produced
  millions of identical records (98% of one 277 MB conversion).
- Servo Hub firmware versions were decoded with the SPARK layout (for
  example "2.1.6400" instead of "25.1.2").
revlog-converter --stats <file> prints the format version, record counts
and sizes, time span, per-device frame counts and rates, logger events, and
known problems: wrapped timestamps from REVLib 2027 alphas, a logger loop
running far faster than 40 Hz, files that are mostly repeated firmware
tables, firmware tables written more often than devices change, CAN stream
overflows, and a truncated last record. Also exported as
analyzeREVLOG/formatStats.
Documents both REVLOG formats, the WPILOG entries the converter writes,
--stats and the library API, and adds a changelog. Bumps to 2.0.0 because
format v2 files get new entry names; AdvantageScope pins ^1.0.5 and needs
an update to pick this up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant