GUI Subsystem - foolofato0k/Robo-Studio2 GitHub Wiki

Summary and Scope

Summary and Scope

This page describes the Robo‑Da‑Vinci GUI subsystem, a Tkinter interface that captures user selfies, previews contours live, allows countdown and style selection, and publishes confirmation for path planning.

Scope:

  • Launching and visualising live vs. processed camera feed
  • User controls: countdown timer, style dropdown, capture/retake
  • Publishing confirmation messages and saving captured images
  • Displaying a progress bar for processing stages

Subsystem Architecture

Subsystem Architecture

The GUI subsystem is implemented as a single ROS 2 node that cleanly separates user interface logic from message publishing, It consists of:

  • PhotoGUI: Tkinter-based interface handling live camera preview, countdown, style selection, capture/retake, and progress visualisation.
  • PhotoPublisher Topic: ROS 2 topic that is published from the GUI, publishes a std_msgs/Bool on the photo_confirmed topic, and triggers path planning processing.

Structure

Structure

  1. Requirements:
    • ROS 2
    • Python libs
    • Webcam
  2. Running:
    • Colcon build
    • Source
    • ROS2 run command
  3. UI Elements:
    • Live camera pane
    • Contours pane
    • Countdown timer dropdown
    • Style dropdown
    • Take Photo / Yes / No buttons
    • Progress bar + status labels
  4. Behaviour:
    • Camera autodetection (/dev/videoX or indices)
    • Frame processing (gray → blur → edges → contours)
    • Countdown & capture image
    • Confirmation → publish, save, and progress visualisation

Expectations

What to Expect

  • Live Camera Feed (left)
  • Contour Preview (right)
  • Countdown Timer: None, 3s, 5s, 10s
  • Style Selector: None, Wanted, Style 2-4
  • Take Photo:
    • Freezes feed after the countdown
    • Prompts Yes / No
  • On Confirm:
    • Publishes std_msgs/Bool on photo_confirmed
    • Saves image to image_processing/test_images/webcam_img.jpg
    • Shows progress: Processing Image → Path Planning → Drawing → Completed

1


Instructions

Running Instructions

Build your workspace:

colcon build --symlink-install

Source your workspace:

source install/setup.bash

Launch the GUI:

ros2 run robo_da_vinci gui_node
  1. Live Preview: confirm your webcam feed appears on the left, contours on the right.
  2. Countdown: choose None, 3s, 5s, or 10s before capture.
  3. Style Selection: pick an artistic style; the label updates immediately.
  4. Capture: click Take Photo to freeze the image, then use Yes to confirm or No to retake.
  5. Progress: after confirmation, watch the progress bar advance through Processing Image → Path Planning → Drawing until Completed.

Subsystem Tests

Subsystem Tests

Below is a test plan for the GUI subsystem. Users can run these tests to verify functionality.

Test 1:

Test 1: Live Camera Feed Display

  • Requirement: Show a real-time camera feed within the GUI window.
  • Assumptions: Webcam functional, OpenCV installed.
  • Procedure:
  1. Connect and power on the webcam.
  2. Launch the GUI: ros2 run robo_da_vinci gui_node.
  3. Observe the left pane for live video.
  4. Move an object in front of the camera.
  • Pass Criteria:
    • Feed appears within 5 s
    • Updates smoothly with minimal latency.
  • Fail Criteria:
    • No feed
    • Frozen image
    • Program crash.

Test 2:

Test 2: Live Processed Image Display

  • Requirement: Show real-time contour-processed preview.
  • Assumptions: Image processing runs in real time.
  • Procedure:
  1. With the GUI running, confirm both panes (live and processed) are visible.
  2. Compare movements between the two.
  • Pass Criteria:
    • Processed pane updates in real time
    • Mirroring movements.
  • Fail Criteria:
    • No processed pane
    • Frozen or laggy display.

Test 3:

Test 3: GUI Responsiveness

  • Requirement: UI responds promptly to user interactions.
  • Procedure:
  1. Click dropdowns and buttons (timer, style, Take Photo, Yes/No).
  2. Measure response time.
  • Pass Criteria:
    • All interactions respond within 1s.
  • Fail Criteria:
    • Delays > 1 s
    • Unresponsive elements
    • Incorrect actions.

Test 4:

Test 4: Capture Workflow & Style Selection

  • Requirement: Countdown, capture, retake, and style dropdown function correctly.
  • Procedure:
  1. Select each timer option and press Take Photo.
  2. Confirm countdown behaviour.
  3. Choose a style and verify selection label updates.
  4. On capture, press Yes and No to test both flows.
  • Pass Criteria: Countdown matches selection
    • Style label updates
    • Yes, saves and publishes
    • No returns to live view.
  • Fail Criteria:
    • Incorrect countdown
    • Style not applied
    • Confirmation flow broken.

Test 5:

Test 5: Progress Bar Synchronisation

  • Requirement: Progress bar reflects processing stages.
  • Procedure:
  1. After confirming a capture, observe the progress bar.
  2. Ensure it transitions through Processing Image → Path Planning → Drawing to Completed.
  • Pass Criteria:
    • Bar moves smoothly in sync with simulated stages
    • “COMPLETED” appears and blinks.
  • Fail Criteria:
    • Bar frozen
    • Jumps incorrectly
    • Missing stages.
⚠️ **GitHub.com Fallback** ⚠️