Final Fiiiiiiiiiiiiiiiiiiiibox Copilot Rules — Free CoPilot…
    Neura Market
    Neura Market
    /CoPilot
    Marketplace
    Directories
    Resources
    CoPilot
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeekCoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityPluginsTrending
    CoPilotRulesFinal Fiiiiiiiiiiiiiiiiiiiibox Copilot Rules
    Back to Rules

    Final Fiiiiiiiiiiiiiiiiiiiibox Copilot Rules

    Matthew12045 April 16, 2026
    0 copies 0 downloads
    Rule Content
    # August FRAB12 Control - AI Agent Instructions
    
    ## Project Architecture
    
    This is a dual-layer robotics control system:
    
    **HIGH-LEVEL (ROS2_PACKAGE/)**: ROS2 Python package `bocchi` providing web-based keyboard control
    - **Publisher Node**: Flask web server + WebSocket server for real-time keyboard input
    - **Subscriber Node**: Processes movement commands and servo controls
    - **Cross-platform**: Runs in Docker with VNC desktop support
    
    **LOW-LEVEL (LOW_LEVEL/)**: PlatformIO C++ firmware for Raspberry Pi Pico
    - **micro-ROS**: Bridges Arduino framework with ROS2 ecosystem
    - **Hardware Control**: 4x DC motors with encoders, servo motor, LED status
    - **Real-time**: Subscribes to `/cmd_vel` and `/servo_position` topics
    
    ## Development Workflow
    
    ### Docker-First Development
    Always use Docker scripts - never run ROS2 commands directly:
    
    ```bash
    # Start development environment
    ./docker.sh run                    # or ./docker.sh run --desktop for GUI tools
    ./ros2-docker.sh build            # Build ROS2 workspace
    ./ros2-docker.sh run bocchi publisher    # Run nodes
    
    # Development cycle
    ./ros2-docker.sh shell             # Interactive development
    ./ros2-docker.sh test              # Run all tests
    ./ros2-docker.sh monitor-topics    # Debug communication
    ```
    
    ### PlatformIO Workflow
    LOW_LEVEL/ uses PlatformIO with custom Raspberry Pi Pico platform:
    - Board: `pico` with `earlephilhower` core
    - Framework: Arduino with micro-ROS integration
    - Libraries: Custom motor/encoder/servo classes in `lib/`
    
    ## Code Patterns & Conventions
    
    ### ROS2 Python Patterns
    - **Dependency Injection**: Pass hardware interfaces to node constructors
    - **WebSocket + Flask**: Real-time keyboard control via `publisher.py` (2100+ lines)
    - **Async Communication**: WebSocket for low-latency, REST API fallback
    - **Testing**: Comprehensive WebSocket test suite in `test/test_websocket*.py`
    
    ### C++ Embedded Patterns  
    - **RAII Hardware**: DCMotor, ServoMotor, IncrementalMotorEncoder classes
    - **Node Composition**: Separate publisher/subscriber nodes in `src/nodes/`
    - **Error Handling**: `RCCHECK`/`RCSOFTCHECK` macros for micro-ROS operations
    
    ### File Organization
    ```
    ROS2_PACKAGE/bocchi/
    ├── publisher.py          # Main web server + ROS2 publisher (Flask + WebSocket)
    ├── subscriber.py         # Command processor
    ├── templates/           # Mako templates for web UI
    └── static/             # CSS/JS for keyboard interface
    
    LOW_LEVEL/src/
    ├── main.cpp            # micro-ROS setup + hardware initialization  
    ├── nodes/              # ROS2 node implementations
    └── lib/                # Custom hardware abstraction classes
    ```
    
    ## Key Integration Points
    
    ### Topic Communication
    - `/cmd_vel` (geometry_msgs/Twist): WASD keyboard → motor control (20Hz)
    - `/servo_position` (std_msgs/Int32): F key → servo toggle (0°/180°)
    - `/encoder_data`: Feedback from hardware to ROS2 system
    
    ### WebSocket Protocol
    Real-time keyboard events via `ws://localhost:8765`:
    ```json
    {"type": "key_down", "key": "W", "timestamp": 1640995200000}
    ```
    
    ### Docker Network Bridge
    - SSH: `ssh root@localhost -p 2222` (password: `password`)
    - Web UI: `http://localhost:5000`
    - WebSocket: `ws://localhost:8765`
    
    ## Testing Strategy
    
    Run comprehensive test suite covering WebSocket functionality, ROS2 integration, and security:
    ```bash
    ./ros2-docker.sh test                    # All tests
    python3 test_websocket_comprehensive.py # WebSocket-specific
    ```
    
    Tests validate: real-time communication, fallback mechanisms, concurrent connections, and message ordering.
    
    ## Debugging Commands
    
    ```bash
    # Container status and health
    ./ros2-docker.sh status
    
    # ROS2 system inspection  
    ./ros2-docker.sh exec "ros2 node list"
    ./ros2-docker.sh exec "ros2 topic list"
    ./ros2-docker.sh exec "ros2 topic echo /cmd_vel"
    
    # WebSocket debugging
    python3 test/debug_websocket_responses.py
    ```
    
    ## Cross-Platform Notes
    - Use `--platform linux/amd64` flag for Apple Silicon compatibility
    - Desktop image requires `--security-opt seccomp=unconfined` for Ubuntu Jammy
    - WebSocket server binds to `0.0.0.0` for Docker networking
    
    When editing this codebase:
    1. Use `./ros2-docker.sh` wrapper for all ROS2 operations
    2. Test both WebSocket and REST API fallback paths  
    3. Validate hardware integration with micro-ROS subscriber nodes
    4. Follow existing patterns: dependency injection, comprehensive testing, Docker-first development

    Comments

    More Rules

    View all

    QPrisma Copilot Rules

    A
    alexandergg

    Site Casanova Limaemedeiros Copilot Rules

    V
    victormedeeeiros-design

    Mosl Custom Chart Copilot Rules

    R
    riviangeralt

    InOut App Copilot Rules

    J
    jeanvq

    Fastfood Express Copilot Rules

    J
    jersonjjcr

    Pds Pre View Copilot Rules

    E
    eiriksgata

    Stay up to date

    Get the latest CoPilot prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for CoPilot and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Games
    • Blog
    • Videos
    • Guides
    • Courses
    • Community
    • Plugins

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this CoPilot resource

    • Automated Execution Cleanup System with n8n API and Custom Retention Rulesn8n · $9.99 · Related topic
    • Receive and Analyze Emails with Rules in Sublime Securityn8n · $9.99 · Related topic
    • Create an IPL Cricket Rules Q&A Chatbot with Google Gemini APIn8n · $14.99 · Related topic
    • Automate Bing Copilot Searches and Summarize Results with AIn8n · $14.99 · Related topic
    Browse all workflows