Welcome to the BUDI repository! In order to get the project up and running on your system, follow these steps:
Environment Setup
- Install XCode, and ensure that you have at least version 13.2.1
- Clone the "main-app" repository into the desired directory on your device.
- In your terminal, navigate to the project directory. Within the project directory, go to CardinalKit > CardinalKit-Example
- Once you're in CardinalKit-Example, run "pod install" to get the CocoaPods setup.
Build & Run
- Open the workspace by navigating to your project directory, then opening the "CardinalKit.xcworkspace" file within CardinalKit > CardinalKit-Example
- Install a simulator with an Apple Watch and iPhone through XCode.
- Clean the build folder in XCode: Product > Clean Build Folder
- Run the project by building & running the "Budi Watchkit" on iOS simulators: Apple Watch Series 4+
- CardinalKit
- ResearchKit
- HealthKit
- CocoaPods
If you're having trouble getting started with the codebase or with the latest repo pull, consider taking the following steps:
- quit XCode completely
- remove CocoaPods: in the terminal, go to the CardinalKit-Example folder and run the command "pod deintegrate"
- reinstall CocoaPods: in the same folder, run the command "pod install"
- reopen CardinalKit.xcworkspace in XCode
- clean build folder: Product > Clean Build Folder
- rebuild & run
Acceleration data is collected on the Apple watch and sent to the phone via a shared WatchConnectivity session. The files where the phone and watch directly communicate through WCSessions are CardinalKit-Example > Library > WatchViewModel and BUDI WatchKit Extension > SendDataToPhone. The actual acceleration data is collected in CoreMotionManager via DeviceMotion, which gives gravity adjusted rather than raw acceleration. Every five seconds, the maximum observed acceleration value is sent to the phone as a message in the WCSession.
Two ResearchKit active tasks currently comprise the "Games" section of the application. To edit these files & add more games, go to the CardinalKit > Components > Home > Games. Note, you cannot edit the ResearchKit tasks themselves; these are off the shelf from Apple.
Users can currently view their progress on their daily therapy rings and their total therapy for the week in the "View Progress" section. Progress data relies on the goals the users set for active tasks & gross motor therapy (live therapy), which they set in their profile (as described below). In order to populate this view, we pull in data from Google's Firebase Firestore for the last seven days. The essential files involved are: WatchViewModel (sends the therapy duration data to Firestore, updating the totaltime in seconds for a given date after a session has been completed), ProgressUIChartView (houses ProgressUIChartViewModel which fetches the data from last 7 days from Firestore; populates the weekly chart), TherapyRingView (creates therapy ring based on percentage of therapy goal achieved on a given day), and ProgressUIView (presents the chart and rings to user).
In the profile view, the user can provide information about themselves, modify therapy schedule and notifications, set daily therapy goals and view contact information.
Goal Setting: Allows the user to set daily goals for number of active tasks and minutes of physical therapy. These variables are persistant and accessible globaly.
For general questions about the Budi project, reach out to blynns@stanford.edu.
Budi watchOS & data collection inquiries:
Taylor Lallas -- tlallas@stanford.edu
Tracy Cai -- cpcai@stanford.edu
Mihir Joshi -- joshi.373@osu.edu
Live Therapy View:
Blynn Shideler -- blynns@stanford.edu
Lavender Chen -- lvc0417@stanford.edu
Taylor Lallas -- tlallas@stanford.edu
Mihir Joshi -- joshi.373@osu.edu
iOS Charts & Progress View:
Lina Fang -- linafang@stanford.edu
Yoonju Kim -- yoonjuk@stanford.edu
Lavender Chen -- lvc0417@stanford.edu
Taylor Lallas -- tlallas@stanford.edu
Goal Setting:
Beste Aydin -- bestea@stanford.edu
Budi Integration with Firebase:
Bill Zhu -- zheqzhu@stanford.edu
Taylor Lallas -- tlallas@stanford.edu