Skip to content

Conversation

@mcassar4
Copy link

@mcassar4 mcassar4 commented Mar 4, 2025

PR: Initial Implementation of Q25FSAE Telemetry System

Overview

This PR introduces the initial implementation of the Q25FSAE telemetry system, designed to provide live telemetry data visualization for the race car during testing. The system is currently in a demonstration phase, relying on simulated telemetry data for testing and development.

Features Added

Core Components:

  • gui.py: Implements the PyQt5-based graphical user interface (GUI) for real-time telemetry monitoring.
  • main.py: Serves as the entry point of the application, initializing the GUI and handling demo data integration.
  • demo_data.py: Generates simulated telemetry data to test the system’s real-time capabilities.

GUI Features:

  • Real-time plotting of:
    • Battery SOC (State of Charge)
    • Wheel Speed
    • Throttle and Brake Percentages
    • Cell Temperatures
  • Dial-based displays for throttle and brake.
  • Fault detection with visual alerts.
  • Low battery warning system with audio and visual notifications.
  • CSV logging for data export.

Data Handling:

  • Implemented DemoDataThread to generate and emit synthetic telemetry data.
  • Designed updateTelemetry() to process real-time updates in the GUI.
  • Added updatePlots() to dynamically update graphs and statistics.
  • Implemented resetData() to clear and restart telemetry tracking.
  • Provided exportData() for saving telemetry logs as CSV files.

How to Run

  1. Install dependencies using pipenv install.
  2. Activate the virtual environment with pipenv shell.
  3. Run the application with:
python telemetry/main.py
  • To run with simulated telemetry data:
python telemetry/main.py --demo

Future Improvements

  1. Real-Time Data from Q25FSAE
  • Implement a socket-based client-server architecture for data transmission from the car.
  • Develop a CAN data translation module to interpret messages from the car’s onboard system.

2. Performance Enhancements

  • Improve threading efficiency to handle high-frequency telemetry updates.
  • Optimize data buffering for handling incoming messages.
  • Reduce GUI overhead by updating only significantly changed values.

mcassar4 added 13 commits March 4, 2025 11:25
- Explains what the files do, the purpose of the project, and how next steps for development
- use `pipenv install --dev`  in the directory to set up the virtual environment
- Created `main.py` as the entry point for the telemetry system.
- Added PyQt5-based GUI initialization.
- Implemented `TelemetryWindow` (to be added in future commits).
- Launched the PyQt5 application loop.
- Imported PyQt5 modules for UI components, timers, and multimedia effects.
- Integrated `pyqtgraph` for real-time telemetry data visualization.
- Added CSV and datetime support for potential data logging.
…orage

- Added `TelemetryWindow` class for displaying telemetry data.
- Configured window properties (title, size, initialization).
- Introduced data structures for telemetry storage:
  - Cell temperatures for `num_BMS_sensors` sensors.
  - SOC, wheel speed, throttle, and brake data tracking.
- Implemented timers for real-time plot updates every 50ms.
- Added `initUI()` method to construct the telemetry dashboard layout.
- Integrated real-time plots for:
  - Cell temperatures
  - Wheel speed
  - Battery SOC (State of Charge)
  - Throttle and brake percentages
- Implemented dials for throttle and brake display.
- Added speed display and fault indicator status.
- Included Reset and Export buttons for data control.
- Created helper methods for plot creation and organization.
- Initialized data curves for real-time plotting.
- Added `updateTelemetry()` method to process incoming telemetry data.
- Updates time tracking with effective timestamps.
- Stores and updates key telemetry values:
  - Cell temperatures
  - State of Charge (SOC)
  - Wheel speed
  - Throttle and brake percentages
  - Speed numeric display
  - Fault status indicator
- Dynamically changes UI fault status color based on fault conditions.
- Added `updatePlots()` to update real-time graphs:
  - Cell temperatures with rolling averages.
  - Wheel speed with historical tracking.
  - Battery SOC with a full-timeline view.
  - Throttle and brake values with averages in a 60-second window.
- Integrated `updateElapsedTime()` to track and display elapsed time.
- Ensured dynamic range adjustments to keep recent data visible.
- Implemented statistical averaging for each telemetry metric.
- Added `resetData()` to clear and restart telemetry tracking.
- Resets time offset to maintain continuity in timestamps.
- Clears all telemetry data storage arrays:
  - Cell temperatures
  - SOC, wheel speed, throttle, and brake data
- Resets plot displays and reinitializes curves.
- Ensures the telemetry session restarts with fresh data.
- Implemented `exportData()` to save telemetry data to a timestamped CSV file.
- Captures key telemetry metrics, including:
  - Time
  - BMS Cell Temperatures
  - State of Charge (SOC)
  - Wheel Speed
  - Throttle and Brake Percentages
- Ensures missing data points are handled gracefully.
- Prints confirmation message upon successful export.
- Added `lowBattery.wav` sound file to `assets/` for audio alerts.
- Integrated `QSoundEffect` to play a warning beep when battery SOC drops below 10%.
- Implemented a warning light:
  - Displays an orange "Battery Low!" message when SOC < 10%.
  - Automatically hides the warning when SOC recovers above 10%.
- Ensures real-time alerts in `updateTelemetry()` for low SOC detection.
- Implemented `DemoDataThread`:
  - Generates simulated telemetry data with sine/cosine patterns.
  - Includes throttle, brake, cell temperatures, SOC, wheel speed, speed, and random fault generation.
  - Runs continuously, emitting telemetry updates every 5ms.
- Added a `--demo` command-line flag in `main.py` to enable simulated telemetry mode.
- Ensures smooth integration by connecting the demo data generator to the telemetry UI.
- Allows resetting SOC value to 100% for repeatable test sessions.
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.

3 participants