Skip to content
David Masin edited this page Oct 30, 2024 · 4 revisions

Battery Manager Application

Welcome to the Battery Manager Application! This application is designed to help robotics teams manage their batteries efficiently by tracking their status, usage, and maintenance cycles. It uses barcode scanning, manual entry, and a web interface to provide real-time information about each battery in the system.

Overview

The Battery Manager Application helps teams keep track of their batteries' statuses, ensuring that they are properly charged, cooled down, and ready for use. It uses a combination of barcode scanning (via a connected camera), manual entry, and a Flask-based web interface to monitor and update the status of each battery.

Prerequisites

  • Python 3.6 or higher

  • pip (Python package manager)

  • Camera: A webcam or camera connected to the system for barcode scanning.

  • Audio Output: For playback of audio notifications (optional).

Installation:

  1. Clone the Repository

git clone https://github.com/yourusername/battery-manager.git

cd battery-manager

Install Dependencies:

Install the required Python packages using pip:

pip install -r requirements.txt

Required Packages:

  • opencv-python
  • pyzbar
  • flask
  • pygame

Set Up Audio (Optional):

If you want audio notifications when a battery is scanned, ensure that your system has audio output and that pygame is properly configured.

Configuration

The application can be configured through the web interface or by modifying variables in the main.py script.

  • Team Number:

    • Default: "5987"
    • Purpose: Used to generate new battery codes and validate existing ones.
    • Can be changed via the web interface under Settings.
  • Cooldown Duration:

    • Default: 600 seconds (10 minutes)
    • Purpose: Enforce a cooldown period after charging or usage before the battery can be moved to the next status.
    • Can be changed via the web interface under Settings.
  • Camera Settings

    • The camera is set to a resolution of 320x240 pixels.
    • Modify cap.set(cv2.CAP_PROP_FRAME_WIDTH, 320) and cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 240) in main.py to change the resolution.

Usage

Running the Application Start the Flask Application

  • Run the main.py script:

python main.py

  • Access the Web Interface:

Open your web browser and navigate to http://localhost:5000 or http://0.0.0.0:5000 depending on your network configuration.

Clone this wiki locally