Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Readmes and use included 3rdparty/boost in cmake #27

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
```
37 changes: 36 additions & 1 deletion exampleProjects/touch/README.md
Original file line number Diff line number Diff line change
@@ -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.

<p align="center">
<img width="450" src="https://github.com/user-attachments/assets/3502135c-9326-40aa-9887-8d796e464ff9">
</p>

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

<p align="center">
<img width="600" src="https://github.com/user-attachments/assets/f073b596-53a7-4404-a2aa-0ac49ad176b6">
</p>

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:

<p align="center">
<img width="600" src="https://github.com/user-attachments/assets/bafca748-f5d7-46ba-8f48-a05db5cf996e">
</p>

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

Expand Down
Loading