How 2e10-buggyproject/buggysoftware works
Main Components
• Autonomous Buggy Controller: Use the Gold code (e.g., GoldBuggyVFinal.ino) as the core firmware running on a microcontroller.
• Sensor Suite:
– Line-following sensors (likely IR sensors) to detect and follow track lines.
– Ultrasound sensor for obstacle detection (if still used, inherited by previous challenges).
– Wheel encoders for measuring distance travelled.
– HuskyLens vision sensor for detecting and interpreting April tags.
• Decision & Control Unit:
– Input Processing Module: Interfaces with all sensors, reads raw data.
– Tag Recognition Module: Processes the vision sensor data to identify April tags and decode instructions (such as turning left/right, adjusting speed, etc.).
– Navigation & Behavior Module: Implements logic (e.g., state machine or decision tree) that translates sensor inputs and tag instructions into motor control commands.
• Actuator Control:
– Motor Driver Circuit: Actually interfaces with the buggy’s motors to control movement based on the commands.
– PID Speed Controller: (Inherited from Silver challenge but might also be integrated here) to adjust motor speeds accurately per the challenge instruction, especially after speed-related April tags.
• Communication & Telemetry (if applicable):
– Although the Bronze version required a PC-based GUI to send GO/STOP commands and display telemetry, for Gold the primary focus is on autonomous decision-making. If telemetry is still provided, include a bi-directional link to a PC module or logging interface.
Relationships and Data Flow
• Sensor Data Flow: Each sensor gathers measurements and passes data to the Input Processing Module.
– The HuskyLens sends processed images and tag-related data to the Tag Recognition Module.
– IR sensors, ultrasound, and wheel encoders feed information directly into the Navigation & Behavior Module.
• Control Flow: The Navigation & Behavior Module determines the desired action (e.g., “turn left”, “speed up”, “reduce speed”) and sends commands downstream to the Motor Driver and (if applicable) to the PID Controller.
Important Architectural Patterns
• Modular decomposition: Clearly separate sensor interfacing, decision-making, and motor control.
• Closed-loop control: Emphasize the feedback from wheel encoders (and possibly other sensors) to the PID Controller.
• Real-time processing: Ensure that sensor inputs (especially the vision sensor for April tag detection) and decision logic operate in a timely fashion.
Relevant Technologies and Frameworks
• Programming language/firmware: Arduino-style sketches (.ino files in the Gold folder).
• Sensor libraries: Libraries for interfacing with IR sensors, US sensor and especially the HuskyLens (for April tags).
• PID libraries: Likely used for speed regulation imported from the Silver challenge revisions.
• (Optional) Communication libraries if telemetry or PC interfacing remains relevant beyond Bronze.
• At the microcontroller level, detail the sequence:
1. Sensor data acquisition (show branches for each sensor).
2. Data parsing and filtering (especially from HuskyLens, converting visual input to April tag instructions).
3. Decision-making logic:
• For “Turn Left” or “Turn Right”: a conditional decision block triggered by the recognized tag.
• For “Speed Limit” or “Accelerate”: a PID control block that adapts motor commands.
4. Actuation & motor control:
• Motor Driver receiving commands, with visual feedback controls (from wheel encoders).
• Timing or synchronization elements if necessary (e.g., real-time sensor polling loops and state machine transitions).
Final Touches
• Block is clearly labeled and describes its function.
• Notes/comments around any critical interfaces—such as the exact wiring between the HuskyLens sensor and the microcontroller if known.