diff --git a/CMakeLists.txt b/CMakeLists.txt index 1973592..ba652e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,9 +14,10 @@ option(PUARA_GESTURES_ENABLE_STANDALONE "Enable building and running Puara stand if(POLICY CMP0167) cmake_policy(SET CMP0167 OLD) endif() -if(NOT TARGET Boost::headers) - find_package(Boost REQUIRED) -endif() + +set(BOOST_ROOT "${CMAKE_SOURCE_DIR}/3rdparty") +set(Boost_NO_SYSTEM_PATHS ON) +find_package(Boost REQUIRED) ### Main library ### add_library(puara_gestures diff --git a/README.md b/README.md index 409590a..ad7efb7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,37 @@ -# puara-gestures -High-level gestural descriptor functions for the Puara Framework +# Puara Gestures +The `puara-gestures` library provides a set of tools for creating and managing high-level gestural descriptors using data from various sensors such as accelerometers, gyroscopes, and magnetometers. The library includes classes for handling different types of gestures, including shakes, rolls, tilts, jabs, and touches. + +## Features + +- **Shake Gestures**: Detects shake movements using accelerometer data. +- **Roll Gestures**: Measures roll gestures using 3DoF info from an accelerometer, gyroscope, and magnetometer. +- **Tilt Gestures**: Measures tilt gestures using 3DoF info from an accelerometer, gyroscope, and magnetometer. +- **Jab Gestures**: Detects jab movements using accelerometer data. +- **Touch Gestures**: Interprets touch features based on movement input using a leaky integrator for smoothing. + +## Example Projects +The included `exampleProjects` directory contains example projects and is probably the best starting point for new users. See `exampleProjects/README.md` for details. + +## Building the Library + +### Prerequisites +- CMake 3.24 or higher +- A compatible C++ compiler +- Arduino IDE (for running the example project on hardware) + +### Building +To build the `puara-gestures` library, follow these steps: + +1. Clone the repository: + ```sh + git clone https://github.com/Puara/puara-gestures.git + cd puara-gestures + ``` +2. Configure the project using CMake: + ```sh + cmake -B build + ``` +3. Build the project: + ```sh + cmake --build build + ``` diff --git a/exampleProjects/touch/README.md b/exampleProjects/touch/README.md index b446577..765ac2c 100644 --- a/exampleProjects/touch/README.md +++ b/exampleProjects/touch/README.md @@ -1,6 +1,41 @@ # Touch Project -This project is part of the Puara Framework and demonstrates high-level gestural descriptor functions using a touchscreen. It showcases the integration of `puara-gestures` with a touchscreen to detect and display touch interactions. You can use the built-in wokwi diagram.json to simulate the project. +This project is part of the Puara Framework and showcases the integration of `puara-gestures` with a touchscreen in a [Wokwi](https://wokwi.com/) simulation to detect and display touch interactions. + +## Running the Project Using Wokwi in Visual Studio Code + +1. Install [Visual Studio Code](https://code.visualstudio.com/), as well as the [PlatformIO](https://platformio.org/install/ide?install=vscode) and [Wokwi](https://docs.wokwi.com/vscode/getting-started) VS Code extensions. As part of the process you'll need to create a free [Wokwi](https://wokwi.com/) online account. + +2. Clone this repository and open the `exampleProjects/touch` directory in Visual Studio Code. + + ```sh + git clone https://github.com/Puara/puara-gestures.git + code puara-gestures/exampleProjects/touch + ``` + + Once you open the `touch` directory in VS Code, PlatformIO should take a moment to install all the dependencies listed in `exampleProjects/touch/platformio.ini`. + +3. Open the `diagram.json` file. + +4. If you've never signed in your wokwi account from VS Code, or it's been more than a month since you got your last license, you might get this dialog in the bottom right of the IDE. If so, click on "Request a New License" and follow the instructions to get another free Wokwi license. + +

+ +

+ +5. Click on the green arrow "Start Simulation" button in the top left to build and run the project in Wokwi: + +

+ +

+ +6. Once the simulation is started, click on the touch screen to start the touch example. Now if you "brush" and "rub" the touch screen up and down with your mouse cursor you should see `brush` and `rub` values printed in the VS Code Wokwi Terminal: + +

+ +

+ +7. The firmware code to run this simulation is located in `exampleProjects/touch/src`. Feel free to explore and modify the code to understand how it all works. Have fun! ## License