Skip to content

Implement runtime settings menu with triple-down button detection#35

Draft
Copilot wants to merge 3 commits intodevfrom
copilot/fix-34
Draft

Implement runtime settings menu with triple-down button detection#35
Copilot wants to merge 3 commits intodevfrom
copilot/fix-34

Conversation

Copy link
Copy Markdown

Copilot AI commented Jun 4, 2025

This PR implements a comprehensive runtime settings system that allows drivers to modify key robot settings during competition without requiring a restart.

Key Features

Triple-Down Detection

  • Detects 3 consecutive "Down" button presses within a 1.5-second window
  • Provides controller rumble feedback after the 2nd press to guide users
  • Automatically resets if time window expires between presses
  • Uses state-change detection to prevent accidental triggers from holding the button

Runtime Settings Menu

The settings panel displays on the controller screen with these options:

  • A Button: Cycle through drive modes (Left Arcade → Right Arcade → Split Arcade → Tank → repeat)
  • B Button: Toggle traction control on/off
  • X Button: Toggle stability control on/off
  • Y Button: Toggle ABS on/off

User Experience

  • Clear status feedback showing current setting after each change
  • 10-second automatic timeout for safety during competition
  • Manual exit via Down/Up button press
  • Button debouncing prevents accidental multiple triggers
  • Settings apply immediately without restart

Technical Implementation

// Example usage during competition:
// 1. Press Down button 3 times quickly (within 1.5s)
// 2. Controller rumbles after 2nd press
// 3. Settings menu appears on controller screen
// 4. Press A/B/X/Y to change settings
// 5. Settings apply instantly to drive system

The drive system reads updated settings from ConfigManager in the same loop iteration, ensuring real-time application. All existing functionality remains intact, including the original UP button configuration menu.

Code Quality

  • Maintains existing code patterns and style
  • Single file modification for minimal impact
  • Comprehensive edge case handling
  • Added development test function for validation
  • Thread-safe implementation within main control loop

Fixes #34.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • http://168.63.129.16:80/machine/
    • Triggering command: /usr/bin/python3 -u bin/WALinuxAgent-2.13.1.1-py3.9.egg -collect-logs (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits June 4, 2025 03:18
Co-authored-by: Voidless7125 <167136334+Voidless7125@users.noreply.github.com>
Co-authored-by: Voidless7125 <167136334+Voidless7125@users.noreply.github.com>
Copilot AI changed the title [WIP] Rewrite startup and drive code for on-the-go settings changes Implement runtime settings menu with triple-down button detection Jun 4, 2025
Copilot AI requested a review from Voidless7125 June 4, 2025 03:21
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.

Rewrite startup and drive code for on-the-go settings changes

2 participants