Skip to content

Commit 9bdde0e

Browse files
committed
[tests] Update standalone to work with the refactor
1 parent a8f13cd commit 9bdde0e

File tree

3 files changed

+24
-40
lines changed

3 files changed

+24
-40
lines changed

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ project(
88

99
### Library options ###
1010
option(PUARA_GESTURES_ENABLE_TESTING "Enable building and running Puara gestures tests" ON)
11+
option(PUARA_GESTURES_ENABLE_STANDALONE "Enable building and running Puara standalone" ON)
1112

1213
### Dependencies ###
1314
if(POLICY CMP0167)
@@ -58,3 +59,8 @@ if(PUARA_GESTURES_ENABLE_TESTING)
5859
target_link_libraries(testing_roll PRIVATE puara_gestures)
5960
target_link_libraries(testing_tilt PRIVATE puara_gestures)
6061
endif()
62+
63+
### Example ###
64+
if(PUARA_GESTURES_ENABLE_STANDALONE)
65+
add_subdirectory(standalone)
66+
endif()

standalone/CMakeLists.txt

+5-18
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ set(OSSIA_OVERRIDE_PROTOCOLS "OSC;OSCQuery")
2020

2121
FetchContent_Declare(
2222
libossia
23-
GIT_REPOSITORY "https://github.com/OSSIA/libossia"
23+
GIT_REPOSITORY "https://github.com/ossia/libossia"
2424
GIT_TAG master
2525
GIT_PROGRESS true
26+
GIT_SHALLOW 1
2627
)
2728
FetchContent_MakeAvailable(libossia)
2829

@@ -43,26 +44,12 @@ FetchContent_MakeAvailable(Eigen)
4344

4445
file(GLOB_RECURSE PUARA_SOURCE ../descriptors/*.cpp ../descriptors/*.h)
4546

46-
add_library(puara-gestures STATIC ${PUARA_SOURCE})
47-
target_link_libraries(puara-gestures PUBLIC
48-
Eigen3::Eigen
49-
Boost::boost
50-
)
51-
5247
# Project setup
53-
add_executable(puara-gestures-standalone)
54-
55-
target_sources(puara-gestures-standalone
56-
PRIVATE
57-
main.cpp
48+
add_executable(puara-gestures-standalone
49+
main.cpp
5850
)
5951
target_link_libraries(puara-gestures-standalone
6052
PRIVATE
6153
ossia
62-
puara-gestures
63-
)
64-
target_include_directories(puara-gestures-standalone
65-
PRIVATE
66-
${libossia_SOURCE_DIR}/ossia/include
67-
${libossia_SOURCE_DIR}/ossia
54+
puara_gestures
6855
)

standalone/main.cpp

+13-22
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,17 @@
1111

1212
// clang-format -i *.h
1313

14-
#include "../puara_gestures.h"
15-
16-
#include <ossia/network/generic/generic_device.hpp>
17-
#include <ossia/network/osc/osc.hpp>
18-
1914
#include <ossia/network/base/parameter_data.hpp>
2015
#include <ossia/network/common/debug.hpp>
16+
#include <ossia/network/generic/generic_device.hpp>
17+
#include <ossia/network/osc/osc.hpp>
18+
#include <puara/gestures.h>
2119

20+
#include <chrono>
2221
#include <iostream>
2322
#include <sstream>
24-
25-
#include <vector>
26-
#include <chrono>
2723
#include <thread>
28-
#include "../descriptors/IMU_Sensor_Fusion/imu_orientation.h"
24+
#include <vector>
2925

3026
std::string client_ip = "127.0.0.1";
3127
int client_port = 9000;
@@ -42,10 +38,6 @@ puara_gestures::Shake3D shake;
4238
puara_gestures::Jab3D jab;
4339
puara_gestures::utils::LeakyIntegrator leakyintegrator;
4440
IMU_Orientation orientation;
45-
puara_gestures::testing_roll rollTest;
46-
puara_gestures::testing_tilt tiltTest;
47-
48-
#include <vector>
4941

5042
// struct Coord3D {
5143
// double x, y, z;
@@ -75,13 +67,12 @@ int main(int argc, char* argv[]) {
7567
leakyintegrator.integrate(accelerometer[0]);
7668
});
7769

78-
//rollTest.test();
79-
tiltTest.test();
80-
81-
// while(true) {
82-
// puara_gestures::Coord3D shakeout = shake.current_value();
83-
// puara_gestures::Coord3D jabout = jab.current_value();
84-
// std::cout << "Shake X: " << shakeout.x << ", Jab X: " << jabout.x << ", Integrator: " << leakyintegrator.current_value << std::endl;
85-
// std::this_thread::sleep_for(std::chrono::milliseconds(10));
86-
// };
70+
while(true)
71+
{
72+
puara_gestures::Coord3D shakeout = shake.current_value();
73+
puara_gestures::Coord3D jabout = jab.current_value();
74+
std::cout << "Shake X: " << shakeout.x << ", Jab X: " << jabout.x
75+
<< ", Integrator: " << leakyintegrator.current_value << std::endl;
76+
std::this_thread::sleep_for(std::chrono::milliseconds(10));
77+
};
8778
}

0 commit comments

Comments
 (0)