Repository navigation
feat(scope): decode WPILib structs, range parquet, freeze SPL transform - #30
Merged
Merged
Conversation
…L transform
Strategic pivot: freeze the SPL *transform* stages (eval/where/timechart/rex/
stats-by) and lean on cs -> parquet -> pandas for transforms, keeping SPL's
access/correlation verbs and the dedicated verbs first-class. Rationale and
resolution status in ClaudeScope/USABILITY_FRICTION.md.
F17 (highest-value telemetry gap): WPILib struct fields no longer return an
opaque base64 blob. New session/structs.go decodes the known fixed-packing
structs (Pose2d/3d, Rotation2d/3d, Translation2d/3d, Transform2d/3d, Twist2d/3d,
ChassisSpeeds, SwerveModuleState/Position, Quaternion) and their []-arrays into
named-field objects, wired into both the log decode path (decodeValue) and the
live NT path (pump). Unknown or length-mismatched payloads fall back to raw
bytes. Verified on a real log: Pose2d -> {x,y,theta}, ChassisSpeeds ->
{vx,vy,omega}, SwerveModuleState[] -> [{speed,angle},...].
F11 for range: `range` gains --format csv|parquet, emitting long-format
{key,timestamp,value} rows straight into pandas.read_csv/read_parquet.
F10/F13 (CSV): format float64 in fixed notation so large timestamps render
30046400 not 3.00464e+07, and integral values drop the trailing .0.
Python Session: add range_df(*keys, pivot=False) as the documented parquet ->
tidy DataFrame path; query()/range() docstrings point transform work at pandas.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Acting on the strategic question raised against
USABILITY_FRICTION.md: is the SPL pipe language worth its cost? Split the answer — SPL is two things wearing one coat:get/range/find-bool/find-threshold/stats/set/connect) — thin, correct, valuable. Keep.eval/where/timechart/rex/stats-by, ~3k LOC) — reimplements pandas/SQL; both 🔴 blockers (F1abs(nil), F2!=0null leak) and the token-cost findings (F10/F11/F12) live here.Decision: freeze the transform engine and lean on cs → parquet → pandas for transforms (correct null handling + numeric formatting for free, near-zero response token cost). This PR does that and closes the highest-value telemetry gap.
What
struct:fields no longer return opaque base64.session/structs.godecodes fixed-packing WPILib structs — Pose2d/3d, Rotation2d/3d, Translation2d/3d, Transform2d/3d, Twist2d/3d, ChassisSpeeds, SwerveModuleState/Position, Quaternion, and their[]arrays — into named-field objects, wired into both the log path (decodeValue) and the live NT path (pump). Unknown/length-mismatched payloads fall back to raw bytes.Verified on a real 2026-Robot log:
Pose2d → {x,y,theta},Rotation2d → {value},ChassisSpeeds → {vx,vy,omega},SwerveModuleState[] → [{speed,angle},…].range—rangenow accepts--format csv|parquet, emitting long-format{key,timestamp,value}rows straight intopandas.read_csv/read_parquet(df.pivot(...)to go wide). Documented as the preferred raw-series path.30046400not3.00464e+07and integral values drop the trailing.0.Session— addsrange_df(*keys, pivot=False)(parquet → tidy DataFrame);query()/range()docstrings now steer transform work to pandas.USABILITY_FRICTION.mdfrom the staleDev/TheFRCSuiteclone (its only unique file) and appended a resolution log + a note on the two-clone consolidation.Not done (intentionally, per the freeze)
F1, F2, F10 (JSON precision), F12, F14, F15, F16 — not pursued in the SPL engine; F1/F2 stop mattering once transforms move to pandas.
Tests
go test ./...green — new struct-decode tests (session/structs_test.go) and range CSV/parquet reshape tests (cli/commands_test.go).range_dflong-format/pivot/empty tests.range --format parquet/csvexercised against a real wpilog.🤖 Generated with Claude Code