-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make a larger gesture recognizer object
- Loading branch information
Showing
9 changed files
with
125 additions
and
63 deletions.
There are no files selected for viewing
Submodule puara-gestures
updated
30 files
+ − | .DS_Store | |
+41 −0 | .github/workflows/cmake.yml | |
+4 −1 | .gitignore | |
+1 −1 | .gitmodules | |
+0 −0 | 3rdparty/IMU_Sensor_Fusion | |
+60 −0 | CMakeLists.txt | |
+0 −87 | descriptors/puara-gestures.code-workspace | |
+1 −1 | include/puara/descriptors/button.h | |
+2 −5 | include/puara/descriptors/jab.h | |
+6 −9 | include/puara/descriptors/roll.h | |
+2 −4 | include/puara/descriptors/shake.h | |
+2 −5 | include/puara/descriptors/tilt.h | |
+0 −2 | include/puara/descriptors/touch.h | |
+6 −15 | include/puara/gestures.h | |
+0 −0 | include/puara/structs.h | |
+8 −7 | include/puara/utils.h | |
+1 −1 | include/puara/utils/calibration.h | |
+1 −1 | include/puara/utils/circularbuffer.h | |
+2 −0 | include/puara/utils/leakyintegrator.h | |
+1 −1 | include/puara/utils/maprange.h | |
+2 −1 | include/puara/utils/rollingminmax.h | |
+4 −1 | include/puara/utils/smooth.h | |
+1 −1 | include/puara/utils/threshold.h | |
+2 −0 | include/puara/utils/wrap.h | |
+5 −2 | src/puara_gestures.cpp | |
+ − | standalone/.DS_Store | |
+0 −127 | testing_roll.h | |
+0 −123 | testing_tilt.h | |
+114 −0 | tests/testing_roll.cpp | |
+109 −0 | tests/testing_tilt.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "GestureRecognizer.hpp" | ||
namespace puara_gestures::objects | ||
{ | ||
void GestureRecognizer::operator()(halp::tick t) | ||
{ | ||
const double period = t.frames / setup.rate; | ||
|
||
auto [ax, ay, az] = inputs.accel.value; | ||
jab.update(ax, ay, az); | ||
shake.update(ax, ay, az); | ||
|
||
outputs.jab = jab.current_value(); | ||
outputs.shake = shake.current_value(); | ||
outputs.tilt = tilt.tilt(inputs.accel, inputs.gyro, inputs.mag, period); | ||
outputs.roll = roll.roll(inputs.accel, inputs.gyro, inputs.mag, period); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#pragma once | ||
#include <halp/audio.hpp> | ||
#include <halp/controls.hpp> | ||
#include <halp/meta.hpp> | ||
#include <puara/gestures.h> | ||
|
||
namespace puara_gestures::objects | ||
{ | ||
class GestureRecognizer | ||
{ | ||
public: | ||
halp_meta(name, "Gesture recognizer") | ||
halp_meta(category, "Gestures") | ||
halp_meta(c_name, "puara_roll") | ||
halp_meta(uuid, "3135b5e0-39a6-4151-8ae4-a657d577eab8") | ||
|
||
struct ins | ||
{ | ||
halp::val_port<"Acceleration", puara_gestures::Coord3D> accel; | ||
halp::val_port<"Gyrosocope", puara_gestures::Coord3D> gyro; | ||
halp::val_port<"Magnetometer", puara_gestures::Coord3D> mag; | ||
} inputs; | ||
|
||
struct | ||
{ | ||
halp::val_port<"Jab", puara_gestures::Coord3D> jab; | ||
halp::val_port<"Shake", puara_gestures::Coord3D> shake; | ||
halp::val_port<"Tilt", float> tilt; | ||
halp::val_port<"Roll", float> roll; | ||
} outputs; | ||
|
||
halp::setup setup; | ||
void prepare(halp::setup info) { setup = info; } | ||
|
||
using tick = halp::tick; | ||
void operator()(halp::tick t); | ||
|
||
puara_gestures::Jab3D jab; | ||
puara_gestures::Shake3D shake; | ||
puara_gestures::Tilt tilt; | ||
puara_gestures::Roll roll; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters