Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
bd1c023
initial
godbrigero Jan 15, 2026
fb5cf4c
commands and helper methods pre
godbrigero Jan 15, 2026
e93c3a1
rename some stuff + add logging stuff to new commands and things
godbrigero Jan 15, 2026
8c640b7
add logging to aiming
godbrigero Jan 15, 2026
a43f7e9
add function to calculate the aim angle rate for feed forward and may…
godbrigero Jan 16, 2026
89ea4e4
update for talonfx
godbrigero Jan 17, 2026
567ee62
add shooter code pre
godbrigero Jan 17, 2026
38fb6e2
switch to sparkmax-based motor
godbrigero Jan 18, 2026
0993688
update some sparkmax configs
godbrigero Jan 18, 2026
29954d3
add some extra logging stuff
godbrigero Jan 18, 2026
c1c5f2a
rearange some stuff
godbrigero Jan 18, 2026
0ab8395
bump version
godbrigero Jan 19, 2026
9e556c2
working
godbrigero Jan 19, 2026
39db513
add tuning
godbrigero Jan 19, 2026
19e3174
tuning
godbrigero Jan 20, 2026
f260ef8
tool website and model pre
godbrigero Jan 20, 2026
fa5cdbd
Merge branch 'main' into shooter-turret
godbrigero Feb 14, 2026
b45920b
building code
godbrigero Feb 14, 2026
06fcfc3
working turret position
godbrigero Feb 15, 2026
91f7ad3
working global pose and fixed camera stuff
godbrigero Feb 15, 2026
4b3f259
end of testing day 1
godbrigero Feb 15, 2026
e62bfba
add stuff
godbrigero Feb 17, 2026
68d42fd
reconnect
AdamEXu Feb 18, 2026
845d19d
fix bug in odom prep + add time pred for turret rotation
godbrigero Feb 18, 2026
b566aac
denis made me lean down code or something
AdamEXu Feb 18, 2026
be253ba
fix gyro usage of rotation wrong
godbrigero Feb 18, 2026
d3c2a6b
Merge branch 'shooter-turret' of https://github.com/PinewoodRobotics/…
godbrigero Feb 18, 2026
6879098
clean up bad code
godbrigero Feb 18, 2026
31e356e
add constants for clarity
godbrigero Feb 18, 2026
892fd53
update deployment to work w jetson orin nano
godbrigero Feb 19, 2026
979915b
add zones and robot detection in each zone + switching target for tho…
godbrigero Feb 19, 2026
f290430
update replay logic to implement a thread approach where the data is …
godbrigero Feb 19, 2026
948ebb4
remove compilation in deploy.py
godbrigero Feb 19, 2026
55b80ed
add indexer (and test command to test it, to be removed in future)
AdamEXu Feb 20, 2026
3eef4cf
shooter roughly debugged on a bot
godbrigero Feb 20, 2026
40498c6
fix rotation huge bug
godbrigero Feb 20, 2026
87428ef
compensating for velocity when aiming turret
godbrigero Feb 20, 2026
09243d3
add intake (including wrist and intaker thing)
AdamEXu Feb 21, 2026
c729807
Merge remote-tracking branch 'origin/adam/intake' into shooter-turret
godbrigero Feb 21, 2026
3fc231b
remove prints
godbrigero Feb 21, 2026
82fd925
add working integrated systems
godbrigero Feb 22, 2026
b312ab8
bump thrift
godbrigero Feb 22, 2026
b60ae6d
update pose extrapolator for better coding practices
godbrigero Feb 25, 2026
95faef4
move some stuff aroudn
godbrigero Feb 26, 2026
882e64f
update api for april tags + add disambiguation mode etc.
godbrigero Feb 26, 2026
24321f1
update tests for new api
godbrigero Feb 27, 2026
217859f
update path stuff, making selection possible and other stuff
godbrigero Feb 27, 2026
aca2ecd
working wrist
godbrigero Feb 27, 2026
2765d7f
update path planner and make the robot move in a much better way
godbrigero Mar 3, 2026
1058d09
update compression quality on all cameras
godbrigero Mar 3, 2026
1d9dbbf
add agents md
godbrigero Mar 3, 2026
4adc635
update communication with the driver dashboard to be easier to read a…
godbrigero Mar 3, 2026
afbe72e
LIGHTING HUGE!!11!11
godbrigero Mar 3, 2026
3f9d5c5
remove tests
godbrigero Mar 4, 2026
aa41cea
fix odom position jumping a lot
godbrigero Mar 5, 2026
3299a3d
update lighting command + add morse code + lane pulling (terench cent…
godbrigero Mar 5, 2026
f127468
drive velocity enable and disable and fix dashboard updating taking t…
godbrigero Mar 6, 2026
e8cd466
add gyro resetting
godbrigero Mar 6, 2026
564c3ee
add shooting command to the auto to physically shoot when in range
godbrigero Mar 6, 2026
3f360e6
update intake related stuff for better conventions
godbrigero Mar 7, 2026
fdcdb51
add internal filter filteting where 5 sd values will b e removed from…
godbrigero Mar 7, 2026
5e38304
update climber
godbrigero Mar 8, 2026
631e78b
update
godbrigero Mar 9, 2026
40b941c
update
godbrigero Mar 10, 2026
c6a9391
does stuff
godbrigero Mar 10, 2026
064208e
update turret to use aboslute encoder
godbrigero Mar 10, 2026
3f80fc3
update ai rules
godbrigero Mar 10, 2026
427dcd6
update
godbrigero Mar 11, 2026
4906ed5
add a function to reverse direction
godbrigero Mar 11, 2026
f5a1318
uopdate path planner
godbrigero Mar 12, 2026
17a9d6b
fix commands
godbrigero Mar 13, 2026
37797b9
day 2
godbrigero Mar 13, 2026
a4858c0
final day code
godbrigero Mar 14, 2026
a3ed0e3
fix alliance color unsure
godbrigero Mar 14, 2026
fb95cc9
update aim points to house middle center
godbrigero Mar 14, 2026
00798d0
Add button mapping visualization and update intake command behavior. …
godbrigero Mar 14, 2026
aa9b8ac
Update intake command to include right flight stick trigger and adjus…
godbrigero Mar 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .cursor/rules/java.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
globs: src/main/java/**
alwaysApply: false
---

Use this rule when writing or refactoring Java robot code under `src/main/java/**`.

## Expected notation

- **Public static methods**: Must start with an uppercase letter.
- Example: `public static void Register(...)` (not `public static void register(...)`).
70 changes: 70 additions & 0 deletions .cursor/rules/lighting.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
description: Rules for extending and using the robot lighting framework (LightsSubsystem, lighting effects, and polling-based multi-command orchestration)
globs:
- src/main/java/frc/robot/subsystem/LightsSubsystem.java
- src/main/java/frc/robot/util/lighting/**
- src/main/java/frc/robot/command/lighting/**
- src/main/java/frc/robot/command/util/PollingCommand.java
- src/main/java/frc/robot/constant/LEDConstants.java
- src/main/java/frc/robot/RobotContainer.java
alwaysApply: false
---

Use this rule when modifying robot lights code.

## Core ownership model

- `LightsSubsystem` is the only class that should write LED hardware frames.
- `LightsEngine` owns effect composition, priorities, blend logic, diffing, and compression.
- `PollingCommand` is the default command of `LightsSubsystem` and runs multiple lighting commands per loop.

Do not add direct CANdle writes in lighting commands.

## Multi-command model (important)

The lights subsystem supports multiple independent lighting commands via polling:
- Register commands with `LightsSubsystem.addLightsCommand(...)`.
- Keep the default command as the internal `PollingCommand`.
- Do not overwrite default command in `RobotContainer` for lights orchestration.

If adding a new lighting behavior, make it a command in `src/main/java/frc/robot/command/lighting`.

## Read-only command expectations

Lighting commands should be read-only signal producers:
- Read robot state (sensors, subsystem status, operator inputs).
- Create effects in `initialize()`.
- Update effect parameters in `execute()` (for example `setInput` / `setProgress`).
- Cleanup with `removeEffect(...)` in `end(...)` when appropriate.

They should not:
- Mutate unrelated robot subsystem state.
- Perform scheduling side effects.
- Send raw hardware controls directly.

## API conventions

- Prefer named zones through `lights.rangeOf(LightZone.X)` over raw indices when possible.
- Keep `EffectHandle<TInput>` references in command state; this is the stable id for updates/removal.
- Prefer typed updates through `setInput(handle, value)` when an effect exposes a typed input.
- For base layers: lower priority + `BlendMode.OVERWRITE`.
- For overlays: higher priority + `BlendMode.ADD`.
- Clamp-like behavior is already handled in effect/color classes; do not duplicate ad hoc clamp logic unless needed.

## Render semantics to preserve

- Effects are composited in ascending priority.
- `OVERWRITE` replaces touched pixels only.
- `ADD` channel-adds and clamps each channel to 255.
- If frame diff is empty, no writes are emitted.
- If segment count exceeds `LEDConstants.maxSolidWritesPerCycle`, adaptive compression must remain active.

## Safe extension checklist

When introducing a new effect type:
1. Add effect class under `src/main/java/frc/robot/util/lighting/effects`.
2. Extend `LightsSubsystem` with a typed `addX(...)` creation method.
3. Choose an input type `T` for `LightEffect<T>` (`Void` if no runtime input), and wire `updateInput` if needed.
4. Keep behavior deterministic with respect to `(ledIndex, nowSeconds)` inputs.
5. Add/extend tests in `src/test/java/frc/robot/util/lighting`.
6. Preserve existing priority/blend/segment invariants.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,6 @@ src/main/deploy/config

*.db
.coverage
*.lock
*.bin
checkpoints/
37 changes: 37 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# AGENTS

## Verified workflows

- Workspace bootstrap: `git submodule update --init --recursive` then `npm install`
- Full robot build: `./gradlew build`
- Also runs dynamic vendor dependency build (`scripts/clone_and_build_repos.py --config-file-path config.ini`) and protobuf generation.
- Java build wrapper: `make build`
- Java simulation: `./gradlew simulateJava`
- Robot deploy: `./gradlew deploy -PteamNumber=<TEAM_NUMBER>`
- Robot deploy wrapper: `make deploy` (uses `TEAM_NUMBER`, default `4765`)
- Combined deploy flow: `./gradlew deployAll`
- Runs robot deploy plus backend deploy task.
- Gradle backend deploy task: `./gradlew deployBackend`
- Invokes `make deploy-backend` and validates deployed Pi count against `EXPECTED_NUM_OF_PIS`.
- Python backend deploy directly: `make deploy-backend`
- Python test flow: `make initialize` (creates `.venv`, installs `requirements.txt`, then runs tests) and `make test`
- Config generation from TypeScript: `npm run config -- --dir src/config`
- Regenerate Thrift TS bindings: `npm run generate-thrift`
- Generate backend code artifacts: `make generate` (Python protobuf + Python thrift + Java proto task)
- Java protobuf generation via Gradle: `./gradlew generate` (depends on `generateProto`)

## Command notes

- `make build` and `make deploy` enforce Java 17 via `/usr/libexec/java_home -v 17`.
- `make deploy` defaults `TEAM_NUMBER=4765` unless overridden.
- `./gradlew deployBackend` expects deployment on `EXPECTED_NUM_OF_PIS` (currently `2`) and fails if mismatch.
- Dynamic vendor dependency builds are intentionally forced every Gradle compile/build cycle (`buildDynamicDeps.outputs.upToDateWhen { false }`).

## TODO

- Confirm whether automation should keep `TEAM_NUMBER=4765` and `EXPECTED_NUM_OF_PIS=2` as defaults or document per-robot override policy.
- README references `applyBackend` and `make prep-project`; verify whether docs should be updated to `deployBackend`/`make initialize`.

## Agent docs

- Lighting API and extension guide: `docs/LightingApiForAgents.md`
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ THRIFT_GEN_DIR = $(GEN_DIR)/thrift
THRIFT_TS_SCHEMA_GEN_DIR = $(THRIFT_GEN_DIR)/ts_schema
PROTO_PY_GEN_DIR = $(PROTO_GEN_DIR)/python

TEAM_NUMBER=4765

build:
export JAVA_HOME=$(/usr/libexec/java_home -v 17)
./gradlew build

deploy:
export JAVA_HOME=$(/usr/libexec/java_home -v 17)
./gradlew deploy -PteamNumber=$(TEAM_NUMBER)

initialize:
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
Expand All @@ -37,7 +47,10 @@ thrift-to-py:
-out $(THRIFT_GEN_DIR) \
$(THRIFT_ROOT_FILE);

generate: generate-proto-python thrift-to-py
proto-to-java:
./gradlew generateProto

generate: generate-proto-python thrift-to-py proto-to-java

deploy-backend:
PYTHONPATH="$(PWD)/src" $(VENV_PYTHON) -m backend.deploy
Loading