A.R.G.U.S. (Adaptive Real-Time Guardian for Unsafe Situations) is a real-time safety supervisor for a small robotic arm.
It watches camera input, decides whether the scene is safe, and routes motion through guardian + interlock logic so unsafe conditions trigger retract + freeze.
Validated ARGUS bench setup on Raspberry Pi 5 with Pi Camera, PCA9685 and MeArm platform.
| Component | Quantity | Cost (£) |
|---|---|---|
| Raspberry Pi 5 | 1 | Free |
| Component | Quantity | Cost (£) |
|---|---|---|
| Raspberry Pi Camera Module | 1 | Free |
| Component | Quantity | Cost (£) |
|---|---|---|
| MeArm Maker Kit V3 | 1 | £47 |
| Adafruit PCA9685 | 1 | £14.40 |
| Raspberry Pi Power Supply | 1 | £11.50 |
| Tactile Switch Button | 1 | Free |
| 6V AA Batteries | 1 | Free |
| Breadboard | 1 | Free |
| Jumper Wires | 1 | Free |
| 3D Printed Tools | 2 | Free |
Total Cost: £72.90
| Component | Quantity | Notes |
|---|---|---|
| Raspberry Pi 5 | 1 | validated target |
| Raspberry Pi camera | 1 | used with libcamerify |
| Adafruit PCA9685 | 1 | I2C servo driver |
| MeArm | 1 | 4-servo arm |
| Servos | 4 | base / lower / upper / grip |
| Momentary tactile button | 1 | active-low physical continue / ACK |
| External 6V battery pack | 1 | servo power |
Current validated runtime path:
AppController -> CameraCapture -> VisionProcessor -> GuardianStateMachine -> RobotInterlock -> MotionController
Validated hardware:
- Raspberry Pi 5
- Raspberry Pi camera
- Adafruit PCA9685 (I2C)
- MeArm (4 servos)
- one physical operator button (GPIO24, active-low)
Validated behaviour:
- live camera safety supervision
- forbidden-layer colour unsafe trigger
- guardian freeze/recover state flow
- retract-safe before freeze hold
- manual operator acknowledge to resume
- single control contract:
spacekey or physical button
sudo apt update
sudo apt install -y \
build-essential cmake pkg-config \
libopencv-dev libopencv-contrib-dev \
libcamera-tools libcamera-dev libturbojpeg0-devgit clone git@github.com:ENG5220-RTEP-Team-ARGUS/ARGUS.git --recursive
cd ARGUS
cmake -S . -B build
cmake --build build -j$(nproc)./scripts/live_test.shNotes:
live_test.shself-elevates withsudofor GPIO button access- wrapper tries
libcamera2opencvfirst, then falls back to OpenCV/V4L2 - you can force backend:
ARGUS_CAMERA_BACKEND=libcamera2opencv ./scripts/live_test.shARGUS_CAMERA_BACKEND=opencv ./scripts/live_test.sh
Global controls:
spaceor physical button: single control action (arm/disarm/ack based on current state)0: manual mode1: routine 1 (SURGERY_CUT)2: routine 2 (BASE_SCAN)3: routine 3 (GRIP_PULSE)esc: quit+/-: camera focus adjust (Pi Camera Module 3)
Manual mode (0) keys:
d/a: base left/rightw/s: forward/backwardi/k: up/downl/j: gripper open/close
Expected safety flow:
- Start in disarmed setup mode.
- Wait until scene is safe.
- Press
space/button to arm and start. - Unsafe trigger occurs -> routine stops -> retract-safe -> freeze hold.
- Make scene safe again.
- Press
space/button to acknowledge and resume.
./scripts/camera_backend_check.sh./scripts/smoke_all.sh
./scripts/smoke_base.sh
./scripts/smoke_lower.sh
./scripts/smoke_upper.sh
./scripts/smoke_grip.sh./scripts/set_home.sh./scripts/servo_console.sh
./scripts/servo_drive.sh
./scripts/servo_calibrate.sh./scripts/test_button.shUnit/integration tests configured in CMake:
cmake -S . -B build
cmake --build build -j$(nproc)
ctest --test-dir build --output-on-failureRuntime logs and dashboards expose:
vision_usunsafe_detect_msfreeze_pipeline_msfreeze_cmd_mstotal_stop_msack_to_resume_ms
Current guardian thresholds in live mode:
- freeze after
15consecutive bad frames - recover after
3consecutive good frames
Benchmarked against published literature and IEC 80601-2-77.
| Metric | Measured | Target | Status | Justification |
|---|---|---|---|---|
| Frame Processing | 706 µs |
— | Good | Well below the 75 ms achieved by NVIDIA Holoscan [1] and 15–20 ms AI pipelines in MIS [2]. |
| Detect Unsafe | 4 ms |
≤ 30 ms | Good | Delays >100 ms risk tissue damage [3]. Meets IEC 80601-2-77 protective stop requirements [4]. |
| Issue Freeze | 458 ms |
≤ 900 ms | Good | Telesurgery validated up to 500 ms latency [5]; 320 ms confirmed safe over 3000 km [6]. |
| Stop Motion | 7206 ms |
≤ 8000 ms | Good | Controlled deceleration prevents secondary tissue injury per IEC 80601-2-77 [4]. |
- NVIDIA, "Real-Time Surgical Guidance with Holoscan," 2025. Link
- "AI-Based Sensorless Force Feedback in Robot-Assisted MIS," MDPI, 2025. Link
- Leung, "Engineering precision in surgical robotics," Medical Design & Outsourcing, 2025. Link
- IEC 80601-2-77:2019; Chinzei, "Safety of Surgical Robots," Acta Polytechnica Hungarica, 2019. PDF
- Korte et al., "Impact of latency on surgical precision," Computer Aided Surgery, 2005. Link
- Xu et al., "Latency in robot-assisted telesurgery," PMC, 2024. Link
Key docs:
- System architecture diagram
- Guardian state machine
- Threading model
- Vision safety pipeline (PDF)
- Compliance matrix
- Compliance ADR
Project wiki:
Full API documentation is generated from source comments:
To regenerate locally:
doxygen Doxyfile
open docs/doxygen/html/index.htmlconfig/ Runtime configuration and calibration files
docs/architecture/ Architecture and wiring diagrams
docs/adr/ Architecture decision records
docs/doxygen/ Generated Doxygen HTML output
docs/compliance_matrix.md
include/ Headers
src/ C++ implementation
scripts/ Pi run/test helper scripts
tests/ CTest targets
third_party/ Vendored third-party dependencies
ARGUS public channels for demos, build updates, and outreach:
- Website: thewebbutbeyond.github.io/argus
- Website source: gui/argus-app
- Instagram: @argus102026
- YouTube: @argus-w3g
- LinkedIn: A.R.G.U.S
- TikTok: @argusxisx61
| Name | Component Ownership | Key Contributions |
|---|---|---|
| Nathan Sidi Bakari | MotionController, AppController | Servo output path, PCA9685 driver integration, run modes, CLI interface, hardware wiring, social media content |
| Patricia Munginga | VisionProcessor | Vision safety pipeline, colour detection, Doxygen documentation, PR reviews, social media content |
| Jui Ning Chin | GuardianStateMachine | FSM design and implementation, state transitions, freeze/recovery logic, social media content |
| Liyue Tian | CameraCapture | Camera acquisition pipeline, libcamera2opencv integration, V4L2 fallback, social media content |
| Nigar Baghirova | RobotInterlock | Interlock gate logic, atomic state management, motion enable/disable, social media content |
This project is tracked using GitHub Projects. The project board tracks all issues, bugs and tasks with clear ownership per team member.
- Dr Bernd Porr and Dr Chongfeng Wei - course lecturers, ENG5220 Real-Time Embedded Programming
- Teaching assistants — lab support and coding standard guidance
- Bernd Porr's open-source libraries - cppTimer and libcamera2opencv, vendored under
third_party/with GPL licensing - University of Glasgow, School of Engineering - lab facilities and hardware budget
Mixed license model:
- original ARGUS code outside
third_party/: MIT - vendored third-party code in
third_party/: original upstream licenses
See:
