Skip to content

JoDavidsson/ConjureKit-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ConjureKit Shared AR Cup Detection

A Unity-based shared AR experience that detects cups in real-time and shares their positions across multiple devices using ConjureKit.

Features

  • Real-time cup detection using ML Kit
  • Cross-device position sharing via ConjureKit
  • Smooth animations and visual effects
  • Works on both iOS and Android
  • Debug UI for monitoring system status
  • Optimized for mobile performance

Prerequisites

  • Unity 2021.3 or newer
  • ConjureKit account and credentials
  • iOS 13+ or Android API Level 24+
  • AR-capable device (ARKit for iOS, ARCore for Android)

Installation

  1. Create Unity Project

    • Create a new 3D Unity project
    • Switch platform to iOS or Android
    • Enable Version Control in Project Settings
  2. Install Required Packages Add the following to your project's manifest.json:

    {
      "dependencies": {
        "com.google.mlkit.vision.objects": "0.6.0",
        "com.unity.nuget.newtonsoft-json": "3.0.2",
        "com.dbrizov.naughtyattributes": "2.1.4",
        "com.google.external-dependency-manager": "1.2.169",
        "com.unity.xr.arfoundation": "5.0.7",
        "com.unity.xr.arkit": "5.0.7",
        "com.unity.xr.arcore": "5.0.7"
      },
      "scopedRegistries": [
        {
          "name": "Google MLKit",
          "url": "https://registry.npmjs.org",
          "scopes": ["com.google"]
        }
      ]
    }
  3. Project Structure Create the following folder structure:

    Assets/
    ├── Materials/
    ├── Prefabs/
    ├── Scenes/
    └── Scripts/
    

Setup Instructions

1. Scene Setup

  1. Create a new scene named "MainScene"
  2. Add AR components:
    • Create AR Session object
    • Create AR Session Origin object
    • Add AR Camera under Session Origin
    • Add required AR managers:
      • AR Plane Manager
      • AR Raycast Manager
      • AR Camera Manager

2. Create Cup Prefab

  1. Create Cup Material:

    • Create new material in Materials folder
    • Name it "CupMaterial"
    • Set shader to "Standard"
    • Configure properties:
      • Albedo: Semi-transparent blue (0, 0.5, 1, 0.6)
      • Metallic: 0.5
      • Smoothness: 0.8
      • Rendering Mode: Transparent
  2. Create Cup Prefab:

    • Create empty GameObject "CupPrefab"
    • Add cylinder as child
    • Scale cylinder to cup shape (e.g., 0.1, 0.15, 0.1)
    • Add Box Collider
    • Add CupVisual script
    • Apply CupMaterial
    • Save as prefab in Prefabs folder

3. Configure Managers

  1. On AR Session Origin:

    • Add CupDetectionManager component
    • Configure references:
      • AR Camera Manager
      • AR Raycast Manager
      • AR Camera
    • Set detection settings:
      • Detection Threshold: 0.5
      • Detection Interval: 0.5
  2. Add CupVisualizationManager:

    • Assign Cup Prefab
    • Set Cup Lifetime: 5.0
    • Enable Show Debug UI

4. Platform Configuration

iOS Setup

  1. Player Settings > iOS:
    • Set Bundle Identifier
    • Enable ARKit
    • Add Camera Usage Description
    • Set target iOS version (13+)
    • Architecture: ARM64

Android Setup

  1. Player Settings > Android:
    • Set Package Name
    • Enable ARCore
    • Min API Level: 24
    • Target API Level: 33
    • Scripting Backend: IL2CPP
    • Add Camera Permission

5. ConjureKit Integration

  1. Get ConjureKit credentials:

    • Register at Auki Labs
    • Obtain API Key and Secret
  2. Update CupDetectionManager:

    • Replace "YOUR_APP_KEY" with your API key
    • Replace "YOUR_APP_SECRET" with your API secret

Usage

  1. Starting the App

    • Launch on AR-capable device
    • Grant camera permissions when prompted
    • Wait for AR plane detection (white dots will appear)
  2. Detecting Cups

    • Point camera at cups
    • Hold device steady for best detection
    • Detected cups will appear with visual effects
    • Positions are automatically shared with other users
  3. Debug Information

    • Top-left shows active cups count
    • Shows total detections
    • Displays connection status

Troubleshooting

Common issues and solutions:

  1. No Cup Detection

    • Ensure good lighting
    • Hold device steady
    • Check debug UI for connection status
    • Verify camera permissions
  2. Poor Performance

    • Reduce detection interval
    • Close background apps
    • Check device temperature
    • Ensure device supports AR
  3. Sharing Issues

    • Verify internet connection
    • Check ConjureKit credentials
    • Confirm all users on same version
    • Verify ConjureKit service status

Performance Optimization

  1. Detection Settings

    • Adjust detection interval based on device capability
    • Modify confidence threshold for accuracy vs. speed
    • Consider reducing visual effects on lower-end devices
  2. Memory Management

    • Stale cups are automatically removed after 5 seconds
    • Texture memory is properly disposed
    • Camera frames are processed efficiently

Contributing

  1. Fork the repository
  2. Create feature branch
  3. Commit changes
  4. Push to branch
  5. Create Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Auki Labs for ConjureKit
  • Google for ML Kit
  • Unity for AR Foundation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages