Skip to content

padd: only the driving pad's buttons may act - #277

Open
hadelan wants to merge 1 commit into
pollen-robotics:mainfrom
hadelan:padd-one-pad-drives
Open

padd: only the driving pad's buttons may act#277
hadelan wants to merge 1 commit into
pollen-robotics:mainfrom
hadelan:padd-one-pad-drives

Conversation

@hadelan

@hadelan hadelan commented Sep 12, 2026

Copy link
Copy Markdown

With two pads connected, the event drain matched no pad id: a Start or Select from the second pad toggled the policy or shut the robot down, while the sticks those commands combined with were the first pad's.

The driving pad is the first one; events from any other are skipped. After the drain the pad is re-read by id (connected_gamepad), so a Disconnected dequeued this tick yields one tick of "pad gone" instead of silently handing the robot the other pad's sticks.

Behavior with a single pad is unchanged. The drain needs a real gilrs instance, so there is no new unit test; cargo test -p padd, clippy -D warnings, fmt --check all green.

With two pads connected, the event drain matched no pad id: a Start or
Select from the second pad toggled the policy or shut the robot down
while the sticks it combined with were the first pad's. The driving pad
is the first one; events from any other are skipped, and after the drain
the pad is re-read by id — a Disconnected dequeued this tick must yield
one tick of "pad gone", not a silent handover to the other pad's sticks.
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