Compare commits
1 Commits
59-als-stu
...
44-als-geb
Author | SHA1 | Date | |
---|---|---|---|
|
396403fd85 |
10
.gitignore
vendored
10
.gitignore
vendored
@@ -1,9 +1 @@
|
||||
.DS_Store
|
||||
/.idea/.gitignore
|
||||
/.idea/dictionaries/lucawarm.xml
|
||||
/.idea/material_theme_project_new.xml
|
||||
/docs/documentation/assets/math-expression-location-calculation.png
|
||||
/.idea/modules.xml
|
||||
/.idea/muupooviixee66.iml
|
||||
/.idea/vcs.xml
|
||||
/node_modules/
|
||||
.DS_Store
|
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/muupooviixee66-3.iml" filepath="$PROJECT_DIR$/.idea/muupooviixee66-3.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
9
.idea/muupooviixee66-3.iml
generated
9
.idea/muupooviixee66-3.iml
generated
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
250
.idea/workspace.xml
generated
250
.idea/workspace.xml
generated
@@ -14,10 +14,15 @@
|
||||
</configurations>
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="00599d5b-7eb5-44da-ad7f-98bf42384c16" name="Changes" comment="Crack butt">
|
||||
<change afterPath="$PROJECT_DIR$/code/web/pepper_data_test.js" afterDir="false" />
|
||||
<list default="true" id="00599d5b-7eb5-44da-ad7f-98bf42384c16" name="Changes" comment="Final update onderzoek-formulier.md">
|
||||
<change afterPath="$PROJECT_DIR$/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/server/WebSocketConnection.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/code/web/incoming_request_handlers.js" beforeDir="false" afterPath="$PROJECT_DIR$/code/web/incoming_request_handlers.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/processing/MotionData.java" beforeDir="false" afterPath="$PROJECT_DIR$/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/processing/MotionData.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/processing/MotionInputStream.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/processing/MotionProcessor.java" beforeDir="false" afterPath="$PROJECT_DIR$/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/processing/MotionProcessor.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/server/IWebSocketHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/server/IWebSocketHandler.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/server/WebSocket.java" beforeDir="false" afterPath="$PROJECT_DIR$/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/server/WebSocket.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/server/WebSocketConnectionHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/code/src/Fitbot/app/src/main/java/com/example/fitbot/util/server/WebSocketConnectionHandler.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@@ -27,6 +32,7 @@
|
||||
<component name="ClangdSettings">
|
||||
<option name="formatViaClangd" value="false" />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[]" />
|
||||
<component name="ExternalProjectsData">
|
||||
<projectState path="$PROJECT_DIR$">
|
||||
<ProjectState />
|
||||
@@ -49,8 +55,6 @@
|
||||
<list>
|
||||
<option value="Interface" />
|
||||
<option value="Class" />
|
||||
<option value="package.json" />
|
||||
<option value="JavaScript File" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
@@ -58,11 +62,6 @@
|
||||
<option name="BRANCH" value="origin/main" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||
<map>
|
||||
<entry key="$PROJECT_DIR$" value="44-als-gebruiker-wil-ik-dat-ik-feedback-krijg-als-mijn-bewegingen-niet-optimaal-zijn-zodat-ik-weet" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="GitSEFilterConfiguration">
|
||||
@@ -77,7 +76,8 @@
|
||||
<option name="stateVersion" value="1" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 5
|
||||
"customColor": "",
|
||||
"associatedIndex": 7
|
||||
}</component>
|
||||
<component name="ProjectId" id="2fE3N2CwEPDo9wBtexBLxU20tCJ" />
|
||||
<component name="ProjectLevelVcsManager">
|
||||
@@ -87,26 +87,28 @@
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"Node.js.pepper_data_test.js.executor": "Run",
|
||||
"git-widget-placeholder": "main",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"settings.editor.selected.configurable": "preferences.lookFeel",
|
||||
"ts.external.directory.path": "/Applications/WebStorm.app/Contents/plugins/javascript-plugin/jsLanguageServicesImpl/external",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"git-widget-placeholder": "44-als-gebruiker-wil-ik-dat-ik-feedback-krijg-als-mijn-bewegingen-niet-op…-weet",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "/Users/lucawarm/Jetbrains/Android Studio/muupooviixee66",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"settings.editor.selected.configurable": "preferences.pluginManager",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}</component>
|
||||
}]]></component>
|
||||
<component name="RecentsManager">
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="$PROJECT_DIR$/code/src/app/src/main/java/com/fitbot" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager" selected="Node.js.pepper_data_test.js">
|
||||
<component name="RunManager">
|
||||
<configuration name="Fitbot" type="AndroidRunConfigurationType" factoryName="Android App">
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
@@ -115,40 +117,16 @@
|
||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||
<option name="ALL_USERS" value="false" />
|
||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||
<option name="CLEAR_APP_STORAGE" value="false" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="CLEAR_LOGCAT" value="false" />
|
||||
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
|
||||
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
|
||||
<option name="FORCE_STOP_RUNNING_APP" value="true" />
|
||||
<option name="INSPECTION_WITHOUT_ACTIVITY_RESTART" value="false" />
|
||||
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
|
||||
<option name="DEBUGGER_TYPE" value="Java" />
|
||||
<Auto>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Auto>
|
||||
<Hybrid>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Hybrid>
|
||||
<Java />
|
||||
<Native>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Native>
|
||||
<Profilers>
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
||||
@@ -163,21 +141,6 @@
|
||||
<option name="SKIP_ACTIVITY_VALIDATION" value="false" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="pepper_data_test.js" type="NodeJSConfigurationType" temporary="true" nameIsGenerated="true" path-to-js-file="$PROJECT_DIR$/code/web/pepper_data_test.js" working-dir="$PROJECT_DIR$/code/web">
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="Node.js.pepper_data_test.js" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
<component name="SharedIndexes">
|
||||
<attachedChunks>
|
||||
<set>
|
||||
<option value="bundled-js-predefined-1d06a55b98c1-91d5c284f522-JavaScript-WS-241.15989.105" />
|
||||
</set>
|
||||
</attachedChunks>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
@@ -192,25 +155,6 @@
|
||||
<workItem from="1713814327036" duration="4920000" />
|
||||
<workItem from="1713863377053" duration="634000" />
|
||||
<workItem from="1713960463274" duration="353000" />
|
||||
<workItem from="1715686350378" duration="91000" />
|
||||
<workItem from="1715687332786" duration="822000" />
|
||||
<workItem from="1715724270673" duration="5481000" />
|
||||
<workItem from="1715765990621" duration="8538000" />
|
||||
<workItem from="1715777647522" duration="725000" />
|
||||
<workItem from="1715779408605" duration="3840000" />
|
||||
<workItem from="1715957538891" duration="2000" />
|
||||
<workItem from="1716126955744" duration="1102000" />
|
||||
<workItem from="1716286107331" duration="6057000" />
|
||||
<workItem from="1716308427931" duration="28000" />
|
||||
<workItem from="1716318640952" duration="7000" />
|
||||
<workItem from="1716363591734" duration="658000" />
|
||||
<workItem from="1716538507910" duration="2194000" />
|
||||
<workItem from="1716547378856" duration="243000" />
|
||||
<workItem from="1716648462646" duration="8555000" />
|
||||
<workItem from="1716674767699" duration="21000" />
|
||||
<workItem from="1716889548355" duration="3475000" />
|
||||
<workItem from="1716904079045" duration="2259000" />
|
||||
<workItem from="1716977405893" duration="336000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Changes">
|
||||
<created>1713528225837</created>
|
||||
@@ -264,127 +208,7 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1713858768333</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00008" summary="onderzoek-voorbeeld.md">
|
||||
<option name="closed" value="true" />
|
||||
<created>1715729252488</created>
|
||||
<option name="number" value="00008" />
|
||||
<option name="presentableId" value="LOCAL-00008" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1715729252488</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00009" summary="Updated onderzoek-voorbeeld.md">
|
||||
<option name="closed" value="true" />
|
||||
<created>1715762530473</created>
|
||||
<option name="number" value="00009" />
|
||||
<option name="presentableId" value="LOCAL-00009" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1715762530473</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00010" summary="Renamed files, added motion-tracking-system-analysis.md">
|
||||
<option name="closed" value="true" />
|
||||
<created>1715767477412</created>
|
||||
<option name="number" value="00010" />
|
||||
<option name="presentableId" value="LOCAL-00010" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1715767477412</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00011" summary="Updated onderzoek-voorbeeld.md and motion-tracking-system-analysis.md">
|
||||
<option name="closed" value="true" />
|
||||
<created>1715773120402</created>
|
||||
<option name="number" value="00011" />
|
||||
<option name="presentableId" value="LOCAL-00011" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1715773120402</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00012" summary="Updated onderzoek-voorbeeld.md & motion-tracking-system-analysis.md">
|
||||
<option name="closed" value="true" />
|
||||
<created>1715780873394</created>
|
||||
<option name="number" value="00012" />
|
||||
<option name="presentableId" value="LOCAL-00012" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1715780873394</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00013" summary="Merge">
|
||||
<option name="closed" value="true" />
|
||||
<created>1715951036170</created>
|
||||
<option name="number" value="00013" />
|
||||
<option name="presentableId" value="LOCAL-00013" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1715951036170</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00014" summary="nonsense">
|
||||
<option name="closed" value="true" />
|
||||
<created>1716363685668</created>
|
||||
<option name="number" value="00014" />
|
||||
<option name="presentableId" value="LOCAL-00014" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1716363685669</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00015" summary="Added Skills Ontwikkelings Plan.docx">
|
||||
<option name="closed" value="true" />
|
||||
<created>1716363757016</created>
|
||||
<option name="number" value="00015" />
|
||||
<option name="presentableId" value="LOCAL-00015" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1716363757016</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00016" summary="Added NodeJS Server files">
|
||||
<option name="closed" value="true" />
|
||||
<created>1716540796495</created>
|
||||
<option name="number" value="00016" />
|
||||
<option name="presentableId" value="LOCAL-00016" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1716540796495</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00017" summary="killed my brain doing literature">
|
||||
<option name="closed" value="true" />
|
||||
<created>1716658275320</created>
|
||||
<option name="number" value="00017" />
|
||||
<option name="presentableId" value="LOCAL-00017" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1716658275320</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00018" summary="updated gay">
|
||||
<option name="closed" value="true" />
|
||||
<created>1716658499589</created>
|
||||
<option name="number" value="00018" />
|
||||
<option name="presentableId" value="LOCAL-00018" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1716658499589</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00019" summary="Commit crack cocaine">
|
||||
<option name="closed" value="true" />
|
||||
<created>1716889664199</created>
|
||||
<option name="number" value="00019" />
|
||||
<option name="presentableId" value="LOCAL-00019" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1716889664199</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00020" summary="Commit war crimes in formal Yugoslavia">
|
||||
<option name="closed" value="true" />
|
||||
<created>1716890009616</created>
|
||||
<option name="number" value="00020" />
|
||||
<option name="presentableId" value="LOCAL-00020" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1716890009616</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00021" summary="Crack butt">
|
||||
<option name="closed" value="true" />
|
||||
<created>1716890828736</created>
|
||||
<option name="number" value="00021" />
|
||||
<option name="presentableId" value="LOCAL-00021" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1716890828736</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00022" summary="Crack butt">
|
||||
<option name="closed" value="true" />
|
||||
<created>1716891155110</created>
|
||||
<option name="number" value="00022" />
|
||||
<option name="presentableId" value="LOCAL-00022" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1716891155110</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="23" />
|
||||
<option name="localTasksCounter" value="8" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
@@ -410,20 +234,6 @@
|
||||
<MESSAGE value="Added 'onderzoek.md' & 'onderzoek-formulier.md'" />
|
||||
<MESSAGE value="Updated 'onderzoek-formulier.md'" />
|
||||
<MESSAGE value="Final update onderzoek-formulier.md" />
|
||||
<MESSAGE value="onderzoek-voorbeeld.md" />
|
||||
<MESSAGE value="Updated onderzoek-voorbeeld.md" />
|
||||
<MESSAGE value="Renamed files, added motion-tracking-system-analysis.md" />
|
||||
<MESSAGE value="Updated onderzoek-voorbeeld.md and motion-tracking-system-analysis.md" />
|
||||
<MESSAGE value="Updated onderzoek-voorbeeld.md & motion-tracking-system-analysis.md" />
|
||||
<MESSAGE value="Merge" />
|
||||
<MESSAGE value="nonsense" />
|
||||
<MESSAGE value="Added Skills Ontwikkelings Plan.docx" />
|
||||
<MESSAGE value="Added NodeJS Server files" />
|
||||
<MESSAGE value="killed my brain doing literature" />
|
||||
<MESSAGE value="updated gay" />
|
||||
<MESSAGE value="Commit crack cocaine" />
|
||||
<MESSAGE value="Commit war crimes in formal Yugoslavia" />
|
||||
<MESSAGE value="Crack butt" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Crack butt" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Final update onderzoek-formulier.md" />
|
||||
</component>
|
||||
</project>
|
4
.vscode/arduino.json
vendored
4
.vscode/arduino.json
vendored
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"port": "COM3",
|
||||
"board": "esp32:esp32:esp32s3"
|
||||
}
|
593
.vscode/c_cpp_properties.json
vendored
593
.vscode/c_cpp_properties.json
vendored
@@ -1,593 +0,0 @@
|
||||
{
|
||||
"version": 4,
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Arduino",
|
||||
"compilerPath": "C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\xtensa-esp32s3-elf-gcc\\esp-2021r2-patch5-8.4.0\\bin\\xtensa-esp32s3-elf-g++",
|
||||
"compilerArgs": [
|
||||
"-mlongcalls",
|
||||
"-ffunction-sections",
|
||||
"-fdata-sections",
|
||||
"-Wno-error=unused-function",
|
||||
"-Wno-error=unused-variable",
|
||||
"-Wno-error=deprecated-declarations",
|
||||
"-Wno-unused-parameter",
|
||||
"-Wno-sign-compare",
|
||||
"-freorder-blocks",
|
||||
"-Wwrite-strings",
|
||||
"-fstack-protector",
|
||||
"-fstrict-volatile-bitfields",
|
||||
"-Wno-error=unused-but-set-variable",
|
||||
"-fno-jump-tables",
|
||||
"-fno-tree-switch-conversion",
|
||||
"-std=gnu++11",
|
||||
"-fexceptions",
|
||||
"-fno-rtti"
|
||||
],
|
||||
"intelliSenseMode": "gcc-x64",
|
||||
"includePath": [
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\newlib\\platform_include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\freertos\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\freertos\\include\\esp_additions\\freertos",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\freertos\\port\\xtensa\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\freertos\\include\\esp_additions",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_hw_support\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_hw_support\\include\\soc",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_hw_support\\include\\soc\\esp32s3",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_hw_support\\port\\esp32s3",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_hw_support\\port\\esp32s3\\private_include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\heap\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\log\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\lwip\\include\\apps",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\lwip\\include\\apps\\sntp",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\lwip\\lwip\\src\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\lwip\\port\\esp32\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\lwip\\port\\esp32\\include\\arch",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\soc\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\soc\\esp32s3",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\soc\\esp32s3\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\hal\\esp32s3\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\hal\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\hal\\platform_port\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_rom\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_rom\\include\\esp32s3",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_rom\\esp32s3",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_common\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_system\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_system\\port\\soc",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_system\\port\\public_compat",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\xtensa\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\xtensa\\esp32s3\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\driver\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\driver\\esp32s3\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_pm\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_ringbuf\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\efuse\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\efuse\\esp32s3\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\vfs\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_wifi\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_event\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_netif\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_eth\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\tcpip_adapter\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_phy\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_phy\\esp32s3\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_ipc\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\app_trace\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_timer\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\mbedtls\\port\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\mbedtls\\mbedtls\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\mbedtls\\esp_crt_bundle\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\app_update\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\spi_flash\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bootloader_support\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\nvs_flash\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\pthread\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_gdbstub\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_gdbstub\\xtensa",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_gdbstub\\esp32s3",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espcoredump\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espcoredump\\include\\port\\xtensa",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\wpa_supplicant\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\wpa_supplicant\\port\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\wpa_supplicant\\esp_supplicant\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\ieee802154\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\console",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\asio\\asio\\asio\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\asio\\port\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\common\\osi\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\include\\esp32c3\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\common\\api\\include\\api",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\common\\btc\\profile\\esp\\blufi\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\common\\btc\\profile\\esp\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\host\\bluedroid\\api\\include\\api",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\esp_ble_mesh\\mesh_common\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\esp_ble_mesh\\mesh_common\\tinycrypt\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\esp_ble_mesh\\mesh_core",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\esp_ble_mesh\\mesh_core\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\esp_ble_mesh\\mesh_core\\storage",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\esp_ble_mesh\\btc\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\esp_ble_mesh\\mesh_models\\common\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\esp_ble_mesh\\mesh_models\\client\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\esp_ble_mesh\\mesh_models\\server\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\esp_ble_mesh\\api\\core\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\esp_ble_mesh\\api\\models\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\bt\\esp_ble_mesh\\api",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\cbor\\port\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\unity\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\unity\\unity\\src",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\cmock\\CMock\\src",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\coap\\port\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\coap\\libcoap\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\nghttp\\port\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\nghttp\\nghttp2\\lib\\includes",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp-tls",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp-tls\\esp-tls-crypto",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_adc_cal\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_hid\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\tcp_transport\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_http_client\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_http_server\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_https_ota\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_https_server\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_lcd\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_lcd\\interface",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\protobuf-c\\protobuf-c",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\protocomm\\include\\common",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\protocomm\\include\\security",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\protocomm\\include\\transports",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\mdns\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_local_ctrl\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\sdmmc\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_serial_slave_link\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_websocket_client\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\expat\\expat\\expat\\lib",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\expat\\port\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\wear_levelling\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\fatfs\\diskio",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\fatfs\\vfs",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\fatfs\\src",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\freemodbus\\freemodbus\\common\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\idf_test\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\idf_test\\include\\esp32s3",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\jsmn\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\json\\cJSON",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\libsodium\\libsodium\\src\\libsodium\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\libsodium\\port_include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\mqtt\\esp-mqtt\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\openssl\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\perfmon\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\spiffs\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\usb\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\ulp\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\wifi_provisioning\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\rmaker_common\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_diagnostics\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\rtc_store\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_insights\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\json_parser\\upstream\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\json_parser\\upstream",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\json_generator\\upstream",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_schedule\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp_secure_cert_mgr\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_rainmaker\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\gpio_button\\button\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\qrcode\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\ws2812_led",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\freertos\\include\\freertos",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\arduino_tinyusb\\tinyusb\\src",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\arduino_tinyusb\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp_littlefs\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp-dl\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp-dl\\include\\tool",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp-dl\\include\\typedef",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp-dl\\include\\image",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp-dl\\include\\math",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp-dl\\include\\nn",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp-dl\\include\\layer",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp-dl\\include\\detect",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp-dl\\include\\model_zoo",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp32-camera\\driver\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\esp32-camera\\conversions\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\dotprod\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\support\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\support\\mem\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\windows\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\windows\\hann\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\windows\\blackman\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\windows\\blackman_harris\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\windows\\blackman_nuttall\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\windows\\nuttall\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\windows\\flat_top\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\iir\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\fir\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\math\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\math\\add\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\math\\sub\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\math\\mul\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\math\\addc\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\math\\mulc\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\math\\sqrt\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\matrix\\mul\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\matrix\\add\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\matrix\\addc\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\matrix\\mulc\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\matrix\\sub\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\matrix\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\fft\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\dct\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\conv\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\common\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\matrix\\mul\\test\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\kalman\\ekf\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\espressif__esp-dsp\\modules\\kalman\\ekf_imu13states\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\include\\fb_gfx\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\tools\\sdk\\esp32s3\\qio_qspi\\include",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\cores\\esp32",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\variants\\esp32s3",
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\libraries\\BLE\\src",
|
||||
"c:\\users\\sebas\\appdata\\local\\arduino15\\packages\\esp32\\tools\\xtensa-esp32s3-elf-gcc\\esp-2021r2-patch5-8.4.0\\xtensa-esp32s3-elf\\include\\c++\\8.4.0",
|
||||
"c:\\users\\sebas\\appdata\\local\\arduino15\\packages\\esp32\\tools\\xtensa-esp32s3-elf-gcc\\esp-2021r2-patch5-8.4.0\\xtensa-esp32s3-elf\\include\\c++\\8.4.0\\xtensa-esp32s3-elf",
|
||||
"c:\\users\\sebas\\appdata\\local\\arduino15\\packages\\esp32\\tools\\xtensa-esp32s3-elf-gcc\\esp-2021r2-patch5-8.4.0\\xtensa-esp32s3-elf\\include\\c++\\8.4.0\\backward",
|
||||
"c:\\users\\sebas\\appdata\\local\\arduino15\\packages\\esp32\\tools\\xtensa-esp32s3-elf-gcc\\esp-2021r2-patch5-8.4.0\\lib\\gcc\\xtensa-esp32s3-elf\\8.4.0\\include",
|
||||
"c:\\users\\sebas\\appdata\\local\\arduino15\\packages\\esp32\\tools\\xtensa-esp32s3-elf-gcc\\esp-2021r2-patch5-8.4.0\\lib\\gcc\\xtensa-esp32s3-elf\\8.4.0\\include-fixed",
|
||||
"c:\\users\\sebas\\appdata\\local\\arduino15\\packages\\esp32\\tools\\xtensa-esp32s3-elf-gcc\\esp-2021r2-patch5-8.4.0\\xtensa-esp32s3-elf\\sys-include",
|
||||
"c:\\users\\sebas\\appdata\\local\\arduino15\\packages\\esp32\\tools\\xtensa-esp32s3-elf-gcc\\esp-2021r2-patch5-8.4.0\\xtensa-esp32s3-elf\\include"
|
||||
],
|
||||
"forcedInclude": [
|
||||
"C:\\Users\\sebas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.16\\cores\\esp32\\Arduino.h"
|
||||
],
|
||||
"cStandard": "c11",
|
||||
"cppStandard": "c++11",
|
||||
"defines": [
|
||||
"HAVE_CONFIG_H",
|
||||
"MBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"",
|
||||
"UNITY_INCLUDE_CONFIG_H",
|
||||
"WITH_POSIX",
|
||||
"_GNU_SOURCE",
|
||||
"IDF_VER=\"v4.4.7-dirty\"",
|
||||
"ESP_PLATFORM",
|
||||
"_POSIX_READER_WRITER_LOCKS",
|
||||
"F_CPU=240000000L",
|
||||
"ARDUINO=10607",
|
||||
"ARDUINO_ESP32S3_DEV",
|
||||
"ARDUINO_ARCH_ESP32",
|
||||
"ARDUINO_BOARD=\"ESP32S3_DEV\"",
|
||||
"ARDUINO_VARIANT=\"esp32s3\"",
|
||||
"ARDUINO_PARTITION_default",
|
||||
"ESP32",
|
||||
"CORE_DEBUG_LEVEL=0",
|
||||
"ARDUINO_RUNNING_CORE=1",
|
||||
"ARDUINO_EVENT_RUNNING_CORE=1",
|
||||
"ARDUINO_USB_MODE=1",
|
||||
"ARDUINO_USB_CDC_ON_BOOT=0",
|
||||
"ARDUINO_USB_MSC_ON_BOOT=0",
|
||||
"ARDUINO_USB_DFU_ON_BOOT=0",
|
||||
"__DBL_MIN_EXP__=(-1021)",
|
||||
"__FLT32X_MAX_EXP__=1024",
|
||||
"__cpp_attributes=200809",
|
||||
"__UINT_LEAST16_MAX__=0xffff",
|
||||
"__ATOMIC_ACQUIRE=2",
|
||||
"__FLT_MIN__=1.1754943508222875e-38F",
|
||||
"__GCC_IEC_559_COMPLEX=0",
|
||||
"__cpp_aggregate_nsdmi=201304",
|
||||
"__UINT_LEAST8_TYPE__=unsigned char",
|
||||
"__INTMAX_C(c)=c ## LL",
|
||||
"__CHAR_BIT__=8",
|
||||
"__UINT8_MAX__=0xff",
|
||||
"__WINT_MAX__=0xffffffffU",
|
||||
"__FLT32_MIN_EXP__=(-125)",
|
||||
"__cpp_static_assert=200410",
|
||||
"__ORDER_LITTLE_ENDIAN__=1234",
|
||||
"__SIZE_MAX__=0xffffffffU",
|
||||
"__WCHAR_MAX__=0xffff",
|
||||
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1=1",
|
||||
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2=1",
|
||||
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1",
|
||||
"__DBL_DENORM_MIN__=double(4.9406564584124654e-324L)",
|
||||
"__GCC_ATOMIC_CHAR_LOCK_FREE=2",
|
||||
"__GCC_IEC_559=0",
|
||||
"__FLT32X_DECIMAL_DIG__=17",
|
||||
"__FLT_EVAL_METHOD__=0",
|
||||
"__cpp_binary_literals=201304",
|
||||
"__FLT64_DECIMAL_DIG__=17",
|
||||
"__GCC_ATOMIC_CHAR32_T_LOCK_FREE=2",
|
||||
"__cpp_variadic_templates=200704",
|
||||
"__UINT_FAST64_MAX__=0xffffffffffffffffULL",
|
||||
"__SIG_ATOMIC_TYPE__=int",
|
||||
"__DBL_MIN_10_EXP__=(-307)",
|
||||
"__FINITE_MATH_ONLY__=0",
|
||||
"__cpp_variable_templates=201304",
|
||||
"__GNUC_PATCHLEVEL__=0",
|
||||
"__FLT32_HAS_DENORM__=1",
|
||||
"__UINT_FAST8_MAX__=0xffffffffU",
|
||||
"__has_include(STR)=__has_include__(STR)",
|
||||
"__DEC64_MAX_EXP__=385",
|
||||
"__INT8_C(c)=c",
|
||||
"__INT_LEAST8_WIDTH__=8",
|
||||
"__UINT_LEAST64_MAX__=0xffffffffffffffffULL",
|
||||
"__SHRT_MAX__=0x7fff",
|
||||
"__LDBL_MAX__=1.7976931348623157e+308L",
|
||||
"__UINT_LEAST8_MAX__=0xff",
|
||||
"__GCC_ATOMIC_BOOL_LOCK_FREE=2",
|
||||
"__UINTMAX_TYPE__=long long unsigned int",
|
||||
"__DEC32_EPSILON__=1E-6DF",
|
||||
"__FLT_EVAL_METHOD_TS_18661_3__=0",
|
||||
"__CHAR_UNSIGNED__=1",
|
||||
"__UINT32_MAX__=0xffffffffU",
|
||||
"__GXX_EXPERIMENTAL_CXX0X__=1",
|
||||
"__LDBL_MAX_EXP__=1024",
|
||||
"__WINT_MIN__=0U",
|
||||
"__INT_LEAST16_WIDTH__=16",
|
||||
"__SCHAR_MAX__=0x7f",
|
||||
"__WCHAR_MIN__=0",
|
||||
"__INT64_C(c)=c ## LL",
|
||||
"__DBL_DIG__=15",
|
||||
"__GCC_ATOMIC_POINTER_LOCK_FREE=2",
|
||||
"__SIZEOF_INT__=4",
|
||||
"__SIZEOF_POINTER__=4",
|
||||
"__GCC_ATOMIC_CHAR16_T_LOCK_FREE=2",
|
||||
"__USER_LABEL_PREFIX__",
|
||||
"__STDC_HOSTED__=1",
|
||||
"__LDBL_HAS_INFINITY__=1",
|
||||
"__XTENSA_EL__=1",
|
||||
"__FLT32_DIG__=6",
|
||||
"__FLT_EPSILON__=1.1920928955078125e-7F",
|
||||
"__GXX_WEAK__=1",
|
||||
"__SHRT_WIDTH__=16",
|
||||
"__LDBL_MIN__=2.2250738585072014e-308L",
|
||||
"__DEC32_MAX__=9.999999E96DF",
|
||||
"__cpp_threadsafe_static_init=200806",
|
||||
"__FLT32X_HAS_INFINITY__=1",
|
||||
"__INT32_MAX__=0x7fffffff",
|
||||
"__INT_WIDTH__=32",
|
||||
"__SIZEOF_LONG__=4",
|
||||
"__UINT16_C(c)=c",
|
||||
"__PTRDIFF_WIDTH__=32",
|
||||
"__DECIMAL_DIG__=17",
|
||||
"__FLT64_EPSILON__=2.2204460492503131e-16F64",
|
||||
"__INTMAX_WIDTH__=64",
|
||||
"__FLT64_MIN_EXP__=(-1021)",
|
||||
"__has_include_next(STR)=__has_include_next__(STR)",
|
||||
"__LDBL_HAS_QUIET_NAN__=1",
|
||||
"__FLT64_MANT_DIG__=53",
|
||||
"__GNUC__=8",
|
||||
"__GXX_RTTI=1",
|
||||
"__cpp_delegating_constructors=200604",
|
||||
"__FLT_HAS_DENORM__=1",
|
||||
"__SIZEOF_LONG_DOUBLE__=8",
|
||||
"__BIGGEST_ALIGNMENT__=16",
|
||||
"__STDC_UTF_16__=1",
|
||||
"__FLT64_MAX_10_EXP__=308",
|
||||
"__FLT32_HAS_INFINITY__=1",
|
||||
"__DBL_MAX__=double(1.7976931348623157e+308L)",
|
||||
"__cpp_raw_strings=200710",
|
||||
"__INT_FAST32_MAX__=0x7fffffff",
|
||||
"__DBL_HAS_INFINITY__=1",
|
||||
"__DEC32_MIN_EXP__=(-94)",
|
||||
"__INTPTR_WIDTH__=32",
|
||||
"__FLT32X_HAS_DENORM__=1",
|
||||
"__INT_FAST16_TYPE__=int",
|
||||
"__LDBL_HAS_DENORM__=1",
|
||||
"__cplusplus=201402L",
|
||||
"__cpp_ref_qualifiers=200710",
|
||||
"__DEC128_MAX__=9.999999999999999999999999999999999E6144DL",
|
||||
"__INT_LEAST32_MAX__=0x7fffffff",
|
||||
"__DEC32_MIN__=1E-95DF",
|
||||
"__DEPRECATED=1",
|
||||
"__cpp_rvalue_references=200610",
|
||||
"__DBL_MAX_EXP__=1024",
|
||||
"__WCHAR_WIDTH__=16",
|
||||
"__FLT32_MAX__=3.4028234663852886e+38F32",
|
||||
"__DEC128_EPSILON__=1E-33DL",
|
||||
"__PTRDIFF_MAX__=0x7fffffff",
|
||||
"__FLT32_HAS_QUIET_NAN__=1",
|
||||
"__GNUG__=8",
|
||||
"__LONG_LONG_MAX__=0x7fffffffffffffffLL",
|
||||
"__SIZEOF_SIZE_T__=4",
|
||||
"__cpp_rvalue_reference=200610",
|
||||
"__cpp_nsdmi=200809",
|
||||
"__SIZEOF_WINT_T__=4",
|
||||
"__LONG_LONG_WIDTH__=64",
|
||||
"__cpp_initializer_lists=200806",
|
||||
"__FLT32_MAX_EXP__=128",
|
||||
"__cpp_hex_float=201603",
|
||||
"__GXX_ABI_VERSION=1013",
|
||||
"__FLT_MIN_EXP__=(-125)",
|
||||
"__cpp_lambdas=200907",
|
||||
"__INT_FAST64_TYPE__=long long int",
|
||||
"__FP_FAST_FMAF=1",
|
||||
"__FLT64_DENORM_MIN__=4.9406564584124654e-324F64",
|
||||
"__DBL_MIN__=double(2.2250738585072014e-308L)",
|
||||
"__FLT32X_EPSILON__=2.2204460492503131e-16F32x",
|
||||
"__FLT64_MIN_10_EXP__=(-307)",
|
||||
"__DEC128_MIN__=1E-6143DL",
|
||||
"__REGISTER_PREFIX__",
|
||||
"__UINT16_MAX__=0xffff",
|
||||
"__DBL_HAS_DENORM__=1",
|
||||
"__FLT32_MIN__=1.1754943508222875e-38F32",
|
||||
"__UINT8_TYPE__=unsigned char",
|
||||
"__NO_INLINE__=1",
|
||||
"__FLT_MANT_DIG__=24",
|
||||
"__LDBL_DECIMAL_DIG__=17",
|
||||
"__VERSION__=\"8.4.0\"",
|
||||
"__UINT64_C(c)=c ## ULL",
|
||||
"__cpp_unicode_characters=200704",
|
||||
"__cpp_decltype_auto=201304",
|
||||
"__GCC_ATOMIC_INT_LOCK_FREE=2",
|
||||
"__FLT32_MANT_DIG__=24",
|
||||
"__FLOAT_WORD_ORDER__=__ORDER_LITTLE_ENDIAN__",
|
||||
"__SCHAR_WIDTH__=8",
|
||||
"__INT32_C(c)=c",
|
||||
"__DEC64_EPSILON__=1E-15DD",
|
||||
"__ORDER_PDP_ENDIAN__=3412",
|
||||
"__DEC128_MIN_EXP__=(-6142)",
|
||||
"__FLT32_MAX_10_EXP__=38",
|
||||
"__INT_FAST32_TYPE__=int",
|
||||
"__UINT_LEAST16_TYPE__=short unsigned int",
|
||||
"__INT16_MAX__=0x7fff",
|
||||
"__cpp_rtti=199711",
|
||||
"__SIZE_TYPE__=unsigned int",
|
||||
"__UINT64_MAX__=0xffffffffffffffffULL",
|
||||
"__INT8_TYPE__=signed char",
|
||||
"__cpp_digit_separators=201309",
|
||||
"__ELF__=1",
|
||||
"__xtensa__=1",
|
||||
"__FLT_RADIX__=2",
|
||||
"__INT_LEAST16_TYPE__=short int",
|
||||
"__LDBL_EPSILON__=2.2204460492503131e-16L",
|
||||
"__UINTMAX_C(c)=c ## ULL",
|
||||
"__SIG_ATOMIC_MAX__=0x7fffffff",
|
||||
"__GCC_ATOMIC_WCHAR_T_LOCK_FREE=2",
|
||||
"__SIZEOF_PTRDIFF_T__=4",
|
||||
"__FLT32X_MANT_DIG__=53",
|
||||
"__FLT32X_MIN_EXP__=(-1021)",
|
||||
"__DEC32_SUBNORMAL_MIN__=0.000001E-95DF",
|
||||
"__INT_FAST16_MAX__=0x7fffffff",
|
||||
"__FLT64_DIG__=15",
|
||||
"__UINT_FAST32_MAX__=0xffffffffU",
|
||||
"__UINT_LEAST64_TYPE__=long long unsigned int",
|
||||
"__FLT_HAS_QUIET_NAN__=1",
|
||||
"__FLT_MAX_10_EXP__=38",
|
||||
"__LONG_MAX__=0x7fffffffL",
|
||||
"__DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL",
|
||||
"__FLT_HAS_INFINITY__=1",
|
||||
"__cpp_unicode_literals=200710",
|
||||
"__UINT_FAST16_TYPE__=unsigned int",
|
||||
"__DEC64_MAX__=9.999999999999999E384DD",
|
||||
"__INT_FAST32_WIDTH__=32",
|
||||
"__CHAR16_TYPE__=short unsigned int",
|
||||
"__PRAGMA_REDEFINE_EXTNAME=1",
|
||||
"__SIZE_WIDTH__=32",
|
||||
"__INT_LEAST16_MAX__=0x7fff",
|
||||
"__DEC64_MANT_DIG__=16",
|
||||
"__INT64_MAX__=0x7fffffffffffffffLL",
|
||||
"__UINT_LEAST32_MAX__=0xffffffffU",
|
||||
"__FLT32_DENORM_MIN__=1.4012984643248171e-45F32",
|
||||
"__GCC_ATOMIC_LONG_LOCK_FREE=2",
|
||||
"__SIG_ATOMIC_WIDTH__=32",
|
||||
"__INT_LEAST64_TYPE__=long long int",
|
||||
"__INT16_TYPE__=short int",
|
||||
"__INT_LEAST8_TYPE__=signed char",
|
||||
"__DEC32_MAX_EXP__=97",
|
||||
"__INT_FAST8_MAX__=0x7fffffff",
|
||||
"__INTPTR_MAX__=0x7fffffff",
|
||||
"__cpp_sized_deallocation=201309",
|
||||
"__cpp_range_based_for=200907",
|
||||
"__FLT64_HAS_QUIET_NAN__=1",
|
||||
"__FLT32_MIN_10_EXP__=(-37)",
|
||||
"__EXCEPTIONS=1",
|
||||
"__LDBL_MANT_DIG__=53",
|
||||
"__DBL_HAS_QUIET_NAN__=1",
|
||||
"__FLT64_HAS_INFINITY__=1",
|
||||
"__SIG_ATOMIC_MIN__=(-__SIG_ATOMIC_MAX__ - 1)",
|
||||
"__cpp_return_type_deduction=201304",
|
||||
"__INTPTR_TYPE__=int",
|
||||
"__UINT16_TYPE__=short unsigned int",
|
||||
"__WCHAR_TYPE__=short unsigned int",
|
||||
"__SIZEOF_FLOAT__=4",
|
||||
"__UINTPTR_MAX__=0xffffffffU",
|
||||
"__INT_FAST64_WIDTH__=64",
|
||||
"__DEC64_MIN_EXP__=(-382)",
|
||||
"__cpp_decltype=200707",
|
||||
"__FLT32_DECIMAL_DIG__=9",
|
||||
"__INT_FAST64_MAX__=0x7fffffffffffffffLL",
|
||||
"__GCC_ATOMIC_TEST_AND_SET_TRUEVAL=1",
|
||||
"__FLT_DIG__=6",
|
||||
"__UINT_FAST64_TYPE__=long long unsigned int",
|
||||
"__INT_MAX__=0x7fffffff",
|
||||
"__INT64_TYPE__=long long int",
|
||||
"__FLT_MAX_EXP__=128",
|
||||
"__DBL_MANT_DIG__=53",
|
||||
"__cpp_inheriting_constructors=201511",
|
||||
"__INT_LEAST64_MAX__=0x7fffffffffffffffLL",
|
||||
"__FP_FAST_FMAF32=1",
|
||||
"__DEC64_MIN__=1E-383DD",
|
||||
"__WINT_TYPE__=unsigned int",
|
||||
"__UINT_LEAST32_TYPE__=unsigned int",
|
||||
"__SIZEOF_SHORT__=2",
|
||||
"__LDBL_MIN_EXP__=(-1021)",
|
||||
"__FLT64_MAX__=1.7976931348623157e+308F64",
|
||||
"__WINT_WIDTH__=32",
|
||||
"__INT_LEAST8_MAX__=0x7f",
|
||||
"__FLT32X_MAX_10_EXP__=308",
|
||||
"__WCHAR_UNSIGNED__=1",
|
||||
"__LDBL_MAX_10_EXP__=308",
|
||||
"__ATOMIC_RELAXED=0",
|
||||
"__DBL_EPSILON__=double(2.2204460492503131e-16L)",
|
||||
"__XTENSA_WINDOWED_ABI__=1",
|
||||
"__UINT8_C(c)=c",
|
||||
"__FLT64_MAX_EXP__=1024",
|
||||
"__INT_LEAST32_TYPE__=int",
|
||||
"__SIZEOF_WCHAR_T__=2",
|
||||
"__INT_FAST8_TYPE__=int",
|
||||
"__GNUC_STDC_INLINE__=1",
|
||||
"__FLT64_HAS_DENORM__=1",
|
||||
"__FLT32_EPSILON__=1.1920928955078125e-7F32",
|
||||
"__DBL_DECIMAL_DIG__=17",
|
||||
"__STDC_UTF_32__=1",
|
||||
"__INT_FAST8_WIDTH__=32",
|
||||
"__DEC_EVAL_METHOD__=2",
|
||||
"__FLT32X_MAX__=1.7976931348623157e+308F32x",
|
||||
"__XTENSA__=1",
|
||||
"__ORDER_BIG_ENDIAN__=4321",
|
||||
"__cpp_runtime_arrays=198712",
|
||||
"__UINT64_TYPE__=long long unsigned int",
|
||||
"__UINT32_C(c)=c ## U",
|
||||
"__INTMAX_MAX__=0x7fffffffffffffffLL",
|
||||
"__cpp_alias_templates=200704",
|
||||
"__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__",
|
||||
"__FLT_DENORM_MIN__=1.4012984643248171e-45F",
|
||||
"__INT8_MAX__=0x7f",
|
||||
"__LONG_WIDTH__=32",
|
||||
"__UINT_FAST32_TYPE__=unsigned int",
|
||||
"__CHAR32_TYPE__=unsigned int",
|
||||
"__FLT_MAX__=3.4028234663852886e+38F",
|
||||
"__cpp_constexpr=201304",
|
||||
"__INT32_TYPE__=int",
|
||||
"__SIZEOF_DOUBLE__=8",
|
||||
"__cpp_exceptions=199711",
|
||||
"__FLT_MIN_10_EXP__=(-37)",
|
||||
"__FLT64_MIN__=2.2250738585072014e-308F64",
|
||||
"__INT_LEAST32_WIDTH__=32",
|
||||
"__INTMAX_TYPE__=long long int",
|
||||
"__DEC128_MAX_EXP__=6145",
|
||||
"__FLT32X_HAS_QUIET_NAN__=1",
|
||||
"__ATOMIC_CONSUME=1",
|
||||
"__GNUC_MINOR__=4",
|
||||
"__INT_FAST16_WIDTH__=32",
|
||||
"__UINTMAX_MAX__=0xffffffffffffffffULL",
|
||||
"__DEC32_MANT_DIG__=7",
|
||||
"__FLT32X_DENORM_MIN__=4.9406564584124654e-324F32x",
|
||||
"__DBL_MAX_10_EXP__=308",
|
||||
"__LDBL_DENORM_MIN__=4.9406564584124654e-324L",
|
||||
"__INT16_C(c)=c",
|
||||
"__cpp_generic_lambdas=201304",
|
||||
"__STDC__=1",
|
||||
"__FLT32X_DIG__=15",
|
||||
"__PTRDIFF_TYPE__=int",
|
||||
"__ATOMIC_SEQ_CST=5",
|
||||
"__UINT32_TYPE__=unsigned int",
|
||||
"__FLT32X_MIN_10_EXP__=(-307)",
|
||||
"__UINTPTR_TYPE__=unsigned int",
|
||||
"__DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD",
|
||||
"__DEC128_MANT_DIG__=34",
|
||||
"__LDBL_MIN_10_EXP__=(-307)",
|
||||
"__SIZEOF_LONG_LONG__=8",
|
||||
"__cpp_user_defined_literals=200809",
|
||||
"__GCC_ATOMIC_LLONG_LOCK_FREE=1",
|
||||
"__FLT32X_MIN__=2.2250738585072014e-308F32x",
|
||||
"__LDBL_DIG__=15",
|
||||
"__FLT_DECIMAL_DIG__=9",
|
||||
"__UINT_FAST16_MAX__=0xffffffffU",
|
||||
"__GCC_ATOMIC_SHORT_LOCK_FREE=2",
|
||||
"__INT_LEAST64_WIDTH__=64",
|
||||
"__UINT_FAST8_TYPE__=unsigned int",
|
||||
"__cpp_init_captures=201304",
|
||||
"__ATOMIC_ACQ_REL=4",
|
||||
"__ATOMIC_RELEASE=3",
|
||||
"USBCON"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"java.configuration.updateBuildConfiguration": "interactive"
|
||||
}
|
@@ -1,40 +0,0 @@
|
||||
#include "Connectivity.h"
|
||||
|
||||
void Connectivity::connectWiFi(char* ssid, char* pass){
|
||||
WiFi.mode(WIFI_STA);
|
||||
WiFi.begin(ssid, pass);
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
// Serial.println("connecting to wifi");
|
||||
delay(1000);
|
||||
}
|
||||
Serial.println(WiFi.localIP());
|
||||
}
|
||||
|
||||
void Connectivity::websocketSetup(char* ip, uint16_t port, char* adress){
|
||||
//ws server address, port and URL
|
||||
webSocket.begin(ip , port, adress);
|
||||
// try every 500 again if connection has failed
|
||||
webSocket.setReconnectInterval(500);
|
||||
}
|
||||
|
||||
void Connectivity::sendData(float roll, float pitch, float yaw){
|
||||
String message = "{\"Sensor\": 1, \"roll\":\"" + String(roll) + "\",\"pitch\":\"" + String(pitch) + "\",\"yaw\":\"" + String(yaw) + "\"}";
|
||||
webSocket.sendTXT(message);
|
||||
}
|
||||
|
||||
/** Send a POST request to a server with provided data */
|
||||
int Connectivity::httpPost(const char *serverAddress, const char *serverSubPath, const unsigned short serverPort,
|
||||
const char *data, const size_t dataLength, const char *contentType)
|
||||
{
|
||||
if ( wifi_client.connect(serverAddress, serverPort)) {
|
||||
wifi_client.printf("POST %s HTTP/1.1\r\n", serverSubPath);
|
||||
wifi_client.printf("Content-Type: %s\r\n", contentType);
|
||||
wifi_client.printf("Content-Length: %d\r\n", dataLength);
|
||||
wifi_client.printf("Host: %s\r\n\n", serverAddress);
|
||||
wifi_client.println(data);
|
||||
wifi_client.stop();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
@@ -1,30 +0,0 @@
|
||||
#ifndef Connectivity_h
|
||||
#define Connectivity_h
|
||||
|
||||
#include "Arduino.h"
|
||||
#include <WebSocketsClient.h>
|
||||
#include <ArduinoWiFiServer.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESP8266WiFiGeneric.h>
|
||||
#include <ESP8266WiFiMulti.h>
|
||||
#include <ESP8266WiFiSTA.h>
|
||||
#include <WiFiClient.h>
|
||||
#include <WiFiClientSecure.h>
|
||||
|
||||
|
||||
class Connectivity {
|
||||
public:
|
||||
void connectWiFi(char* ssid, char* pass);
|
||||
void websocketSetup(char* ip, uint16_t port, char* adress);
|
||||
void sendData(float roll, float pitch, float yaw);
|
||||
int httpPost(const char *serverAddress, const char *serverSubPath, const unsigned short serverPort, const char *data, const size_t dataLength, const char *contentType);
|
||||
|
||||
|
||||
private:
|
||||
ESP8266WiFiMulti wifi;
|
||||
WiFiClient wifi_client;
|
||||
WebSocketsClient webSocket;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@@ -1,40 +0,0 @@
|
||||
#include "headerFile.h"
|
||||
|
||||
// SensorManager::Rotation offset;
|
||||
|
||||
void setup() {
|
||||
// Serial.begin(9600);
|
||||
// Serial.println("startup");
|
||||
//connect to internet and start sensor
|
||||
connectivity.connectWiFi(ssid, pass);
|
||||
sensorManager.sensorSetup();
|
||||
}
|
||||
|
||||
unsigned long lastTime = 0; // will store the last time the code was run
|
||||
|
||||
void loop() {
|
||||
SensorManager::eulerAngles eulerRotation = sensorManager.getEulerAngles();
|
||||
SensorManager::acceleration rotationAcceleration = sensorManager.getAcelleration();
|
||||
|
||||
unsigned long currentTime = millis();
|
||||
if (currentTime - lastTime >= 100) { // 100 ms has passed
|
||||
memset(buffer, 0, BUFFER_SIZE);
|
||||
sprintf(
|
||||
buffer,
|
||||
"{\"deviceId\": %d, \"rotationX\": %f, \"rotationY\": %f, \"rotationZ\": %f, \"accelerationX\": %f, \"accelerationY\": %f, \"accelerationZ\": %f, \"type\": %s}",
|
||||
DEVICE_ID,
|
||||
eulerRotation.roll,
|
||||
eulerRotation.pitch,
|
||||
eulerRotation.yaw,
|
||||
rotationAcceleration.x,
|
||||
rotationAcceleration.y,
|
||||
rotationAcceleration.z,
|
||||
"data");
|
||||
// %d = int, %f = floatation, %s = string
|
||||
connectivity.httpPost("192.168.137.45", "/", 3445, buffer, strlen(buffer), "application/json");
|
||||
lastTime = currentTime;
|
||||
}
|
||||
}
|
||||
//acceleration.X
|
||||
//acceleration.Y
|
||||
//acceleration.Z
|
@@ -1,71 +0,0 @@
|
||||
#include "SensorManager.h"
|
||||
#include <Wire.h>
|
||||
|
||||
|
||||
SensorManager::SensorManager() {}
|
||||
|
||||
void SensorManager::sensorSetup() {
|
||||
Wire.begin();
|
||||
//wait for the sensor to start before continue
|
||||
if (myIMU.begin() == false) {
|
||||
delay(1000);
|
||||
// Serial.println(".");
|
||||
}
|
||||
//start sensorfunction and start autocalibration
|
||||
//once calibration is enabled it attempts to every 5 min
|
||||
|
||||
myIMU.enableGyroIntegratedRotationVector(100); //send data every 100ms
|
||||
myIMU.enableAccelerometer(100); //Send data update every 100ms
|
||||
Serial.println(F("magnetometer rotation enabled"));
|
||||
myIMU.enableStepCounter(500); //Send data update every 500ms
|
||||
}
|
||||
//get sensordata
|
||||
SensorManager::RotationQuintillions SensorManager::getQuintillions() {
|
||||
if (myIMU.dataAvailable() == true) {
|
||||
float i = myIMU.getQuatI();
|
||||
float j = myIMU.getQuatJ();
|
||||
float k = myIMU.getQuatK();
|
||||
float w = myIMU.getQuatReal();
|
||||
|
||||
RotationQuintillions rotation = { i, j, k, w };
|
||||
return rotation;
|
||||
} else {
|
||||
float i = myIMU.getQuatI();
|
||||
float j = myIMU.getQuatJ();
|
||||
float k = myIMU.getQuatK();
|
||||
float w = myIMU.getQuatReal();
|
||||
|
||||
RotationQuintillions rotation = { i, j, k, w };
|
||||
return rotation;
|
||||
}
|
||||
}
|
||||
//calculate Quintillions to Euler angles from -1π to +1π
|
||||
SensorManager::eulerAngles SensorManager::getEulerAngles() {
|
||||
SensorManager::RotationQuintillions rotation = getQuintillions();
|
||||
float roll = atan2(2.0f * (rotation.w * rotation.i + rotation.j * rotation.k), 1.0f - 2.0f * (rotation.i * rotation.i + rotation.j * rotation.j));
|
||||
float pitch = asin(2.0f * (rotation.w * rotation.j - rotation.k * rotation.i));
|
||||
float yaw = atan2(2.0f * (rotation.w * rotation.k + rotation.i * rotation.j), 1.0f - 2.0f * (rotation.j * rotation.j + rotation.k * rotation.k));
|
||||
eulerAngles EulerAngles = { roll, pitch, yaw };
|
||||
return EulerAngles;
|
||||
}
|
||||
SensorManager::acceleration SensorManager::getAcelleration() {
|
||||
float x = myIMU.getAccelX();
|
||||
float y = myIMU.getAccelY();
|
||||
float z = myIMU.getAccelZ();
|
||||
acceleration Acceleration = { x, y, z };
|
||||
|
||||
return Acceleration;
|
||||
}
|
||||
|
||||
bool SensorManager::sensorTap() {
|
||||
int taps = 0;
|
||||
if (myIMU.dataAvailable() == true) {
|
||||
int taps = myIMU.getStepCount();
|
||||
}
|
||||
if (taps) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
@@ -1,36 +0,0 @@
|
||||
#ifndef SensorManager_h
|
||||
#define SensorManager_h
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "SparkFun_BNO080_Arduino_Library.h"
|
||||
|
||||
class SensorManager {
|
||||
public:
|
||||
SensorManager();
|
||||
void sensorSetup();
|
||||
struct eulerAngles {
|
||||
float roll;
|
||||
float pitch;
|
||||
float yaw;
|
||||
};
|
||||
struct acceleration {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
};
|
||||
|
||||
eulerAngles getEulerAngles();
|
||||
acceleration getAcelleration();
|
||||
bool sensorTap();
|
||||
private:
|
||||
struct RotationQuintillions {
|
||||
float i;
|
||||
float j;
|
||||
float k;
|
||||
float w;
|
||||
};
|
||||
RotationQuintillions getQuintillions();
|
||||
BNO080 myIMU;
|
||||
};
|
||||
|
||||
#endif
|
@@ -1,15 +0,0 @@
|
||||
//classes
|
||||
#include "SensorManager.h"
|
||||
#include "Connectivity.h"
|
||||
|
||||
//define
|
||||
SensorManager sensorManager;
|
||||
Connectivity connectivity;
|
||||
WebSocketsClient webSocket;
|
||||
#define USE_SERIAL Serial
|
||||
|
||||
#define ssid "1235678i"
|
||||
#define pass "12345678"
|
||||
#define BUFFER_SIZE 1024
|
||||
#define DEVICE_ID 1
|
||||
char *buffer = (char *)malloc(sizeof(char) * BUFFER_SIZE);
|
@@ -1,33 +0,0 @@
|
||||
#include <BLEDevice.h>
|
||||
#include <BLEServer.h>
|
||||
|
||||
// Define the service UUID
|
||||
#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
|
||||
|
||||
// Define the characteristic UUID
|
||||
#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8"
|
||||
|
||||
void setup() {
|
||||
// Create a BLE server
|
||||
BLEServer *pServer = BLEDevice::createServer();
|
||||
|
||||
// Create a BLE service
|
||||
BLEService *pService = pServer->createService(SERVICE_UUID);
|
||||
|
||||
// Create a BLE characteristic
|
||||
BLECharacteristic *pCharacteristic = pService->createCharacteristic(
|
||||
CHARACTERISTIC_UUID, BLECharacteristic::PROPERTY_READ);
|
||||
|
||||
// Set the characteristic value
|
||||
pCharacteristic->setValue("Hello, Bluetooth!");
|
||||
|
||||
// Start the service
|
||||
pService->start();
|
||||
|
||||
// Start advertising the service
|
||||
pServer->getAdvertising()->start();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// Nothing to do here
|
||||
}
|
@@ -1,28 +0,0 @@
|
||||
# testscript for websocket server
|
||||
# stolen from Sam's last project
|
||||
import websockets
|
||||
import asyncio
|
||||
|
||||
connected = set()
|
||||
|
||||
async def handler(websocket):
|
||||
# Register.
|
||||
connected.add(websocket)
|
||||
try:
|
||||
while True:
|
||||
message = await websocket.recv()
|
||||
print(message)
|
||||
except websockets.ConnectionClosedOK:
|
||||
print("Client disconnected")
|
||||
finally:
|
||||
connected.remove(websocket)
|
||||
|
||||
|
||||
async def main():
|
||||
async with websockets.serve(handler, "0.0.0.0", 8001):
|
||||
await asyncio.Future() # run forever
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
|
||||
#https://websockets.readthedocs.io/en/stable/reference/sync/server.html#websockets.sync.server.serve
|
2
code/src/Fitbot/.gitignore
vendored
2
code/src/Fitbot/.gitignore
vendored
@@ -13,5 +13,3 @@
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
.idea
|
||||
.vscode
|
17
code/src/Fitbot/.idea/deploymentTargetDropDown.xml
generated
Normal file
17
code/src/Fitbot/.idea/deploymentTargetDropDown.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<targetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="QUICK_BOOT_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="VIRTUAL_DEVICE_PATH" />
|
||||
<value value="C:\Users\sebas\.android\avd\Pepper_1.9_API_29.avd" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</targetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2024-04-26T10:10:48.222593700Z" />
|
||||
</component>
|
||||
</project>
|
75
code/src/Fitbot/.idea/misc.xml
generated
75
code/src/Fitbot/.idea/misc.xml
generated
@@ -4,46 +4,12 @@
|
||||
<option name="filePathToZoomLevelMap">
|
||||
<map>
|
||||
<entry key="../../../../../../../../layout/custom_preview.xml" value="0.35989583333333336" />
|
||||
<entry key="../../../../../../.gradle/caches/transforms-3/9c4b978f8e84c8bb9ebef5f19e8c189e/transformed/qisdk-design-1.7.5/res/layout/activity_robot.xml" value="0.1" />
|
||||
<entry key="../../../../../../.gradle/caches/transforms-3/9c4b978f8e84c8bb9ebef5f19e8c189e/transformed/qisdk-design-1.7.5/res/layout/view_always_top_speech_bar.xml" value="0.167877197265625" />
|
||||
<entry key="..\:/Users/31687/muupooviixee66-1/code/src/Fitbot/app/src/main/res/drawable/button_background.xml" value="0.128" />
|
||||
<entry key="..\:/Users/31687/muupooviixee66-1/code/src/Fitbot/app/src/main/res/drawable/rectangle.xml" value="0.128" />
|
||||
<entry key="..\:/Users/31687/muupooviixee66-1/code/src/Fitbot/app/src/main/res/layout/activity_bicepvideo.xml" value="0.2015625" />
|
||||
<entry key="..\:/Users/31687/muupooviixee66-1/code/src/Fitbot/app/src/main/res/layout/activity_end_screen.xml" value="0.18" />
|
||||
<entry key="..\:/Users/31687/muupooviixee66-1/code/src/Fitbot/app/src/main/res/layout/activity_main.xml" value="0.2015625" />
|
||||
<entry key="..\:/Users/31687/muupooviixee66-1/code/src/Fitbot/app/src/main/res/layout/activity_main_screen.xml" value="0.358695652173913" />
|
||||
<entry key="..\:/Users/Niels/muupooviixee66-3/code/src/Fitbot/app/src/main/res/drawable/rectangle.xml" value="0.1665" />
|
||||
<entry key="..\:/Users/Niels/muupooviixee66-3/code/src/Fitbot/app/src/main/res/layout/activity_end_screen.xml" value="0.165" />
|
||||
<entry key="..\:/Users/Niels/muupooviixee66-3/code/src/Fitbot/app/src/main/res/layout/activity_endscreen.xml" value="0.1" />
|
||||
<entry key="..\:/Users/Niels/muupooviixee66-3/code/src/Fitbot/app/src/main/res/layout/activity_fitness.xml" value="0.1234375" />
|
||||
<entry key="..\:/Users/Niels/muupooviixee66-3/code/src/Fitbot/app/src/main/res/layout/activity_main.xml" value="0.1" />
|
||||
<entry key="..\:/Users/Niels/muupooviixee66-3/code/src/Fitbot/app/src/main/res/layout/header.xml" value="0.1234375" />
|
||||
<entry key="..\:/Users/Niels/muupooviixee66-3/code/src/Fitbot/app/src/main/res/layout/toolbar.xml" value="0.1234375" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable-v24/ic_launcher_foreground.xml" value="0.25" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/box_background.xml" value="0.2555" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/darkred_button_gradient.xml" value="0.346" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/help2_background.xml" value="0.2395" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/help_background.xml" value="0.2395" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/ic_baseline_home_48.xml" value="0.25" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/ic_baseline_settings_48.xml" value="0.25" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/ic_baseline_star_rate_48.xml" value="0.25" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/ic_launcher_background.xml" value="0.25" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/rectangle.xml" value="0.2395" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/red_button_gradient.xml" value="0.346" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/layout/activity_bicepvideo.xml" value="0.22826086956521738" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/layout/activity_end_screen.xml" value="0.4" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/layout/activity_fitness.xml" value="0.264" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/layout/activity_help.xml" value="0.4" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/layout/activity_main.xml" value="0.4" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/layout/activity_main.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/layout/activity_main_screen.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/layout/activity_power_screen.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/layout/activity_sport_item.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/layout/activity_sport_menu.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/layout/header.xml" value="0.264" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/layout/toolbar.xml" value="0.264" />
|
||||
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/menu/main_menu.xml" value="0.4" />
|
||||
<entry key="app/src/main/res/layout/activity_end_screen.xml" value="0.1" />
|
||||
<entry key="app/src/main/res/layout/activity_fitness.xml" value="0.23550724637681159" />
|
||||
<entry key="app/src/main/res/layout/activity_main.xml" value="0.1" />
|
||||
<entry key="app/src/main/res/layout/activity_sport_item.xml" value="0.2341485507246377" />
|
||||
<entry key="app/src/main/res/layout/activity_sport_menu.xml" value="0.22056159420289856" />
|
||||
@@ -52,45 +18,6 @@
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="NullableNotNullManager">
|
||||
<option name="myDefaultNullable" value="androidx.annotation.Nullable" />
|
||||
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
||||
<option name="myNullables">
|
||||
<value>
|
||||
<list size="12">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
|
||||
<item index="1" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
||||
<item index="2" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
|
||||
<item index="3" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.Nullable" />
|
||||
<item index="4" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
|
||||
<item index="5" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
||||
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
|
||||
<item index="7" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
||||
<item index="8" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
|
||||
<item index="9" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
||||
<item index="10" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
|
||||
<item index="11" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myNotNulls">
|
||||
<value>
|
||||
<list size="11">
|
||||
<item index="0" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
|
||||
<item index="1" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
|
||||
<item index="2" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
|
||||
<item index="3" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
|
||||
<item index="4" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
|
||||
<item index="5" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
||||
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
|
||||
<item index="7" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
|
||||
<item index="8" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
||||
<item index="9" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
||||
<item index="10" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.NonNull" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
|
@@ -7,7 +7,7 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.fitbot"
|
||||
minSdk 23
|
||||
minSdk 29
|
||||
targetSdk 29
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
@@ -34,13 +34,7 @@ dependencies {
|
||||
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
|
||||
implementation 'com.android.support:cardview-v7:28.0.0'
|
||||
implementation 'com.android.support:design:28.0.0'
|
||||
implementation 'com.android.support:support-v4:+'
|
||||
implementation 'org.joml:joml:1.10.5'
|
||||
implementation 'com.google.code.gson:gson:2.8.6'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
implementation 'com.aldebaran:qisdk:1.7.5'
|
||||
|
@@ -1,42 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.fitbot">
|
||||
package="com.example.fitbot" >
|
||||
|
||||
<uses-feature android:name="com.softbank.hardware.pepper" />
|
||||
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.bluetooth"
|
||||
android:required="true" />
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
android:theme="@style/Theme.Fitbot" >
|
||||
<activity
|
||||
android:name=".ui.activities.HelpActivity"
|
||||
android:name=".Completion_Screen"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.activities.EndScreenActivity"
|
||||
android:name=".ui.SportMenuActivity"
|
||||
android:exported="true">
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".BicepVideo"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.activities.FitnessActivity"
|
||||
android:name=".PowerScreen"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true" />
|
||||
<activity
|
||||
android:name=".ui.activities.MainActivity"
|
||||
android:exported="true">
|
||||
android:name=".MainScreen"
|
||||
android:exported="true" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
//usage: PlayAnimation(animationfile, Qicontext);
|
||||
// https://qisdk.softbankrobotics.com/sdk/doc/pepper-sdk/ch4_api/movement/reference/animation.html
|
||||
package com.example.fitbot;
|
||||
|
||||
package com.example.fitbot.util;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.builder.AnimateBuilder;
|
||||
@@ -9,9 +8,15 @@ import com.aldebaran.qi.sdk.builder.AnimationBuilder;
|
||||
import com.aldebaran.qi.sdk.object.actuation.Animate;
|
||||
import com.aldebaran.qi.sdk.object.actuation.Animation;
|
||||
|
||||
public class Animations {
|
||||
public class Animations extends AppCompatActivity {
|
||||
|
||||
|
||||
public static void Animate(String AnimationFile, QiContext ctx)
|
||||
{
|
||||
PlayAnimation(AnimationFile, ctx);
|
||||
}
|
||||
|
||||
public static void PlayAnimation(String AnimationFile, QiContext ctx)
|
||||
{
|
||||
int resId = ctx.getResources().getIdentifier(AnimationFile, "raw", ctx.getPackageName());
|
||||
|
||||
@@ -25,4 +30,5 @@ public class Animations {
|
||||
|
||||
animate.async().run();
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,59 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.widget.Button;
|
||||
import android.widget.MediaController;
|
||||
import android.widget.VideoView;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.builder.AnimateBuilder;
|
||||
import com.aldebaran.qi.sdk.builder.AnimationBuilder;
|
||||
import com.aldebaran.qi.sdk.object.actuation.Animate;
|
||||
import com.aldebaran.qi.sdk.object.actuation.Animation;
|
||||
|
||||
public class BicepVideo extends AppCompatActivity {
|
||||
|
||||
// private QiContext qiContext;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_bicepvideo);
|
||||
setupButtons();
|
||||
}
|
||||
|
||||
public void Video(QiContext qiContext) {
|
||||
VideoView videoView = findViewById(R.id.videoView);
|
||||
videoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.bicepvideo));
|
||||
|
||||
MediaController mediaController = new MediaController(this);
|
||||
videoView.setMediaController(mediaController);
|
||||
videoView.setOnCompletionListener(mp -> videoView.start());
|
||||
videoView.start();
|
||||
|
||||
Animation animation = AnimationBuilder.with(qiContext)
|
||||
.withResources(R.raw.bicepcurl)
|
||||
.build();
|
||||
|
||||
Animate animate = AnimateBuilder.with(qiContext)
|
||||
.withAnimation(animation)
|
||||
.build();
|
||||
|
||||
|
||||
animate.async().run();
|
||||
|
||||
}
|
||||
private void setupButtons() {
|
||||
Button backButton = findViewById(R.id.buttonback);
|
||||
backButton.setOnClickListener(v -> finish());
|
||||
|
||||
Button completeButton = findViewById(R.id.buttoncomplete);
|
||||
completeButton.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(BicepVideo.this, Completion_Screen.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
public class Completion_Screen extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_completion_screen);
|
||||
}
|
||||
}
|
@@ -0,0 +1,82 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.QiSDK;
|
||||
import com.aldebaran.qi.sdk.RobotLifecycleCallbacks;
|
||||
import com.aldebaran.qi.sdk.builder.SayBuilder;
|
||||
import com.aldebaran.qi.sdk.design.activity.RobotActivity;
|
||||
import com.aldebaran.qi.sdk.object.conversation.Phrase;
|
||||
import com.aldebaran.qi.sdk.object.conversation.Say;
|
||||
import com.aldebaran.qi.sdk.object.locale.Language;
|
||||
import com.aldebaran.qi.sdk.object.locale.Locale;
|
||||
import com.aldebaran.qi.sdk.object.locale.Region;
|
||||
//import com.example.fitbot.ui.SportMenuActivity;
|
||||
|
||||
public class MainActivity extends RobotActivity implements RobotLifecycleCallbacks {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// Register the RobotLifecycleCallbacks to this Activity.
|
||||
|
||||
QiSDK.register(this, this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
// Unregister the RobotLifecycleCallbacks for this Activity.
|
||||
QiSDK.unregister(this, this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusGained(QiContext qiContext) {
|
||||
Locale locale = new Locale(Language.DUTCH, Region.NETHERLANDS);
|
||||
|
||||
// Create a new say action.
|
||||
Say say = SayBuilder.with(qiContext) // Create the builder with the context.
|
||||
.withText("Hallo hoe gaat het?") // Set the text to say.
|
||||
.build(); // Build the say action.
|
||||
|
||||
String locationName = ("de hogeschool van amsterdam");
|
||||
String locationDescription = ("0 bitches");
|
||||
|
||||
Phrase namePhrase = new Phrase("Deze locatie is " + locationName);
|
||||
Say sayName = SayBuilder.with(qiContext)
|
||||
.withPhrase(namePhrase)
|
||||
.withLocale(locale)
|
||||
.build();
|
||||
|
||||
Phrase descriptionPhrase = new Phrase(locationDescription);
|
||||
Say sayDescription = SayBuilder.with(qiContext)
|
||||
.withPhrase(descriptionPhrase)
|
||||
.withLocale(locale)
|
||||
.build();
|
||||
|
||||
sayName.run();
|
||||
sayDescription.run();
|
||||
|
||||
// Create a new BicepVideo with the qiContext
|
||||
// BicepVideo BicepVideo = new BicepVideo();
|
||||
//
|
||||
// // Call the videoPlayer method
|
||||
// BicepVideo.Video(qiContext);
|
||||
|
||||
// Execute the action.
|
||||
say.run();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRobotFocusLost() {
|
||||
// Nothing here.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusRefused(String reason) {
|
||||
// The robot focus is refused.
|
||||
}
|
||||
}
|
@@ -0,0 +1,55 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.NavigationView;
|
||||
import android.support.v4.view.GravityCompat;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.support.v7.app.ActionBarDrawerToggle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.widget.Button;
|
||||
|
||||
//import com.example.fitbot.ui.SportMenuActivity;
|
||||
|
||||
public class MainScreen extends AppCompatActivity {
|
||||
|
||||
//Variables
|
||||
DrawerLayout drawerLayout;
|
||||
NavigationView navigationView;
|
||||
Toolbar toolbar;
|
||||
|
||||
@SuppressLint("WrongViewCast")
|
||||
@Override
|
||||
protected void onCreate (Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
/*---Hooks---*/
|
||||
drawerLayout = findViewById(R.id.drawer_layout);
|
||||
navigationView = findViewById(R.id.nav_view);
|
||||
toolbar = findViewById(R.id.toolbar);
|
||||
|
||||
/*---Tool Bar---*/
|
||||
// setSupportActionBar(toolbar);
|
||||
|
||||
/*---Navigation Drawer Menu---*/
|
||||
navigationView.bringToFront();
|
||||
|
||||
ActionBarDrawerToggle toggle=new
|
||||
ActionBarDrawerToggle(this,drawerLayout,toolbar,R.string.navigation_drawer_open,R.string.navigation_drawer_close);
|
||||
drawerLayout.addDrawerListener(toggle);
|
||||
toggle.syncState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed(){
|
||||
if(drawerLayout.isDrawerOpen(GravityCompat.START)){
|
||||
drawerLayout.closeDrawer(GravityCompat.START);
|
||||
}
|
||||
else
|
||||
{super.onBackPressed();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
public class PowerScreen extends AppCompatActivity {
|
||||
ImageButton openBicepVideo;
|
||||
ImageButton openSquatVideo;
|
||||
ImageButton openTricepVideo;
|
||||
ImageButton goToHome;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_power_screen);
|
||||
|
||||
openBicepVideo = findViewById(R.id.open_BicepVideo);
|
||||
openSquatVideo = findViewById(R.id.open_SquatVideo);
|
||||
openTricepVideo = findViewById(R.id.open_TricepVideo);
|
||||
goToHome = findViewById(R.id.GoToHome);
|
||||
|
||||
openBicepVideo.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(PowerScreen.this, BicepVideo.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
// openSquatVideo.setOnClickListener(v -> {
|
||||
// Intent intent = new Intent(PowerScreen.this, SquatVideo.class);
|
||||
// startActivity(intent);
|
||||
// });
|
||||
//
|
||||
// openTricepVideo.setOnClickListener(v -> {
|
||||
// Intent intent = new Intent(PowerScreen.this, TricepVideo.class);
|
||||
// startActivity(intent);
|
||||
// });
|
||||
|
||||
goToHome.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(PowerScreen.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
}
|
@@ -1,30 +0,0 @@
|
||||
package com.example.fitbot.exercise;
|
||||
|
||||
public enum EMuscleGroup {
|
||||
// TODO: Implement
|
||||
|
||||
TORSO(0),
|
||||
ARMS(1),
|
||||
LEGS(2),
|
||||
BALANCE(3);
|
||||
|
||||
int muscleGroupIdentifier;
|
||||
|
||||
EMuscleGroup(int identifier) {
|
||||
this.muscleGroupIdentifier = identifier;
|
||||
}
|
||||
|
||||
public int getIdentifier() {
|
||||
return this.muscleGroupIdentifier;
|
||||
}
|
||||
|
||||
public static EMuscleGroup parse(int identifier) {
|
||||
for (EMuscleGroup muscleGroup : EMuscleGroup.values()) {
|
||||
if (muscleGroup.getIdentifier() == identifier) {
|
||||
return muscleGroup;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@@ -1,137 +0,0 @@
|
||||
package com.example.fitbot.exercise;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.example.fitbot.util.path.GesturePath;
|
||||
import com.example.fitbot.util.processing.IMotionDataConsumer;
|
||||
import com.example.fitbot.util.server.IWebServerHandler;
|
||||
import com.example.fitbot.util.server.WebServer;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class Exercise implements IWebServerHandler {
|
||||
|
||||
private EMuscleGroup muscleGroup;
|
||||
private GesturePath leftPath;
|
||||
private GesturePath rightPath;
|
||||
private String title;
|
||||
private String description;
|
||||
private float segmentsPerSecond;
|
||||
|
||||
// Static fields.
|
||||
private static WebServer webSocket;
|
||||
private static Exercise currentExercise = null;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for the AbstractExercise class.
|
||||
*
|
||||
* @param muscleGroup The muscle group of the exercise.
|
||||
* @param leftPath The path of the left hand.
|
||||
* @param rightPath The path of the right hand.
|
||||
* @param title The title of the exercise.
|
||||
* @param description The description of the exercise.
|
||||
* @param segmentsPerSecond The number of segments per second.
|
||||
* This determines how fast the exercise should be performed.
|
||||
*/
|
||||
public Exercise(EMuscleGroup muscleGroup, String title, String description, GesturePath leftPath, GesturePath rightPath) {
|
||||
this.muscleGroup = muscleGroup;
|
||||
this.title = title;
|
||||
this.description = description;
|
||||
this.leftPath = leftPath;
|
||||
this.rightPath = rightPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the exercise.
|
||||
* This method starts a WebSocket server
|
||||
*/
|
||||
public final void startExercise() {
|
||||
|
||||
// Ensure no other exercise is active.
|
||||
if (currentExercise != null && currentExercise != this) {
|
||||
currentExercise.__stopExercise();
|
||||
Log.i("Exercises", "Another exercise was started when another was still running.");
|
||||
}
|
||||
|
||||
// If a WebSocket server is already running, change the event handler to be this class.
|
||||
if (webSocket != null && webSocket.isConnected()) {
|
||||
webSocket.setEventHandler(this);
|
||||
}
|
||||
|
||||
try {
|
||||
webSocket = WebServer.createServer();
|
||||
Objects.requireNonNull(webSocket, "WebSocket server could not be created.");
|
||||
|
||||
webSocket.setEventHandler(this);
|
||||
currentExercise = this;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for ending this exercise and returning the grade of the performance
|
||||
* of this activity.
|
||||
*/
|
||||
public final double finishExercise() {
|
||||
this.__stopExercise();
|
||||
|
||||
// TODO: Implement grade calculation
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop the exercise.
|
||||
* This method stops the WebSocket server.
|
||||
*/
|
||||
private void __stopExercise() {
|
||||
if (webSocket != null && webSocket.isConnected()) {
|
||||
webSocket.stop();
|
||||
webSocket = null;
|
||||
}
|
||||
currentExercise = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the current exercise is the current activity.
|
||||
*/
|
||||
public final boolean isCurrentActivity() {
|
||||
return currentExercise == this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the muscle group of the exercise.
|
||||
*/
|
||||
public EMuscleGroup getMuscleGroup() {
|
||||
return muscleGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the path of the exercise.
|
||||
*/
|
||||
public GesturePath[] getPath() {
|
||||
return new GesturePath[]{leftPath, rightPath};
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the speed of the exercise.
|
||||
*/
|
||||
public double getSegmentsPerSecond() {
|
||||
return segmentsPerSecond;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(String message) {
|
||||
|
||||
}
|
||||
}
|
@@ -1,125 +0,0 @@
|
||||
package com.example.fitbot.exercise;
|
||||
|
||||
import com.example.fitbot.util.path.GesturePath;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
|
||||
public class ExerciseManager {
|
||||
|
||||
private static final String HOST_ADDRESS = "http://145.92.8.132";
|
||||
|
||||
private static final String PROPERTY_DESC = "description";
|
||||
private static final String PROPERTY_VECTORS = "vector_data";
|
||||
private static final String PROPERTY_NAME = "name";
|
||||
private static final String PROPERTY_MUSCLE_GROUP = "muscle_group";
|
||||
private static final String PROPERTY_SEGMENT_SPEED = "segment_speed";
|
||||
|
||||
private static final float DEFAULT_SEGMENT_SPEED = 1.0f;
|
||||
|
||||
/**
|
||||
* Function for sending an HTTP request to the server.
|
||||
*
|
||||
* @param url The URL to send the request to.
|
||||
* @param method The method to use for the request, e.g. GET or POST.
|
||||
* @param contentType The content type of the request.
|
||||
* @param body The body of the request.
|
||||
*
|
||||
* @return The response from the server.
|
||||
*/
|
||||
private static String sendHTTP(String url, String method, String contentType, String body) {
|
||||
try {
|
||||
URLConnection connection = new URL(url).openConnection();
|
||||
connection.addRequestProperty("Content-Type", contentType);
|
||||
connection.addRequestProperty("Request-Method", method);
|
||||
connection.getOutputStream().write(body.getBytes());
|
||||
connection.connect();
|
||||
InputStream stream = connection.getInputStream();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
|
||||
StringBuilder builder = new StringBuilder();
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
builder.append(line);
|
||||
}
|
||||
return builder.toString();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for retrieving an exercise from the Raspberry Pi Database.
|
||||
*
|
||||
* @param uniqueIdentifier The unique identifier of the exercise
|
||||
* @return The exercise, if it exists on the server. Otherwise null.
|
||||
*/
|
||||
public static Exercise retrieveExercise(String uniqueIdentifier) {
|
||||
String response = sendHTTP(
|
||||
HOST_ADDRESS + "/acquire", "GET", "application/json", "{\"kind\":\"" + uniqueIdentifier + "\"}"
|
||||
);
|
||||
// Validate the response
|
||||
if (response != null) {
|
||||
try {
|
||||
JsonObject content = JsonParser.parseString(response).getAsJsonObject();
|
||||
return new Exercise(
|
||||
EMuscleGroup.parse(content.get(PROPERTY_MUSCLE_GROUP).getAsInt()),
|
||||
content.get(PROPERTY_NAME).getAsString(),
|
||||
content.get(PROPERTY_DESC).getAsString(),
|
||||
gesturePathFromString(content.get(PROPERTY_VECTORS).getAsString()),
|
||||
gesturePathFromString(content.get(PROPERTY_SEGMENT_SPEED).getAsString())
|
||||
);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for converting a string to a GesturePath object.
|
||||
* The input string bytes will be directly converted into 3d vectors.
|
||||
* Every scalar is composed of 32 bits (4 characters), meaning 96 bits per vector.
|
||||
*
|
||||
* Note: ASCII to Vector conversion is done in Big Endian format (most significant byte first).
|
||||
*
|
||||
* @param input The string to convert
|
||||
* @return The GesturePath object
|
||||
*/
|
||||
private static GesturePath gesturePathFromString(String input) {
|
||||
byte[] bytes = input.getBytes();
|
||||
|
||||
// Check if the input string contains a valid amount of bytes (12 bytes per vector)
|
||||
if (input.length() % 12 != 0) {
|
||||
throw new IllegalArgumentException("Invalid input string length");
|
||||
}
|
||||
GesturePath.Builder builder = new GesturePath.Builder();
|
||||
|
||||
float[] xyz = new float[3];
|
||||
for (int i = 0; i < bytes.length; i += 12) {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
|
||||
xyz[j] = Float.intBitsToFloat(
|
||||
(bytes[i + j * 4] & 0xFF) << 24 |
|
||||
(bytes[i + j * 4 + 1] & 0xFF) << 16 |
|
||||
(bytes[i + j * 4 + 2] & 0xFF) << 8 |
|
||||
(bytes[i + j * 4 + 3] & 0xFF)
|
||||
);
|
||||
}
|
||||
builder.addVector(new Vector3f(
|
||||
xyz[0], xyz[1], xyz[2]
|
||||
));
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
}
|
@@ -1,53 +0,0 @@
|
||||
package com.example.fitbot.exercise;
|
||||
|
||||
|
||||
/**
|
||||
* The ExerciseUser class represents a user of the exercise application.
|
||||
* This contains all necessary information of the current user.
|
||||
*/
|
||||
public class ExerciseUser {
|
||||
|
||||
public float upperArmLength;
|
||||
public float lowerArmLength;
|
||||
public float upperLegLength;
|
||||
public float lowerLegLength;
|
||||
public float height;
|
||||
|
||||
/**
|
||||
* Constructor for the ExerciseUser class.
|
||||
* @param upperArmLength The length of the upper arm.
|
||||
* @param lowerArmLength The length of the lower arm.
|
||||
* @param height The height of the user.
|
||||
* @param upperLegLength The length of the upper leg.
|
||||
* @param lowerLegLength The length of the lower leg.
|
||||
*/
|
||||
public ExerciseUser(float upperArmLength, float lowerArmLength, float height, float upperLegLength, float lowerLegLength) {
|
||||
this.upperArmLength = upperArmLength;
|
||||
this.lowerArmLength = lowerArmLength;
|
||||
this.upperLegLength = upperLegLength;
|
||||
this.lowerLegLength = lowerLegLength;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for the ExerciseUser class.
|
||||
* @param height The height of the user.
|
||||
*/
|
||||
public ExerciseUser(float height) {
|
||||
this.height = height;
|
||||
this.upperArmLength = height * 0.2f;
|
||||
this.lowerArmLength = height * 0.2f;
|
||||
this.upperLegLength = height * 0.3f;
|
||||
this.lowerLegLength = height * 0.3f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default constructor for the ExerciseUser class.
|
||||
* This sets the default height to 180.0f. (1.80m)
|
||||
*/
|
||||
public ExerciseUser() {
|
||||
this(180.0f);
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
package com.example.fitbot.speech;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.builder.SayBuilder;
|
||||
import com.aldebaran.qi.sdk.object.locale.Language;
|
||||
import com.aldebaran.qi.sdk.object.locale.Locale;
|
||||
import com.aldebaran.qi.sdk.object.locale.Region;
|
||||
|
||||
/**
|
||||
* SpeechGenerator class for generating speech for the robot
|
||||
*/
|
||||
public class SpeechGenerator {
|
||||
|
||||
private static final Locale DUTCH_LOCALE = new Locale(Language.DUTCH, Region.NETHERLANDS);
|
||||
private SayBuilder builder;
|
||||
|
||||
/**
|
||||
* Function for making the robot say something with DUTCH_LOCALE as locale
|
||||
* @param phrase The phrase to make the robot say
|
||||
* @param ctx The QiContext to use
|
||||
*/
|
||||
public static void say(String phrase, QiContext ctx)
|
||||
{
|
||||
say(phrase, ctx, DUTCH_LOCALE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for making the robot say something with a specific locale
|
||||
* @param phrase The phrase to make the robot say
|
||||
* @param ctx The QiContext to use
|
||||
* @param locale The locale to use
|
||||
*/
|
||||
public static void say(String phrase, QiContext ctx, Locale locale)
|
||||
{
|
||||
SayBuilder
|
||||
.with(ctx)
|
||||
.withLocale(locale)
|
||||
.withText(phrase)
|
||||
.build()
|
||||
.run();
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
package com.example.fitbot.sports;
|
||||
|
||||
public enum ESportType {
|
||||
|
||||
FITNESS("Fitness"),
|
||||
POWER("Krachttrening");
|
||||
|
||||
private final String name;
|
||||
|
||||
ESportType(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
package com.example.fitbot.ui;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.RobotLifecycleCallbacks;
|
||||
import com.aldebaran.qi.sdk.design.activity.RobotActivity;
|
||||
|
||||
public class SportPreviewActivity extends RobotActivity implements RobotLifecycleCallbacks {
|
||||
|
||||
|
||||
@Override
|
||||
public void onRobotFocusGained(QiContext qiContext) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
@Override
|
||||
public void onRobotFocusLost() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusRefused(String reason) {
|
||||
|
||||
}
|
||||
}
|
@@ -1,4 +0,0 @@
|
||||
package com.example.fitbot.ui.activities;
|
||||
|
||||
public class CompletionActivity {
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
package com.example.fitbot.ui.activities;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import com.example.fitbot.R;
|
||||
import com.example.fitbot.ui.activities.FitnessActivity;
|
||||
import com.example.fitbot.ui.activities.MainActivity;
|
||||
|
||||
public class EndScreenActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_end_screen);
|
||||
|
||||
com.example.fitbot.util.ButtonNavigation.setupButtonNavigation(this, R.id.homeButton, MainActivity.class);
|
||||
com.example.fitbot.util.ButtonNavigation.setupButtonNavigation(this, R.id.continueButton, FitnessActivity.class);
|
||||
}
|
||||
}
|
@@ -1,96 +0,0 @@
|
||||
package com.example.fitbot.ui.activities;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.widget.VideoView;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.QiSDK;
|
||||
import com.aldebaran.qi.sdk.RobotLifecycleCallbacks;
|
||||
import com.aldebaran.qi.sdk.design.activity.RobotActivity;
|
||||
import com.aldebaran.qi.sdk.design.activity.conversationstatus.SpeechBarDisplayStrategy;
|
||||
import com.example.fitbot.R;
|
||||
import com.example.fitbot.exercise.EMuscleGroup;
|
||||
import com.example.fitbot.exercise.Exercise;
|
||||
import com.example.fitbot.ui.components.PersonalMotionPreviewElement;
|
||||
import com.example.fitbot.util.ButtonNavigation;
|
||||
import com.example.fitbot.util.FitnessCycle;
|
||||
import com.example.fitbot.util.path.GesturePath;
|
||||
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class FitnessActivity extends RobotActivity implements RobotLifecycleCallbacks {
|
||||
|
||||
PersonalMotionPreviewElement personalMotionPreviewElement;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
QiSDK.register(this, this);
|
||||
setContentView(R.layout.activity_fitness);
|
||||
|
||||
// Remove the ugly ass bar on top of the view
|
||||
setSpeechBarDisplayStrategy(SpeechBarDisplayStrategy.IMMERSIVE);
|
||||
|
||||
// Find the VideoView by its ID
|
||||
VideoView videoView = findViewById(R.id.videoView);
|
||||
|
||||
FitnessCycle.playVideo(videoView, this);
|
||||
|
||||
ButtonNavigation.setupButtonNavigation(this, R.id.homeButton, MainActivity.class);
|
||||
// Implement your logic when the robot focus is gained
|
||||
|
||||
GesturePath.Builder gesturePathBuilder = new GesturePath.Builder();
|
||||
|
||||
/* Generate a random path to test the tracking system */
|
||||
for ( int i = 0; i < 40; i++)
|
||||
{
|
||||
gesturePathBuilder.addVector(
|
||||
new Vector3f(
|
||||
(float)Math.cos(Math.PI + (Math.PI / 40.0f) * i),
|
||||
(float)Math.sin(Math.PI + (Math.PI / 40.0f) * i),
|
||||
0
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
personalMotionPreviewElement = findViewById(R.id.personalMotionPreviewElement);
|
||||
personalMotionPreviewElement.post(() -> {
|
||||
Log.i("FitnessActivity", "PersonalMotionPreviewElement.post()");
|
||||
|
||||
Exercise exercise = new Exercise(EMuscleGroup.ARMS, "Bicep Curls", "Oefening voor de biceps.", gesturePathBuilder.build(), gesturePathBuilder.build());
|
||||
|
||||
personalMotionPreviewElement.initialize(exercise);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusGained(QiContext qiContext) {
|
||||
|
||||
// Find the VideoView by its ID
|
||||
// CompletableFuture.runAsync(() -> FitnessCycle.executeMovement("bicepcurl", 10, qiContext));
|
||||
Log.i("Motion", "qiContext provided");
|
||||
personalMotionPreviewElement.provideQiContext(qiContext);
|
||||
|
||||
// FitnessCycle.playVideo(qiContext, videoView, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusLost() {
|
||||
// Implement your logic when the robot focus is lost
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusRefused(String reason) {
|
||||
// Implement your logic when the robot focus is refused
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
QiSDK.unregister(this, this);
|
||||
this.personalMotionPreviewElement.onDestroy();
|
||||
}
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
package com.example.fitbot.ui.activities;
|
||||
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.example.fitbot.R;
|
||||
import com.example.fitbot.util.ButtonNavigation;
|
||||
|
||||
public class HelpActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_help);
|
||||
|
||||
ButtonNavigation.setupButtonNavigation(this, R.id.homeButton, MainActivity.class);
|
||||
|
||||
}
|
||||
}
|
@@ -1,119 +0,0 @@
|
||||
package com.example.fitbot.ui.activities;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.NavigationView;
|
||||
import android.support.v4.view.GravityCompat;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.support.v7.app.ActionBarDrawerToggle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.example.fitbot.R;
|
||||
import com.example.fitbot.util.ButtonNavigation;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
// Variables
|
||||
DrawerLayout drawerLayout;
|
||||
NavigationView navigationView;
|
||||
Toolbar toolbar;
|
||||
Button startButton;
|
||||
|
||||
@SuppressLint("WrongViewCast")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
// Set full screen mode
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
|
||||
// Hide system UI
|
||||
hideSystemUI();
|
||||
|
||||
startButton = findViewById(R.id.startButton);
|
||||
startButton.setOnClickListener(v -> {
|
||||
Uri videoUri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.bicepvideo);
|
||||
Intent intent = new Intent(MainActivity.this, FitnessActivity.class);
|
||||
intent.putExtra("videoUri", videoUri);
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
setUpUi(); // Set up the UI
|
||||
}
|
||||
|
||||
private void setUpUi() {
|
||||
/*---Hooks---*/
|
||||
drawerLayout = findViewById(R.id.drawer_layout);
|
||||
navigationView = findViewById(R.id.nav_view);
|
||||
toolbar = findViewById(R.id.toolbar);
|
||||
startButton = findViewById(R.id.startButton);
|
||||
|
||||
// Hide the action bar
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().hide();
|
||||
}
|
||||
ButtonNavigation.setupButtonNavigation(this, R.id.startButton, FitnessActivity.class);
|
||||
ButtonNavigation.setupButtonNavigation(this, R.id.helpButton, HelpActivity.class);
|
||||
|
||||
/*---Tool Bar---*/
|
||||
setSupportActionBar(toolbar); // Make the toolbar act as the action bar
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(false); // Remove the title from the toolbar
|
||||
}
|
||||
|
||||
/*---Navigation Drawer Menu---*/
|
||||
navigationView.bringToFront(); // Make the navigation drawer menu clickable
|
||||
|
||||
ActionBarDrawerToggle toggle = new // Create a toggle for the navigation drawer
|
||||
ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) {
|
||||
@Override
|
||||
public void onDrawerOpened(View drawerView) {
|
||||
super.onDrawerOpened(drawerView);
|
||||
hideSystemUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDrawerClosed(View drawerView) {
|
||||
super.onDrawerClosed(drawerView);
|
||||
hideSystemUI();
|
||||
}
|
||||
};
|
||||
drawerLayout.addDrawerListener(toggle);
|
||||
toggle.syncState(); // Synchronize the state of the navigation drawer
|
||||
}
|
||||
|
||||
private void hideSystemUI() {
|
||||
View decorView = getWindow().getDecorView();
|
||||
// Hide the status bar and navigation bar
|
||||
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
|
||||
decorView.setSystemUiVisibility(uiOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
if (hasFocus) {
|
||||
hideSystemUI();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() { // Close the navigation drawer when the back button is pressed
|
||||
if (drawerLayout.isDrawerOpen(GravityCompat.START)) {
|
||||
drawerLayout.closeDrawer(GravityCompat.START);
|
||||
} else {
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,232 +0,0 @@
|
||||
package com.example.fitbot.ui.components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Path;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.example.fitbot.exercise.Exercise;
|
||||
import com.example.fitbot.util.FitnessCycle;
|
||||
import com.example.fitbot.util.path.GesturePath;
|
||||
import com.example.fitbot.util.processing.MotionProcessor;
|
||||
|
||||
import org.joml.Matrix4f;
|
||||
import org.joml.Vector2f;
|
||||
import org.joml.Vector3f;
|
||||
import org.joml.Vector4f;
|
||||
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class PersonalMotionPreviewElement extends View {
|
||||
|
||||
private GesturePath[] paths;
|
||||
private MotionProcessor motionProcessor;
|
||||
|
||||
private double pathTime = 0.0D; // The timestamp at which the path is currently at.
|
||||
private final AtomicInteger exerciseProgress = new AtomicInteger(0); // The progress of the exercise. Ranges from 0 to 1000.
|
||||
|
||||
private QiContext qiContext;
|
||||
|
||||
private Exercise exercise;
|
||||
|
||||
private Path targetPath; // The path the user is supposed to follow.
|
||||
private Path actualPath; // The path the user is currently following.
|
||||
|
||||
private final Paint referencePaint = new Paint();
|
||||
private final Paint targetPaint = new Paint();
|
||||
private final Paint backgroundColor = new Paint();
|
||||
|
||||
private Matrix4f modelMatrix = new Matrix4f(); // The model view matrix for the 3D to 2D transformation.
|
||||
private Matrix4f viewMatrix = new Matrix4f()
|
||||
.lookAt(new Vector3f(4, 4, 4), new Vector3f(0, 0, 0), new Vector3f(0, 1, 0)); // The view matrix for the 3D to 2D transformation.
|
||||
private Matrix4f projectionMatrix = new Matrix4f(); // The projection matrix for the 3D to 2D transformation.
|
||||
private final Vector4f objectPosition = new Vector4f(0, 0, 0, 1); // The location of the object in 3D space.
|
||||
private ConcurrentLinkedQueue<Vector2f> vectors = new ConcurrentLinkedQueue<>();
|
||||
|
||||
private Vector2f[] axisVectors;
|
||||
|
||||
|
||||
|
||||
private static final String[] USER_PHRASES = {
|
||||
"Veel success met de oefening!",
|
||||
"Je kan het!",
|
||||
"Veel plezier!"
|
||||
};
|
||||
|
||||
private double timePassed = 0.0D; // The time that has passed since the start of the exercise, in seconds.
|
||||
private long startingTime = 0L;
|
||||
|
||||
private Vector2f screenDimensions = new Vector2f(); // Width and height dimensions of the screen
|
||||
|
||||
public PersonalMotionPreviewElement(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
this.referencePaint.setColor(0xFFFF0000); // Red
|
||||
this.referencePaint.setStyle(Paint.Style.FILL);
|
||||
this.referencePaint.setStrokeWidth(5.0f);
|
||||
this.referencePaint.setAntiAlias(true);
|
||||
|
||||
// Target paint is the filling of the target path.
|
||||
this.targetPaint.setColor(-1);
|
||||
this.targetPaint.setStyle(Paint.Style.STROKE);
|
||||
this.targetPaint.setStrokeWidth(5.0f);
|
||||
this.targetPaint.setAntiAlias(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for initializing the PersonalMotionPreviewElement.
|
||||
* This method has to be called with a "post" function when the element has been
|
||||
* created, otherwise the dimensions of the element aren't initialized yet, which
|
||||
* will cause the vertex projections to fail (0 width and height).
|
||||
*
|
||||
* @param exercise The exercise that the user is currently performing.
|
||||
*/
|
||||
public void initialize(Exercise exercise) {
|
||||
Log.i("PersonalMotionPreviewElement", "Creating new PersonalMotionPreviewElement.");
|
||||
this.backgroundColor.setColor(0xFF000000); // Black
|
||||
|
||||
this.screenDimensions.x = this.getWidth();
|
||||
this.screenDimensions.y = this.getHeight();
|
||||
this.actualPath = new Path();
|
||||
this.targetPath = new Path();
|
||||
|
||||
this.startingTime = System.nanoTime(); // Set the last time to the current time
|
||||
|
||||
this.exercise = exercise;
|
||||
this.paths = exercise.getPath();
|
||||
|
||||
this.axisVectors = new Vector2f[] {
|
||||
|
||||
projectVertex(new Vector3f(-100.0f, 0, 0), getWidth(), getHeight()),
|
||||
projectVertex(new Vector3f(100.0f, 0, 0), getWidth(), getHeight()),
|
||||
projectVertex(new Vector3f(0, -100.0f, 0), getWidth(), getHeight()),
|
||||
projectVertex(new Vector3f(0, 100.0f, 0), getWidth(), getHeight()),
|
||||
projectVertex(new Vector3f(0, 0, -100.0f), getWidth(), getHeight()),
|
||||
projectVertex(new Vector3f(0, 0, 100.0f), getWidth(), getHeight())
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
public void onDestroy()
|
||||
{
|
||||
if ( this.motionProcessor != null )
|
||||
this.motionProcessor.stopListening();
|
||||
|
||||
this.motionProcessor = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for providing a QiContext to the PersonalMotionPreviewElement.
|
||||
* This function will be called by the parent activity when the QiContext is available.
|
||||
* Also say something nice to the user :)
|
||||
*
|
||||
* @param context The QiContext to provide.
|
||||
*/
|
||||
public void provideQiContext(QiContext context) {
|
||||
this.qiContext = context;
|
||||
if ( this.motionProcessor != null )
|
||||
this.motionProcessor.stopListening();
|
||||
|
||||
this.motionProcessor = new MotionProcessor();
|
||||
this.motionProcessor.startListening();
|
||||
|
||||
// Handler that is called every time the motion processor receives new data.
|
||||
this.motionProcessor.setMotionDataEventHandler((processed, preprocessed, sampleIndex, sampleRate, deviceId) -> {
|
||||
int progress = (int)this.motionProcessor.getError(this.paths[0], processed);
|
||||
this.exerciseProgress.set(Math.min(1000, Math.max(0, progress)));
|
||||
Log.i("MotionProcessor", "Processed data: " + progress + " (" + preprocessed + ")");
|
||||
Vector2f parsed = projectVertex(processed, this.getWidth(), this.getHeight());
|
||||
this.vectors.add(parsed);
|
||||
// Remove the first element if the array is too big
|
||||
if (this.vectors.size() > 100)
|
||||
this.vectors.poll();
|
||||
});
|
||||
saySomethingNice();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to say something nice to the user :)
|
||||
*/
|
||||
private void saySomethingNice()
|
||||
{
|
||||
if (this.qiContext == null)
|
||||
return;
|
||||
|
||||
FitnessCycle.say(USER_PHRASES[(int) Math.floor(Math.random() * USER_PHRASES.length)], this.qiContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for setting the gesture path that will be drawn on the canvas.
|
||||
*
|
||||
* @param exercise The exercise that the user is currently performing.
|
||||
*/
|
||||
public void setExercise(Exercise exercise) {
|
||||
this.exercise = exercise;
|
||||
}
|
||||
|
||||
|
||||
private Vector2f projectVertex(Vector3f point, int virtualWidth, int virtualHeight) {
|
||||
modelMatrix
|
||||
.identity()
|
||||
.translate(-objectPosition.x, -objectPosition.y, -objectPosition.z);
|
||||
|
||||
// Transform the projection matrix to a perspective projection matrix
|
||||
// Perspective transformation conserves the depth of the object
|
||||
projectionMatrix
|
||||
.identity()
|
||||
.perspective((float) Math.toRadians(70), (float) virtualWidth / virtualHeight, .01f, 10000.0f);
|
||||
|
||||
// Convert world coordinates to screen-space using MVP matrix
|
||||
Vector4f screenCoordinates = new Vector4f(point, 1.0f)
|
||||
.mul(this.projectionMatrix)
|
||||
.mul(this.viewMatrix)
|
||||
.mul(this.modelMatrix);
|
||||
|
||||
// Normalize screen coordinates from (-1, 1) to (0, virtualWidth) and (0, virtualHeight)
|
||||
float normalizedX = (screenCoordinates.x / screenCoordinates.w + 1.0f) * 0.5f * virtualWidth;
|
||||
float normalizedY = (1.0f - screenCoordinates.y / screenCoordinates.w) * 0.5f * virtualHeight;
|
||||
return new Vector2f(normalizedX, normalizedY);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onDraw(Canvas canvas) {
|
||||
canvas.drawRect(0, 0, getWidth(), getHeight(), backgroundColor);
|
||||
this.setBackgroundColor(0xFF000000); // Black
|
||||
if (this.exercise == null)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < axisVectors.length/2; i++)
|
||||
{
|
||||
canvas.drawLine(axisVectors[i*2].x, axisVectors[i*2].y, axisVectors[i*2+1].x, axisVectors[i*2+1].y, this.targetPaint);
|
||||
}
|
||||
|
||||
for ( Vector2f point : this.vectors)
|
||||
{
|
||||
canvas.drawRect(point.x, point.y, point.x + 5, point.y + 5, this.referencePaint);
|
||||
}
|
||||
/*
|
||||
// Draw target circle
|
||||
float targetRadius = (this.screenDimensions.x + this.screenDimensions.y) / 5.0f;
|
||||
canvas.drawCircle(this.screenDimensions.x / 2, this.screenDimensions.y / 2, targetRadius, this.targetPaint);
|
||||
canvas.drawCircle(this.screenDimensions.x / 2, this.screenDimensions.y / 2, (targetRadius * exerciseProgress.get()/1000.0f), this.referencePaint);
|
||||
referencePaint.setColor(
|
||||
Color.argb(
|
||||
255,
|
||||
(int)(255 * (1.0 - exerciseProgress.get()/1000.0f)),
|
||||
(int)(255 * exerciseProgress.get()/1000.0f),
|
||||
0
|
||||
)
|
||||
);*/
|
||||
|
||||
this.invalidate();
|
||||
|
||||
timePassed = (System.nanoTime() - startingTime) / 1E9D;
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
package com.example.fitbot.ui.components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.view.View;
|
||||
|
||||
public class SportPreviewCanvas extends View {
|
||||
|
||||
|
||||
private void calculatePath
|
||||
|
||||
|
||||
public SportPreviewCanvas(Context context, GesturePath path) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDraw(Canvas canvas) {
|
||||
// Draw the sport preview canvas
|
||||
|
||||
}
|
||||
}
|
@@ -1,26 +0,0 @@
|
||||
package com.example.fitbot.util;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
public class ButtonNavigation {
|
||||
|
||||
/**
|
||||
* Sets up a button to navigate to a different activity when clicked.
|
||||
*
|
||||
* @param currentActivity The activity that contains the button
|
||||
* @param buttonId The ID of the button
|
||||
* @param targetActivity The activity to navigate to
|
||||
*/
|
||||
public static void setupButtonNavigation(Activity currentActivity, int buttonId, Class<? extends Activity> targetActivity) {
|
||||
Button button = currentActivity.findViewById(buttonId);
|
||||
button.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(currentActivity, targetActivity);
|
||||
currentActivity.startActivity(intent);
|
||||
currentActivity.finish();
|
||||
});
|
||||
}
|
||||
}
|
@@ -1,108 +0,0 @@
|
||||
package com.example.fitbot.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.util.Log;
|
||||
import android.widget.VideoView;
|
||||
|
||||
import com.aldebaran.qi.sdk.builder.SayBuilder;
|
||||
import com.aldebaran.qi.sdk.object.locale.Language;
|
||||
import com.aldebaran.qi.sdk.object.locale.Locale;
|
||||
import com.aldebaran.qi.sdk.object.locale.Region;
|
||||
import com.example.fitbot.R;
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.builder.AnimateBuilder;
|
||||
import com.aldebaran.qi.sdk.builder.AnimationBuilder;
|
||||
import com.aldebaran.qi.sdk.object.actuation.Animate;
|
||||
import com.aldebaran.qi.sdk.object.actuation.Animation;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class FitnessCycle extends AppCompatActivity {
|
||||
|
||||
private static final Locale DUTCH_LOCALE = new Locale(Language.DUTCH, Region.NETHERLANDS);
|
||||
|
||||
|
||||
/**
|
||||
* Function for executing a movement animation a certain number of times
|
||||
* on the robot
|
||||
*
|
||||
* @param Exercise The name of the exercise to perform
|
||||
* @param Reps The number of repetitions to perform
|
||||
* @param qiContext The QiContext to use
|
||||
*/
|
||||
public static void executeMovement(String Exercise, int Reps, QiContext qiContext) {
|
||||
AtomicInteger repCount = new AtomicInteger(0);
|
||||
|
||||
Animation animation = AnimationBuilder.with(qiContext)
|
||||
.withResources(qiContext.getResources().getIdentifier(Exercise, "raw", qiContext.getPackageName()))
|
||||
.build();
|
||||
|
||||
Animate animate = AnimateBuilder.with(qiContext)
|
||||
.withAnimation(animation)
|
||||
.build();
|
||||
|
||||
// Add a listener for when a label is reached
|
||||
animate.addOnLabelReachedListener((label, time) -> {
|
||||
// Increment repCount when the end of a repetition is reached
|
||||
if ("end".equals(label)) {
|
||||
repCount.incrementAndGet();
|
||||
}
|
||||
});
|
||||
|
||||
// Run the animation the desired number of times
|
||||
for (int i = 0; i < Reps; i++) {
|
||||
animate.run();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for making the robot say something with DUTCH_LOCALE as locale
|
||||
* @param phrase The phrase to make the robot say
|
||||
* @param ctx The QiContext to use
|
||||
*/
|
||||
public static void say(String phrase, QiContext ctx)
|
||||
{
|
||||
say(phrase, ctx, DUTCH_LOCALE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for making the robot say something with a specific locale
|
||||
* @param phrase The phrase to make the robot say
|
||||
* @param ctx The QiContext to use
|
||||
* @param locale The locale to use
|
||||
*/
|
||||
public static void say(String phrase, QiContext ctx, Locale locale)
|
||||
{
|
||||
SayBuilder
|
||||
.with(ctx)
|
||||
.withLocale(locale)
|
||||
.withText(phrase)
|
||||
.build()
|
||||
.run();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for playing a video in a VideoView
|
||||
*
|
||||
* @param videoView The VideoView to play the video in
|
||||
* @param context The context to use
|
||||
*/
|
||||
public static void playVideo(VideoView videoView, Context context) {
|
||||
// Set up the video player
|
||||
if (videoView != null) {
|
||||
Uri videoUri = Uri.parse("android.resource://" + context.getPackageName() + "/" + R.raw.bicepvideo);
|
||||
videoView.setVideoURI(videoUri);
|
||||
|
||||
videoView.setOnCompletionListener(mp -> {
|
||||
// Repeat the video when it finishes playing
|
||||
videoView.start();
|
||||
});
|
||||
|
||||
videoView.start();
|
||||
} else {
|
||||
Log.e("FitnessActivity", "VideoView is null. Check your layout XML.");
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,118 +0,0 @@
|
||||
package com.example.fitbot.util.path;
|
||||
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class GesturePath {
|
||||
|
||||
// The vectors that make up the path.
|
||||
private final PathSegment[] segments;
|
||||
|
||||
/**
|
||||
* Create a new gesture path with a given set of vectors and curvature.
|
||||
*
|
||||
* @param vectors The vectors that make up the path.
|
||||
*/
|
||||
public GesturePath(Vector3f[] vectors)
|
||||
{
|
||||
if ( vectors.length < 2)
|
||||
throw new IllegalArgumentException("A path must have at least two points.");
|
||||
|
||||
this.segments = new PathSegment[vectors.length - 1];
|
||||
for ( int i = 0; i < vectors.length - 1; i++)
|
||||
segments[i] = new PathSegment(vectors[i], vectors[i + 1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for a GesturePath with provided PathSegments.
|
||||
* @param segments The PathSegments to initialize the path with.
|
||||
*/
|
||||
public GesturePath(PathSegment... segments) {
|
||||
this.segments = segments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter method for retrieving the path segments of this GesturePath.
|
||||
*
|
||||
* @return The path segments.
|
||||
*/
|
||||
public PathSegment[] getSegments() {
|
||||
return segments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for retrieving the closest path segment to a reference point.
|
||||
*
|
||||
* @param reference The reference point to find the closest path segment to.
|
||||
* @return The closest path segment to the reference point.
|
||||
*/
|
||||
public PathSegment closest(Vector3f reference) {
|
||||
// If there's only one segment, return that one.
|
||||
if ( segments.length == 1)
|
||||
return segments[0];
|
||||
|
||||
PathSegment closest = segments[0];
|
||||
for ( int i = 1; i < segments.length; i++)
|
||||
closest = PathSegment.closer(closest, segments[i], reference);
|
||||
|
||||
return closest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the error between an arbitrary path segment and the reference point.
|
||||
*
|
||||
* @param referencePoint The reference point to calculate the error of.
|
||||
* @return The error offset between the path and the reference point.
|
||||
*/
|
||||
public double getError(Vector3f referencePoint) {
|
||||
return closest(referencePoint).difference(referencePoint); // Get the closest segment and calculate the error.
|
||||
}
|
||||
|
||||
// Builder class for the GesturePath object.
|
||||
public static class Builder {
|
||||
|
||||
// List of vectors to add to the GesturePath object.
|
||||
private final List<Vector3f> vectors;
|
||||
|
||||
/**
|
||||
* Constructor for the Builder object.
|
||||
*
|
||||
* @param vectors The list of vectors to add.
|
||||
*/
|
||||
public Builder(List<Vector3f> vectors) {
|
||||
this.vectors = vectors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default constructor for the Builder object.
|
||||
*/
|
||||
public Builder() {
|
||||
this.vectors = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a vector to the GesturePath object.
|
||||
*
|
||||
* @param vector The vector to add.
|
||||
* @return The Builder object.
|
||||
*/
|
||||
public Builder addVector(Vector3f vector) {
|
||||
vectors.add(vector);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the GesturePath object.
|
||||
*
|
||||
* @return The GesturePath object.
|
||||
*/
|
||||
public GesturePath build() {
|
||||
return new GesturePath(vectors.toArray(new Vector3f[0]));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,105 +0,0 @@
|
||||
package com.example.fitbot.util.path;
|
||||
|
||||
import org.joml.Vector3f;
|
||||
|
||||
public class PathSegment {
|
||||
|
||||
private final Vector3f start, end;
|
||||
private final double distance;
|
||||
|
||||
/**
|
||||
* Constructor for creating a PathSegment of two lines, with the normal vector
|
||||
* pointing straight upwards relative to the line, with a curvature of 0.0.
|
||||
*
|
||||
* @param start The starting point of the line segment
|
||||
* @param end The end point of the line segment.
|
||||
*/
|
||||
public PathSegment(Vector3f start, Vector3f end) {
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.distance = start.distance(end);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method that interpolates between the start and end points of the path segment,
|
||||
* depending on the curvature of the curve. If the curvature is unset, or set to 0
|
||||
* then this method will use linear interpolation. Otherwise, it will use a curve.
|
||||
*
|
||||
* @param t The interpolation value between 0 and 1.
|
||||
*/
|
||||
public Vector3f interpolate(double t) {
|
||||
return new Vector3f(this.start)
|
||||
.lerp(this.end, (float) Math.min(1.0F, Math.max(0.0F, t)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for calculating the difference between the provided vector and the
|
||||
* path segment, depending on the normal vector and the curvature.
|
||||
* If the provided vector does not lie on the path segment, this method will return
|
||||
* the linear distance to the path.
|
||||
*
|
||||
* @param other The vector to calculate the difference to.
|
||||
* @return The difference between the vector and the path segment.
|
||||
*/
|
||||
public double difference(Vector3f other) {
|
||||
|
||||
if (this.distance == 0)
|
||||
return this.start.distance(other);
|
||||
|
||||
double t = ((other.x - this.start.x) * (this.end.x - this.start.x) +
|
||||
(other.y - this.start.y) * (this.end.y - this.start.y) +
|
||||
(other.z - this.start.z) * (this.end.z - this.start.z)) / distance;
|
||||
|
||||
t = Math.max(0, Math.min(1, t));
|
||||
|
||||
return other.distance(new Vector3f(
|
||||
(float) (this.start.x + t * (this.end.x - this.start.x)),
|
||||
(float) (this.start.y + t * (this.end.y - this.start.y)),
|
||||
(float) (this.start.z + t * (this.end.z - this.start.z))
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the normal vector of the path segment.
|
||||
*
|
||||
* @return The normal vector of the path segment.
|
||||
*/
|
||||
public Vector3f getStart() {
|
||||
return start;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the end point of the path segment.
|
||||
*
|
||||
* @return The end point of the path segment.
|
||||
*/
|
||||
public Vector3f getEnd() {
|
||||
return end;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for returning the distance to the closest point on the path segment.
|
||||
*
|
||||
* @param reference The reference point to calculate the distance to.
|
||||
* @return The distance to the closest point on the path segment.
|
||||
*/
|
||||
public double distance(Vector3f reference) {
|
||||
if ( this.start.distanceSquared(reference) > this.end.distanceSquared(reference))
|
||||
return this.end.distance(reference);
|
||||
return this.start.distance(reference);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for returning the closest path segment to a reference point.
|
||||
*
|
||||
* @param first The first path segment to compare.
|
||||
* @param second The second path segment to compare.
|
||||
* @param referencePoint The reference point to compare to.
|
||||
* @return The closest path segment to the reference point.
|
||||
*/
|
||||
public static PathSegment closer(PathSegment first, PathSegment second, Vector3f referencePoint) {
|
||||
if (first.distance(referencePoint) < second.distance(referencePoint))
|
||||
return first;
|
||||
return second;
|
||||
}
|
||||
}
|
@@ -0,0 +1,104 @@
|
||||
package com.example.fitbot.util.processing;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GesturePath {
|
||||
|
||||
// The vectors that make up the path.
|
||||
private final Vector3[] vectors;
|
||||
|
||||
public GesturePath(Vector3[] vectors) {
|
||||
this.vectors = vectors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the error between an arbitrary path segment and the reference point.
|
||||
*
|
||||
* @param referencePoint The reference point to calculate the error of.
|
||||
* @return The error offset between the path and the reference point.
|
||||
*/
|
||||
public double getError(Vector3 referencePoint) {
|
||||
// If there are no vectors, return 0.
|
||||
if ( vectors.length == 0)
|
||||
return 0;
|
||||
|
||||
// If there's only one vector, return the distance to that vector.
|
||||
if ( vectors.length == 1)
|
||||
return vectors[0].distance(referencePoint);
|
||||
|
||||
double distance = Double.MAX_VALUE;
|
||||
double currentDistSq, nextDistSq;
|
||||
int closestVectorIdx = 0;
|
||||
|
||||
// Acquire two closest points to the reference point.
|
||||
for ( int i = 0; i < vectors.length - 1; i++) {
|
||||
currentDistSq = vectors[i].distanceSq(referencePoint);
|
||||
nextDistSq = vectors[i + 1].distanceSq(referencePoint);
|
||||
|
||||
if ( currentDistSq < distance) {
|
||||
distance = currentDistSq;
|
||||
closestVectorIdx = i;
|
||||
} else if ( nextDistSq < distance) {
|
||||
distance = nextDistSq;
|
||||
closestVectorIdx = i + 1;
|
||||
i++; // Skip the next iteration; this point is already closer.
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate the error between the two closest points.
|
||||
Vector3 pointB = (closestVectorIdx == vectors.length - 1) ?
|
||||
vectors[closestVectorIdx - 1] : // If the closest point is the last point, use the 1 to last one
|
||||
(closestVectorIdx > 0 && // Find the closer point between the surrounding points.
|
||||
(vectors[closestVectorIdx - 1].distanceSq(referencePoint) < vectors[closestVectorIdx + 1].distanceSq(referencePoint))) ?
|
||||
vectors[closestVectorIdx - 1] :
|
||||
vectors[closestVectorIdx + 1];
|
||||
|
||||
return referencePoint.distanceToLine(vectors[closestVectorIdx], pointB);
|
||||
}
|
||||
|
||||
// Builder class for the GesturePath object.
|
||||
public static class Builder {
|
||||
|
||||
// List of vectors to add to the GesturePath object.
|
||||
private final List<Vector3> vectors;
|
||||
|
||||
/**
|
||||
* Constructor for the Builder object.
|
||||
*
|
||||
* @param vectors The list of vectors to add.
|
||||
*/
|
||||
public Builder(List<Vector3> vectors) {
|
||||
this.vectors = vectors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default constructor for the Builder object.
|
||||
*/
|
||||
public Builder() {
|
||||
this.vectors = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a vector to the GesturePath object.
|
||||
*
|
||||
* @param vector The vector to add.
|
||||
* @return The Builder object.
|
||||
*/
|
||||
public Builder addVector(Vector3 vector) {
|
||||
vectors.add(vector);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the GesturePath object.
|
||||
*
|
||||
* @return The GesturePath object.
|
||||
*/
|
||||
public GesturePath build() {
|
||||
return new GesturePath(vectors.toArray(new Vector3[0]));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,16 +0,0 @@
|
||||
package com.example.fitbot.util.processing;
|
||||
|
||||
import org.joml.Vector3f;
|
||||
|
||||
public interface IMotionDataConsumer {
|
||||
|
||||
/**
|
||||
* Function for accepting motion data and the transformed vector.
|
||||
* @param transformedVector The transformed vector.
|
||||
* @param motionData The input motion data.
|
||||
* @param sampleIndex The index of the current sample
|
||||
* @param sampleRate The sample rate.
|
||||
*/
|
||||
void accept(Vector3f transformedVector, MotionData motionData, int sampleIndex, double sampleRate, int sensorId);
|
||||
|
||||
}
|
@@ -1,14 +1,11 @@
|
||||
package com.example.fitbot.util.processing;
|
||||
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class MotionData {
|
||||
|
||||
// Data of the motion sensor
|
||||
public Vector3f acceleration, rotation;
|
||||
public int sensorId;
|
||||
public Vector3 acceleration, rotation;
|
||||
|
||||
// Delimiter for the data received from the motion sensor
|
||||
private static final String DATA_DELIMITER = ";";
|
||||
@@ -22,10 +19,10 @@ public class MotionData {
|
||||
* @param rotationX The rotation in the X axis in degrees.
|
||||
* @param rotationY The rotation in the Y axis in degrees.
|
||||
* @param rotationZ The rotation in the Z axis in degrees.
|
||||
* @param sensorId The sensor id.
|
||||
*/
|
||||
public MotionData(float accelerationX, float accelerationY, float accelerationZ, float rotationX, float rotationY, float rotationZ, int sensorId) {
|
||||
this(new Vector3f(accelerationX, accelerationY, accelerationZ), new Vector3f(rotationX, rotationY, rotationZ), sensorId);
|
||||
public MotionData(double accelerationX, double accelerationY, double accelerationZ, double rotationX, double rotationY, double rotationZ) {
|
||||
this.acceleration = new Vector3(accelerationX, accelerationY, accelerationZ);
|
||||
this.rotation = new Vector3(rotationX, rotationY, rotationZ);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,10 +31,9 @@ public class MotionData {
|
||||
* @param acceleration The acceleration vector in m/s^2.
|
||||
* @param rotation The rotation vector in degrees.
|
||||
*/
|
||||
public MotionData(Vector3f acceleration, Vector3f rotation, int sensorId) {
|
||||
public MotionData(Vector3 acceleration, Vector3 rotation) {
|
||||
this.acceleration = acceleration;
|
||||
this.rotation = rotation;
|
||||
this.sensorId = sensorId;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,17 +48,16 @@ public class MotionData {
|
||||
Objects.requireNonNull(data); // Ensure data is not null
|
||||
|
||||
String[] parts = data.split(DATA_DELIMITER);
|
||||
if (parts.length != 7)
|
||||
if (parts.length != 6)
|
||||
return null;
|
||||
|
||||
return new MotionData(
|
||||
Float.parseFloat(parts[0]),
|
||||
Float.parseFloat(parts[1]),
|
||||
Float.parseFloat(parts[2]),
|
||||
Float.parseFloat(parts[3]),
|
||||
Float.parseFloat(parts[4]),
|
||||
Float.parseFloat(parts[5]),
|
||||
Integer.parseInt(parts[6])
|
||||
Double.parseDouble(parts[0]),
|
||||
Double.parseDouble(parts[1]),
|
||||
Double.parseDouble(parts[2]),
|
||||
Double.parseDouble(parts[3]),
|
||||
Double.parseDouble(parts[4]),
|
||||
Double.parseDouble(parts[5])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -2,35 +2,27 @@ package com.example.fitbot.util.processing;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.example.fitbot.util.path.GesturePath;
|
||||
import com.example.fitbot.util.server.WebServer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.example.fitbot.util.server.IWebSocketHandler;
|
||||
import com.example.fitbot.util.server.WebSocket;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.joml.Matrix3d;
|
||||
import org.joml.Vector3d;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class MotionProcessor {
|
||||
|
||||
public static final String DELIMITER = ";";
|
||||
|
||||
private final List<Vector3f> relativeLeftPath = new ArrayList<>(); // Relative path of the left motion data
|
||||
private final List<Vector3f> relativeRightPath = new ArrayList<>(); // Relative path of the motion data
|
||||
|
||||
private Vector3f ZERO = new Vector3f(0, 0, 0);
|
||||
|
||||
private final float sampleRate = 1.0f / 10.0F; // samples/second
|
||||
|
||||
private IMotionDataConsumer motionDataConsumer = (p1, p2, p3, p4, p5) -> { };
|
||||
private WebServer server;
|
||||
|
||||
private final List<MotionData> preprocessedData = new ArrayList<>(); // Preprocessed motion data
|
||||
private final List<Vector3> relativePath = new ArrayList<>(); // Relative path of the motion data
|
||||
private Vector3 ZERO = new Vector3(0, 0, 0);
|
||||
private double sampleRate = 1.0D; // samples/second
|
||||
private Consumer<Vector3> motionDataConsumer = (data) -> {};
|
||||
private GesturePath path;
|
||||
private WebSocket socket;
|
||||
|
||||
public MotionProcessor() {}
|
||||
|
||||
@@ -43,14 +35,20 @@ public class MotionProcessor {
|
||||
*/
|
||||
public void startListening() {
|
||||
// Create socket server
|
||||
this.server = WebServer.createServer();
|
||||
this.socket = WebSocket.createServer();
|
||||
|
||||
Log.i("MotionProcessor", "Listening for incoming connections.");
|
||||
|
||||
// Check if the socket
|
||||
if (server != null) {
|
||||
if (socket != null) {
|
||||
// Update event handler to match our functionality.
|
||||
server.setEventHandler(this::parsePacket);
|
||||
socket.setEventHandler(new IWebSocketHandler() {
|
||||
@Override
|
||||
public void onMessageReceived(WebSocket.Message message, WebSocket.MessageReply replier) {
|
||||
parsePacket(message.message);
|
||||
}
|
||||
});
|
||||
socket.startListening();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,95 +58,75 @@ public class MotionProcessor {
|
||||
* the WebSocket server.
|
||||
*/
|
||||
public void stopListening() {
|
||||
if (server != null) {
|
||||
server.stop();
|
||||
if (socket != null) {
|
||||
socket.stop();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for parsing arbitrary packet data.
|
||||
*
|
||||
* @param data The data to parse.
|
||||
*/
|
||||
public void parsePacket(@NotNull String data) {
|
||||
|
||||
try {
|
||||
|
||||
Log.i("MotionProcessor", "Received packet data: " + data);
|
||||
|
||||
JsonElement json = JsonParser.parseString(data);
|
||||
|
||||
if (!json.isJsonObject())
|
||||
return;
|
||||
|
||||
JsonObject object = json.getAsJsonObject();
|
||||
|
||||
String[] required = {
|
||||
"rotationX", "rotationY", "rotationZ",
|
||||
"accelerationX", "accelerationY", "accelerationZ",
|
||||
"type",
|
||||
"deviceId"
|
||||
};
|
||||
|
||||
// Ensure all properties are present in the received JSON object
|
||||
for (String s : required) {
|
||||
if (!object.has(s))
|
||||
return;
|
||||
// If the message starts with 'data', it's a data packet.
|
||||
if ( data.startsWith("data")) {
|
||||
Log.i("MotionProcessor", "Received data packet: " + data.split(" ")[1]);
|
||||
MotionData parsedData = MotionData.decode(data.split(" ")[1]);
|
||||
if (parsedData != null) {
|
||||
addMotionData(parsedData);
|
||||
}
|
||||
|
||||
// Parse the data
|
||||
Vector3f rotation = new Vector3f(object.get("rotationX").getAsFloat(), object.get("rotationY").getAsFloat(), object.get("rotationZ").getAsFloat());
|
||||
Vector3f acceleration = new Vector3f(object.get("accelerationX").getAsFloat(), object.get("accelerationY").getAsFloat(), object.get("accelerationZ").getAsFloat());
|
||||
int deviceId = object.get("deviceId").getAsInt();
|
||||
String type = object.get("type").getAsString();
|
||||
MotionData motionData = new MotionData(rotation, acceleration, deviceId);
|
||||
|
||||
if (type.equals("calibrate")) {
|
||||
ZERO = getRelativeVector(motionData);
|
||||
return;
|
||||
}
|
||||
|
||||
addMotionData(motionData);
|
||||
} catch (Exception e) {
|
||||
Log.i("MotionProcessor", "Failed to parse packet data.");
|
||||
// Otherwise check if it starts with 'calibrate', this is the ZERO point.
|
||||
} else if ( data.startsWith("zero")) { // message to calibrate device
|
||||
String[] vectorData = data.split(" ")[1].split(DELIMITER);
|
||||
ZERO = new Vector3(
|
||||
Float.parseFloat(vectorData[0]),
|
||||
Float.parseFloat(vectorData[1]),
|
||||
Float.parseFloat(vectorData[2])
|
||||
);
|
||||
Log.i("MotionProcessor", "Device calibrated at " + ZERO.toString());
|
||||
} else if ( data.startsWith("sampleRate")) {
|
||||
this.sampleRate = Double.parseDouble(data.split(" ")[1]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for setting the gesture path of the processor.
|
||||
*
|
||||
* @param path The path to set.
|
||||
*/
|
||||
public void setGesturePath(GesturePath path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for adding motion data to the processor.
|
||||
*
|
||||
* @param data The motion data to add.
|
||||
*/
|
||||
public void addMotionData(MotionData data) {
|
||||
List<Vector3f> target;
|
||||
if (data.sensorId == 0)
|
||||
target = relativeLeftPath;
|
||||
else target = relativeRightPath;
|
||||
Vector3f previous = target.isEmpty() ? ZERO : target.get(target.size() - 1);
|
||||
Vector3f relativeVector = getRelativeVector(data).add(previous);
|
||||
target.add(relativeVector);
|
||||
motionDataConsumer.accept(relativeVector, data, target.size(), this.sampleRate, data.sensorId);
|
||||
preprocessedData.add(data);
|
||||
Vector3 previous = this.relativePath.isEmpty() ? ZERO : this.relativePath.get(this.relativePath.size() - 1);
|
||||
Vector3 relativeVector = getRelativeVector(data).add(previous);
|
||||
this.relativePath.add(relativeVector);
|
||||
motionDataConsumer.accept(relativeVector);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for updating the relative path.
|
||||
*
|
||||
* @param relativeRightPath The new relative path.
|
||||
* @param relativePath The new relative path.
|
||||
*/
|
||||
public void setRelativePaths(List<Vector3f> relativeLeftPath, List<Vector3f> relativeRightPath) {
|
||||
this.relativeRightPath.clear();
|
||||
this.relativeLeftPath.clear();
|
||||
this.relativeLeftPath.addAll(relativeLeftPath);
|
||||
this.relativeRightPath.addAll(relativeRightPath);
|
||||
public void setRelativePath(List<Vector3> relativePath) {
|
||||
this.relativePath.clear();
|
||||
this.relativePath.addAll(relativePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for setting the motion data receiver.
|
||||
*
|
||||
* @param consumer The consumer to set.
|
||||
*/
|
||||
public void setMotionDataEventHandler(IMotionDataConsumer consumer) {
|
||||
if (consumer != null)
|
||||
public void setMotionDataEventHandler(Consumer<Vector3> consumer) {
|
||||
if ( consumer != null)
|
||||
this.motionDataConsumer = consumer;
|
||||
}
|
||||
|
||||
@@ -161,21 +139,15 @@ public class MotionProcessor {
|
||||
* @param motionData The motion data to calculate the relative vector for.
|
||||
* @return The relative vector of the motion data.
|
||||
*/
|
||||
public Vector3f getRelativeVector(MotionData motionData) {
|
||||
public Vector3 getRelativeVector(MotionData motionData) {
|
||||
|
||||
// Rotate the acceleration vector back by the rotation vector to make it
|
||||
// perpendicular to the gravity vector, then apply double integration to get the relative position.
|
||||
// s = 1/2 * a * t^2
|
||||
// Step 2: Create rotation matrices for each axis
|
||||
// Step 4: Rotate the acceleration vector
|
||||
|
||||
return motionData.rotation
|
||||
.mul(5);
|
||||
/*return motionData.acceleration
|
||||
.rotateZ(-motionData.rotation.z)
|
||||
.rotateY(-motionData.rotation.y)
|
||||
.rotateX(-motionData.rotation.x)
|
||||
.mul(sampleRate * sampleRate / 2);*/
|
||||
return motionData.acceleration
|
||||
.rotate(motionData.rotation.negate())
|
||||
.divide(2)
|
||||
.multiply(sampleRate * sampleRate);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,21 +159,48 @@ public class MotionProcessor {
|
||||
*/
|
||||
public List<Double> getErrors(GesturePath referencePath) {
|
||||
|
||||
List<Double> errors = new ArrayList<>();
|
||||
for (Vector3f vector : relativeRightPath) {
|
||||
errors.add(referencePath.getError(vector));
|
||||
}
|
||||
return errors;
|
||||
// Return the errors of the relative path compared to the reference path.
|
||||
return relativePath
|
||||
.stream()
|
||||
.map(referencePath::getError)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for getting the error offsets of the motion data compared to the
|
||||
* reference path.
|
||||
*
|
||||
* @return A list of error offsets of the motion data compared to the reference path.
|
||||
* If no path is set, an empty list will be returned.
|
||||
*/
|
||||
public List<Double> getErrors() {
|
||||
if ( path == null)
|
||||
return new ArrayList<>();
|
||||
return getErrors(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for getting the error of the motion data compared to the reference path.
|
||||
*
|
||||
* @param path The path to compare the motion data to.
|
||||
* @param path The path to compare the motion data to.
|
||||
* @param referencePoint The reference point to compare the motion data to.
|
||||
* @return The error of the motion data compared to the reference path.
|
||||
*/
|
||||
public double getError(GesturePath path, Vector3f referencePoint) {
|
||||
public double getError(GesturePath path, Vector3 referencePoint)
|
||||
{
|
||||
return path.getError(referencePoint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for getting the error of the provided vector and the set path.
|
||||
* If no path is set, the error will be 0.
|
||||
*
|
||||
* @param referencePoint The reference point to compare the path data to.
|
||||
* @return The error of the motion data compared to the reference path.
|
||||
*/
|
||||
public double getError(Vector3 referencePoint) {
|
||||
if ( path == null)
|
||||
return 0;
|
||||
return path.getError(referencePoint);
|
||||
}
|
||||
|
||||
@@ -212,12 +211,24 @@ public class MotionProcessor {
|
||||
* @param referencePath The reference path to compare the motion data to.
|
||||
* @return The average error of the motion data compared to the reference path.
|
||||
*/
|
||||
public double getAverageError(GesturePath referencePath, int sensorId) {
|
||||
double error = 0;
|
||||
for (Double e : getErrors(referencePath)) {
|
||||
error += e;
|
||||
}
|
||||
return error / Math.max(1, (sensorId == 0 ? relativeLeftPath : relativeRightPath).size());
|
||||
public double getAverageError(GesturePath referencePath) {
|
||||
return getErrors(referencePath)
|
||||
.stream()
|
||||
.mapToDouble(Double::doubleValue)
|
||||
.average()
|
||||
.orElse(0.0D);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for calculating the average error of the motion data
|
||||
* compared to the reference path.
|
||||
*
|
||||
* @return The average error of the motion data compared to the reference path.
|
||||
*/
|
||||
public double getAverageError() {
|
||||
if ( path == null)
|
||||
return 0;
|
||||
return getAverageError(path);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -226,8 +237,10 @@ public class MotionProcessor {
|
||||
* @param referencePath The reference path to compare the motion data to.
|
||||
*/
|
||||
public void logStatistics(GesturePath referencePath) {
|
||||
Log.i("MotionProcessor", "Path length: " + relativeRightPath.size());
|
||||
Log.i("MotionProcessor", "Average path error: " + getAverageError(referencePath));
|
||||
Log.i("MotionProcessor", "Path length: " + relativePath.size());
|
||||
Log.i("MotionProcessor", "Sample rate: " + sampleRate);
|
||||
Log.i("MotionProcessor", "Calibration point: " + ZERO.toString());
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,258 @@
|
||||
package com.example.fitbot.util.processing;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
|
||||
public class Vector3 {
|
||||
|
||||
public double x, y, z;
|
||||
|
||||
/**
|
||||
* Constructor for creating a new vector.
|
||||
*
|
||||
* @param x The X component of the vector.
|
||||
* @param y The Y component of the vector.
|
||||
* @param z The Z component of the vector.
|
||||
*/
|
||||
public Vector3(double x, double y, double z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy the vector.
|
||||
*
|
||||
* @return A new vector with the same values.
|
||||
*/
|
||||
public Vector3 copy() {
|
||||
return new Vector3(this.x, this.y, this.z);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the zero vector.
|
||||
*
|
||||
* @return The zero vector.
|
||||
*/
|
||||
public static Vector3 zero() {
|
||||
return new Vector3(0, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the magnitude of the vector.
|
||||
*
|
||||
* @return The magnitude of the vector.
|
||||
*/
|
||||
public double magnitude() {
|
||||
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize the vector.
|
||||
*
|
||||
* @return The normalized vector.
|
||||
*/
|
||||
public Vector3 normalize() {
|
||||
double mag = this.magnitude();
|
||||
if (mag == 0) throw new IllegalArgumentException("Cannot normalize the zero vector.");
|
||||
return new Vector3(this.x / mag, this.y / mag, this.z / mag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Subtract the vector from another vector.
|
||||
*
|
||||
* @param other The other vector to subtract.
|
||||
* @return The new vector.
|
||||
*/
|
||||
public Vector3 subtract(Vector3 other) {
|
||||
return new Vector3(this.x - other.x, this.y - other.y, this.z - other.z);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the vector to another vector.
|
||||
*
|
||||
* @param other The other vector to add.
|
||||
* @return The new vector.
|
||||
*/
|
||||
public Vector3 add(Vector3 other) {
|
||||
return new Vector3(this.x + other.x, this.y + other.y, this.z + other.z);
|
||||
}
|
||||
|
||||
/**
|
||||
* Multiply the vector by a scalar.
|
||||
*
|
||||
* @param scalar The scalar to multiply by.
|
||||
* @return The multiplied vector.
|
||||
*/
|
||||
public Vector3 multiply(double scalar) {
|
||||
return new Vector3(this.x * scalar, this.y * scalar, this.z * scalar);
|
||||
}
|
||||
|
||||
/**
|
||||
* Divide the vector by a scalar.
|
||||
*
|
||||
* @param scalar The scalar to divide by.
|
||||
* @return The divided vector.
|
||||
*/
|
||||
public Vector3 divide(double scalar) {
|
||||
if (scalar == 0) throw new IllegalArgumentException("Cannot divide by zero.");
|
||||
return new Vector3(this.x / scalar, this.y / scalar, this.z / scalar);
|
||||
}
|
||||
|
||||
/**
|
||||
* Negate the vector.
|
||||
*
|
||||
* @return The negated vector.
|
||||
*/
|
||||
public Vector3 negate() {
|
||||
return new Vector3(-this.x, -this.y, -this.z);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate the vector around the X, Y, and Z axes.
|
||||
*
|
||||
* @param radX Rotation around the X axis in radians.
|
||||
* @param radY Rotation around the Y axis in radians.
|
||||
* @param radZ Rotation around the Z axis in radians.
|
||||
* @return The rotated vector.
|
||||
*/
|
||||
public Vector3 rotate(double radX, double radY, double radZ) {
|
||||
double cosX = Math.cos(radX);
|
||||
double cosY = Math.cos(radY);
|
||||
double cosZ = Math.cos(radZ);
|
||||
double sinX = Math.sin(radX);
|
||||
double sinY = Math.sin(radY);
|
||||
double sinZ = Math.sin(radZ);
|
||||
double newX = x * cosY * cosZ + y * cosY * sinZ - z * sinY;
|
||||
double newY = x * (sinX * sinY * cosZ - cosX * sinZ) + y * (sinX * sinY * sinZ + cosX * cosZ) + z * sinX * cosY;
|
||||
double newZ = x * (cosX * sinY * cosZ + sinX * sinZ) + y * (cosX * sinY * sinZ - sinX * cosZ) + z * cosX * cosY;
|
||||
return new Vector3(newX, newY, newZ);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate the vector around the X, Y, and Z axes.
|
||||
*
|
||||
* @param rotation The rotation vector.
|
||||
* @return The rotated vector.
|
||||
*/
|
||||
public Vector3 rotate(Vector3 rotation) {
|
||||
return rotate(rotation.x, rotation.y, rotation.z);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate the vector around the X axis.
|
||||
*
|
||||
* @param angle Rotation around the X axis in radians.
|
||||
* @return The rotated vector.
|
||||
*/
|
||||
public Vector3 rotateX(double angle) {
|
||||
double sinTheta = Math.sin(angle);
|
||||
double cosTheta = Math.cos(angle);
|
||||
return new Vector3(
|
||||
x,
|
||||
y * cosTheta - z * sinTheta,
|
||||
y * sinTheta + z * cosTheta
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate the vector around the Y axis.
|
||||
*
|
||||
* @param angle Rotation around the Y axis in radians.
|
||||
* @return The rotated vector.
|
||||
*/
|
||||
public Vector3 rotateY(double angle) {
|
||||
double sinTheta = Math.sin(angle);
|
||||
double cosTheta = Math.cos(angle);
|
||||
return new Vector3(
|
||||
x * cosTheta + z * sinTheta,
|
||||
y,
|
||||
-x * sinTheta + z * cosTheta
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate the vector around the Z axis.
|
||||
*
|
||||
* @param angle Rotation around the Z axis in radians.
|
||||
* @return The rotated vector.
|
||||
*/
|
||||
public Vector3 rotateZ(double angle) {
|
||||
double sinTheta = Math.sin(angle);
|
||||
double cosTheta = Math.cos(angle);
|
||||
return new Vector3(
|
||||
x * cosTheta - y * sinTheta,
|
||||
x * sinTheta + y * cosTheta,
|
||||
z
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the squared distance between this vector and another vector.
|
||||
*
|
||||
* @param compare The other vector.
|
||||
* @return The squared distance between the two vectors.
|
||||
*/
|
||||
public double distanceSq(Vector3 compare) {
|
||||
return Math.pow(compare.x - x, 2) + Math.pow(compare.y - y, 2) + Math.pow(compare.z - z, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the distance between this vector and another vector.
|
||||
*
|
||||
* @param compare The other vector.
|
||||
* @return The distance between the two vectors.
|
||||
*/
|
||||
public double distance(Vector3 compare) {
|
||||
return Math.sqrt(distanceSq(compare));
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the distance to a line defined by two points.
|
||||
*
|
||||
* @param lineStart The starting point of the line.
|
||||
* @param lineEnd The ending point of the line.
|
||||
* @return The distance to the line.
|
||||
*/
|
||||
public double distanceToLine(Vector3 lineStart, Vector3 lineEnd) {
|
||||
double lineDistance = lineStart.distanceSq(lineEnd);
|
||||
if (lineDistance == 0)
|
||||
return this.distanceSq(lineStart);
|
||||
|
||||
double t = ((this.x - lineStart.x) * (lineEnd.x - lineStart.x) +
|
||||
(this.y - lineStart.y) * (lineEnd.y - lineStart.y) +
|
||||
(this.z - lineStart.z) * (lineEnd.z - lineStart.z)) / lineDistance;
|
||||
|
||||
t = Math.max(0, Math.min(1, t));
|
||||
|
||||
return this.distanceSq(new Vector3(
|
||||
lineStart.x + t * (lineEnd.x - lineStart.x),
|
||||
lineStart.y + t * (lineEnd.y - lineStart.y),
|
||||
lineStart.z + t * (lineEnd.z - lineStart.z))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the closest vector to this one given a list of vectors.
|
||||
*
|
||||
* @param vectors The list of vectors to compare.
|
||||
* @return The closest vector.
|
||||
*/
|
||||
public Vector3 closest(Vector3 ... vectors) {
|
||||
return Arrays.stream(vectors).min(Comparator.comparingDouble(this::distanceSq)).orElse(null);
|
||||
}
|
||||
|
||||
public Vector3 map(VectorMapFunction function) {
|
||||
return function.apply(this);
|
||||
}
|
||||
|
||||
public interface VectorMapFunction {
|
||||
Vector3 apply(Vector3 vector);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Vector3(" + this.x + ", " + this.y + ", " + this.z + ")";
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
package com.example.fitbot.util.server;
|
||||
|
||||
import java.net.Socket;
|
||||
|
||||
/**
|
||||
* Interface for handling WebSocket events.
|
||||
*/
|
||||
public interface IWebServerHandler {
|
||||
|
||||
void onReceive(String body);
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
package com.example.fitbot.util.server;
|
||||
|
||||
import java.net.Socket;
|
||||
|
||||
/**
|
||||
* Interface for handling WebSocket events.
|
||||
*/
|
||||
public interface IWebSocketHandler {
|
||||
|
||||
// Function for handling the connection of the WebSocket.
|
||||
default void onConnected(Socket socket) {}
|
||||
|
||||
default void onDisconnected(Socket socket) {}
|
||||
|
||||
default void onMessageReceived(WebSocket.Message message, WebSocket.MessageReply replier) {}
|
||||
|
||||
default void onError(Socket socket, String error) {}
|
||||
}
|
@@ -1,143 +0,0 @@
|
||||
package com.example.fitbot.util.server;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class WebServer implements Runnable {
|
||||
|
||||
private ServerSocket serverSocket;
|
||||
protected IWebServerHandler eventHandler = (input) -> {}; // No-op.
|
||||
|
||||
private Thread thread;
|
||||
private AtomicBoolean forceClose = new AtomicBoolean(false);
|
||||
|
||||
/**
|
||||
* Constructor for creating a new WebSocket server.
|
||||
*/
|
||||
private WebServer() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for creating a new WebSocket server given the provided port.
|
||||
*
|
||||
* @return A WebSocket connection, or null if something went wrong.
|
||||
*/
|
||||
public static WebServer createServer() {
|
||||
try {
|
||||
WebServer server = new WebServer();
|
||||
server.serverSocket = new ServerSocket();
|
||||
server.serverSocket.bind(new InetSocketAddress(3445));
|
||||
server.serverSocket.setSoTimeout(0);
|
||||
|
||||
Log.i("WebServer", "Server created: " + server.serverSocket.getLocalSocketAddress() + ", " + server.serverSocket.getLocalPort());
|
||||
|
||||
server.thread = new Thread(server);
|
||||
server.thread.start();
|
||||
|
||||
return server;
|
||||
} catch (IOException error) {
|
||||
String cause = error.getMessage() == null ? "Unknown reason" : error.getMessage();
|
||||
Log.e("WebServer", cause);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// Listen for new connections until the socket closes.
|
||||
while (this.isConnected() && !this.forceClose.get()) {
|
||||
try {
|
||||
// Find a new connection
|
||||
Socket newSocket = this.serverSocket.accept();
|
||||
InputStream streamIn = newSocket.getInputStream();
|
||||
OutputStream streamOut = newSocket.getOutputStream();
|
||||
|
||||
// Read the incoming data
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(streamIn));
|
||||
StringBuilder builder = new StringBuilder();
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null)
|
||||
builder.append(line).append("\n");
|
||||
|
||||
// Send generic message back
|
||||
streamOut.write("HTTP/1.1 200 OK\n".getBytes());
|
||||
streamOut.write("Content-Type: text/html\n".getBytes());
|
||||
streamOut.write("Connection: close\n".getBytes());
|
||||
|
||||
streamIn.close(); // Closes the reader, stream and socket connection.
|
||||
streamOut.close();
|
||||
newSocket.close();
|
||||
|
||||
String[] data = builder.toString().split("\n\n");
|
||||
|
||||
if ( data.length > 1) { // Check if the data is valid.
|
||||
this.eventHandler.onReceive(data[1]);
|
||||
}
|
||||
|
||||
} catch (IOException error) {
|
||||
String reason = error.getMessage() == null ? "Unknown reason" : error.getMessage();
|
||||
Log.e("WebServerConnectionHandler", "Error listening to Socket connections: " + reason);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for stopping the WebSocket server.
|
||||
*/
|
||||
public void stop() {
|
||||
try {
|
||||
this.serverSocket.close();
|
||||
this.forceClose.set(true);
|
||||
} catch (IOException error) {
|
||||
String cause = error.getMessage() == null ? "Unknown reason" : error.getMessage();
|
||||
Log.e("WebServer", cause);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for setting the event handler for this WebSocket server.
|
||||
*
|
||||
* @param handler The handler to use. This handler will parse all events
|
||||
* that occur in this WebSocket connection. The events are the followed:
|
||||
* - onMessageReceived(Socket, String)
|
||||
* - onConnected(Socket)
|
||||
* - onDisconnected(Socket)
|
||||
* - onError(Socket, String)
|
||||
*/
|
||||
public void setEventHandler(IWebServerHandler handler) {
|
||||
this.eventHandler = handler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for getting the ServerSocket connection
|
||||
*
|
||||
* @return The ServerSocket connection.
|
||||
*/
|
||||
public ServerSocket getSocket() {
|
||||
return this.serverSocket;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for checking whether this WebSocket connection is connected.
|
||||
*
|
||||
* @return The connection status of the WebSocket.
|
||||
*/
|
||||
public boolean isConnected() {
|
||||
return !this.serverSocket.isClosed();
|
||||
}
|
||||
}
|
@@ -0,0 +1,150 @@
|
||||
package com.example.fitbot.util.server;
|
||||
|
||||
import android.support.annotation.Nullable;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class WebSocket {
|
||||
|
||||
private ServerSocket serverSocket;
|
||||
private WebSocketConnectionHandler connectionHandler;
|
||||
private final Set<Socket> clients = Collections.synchronizedSet(new HashSet<>());
|
||||
protected IWebSocketHandler eventHandler = new IWebSocketHandler() {}; // NO-OP event handler.
|
||||
|
||||
/**
|
||||
* Constructor for creating a new WebSocket server.
|
||||
*/
|
||||
private WebSocket() {}
|
||||
|
||||
/**
|
||||
* Function for creating a new WebSocket server given the provided port.
|
||||
* @return A WebSocket connection, or null if something went wrong.
|
||||
*/
|
||||
public static @Nullable WebSocket createServer() {
|
||||
try {
|
||||
WebSocket webSocket = new WebSocket();
|
||||
webSocket.serverSocket = new ServerSocket();
|
||||
webSocket.serverSocket.bind(webSocket.serverSocket.getLocalSocketAddress());
|
||||
Log.i("WebSocket -- Creating new WebSocket server", "Server created: " + webSocket.serverSocket.getLocalSocketAddress() + ", " + webSocket.serverSocket.getLocalPort());
|
||||
return webSocket;
|
||||
} catch (IOException error)
|
||||
{
|
||||
String cause = error.getMessage() == null ? "Unknown reason" : error.getMessage();
|
||||
Log.e("WebSocket -- Creating new WebSocket server", cause);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for listening for incoming connections.
|
||||
*/
|
||||
public void startListening() {
|
||||
this.connectionHandler = new WebSocketConnectionHandler(this);
|
||||
this.connectionHandler.listen();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for stopping the WebSocket server.
|
||||
*/
|
||||
public void stop() {
|
||||
try {
|
||||
this.serverSocket.close();
|
||||
this.connectionHandler.stop();
|
||||
} catch (IOException error) {
|
||||
String cause = error.getMessage() == null ? "Unknown reason" : error.getMessage();
|
||||
Log.e("WebSocket -- Closing server connection", cause);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for setting the event handler for this WebSocket server.
|
||||
* @param handler The handler to use. This handler will parse all events
|
||||
* that occur in this WebSocket connection. The events are the followed:
|
||||
* - onMessageReceived(Socket, String)
|
||||
* - onConnected(Socket)
|
||||
* - onDisconnected(Socket)
|
||||
* - onError(Socket, String)
|
||||
*/
|
||||
public void setEventHandler(IWebSocketHandler handler) {
|
||||
this.eventHandler = handler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for getting the ServerSocket connection
|
||||
* @return The ServerSocket connection.
|
||||
*/
|
||||
public ServerSocket getSocket() {
|
||||
return this.serverSocket;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for checking whether this WebSocket connection is connected.
|
||||
* @return The connection status of the WebSocket.
|
||||
*/
|
||||
public boolean isConnected() {
|
||||
return !this.serverSocket.isClosed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Class representing a message received from a WebSocket connection.
|
||||
*/
|
||||
public static class Message {
|
||||
|
||||
// Enumerable representing message type (opcode).
|
||||
public enum Opcode {
|
||||
|
||||
CONTINUING((byte) 0x0),
|
||||
TEXT((byte) 0x1),
|
||||
BINARY((byte) 0x2),
|
||||
RES0((byte) 0x3), RES1((byte) 0x4), RES2((byte) 0x5), RES3((byte) 0x6), RES4((byte) 0x7),
|
||||
CLOSE_CONNECTION((byte) 0x8),
|
||||
PING((byte) 0x9),
|
||||
PONG((byte) 0xA),
|
||||
RES5((byte) 0xB), RES6((byte) 0xC), RES7((byte) 0xD), RES8((byte) 0xE), RES9((byte) 0xF);
|
||||
|
||||
byte opcode;
|
||||
Opcode(final byte opcode) {
|
||||
this.opcode = opcode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for decoding the opcode of a message.
|
||||
* @param opcode The opcode to decode.
|
||||
* @return The message type.
|
||||
*/
|
||||
public static Opcode decode(byte opcode) {
|
||||
return Opcode.values()[opcode & 0xF];
|
||||
}
|
||||
// Returns the opcode of this message type.
|
||||
public byte getOpcode() { return this.opcode; }
|
||||
}
|
||||
|
||||
public String message;
|
||||
public WebSocketConnection connection;
|
||||
|
||||
/**
|
||||
* Constructor for a WebSocket message.
|
||||
* @param message The message that was sent
|
||||
* @param connection The connection where the message came from.
|
||||
*/
|
||||
public Message(WebSocketConnection connection, String message) {
|
||||
this.message = message;
|
||||
this.connection = connection;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface for a message reply.
|
||||
* This can be used for when a message has been received from a client
|
||||
* to reply back to the client.
|
||||
*/
|
||||
public interface MessageReply {
|
||||
void reply(String message);
|
||||
}
|
||||
}
|
@@ -0,0 +1,35 @@
|
||||
package com.example.fitbot.util.server;
|
||||
|
||||
import java.net.Socket;
|
||||
|
||||
public class WebSocketConnection {
|
||||
|
||||
private final WebSocket origin;
|
||||
private final Socket socket;
|
||||
|
||||
/**
|
||||
* Constructor for creating an arbitrary WebSocket connection (Client)
|
||||
* @param connection The server connection
|
||||
* @param socket The client socket
|
||||
*/
|
||||
public WebSocketConnection(WebSocket connection, Socket socket) {
|
||||
this.origin = connection;
|
||||
this.socket = socket;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter method for retrieving the WebSocket connection
|
||||
* @return The WebSocket instance.
|
||||
*/
|
||||
public WebSocket getOrigin() {
|
||||
return origin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter method for retrieving the Client Socket connection.
|
||||
* @return The Socket connection.
|
||||
*/
|
||||
public Socket getSocket() {
|
||||
return socket;
|
||||
}
|
||||
}
|
@@ -0,0 +1,217 @@
|
||||
package com.example.fitbot.util.server;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class WebSocketConnectionHandler implements Runnable {
|
||||
|
||||
private final WebSocket theSocket;
|
||||
private List<Socket> clients = Collections.synchronizedList(new ArrayList<>());
|
||||
private Thread thread;
|
||||
private boolean forceClose = false;
|
||||
|
||||
/**
|
||||
* Constructor for WebSocketConnectionHandler.
|
||||
* This class handles all new incoming Socket connections.
|
||||
*
|
||||
* @param webSocket The socket to check for new connections.
|
||||
*/
|
||||
protected WebSocketConnectionHandler(WebSocket webSocket) {
|
||||
this.theSocket = webSocket;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// Listen for new connections until the socket closes.
|
||||
while (theSocket.isConnected()) {
|
||||
try {
|
||||
// Find a new connection
|
||||
Socket newSocket = this.theSocket.getSocket().accept();
|
||||
this.theSocket.eventHandler.onConnected(newSocket);
|
||||
clients.add(newSocket);
|
||||
|
||||
InputStream streamIn = newSocket.getInputStream();
|
||||
OutputStream streamOut = newSocket.getOutputStream();
|
||||
|
||||
// Check if the connection was successfully upgraded to WebSocket
|
||||
if (upgradeConnection(streamIn, streamOut)) {
|
||||
applyMessageDecoder(streamIn);
|
||||
}
|
||||
} catch (IOException error) {
|
||||
String reason = error.getMessage() == null ? "Unknown reason" : error.getMessage();
|
||||
Log.e("WebSocketConnectionHandler", "Error listening to Socket connections: " + reason);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for upgrading a HTTP connection to a WebSocket connection.
|
||||
* This checks whether the client sent a GET header and sends back
|
||||
* the required headers to upgrade the connection.
|
||||
* @param streamIn The InputStream of the client socket connection.
|
||||
* @param streamOut The OutputStream of the client socket connection.
|
||||
* @return Whether or not the connection was successfully upgraded.
|
||||
*/
|
||||
private boolean upgradeConnection(InputStream streamIn, OutputStream streamOut) {
|
||||
Scanner scanner = new Scanner(streamIn, "UTF-8");
|
||||
String data = scanner.useDelimiter("\\r\\n\\r\\n").next();
|
||||
Matcher header = Pattern.compile("^GET").matcher(data);
|
||||
|
||||
// Check if the header contains the GET keyword
|
||||
// If this is the case, upgrade the HTTP connection to WebSocket.
|
||||
if (!header.find())
|
||||
return false;
|
||||
|
||||
Matcher match = Pattern.compile("Sec-WebSocket-Key: (.*)").matcher(data);
|
||||
match.find(); // Get next match
|
||||
|
||||
try {
|
||||
String SECAccept = Base64.getEncoder().encodeToString(
|
||||
MessageDigest.getInstance("SHA-1").digest((match.group(1) + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11").getBytes(StandardCharsets.UTF_8)));
|
||||
|
||||
byte[] response = (
|
||||
"HTTP/1.1 101 Switching Protocols\r\n" +
|
||||
"Connection: Upgrade\r\n" +
|
||||
"Upgrade: websocket\r\n" +
|
||||
"Sec-WebSocket-Accept: " +
|
||||
SECAccept + "\r\n\r\n").getBytes(StandardCharsets.UTF_8);
|
||||
streamOut.write(response, 0, response.length);
|
||||
|
||||
} catch (IOException | NoSuchAlgorithmException error) {
|
||||
Log.e("WebSocketConnectionHandler", "Failed upgrading HTTP to WebSocket connection" + error.getMessage());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for applying a message decoder for whenever a socket receives data.
|
||||
* This method attemps to decode a message received from a WebSocket connection.
|
||||
* This message is in the
|
||||
* @param streamIn The message stream to decode.
|
||||
*/
|
||||
private void applyMessageDecoder(InputStream streamIn) {
|
||||
// TODO: Implement
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for decoding an encoded WebSocket message
|
||||
* @param bytes The message to decode, in UTF-8 format.
|
||||
* @return The decoded message.
|
||||
* @throws IllegalArgumentException When the `frame` content is in an incorrect format.
|
||||
*/
|
||||
public static String decodeWebSocketMessage(byte[] bytes) {
|
||||
// Check if the packet isn't corrupted
|
||||
if (bytes.length <= 2 || (bytes[0] & 0b1110) != 0)
|
||||
throw new IllegalArgumentException("Attempted to decode corrupted WebSocket frame data");
|
||||
|
||||
WebSocket.Message.Opcode opcode = WebSocket.Message.Opcode.decode((byte) (bytes[0] & 0b11110000));
|
||||
byte payloadLength = (byte) (bytes[1] & 0b01111111); // Payload size (7 bits)
|
||||
boolean fin = (bytes[0] & 0b1) != 0; // Whether this is the whole message
|
||||
boolean masked = (bytes[1] & 0b10000000) != 0; // Whether the 9th bit is masked
|
||||
|
||||
long extendedPayloadLength = 0;
|
||||
int byteOffset = 2;
|
||||
|
||||
// Check whether the payload length is 16-bit
|
||||
if (payloadLength == 126) {
|
||||
// 16-bit extended payload length (byte 2 and 3)
|
||||
extendedPayloadLength = ((bytes[2] & 0xFF) << 8) | (bytes[3] & 0xFF);
|
||||
byteOffset += 2;
|
||||
|
||||
// Check whether payload length is 64-bit
|
||||
} else if (payloadLength == 127) {
|
||||
// 64-bit extended payload length
|
||||
for (int i = 0; i < 8; i++)
|
||||
extendedPayloadLength |= (long) (bytes[2 + i] & 0xFF) << ((7 - i) * 8);
|
||||
byteOffset += 8;
|
||||
|
||||
} else {
|
||||
extendedPayloadLength = payloadLength;
|
||||
}
|
||||
|
||||
byte[] maskingKey = null;
|
||||
byte[] payloadData = new byte[(int) extendedPayloadLength];
|
||||
|
||||
|
||||
// Check if the MASK bit was set, if so, copy the key to the `maskingKey` array.
|
||||
if (masked) {
|
||||
maskingKey = new byte[4];
|
||||
System.arraycopy(bytes, byteOffset, maskingKey, 0, 4); // move mask bytes
|
||||
byteOffset += 4;
|
||||
}
|
||||
|
||||
// Copy payload bytes into `payloadData` array.
|
||||
System.arraycopy(bytes, byteOffset, payloadData, 0, payloadData.length);
|
||||
|
||||
// If mask is present, decode the payload data with the mask.
|
||||
if (masked)
|
||||
for (int i = 0; i < payloadData.length; i++)
|
||||
payloadData[i] ^= maskingKey[i % 4];
|
||||
|
||||
// Convert payload data to string
|
||||
return new String(payloadData, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for checking whether the connection handler is actively listening.
|
||||
* @return Whether it's listening.
|
||||
*/
|
||||
public boolean isActive() {
|
||||
return this.thread.isAlive();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for listening to all new incoming socket connections.
|
||||
*/
|
||||
public void listen() {
|
||||
this.thread = new Thread(this);
|
||||
this.thread.start();
|
||||
Log.i("WebSocketConnectionHandler", "Listening started.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for stopping the connection handler.
|
||||
*/
|
||||
public void stop() {
|
||||
// Close the socket connection if not already closed
|
||||
if (!this.theSocket.getSocket().isClosed()) {
|
||||
try {
|
||||
this.theSocket.getSocket().close();
|
||||
} catch (IOException error) {
|
||||
Log.e("WebSocketConnectionHandler", "Failed to close the socket connection: " + error.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// Interrupt the thread
|
||||
this.thread.interrupt();
|
||||
|
||||
// Close all connections
|
||||
this.clients.forEach(client -> {
|
||||
try {
|
||||
client.close();
|
||||
} catch (IOException error) {
|
||||
Log.e("WebSocketConnectionHandler", "Failed to close client: " + error.getMessage());
|
||||
}
|
||||
});
|
||||
this.clients.clear();
|
||||
|
||||
|
||||
Log.i("WebSocketConnectionHandler", "Listening stopped.");
|
||||
}
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/darkBlue" />
|
||||
<stroke android:width="4dp" android:color="@color/white" />
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#F0E4E4" />
|
||||
<corners android:radius="15dp" />
|
||||
|
||||
</shape>
|
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<corners
|
||||
android:radius="15dp"
|
||||
/>
|
||||
|
||||
<gradient
|
||||
android:startColor="#990000"
|
||||
android:endColor="#FF0000"
|
||||
android:angle="90"/>
|
||||
</shape>
|
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/midBlue" />
|
||||
<stroke android:width="2dp" android:color="#FF0000" />
|
||||
<corners android:radius="10dp" />
|
||||
</shape>
|
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/lightBlue" />
|
||||
<stroke android:width="2dp" android:color="#FF0000" />
|
||||
<corners android:radius="20dp" />
|
||||
</shape>
|
@@ -1,5 +0,0 @@
|
||||
<vector android:height="48dp" android:tint="?attr/colorControlNormal"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
|
||||
</vector>
|
@@ -5,8 +5,8 @@
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#FF0000"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
|
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<corners
|
||||
android:radius="30dp"
|
||||
/>
|
||||
|
||||
<gradient
|
||||
android:startColor="#990000"
|
||||
android:endColor="#FF0000"
|
||||
android:angle="90"/>
|
||||
|
||||
</shape>
|
Binary file not shown.
Before Width: | Height: | Size: 30 KiB |
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".BicepVideo">
|
||||
|
||||
<VideoView
|
||||
android:id="@+id/videoView"
|
||||
android:layout_width="1142dp"
|
||||
android:layout_height="515dp"
|
||||
android:layout_marginTop="64dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonback"
|
||||
android:layout_width="88dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="back"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttoncomplete"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="complete"
|
||||
app:layout_constraintBottom_toTopOf="@+id/videoView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.093" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="1074dp"
|
||||
android:layout_height="197dp"
|
||||
android:layout_marginStart="122dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginEnd="122dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="Uitleg text"
|
||||
android:textSize="32sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/videoView" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".Completion_Screen">
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -1,108 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/darkBlue"
|
||||
tools:context=".ui.activities.HelpActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="800dp"
|
||||
android:layout_height="450dp"
|
||||
android:layout_marginStart="80dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:background="@drawable/help2_background"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/help_background"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewTitleEndScreen"
|
||||
style="@style/TextStyleTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/klaar" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="700dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/help_background"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewDescriptionEndScreen"
|
||||
style="@style/TextStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/voltooid" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="700dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/help_background"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewScoreEndScreen"
|
||||
style="@style/TextStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/score"
|
||||
android:textAlignment="center"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/homeButtonEndScreen"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="75dp"
|
||||
android:layout_marginEnd="280dp"
|
||||
android:background="@drawable/red_button_gradient"
|
||||
android:drawableTop="@drawable/ic_baseline_home_48"
|
||||
android:drawableTint="@color/white"
|
||||
android:padding="15dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/startButtonEndScreen"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="75dp"
|
||||
android:layout_marginStart="280dp"
|
||||
android:background="@drawable/red_button_gradient"
|
||||
android:text="@string/start"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp"
|
||||
android:padding="15dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -1,56 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/darkBlue"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".ui.activities.FitnessActivity"
|
||||
tools:openDrawer="start">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="900dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:padding="15dp"
|
||||
android:background="@drawable/help2_background"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<VideoView
|
||||
android:id="@+id/videoView"
|
||||
android:layout_width="400dp"
|
||||
android:layout_height="400dp"
|
||||
android:layout_marginStart="20dp"
|
||||
/>
|
||||
|
||||
<com.example.fitbot.ui.components.PersonalMotionPreviewElement
|
||||
android:id="@+id/personalMotionPreviewElement"
|
||||
android:layout_width="400dp"
|
||||
android:layout_height="400dp"
|
||||
android:layout_marginStart="20dp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/homeButtonFitness"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="75dp"
|
||||
android:layout_marginStart="404dp"
|
||||
android:background="@drawable/red_button_gradient"
|
||||
android:drawableTop="@drawable/ic_baseline_home_48"
|
||||
android:drawableTint="@color/white"
|
||||
android:padding="15dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:ignore="SpeakableTextPresentCheck" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -1,94 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/darkBlue"
|
||||
tools:context=".ui.activities.HelpActivity">
|
||||
|
||||
<Button
|
||||
android:id="@+id/homeButtonHelp"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="75dp"
|
||||
android:layout_marginStart="404dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/red_button_gradient"
|
||||
android:drawableTop="@drawable/ic_baseline_home_48"
|
||||
android:drawableTint="@color/white"
|
||||
android:padding="15dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="800dp"
|
||||
android:layout_height="450dp"
|
||||
android:layout_marginStart="80dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:background="@drawable/help2_background"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/help_background"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewTitleHelp"
|
||||
style="@style/TextStyleTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/help" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="700dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/help_background"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewStartHelp"
|
||||
style="@style/TextStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/uitlegStart" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="700dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/help_background"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewHomeHelp"
|
||||
style="@style/TextStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/uitlegHome" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -1,3 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
@@ -5,109 +6,30 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".ui.activities.MainActivity"
|
||||
tools:context=".MainActivity"
|
||||
tools:openDrawer="start">
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<include
|
||||
android:id="@+id/toolbar"
|
||||
layout="@layout/toolbar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="208dp"
|
||||
android:layout_marginTop="120dp"
|
||||
android:background="@drawable/box_background"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewWelkom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/welkom_bij_fitbot"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="64sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewFit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/robot_helpt"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="32sp"
|
||||
android:translationX="8dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/startButtonMain"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginStart="368dp"
|
||||
android:layout_marginTop="312dp"
|
||||
android:background="@drawable/red_button_gradient"
|
||||
android:text="@string/start"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="80sp"
|
||||
android:gravity="center"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/helpButtonMain"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="420dp"
|
||||
android:layout_marginTop="424dp"
|
||||
android:background="@drawable/darkred_button_gradient"
|
||||
android:text="@string/help"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="40sp"
|
||||
android:gravity="center"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageViewRobotLogo"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_marginTop="340dp"
|
||||
android:contentDescription="@string/robot_logo"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/robot_logo_inverted" />
|
||||
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
<include
|
||||
android:id="@+id/toolbar"
|
||||
layout="@layout/toolbar" />
|
||||
|
||||
<android.support.design.widget.NavigationView
|
||||
android:id="@+id/nav_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:background="@color/darkBlue"
|
||||
app:headerLayout="@layout/header"
|
||||
app:itemIconTint="@color/white"
|
||||
app:itemTextColor="@color/white"
|
||||
|
||||
app:menu="@menu/main_menu" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/menu_switch_btn"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="50dp"
|
||||
android:clickable="true"
|
||||
android:text="Go to Sport Menu"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:focusable="true" />
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".PowerScreen">
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/open_BicepVideo"-->
|
||||
<!-- android:layout_width="215dp"-->
|
||||
<!-- android:layout_height="64dp"-->
|
||||
<!-- android:layout_marginStart="108dp"-->
|
||||
<!-- android:layout_marginTop="341dp"-->
|
||||
<!-- android:layout_marginEnd="108dp"-->
|
||||
<!-- android:layout_marginBottom="342dp"-->
|
||||
<!-- android:text="Bicep Oefening"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- app:layout_constraintVertical_bias="1.0" />-->
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/open_BicepVideo"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_marginStart="120dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginEnd="190dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/open_SquatVideo"
|
||||
app:layout_constraintEnd_toStartOf="@+id/open_TricepVideo"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/noun_bicep_499185"
|
||||
android:contentDescription="Open bicep exercise video" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/open_SquatVideo"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_marginStart="120dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginEnd="190dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/GoToHome"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/open_BicepVideo"
|
||||
app:srcCompat="@drawable/squatlogo"
|
||||
android:contentDescription="Open squad exercise video" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/open_TricepVideo"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_marginStart="190dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginEnd="120dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/GoToHome"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/open_BicepVideo"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/triceplogo"
|
||||
android:contentDescription="Open tricep exercise video" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/GoToHome"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_marginStart="190dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginEnd="120dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/open_SquatVideo"
|
||||
app:layout_constraintTop_toBottomOf="@+id/open_TricepVideo"
|
||||
app:srcCompat="@drawable/house_3"
|
||||
android:contentDescription="Go to Home Screen" />
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:context=".ui.SportMenuActivity">
|
||||
|
||||
<com.example.fitbot.ui.SportMenuItem
|
||||
android:id="@+id/sportMenuItem1"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="300dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -1,9 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:orientation="horizontal"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/ic_launcher_background"
|
||||
android:layout_gravity="top"
|
||||
android:padding="10dp">
|
||||
@@ -24,7 +25,6 @@
|
||||
android:layout_marginTop="60dp"
|
||||
android:text="FitBot"
|
||||
android:textSize="48sp"
|
||||
android:textColor="@color/darkBlue"
|
||||
app:layout_constraintStart_toEndOf="@+id/imageView"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
@@ -4,5 +4,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#00000000"
|
||||
android:elevation="8dp"
|
||||
android:theme="@style/ToolbarNav">
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
@@ -12,14 +12,20 @@
|
||||
|
||||
<group android:checkableBehavior="single">
|
||||
|
||||
<item
|
||||
android:id="@+id/nav_settings"
|
||||
android:icon="@drawable/ic_baseline_settings_48"
|
||||
android:title="Settings" />
|
||||
<item
|
||||
android:id="@+id/nav_rate"
|
||||
android:icon="@drawable/ic_baseline_star_rate_48"
|
||||
android:title="Rate" />
|
||||
<item android:title="Options">
|
||||
|
||||
<menu>
|
||||
<item
|
||||
android:id="@+id/nav_settings"
|
||||
android:icon="@drawable/ic_baseline_settings_48"
|
||||
android:title="Settings" />
|
||||
<item
|
||||
android:id="@+id/nav_rate"
|
||||
android:icon="@drawable/ic_baseline_star_rate_48"
|
||||
android:title="Rate" />
|
||||
</menu>
|
||||
|
||||
</item>
|
||||
|
||||
</group>
|
||||
|
||||
|
Binary file not shown.
@@ -2,11 +2,7 @@
|
||||
<Animation xmlns:editor="http://www.ald.softbankrobotics.com/animation/editor" typeVersion="2.0" editor:fps="25">
|
||||
<editor:clip editor:fps="25" editor:startFrame="24" editor:endFrame="79"/>
|
||||
<ActuatorCurve fps="25" actuator="LShoulderPitch" mute="false" unit="degree">
|
||||
<Key value="90.5273514" frame="0">
|
||||
<Tangent side="right" abscissaParam="2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="90.5273514" frame="7">
|
||||
<Tangent side="left" abscissaParam="-2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
<Tangent side="right" abscissaParam="1" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="90.5273514" frame="10">
|
||||
@@ -18,11 +14,7 @@
|
||||
</Key>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="LShoulderRoll" mute="false" unit="degree">
|
||||
<Key value="6.67969275" frame="0">
|
||||
<Tangent side="right" abscissaParam="2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="89.5" frame="7">
|
||||
<Tangent side="left" abscissaParam="-2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
<Tangent side="right" abscissaParam="1" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="6.67969275" frame="10">
|
||||
@@ -34,11 +26,7 @@
|
||||
</Key>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="LElbowYaw" mute="false" unit="degree">
|
||||
<Key value="-69.7851486" frame="0">
|
||||
<Tangent side="right" abscissaParam="2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="-69.7851486" frame="7">
|
||||
<Tangent side="left" abscissaParam="-2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
<Tangent side="right" abscissaParam="1" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="-69.7851486" frame="10">
|
||||
@@ -50,11 +38,7 @@
|
||||
</Key>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="LElbowRoll" mute="false" unit="degree">
|
||||
<Key value="-29.7070332" frame="0">
|
||||
<Tangent side="right" abscissaParam="2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="-29.7070332" frame="7">
|
||||
<Tangent side="left" abscissaParam="-2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
<Tangent side="right" abscissaParam="1" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="-29.7070332" frame="10">
|
||||
@@ -66,11 +50,7 @@
|
||||
</Key>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="LWristYaw" mute="false" unit="degree">
|
||||
<Key value="-1.76023543" frame="0">
|
||||
<Tangent side="right" abscissaParam="2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="-1.76023543" frame="7">
|
||||
<Tangent side="left" abscissaParam="-2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
<Tangent side="right" abscissaParam="1" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="-1.76023543" frame="10">
|
||||
@@ -82,11 +62,7 @@
|
||||
</Key>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="LHand" mute="false" unit="dimensionless">
|
||||
<Key value="0.589630966" frame="0">
|
||||
<Tangent side="right" abscissaParam="2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="0.589630966" frame="7">
|
||||
<Tangent side="left" abscissaParam="-2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
<Tangent side="right" abscissaParam="1" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="0.589630966" frame="10">
|
||||
@@ -98,11 +74,7 @@
|
||||
</Key>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="RShoulderPitch" mute="false" unit="degree">
|
||||
<Key value="90.5273438" frame="0">
|
||||
<Tangent side="right" abscissaParam="2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="90.5273438" frame="7">
|
||||
<Tangent side="left" abscissaParam="-2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
<Tangent side="right" abscissaParam="1" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="90.5273438" frame="10">
|
||||
@@ -114,11 +86,7 @@
|
||||
</Key>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="RShoulderRoll" mute="false" unit="degree">
|
||||
<Key value="-6.59180212" frame="0">
|
||||
<Tangent side="right" abscissaParam="2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="-89.5" frame="7">
|
||||
<Tangent side="left" abscissaParam="-2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
<Tangent side="right" abscissaParam="1" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="-6.59180212" frame="10">
|
||||
@@ -130,11 +98,7 @@
|
||||
</Key>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="RElbowYaw" mute="false" unit="degree">
|
||||
<Key value="70.2246094" frame="0">
|
||||
<Tangent side="right" abscissaParam="2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="70.2246094" frame="7">
|
||||
<Tangent side="left" abscissaParam="-2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
<Tangent side="right" abscissaParam="1" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="70.2246094" frame="10">
|
||||
@@ -146,11 +110,7 @@
|
||||
</Key>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="RElbowRoll" mute="false" unit="degree">
|
||||
<Key value="29.7070332" frame="0">
|
||||
<Tangent side="right" abscissaParam="2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="29.7070332" frame="7">
|
||||
<Tangent side="left" abscissaParam="-2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
<Tangent side="right" abscissaParam="1" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="29.7070332" frame="10">
|
||||
@@ -162,11 +122,7 @@
|
||||
</Key>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="RWristYaw" mute="false" unit="degree">
|
||||
<Key value="1.57964516" frame="0">
|
||||
<Tangent side="right" abscissaParam="2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="1.57964516" frame="7">
|
||||
<Tangent side="left" abscissaParam="-2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
<Tangent side="right" abscissaParam="1" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="1.57964516" frame="10">
|
||||
@@ -178,11 +134,7 @@
|
||||
</Key>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="RHand" mute="false" unit="dimensionless">
|
||||
<Key value="0.588752136" frame="0">
|
||||
<Tangent side="right" abscissaParam="2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="0.588752136" frame="7">
|
||||
<Tangent side="left" abscissaParam="-2.33333333" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
<Tangent side="right" abscissaParam="1" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
<Key value="0.588752136" frame="10">
|
||||
@@ -193,19 +145,4 @@
|
||||
<Tangent side="left" abscissaParam="-20" ordinateParam="0" editor:interpType="bezier_auto"/>
|
||||
</Key>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="HeadYaw" mute="false" unit="degree">
|
||||
<Key value="-0.439454377" frame="0"/>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="HeadPitch" mute="false" unit="degree">
|
||||
<Key value="-12.1289139" frame="0"/>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="HipRoll" mute="false" unit="degree">
|
||||
<Key value="-0.26367262" frame="0"/>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="HipPitch" mute="false" unit="degree">
|
||||
<Key value="-1.49414492" frame="0"/>
|
||||
</ActuatorCurve>
|
||||
<ActuatorCurve fps="25" actuator="KneePitch" mute="false" unit="degree">
|
||||
<Key value="0" frame="0"/>
|
||||
</ActuatorCurve>
|
||||
</Animation>
|
||||
|
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<declare-styleable name="PersonalMotionPreviewElement">
|
||||
|
||||
</declare-styleable>
|
||||
</resources>
|
@@ -7,11 +7,4 @@
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="darkBlue">#1C1C27</color>
|
||||
<color name="midBlue">#24242F</color>
|
||||
<color name="lightBlue">#2C2C37</color>
|
||||
<color name="invertedBackground">#FFFFFF</color>
|
||||
<color name="invertedTextColor">#000000</color>
|
||||
<color name="invertedIconTint">#000000</color>
|
||||
</resources>
|
||||
|
||||
</resources>
|
@@ -4,23 +4,4 @@
|
||||
|
||||
<string name="navigation_drawer_open">Open navigation drawer</string>
|
||||
<string name="navigation_drawer_close">Open navigation close</string>
|
||||
|
||||
<string name="welkom_bij_fitbot">Welkom bij FitBot</string>
|
||||
<string name="robot_helpt">de robot die helpt om fit te blijven</string>
|
||||
|
||||
<string name="start">Start</string>
|
||||
<string name="help">Help</string>
|
||||
<string name="todo">TODO</string>
|
||||
<string name="robot_logo" />
|
||||
<string name="home">Home</string>
|
||||
<string name="skip">Skip</string>
|
||||
<string name="complete">Complete</string>
|
||||
|
||||
<string name="uitlegStart">Druk op Start om de oefening te beginnen</string>
|
||||
<string name="uitlegHome">Ga terug naar het begin scherm door op het huisje te klikken</string>
|
||||
|
||||
<string name="klaar">Klaar!</string>
|
||||
<string name="voltooid">U heeft de oefeningen voltooid, druk op start om nog een sessie te beginnen</string>
|
||||
<string name="score">Score:</string>
|
||||
|
||||
</resources>
|
@@ -2,33 +2,8 @@
|
||||
<resources>
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:colorBackground">@color/darkBlue</item>
|
||||
</style>
|
||||
|
||||
<style name="ToolbarNav" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:textColorSecondary">@color/white</item>
|
||||
</style>
|
||||
|
||||
<style name="ButtonStyle">
|
||||
<item name="android:textSize">24sp</item>
|
||||
<item name="android:textColor">#000000</item>
|
||||
<item name="android:background">@drawable/button_background</item>
|
||||
<item name= "android:textStyle">bold</item>
|
||||
<item name="android:padding">16dp</item>
|
||||
<item name="android:layout_margin">8dp</item>
|
||||
</style>
|
||||
|
||||
<style name="TextStyle">
|
||||
<item name="android:textSize">25sp</item>
|
||||
<item name="android:textColor">#FFFFFF</item>
|
||||
<item name= "android:textStyle">bold</item>
|
||||
<item name="android:padding">6dp</item>
|
||||
</style>
|
||||
|
||||
<style name="TextStyleTitle">
|
||||
<item name="android:textSize">50sp</item>
|
||||
<item name="android:textColor">#D3D3D3</item>
|
||||
<item name= "android:textStyle">bold</item>
|
||||
<item name="android:padding">6dp</item>
|
||||
<item name="android:statusBarColor">#00000000</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
</resources>
|
@@ -1,4 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Fitbot" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
@@ -8,7 +7,4 @@
|
||||
<item name="colorAccent">@color/teal_200</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
|
||||
<!-- Style for general buttons -->
|
||||
<!-- Add button styles here, if needed -->
|
||||
</resources>
|
@@ -1,37 +0,0 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import com.example.fitbot.util.path.GesturePath;
|
||||
import com.example.fitbot.util.path.PathSegment;
|
||||
|
||||
import org.joml.Vector3f;
|
||||
import org.junit.Test;
|
||||
|
||||
public class PathSegmentTest {
|
||||
|
||||
@Test
|
||||
public void testPathSegment() {
|
||||
// Test the PathSegment class
|
||||
Vector3f[] vectors = new Vector3f[2];
|
||||
vectors[0] = new Vector3f(0, 0, 0);
|
||||
vectors[1] = new Vector3f(1, 1, 1);
|
||||
GesturePath path = new GesturePath(vectors);
|
||||
PathSegment[] segments = path.getSegments();
|
||||
assertEquals(1, segments.length);
|
||||
assertEquals(new Vector3f(0, 0, 0), segments[0].getStart());
|
||||
assertEquals(new Vector3f(1, 1, 1), segments[0].getEnd());
|
||||
assertEquals(new Vector3f(0.5f, 0.5f, 0.5f), segments[0].interpolate(0.5));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test_pathSegmentInterpolation() {
|
||||
Vector3f start = new Vector3f(0, 0, 0);
|
||||
Vector3f end = new Vector3f(1, 1, 1);
|
||||
PathSegment segment = new PathSegment(start, end);
|
||||
assertEquals(new Vector3f(0.5f, 0.5f, 0.5f), segment.interpolate(0.5));
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import com.example.fitbot.util.server.WebSocketConnectionHandler;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Created on 07/05/2024 at 18:27
|
||||
* by Luca Warmenhoven.
|
||||
*/
|
||||
public class WebSocketMessageParsingTest {
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void parseWebSocketMessage() {
|
||||
|
||||
String reference = "abcdef";
|
||||
final byte[] encoded = {
|
||||
(byte) 129, (byte) 134, (byte) 167,
|
||||
(byte) 225, (byte) 225, (byte) 210,
|
||||
(byte) 198, (byte) 131, (byte) 130,
|
||||
(byte) 182, (byte) 194, (byte) 135
|
||||
};
|
||||
String decoded = "";
|
||||
try {
|
||||
decoded = WebSocketConnectionHandler.decodeWebSocketMessage(encoded);
|
||||
} catch (Exception e) {
|
||||
System.err.println("Error occurred whilst attempting to parse input" + e.getMessage());
|
||||
}
|
||||
assertEquals(reference, decoded);
|
||||
}
|
||||
}
|
@@ -1,71 +0,0 @@
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Request} request The incoming request
|
||||
* @param {Response} response The response to send back
|
||||
* @param {Express} app Express app instance
|
||||
* @param {Pool} pool MariaDB pool instance
|
||||
*/
|
||||
function handleIncoming(request, response, app, pool)
|
||||
{
|
||||
|
||||
let query = 'SELECT * FROM Exercise WHERE ExerciseID = ?';
|
||||
let parameters = [];
|
||||
|
||||
if (!request.hasOwnProperty('uid') || typeof request.uid !== 'number')
|
||||
{
|
||||
query = 'SELECT * FROM Exercise';
|
||||
} else parameters.push(request.uid);
|
||||
|
||||
// Acquire database connection
|
||||
pool.getConnection()
|
||||
.then(conn => {
|
||||
conn.query(query, parameters)
|
||||
.then(rows => {
|
||||
if (rows.length === 0)
|
||||
{
|
||||
response
|
||||
.status(404)
|
||||
.send(JSON.stringify({error: 'Exercise not found'}));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Send back the data in the right format
|
||||
let converted = rows.map(row => {
|
||||
return {
|
||||
name: row.Name,
|
||||
description: row.Description,
|
||||
muscleGroup: row.MuscleGroup,
|
||||
imageUrl: row.ImageURL,
|
||||
videoUrl: row.VideoURL
|
||||
};
|
||||
});
|
||||
|
||||
response
|
||||
.status(200)
|
||||
.send(JSON.stringify(converted));
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
response
|
||||
.status(500)
|
||||
.send(JSON.stringify({error: 'Internal server error (Querying)'}));
|
||||
})
|
||||
.finally(() => {
|
||||
conn.end();
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
response
|
||||
.status(500)
|
||||
.send(JSON.stringify({error: 'Internal server error (Connection)'}));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Export the function that registers the incoming request handlers
|
||||
module.exports = function(app, pool) {
|
||||
app.post('/', (req, res) => handleIncoming(req, res, app, pool));
|
||||
};
|
@@ -1,24 +0,0 @@
|
||||
const address = 'http://145.92.8.135:3445/';
|
||||
|
||||
const data = {
|
||||
rotationX: 1,
|
||||
rotationY: .4,
|
||||
rotationZ: .1,
|
||||
accelerationX: 1,
|
||||
accelerationY: 2,
|
||||
accelerationZ: 4,
|
||||
deviceId: 1,
|
||||
type: 'data'
|
||||
};
|
||||
|
||||
for ( let i = 0; i < 10; i++)
|
||||
{
|
||||
setTimeout(() => {
|
||||
console.log("Sending data");
|
||||
fetch(address, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
}, i * 1000);
|
||||
}
|
@@ -1,27 +0,0 @@
|
||||
const mariadb = require('mariadb');
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const bodyParser = require('body-parser');
|
||||
|
||||
app.use(bodyParser.json());
|
||||
const serverPort = 3000;
|
||||
|
||||
const databaseCredentials = {
|
||||
host: '127.0.0.1',
|
||||
user: 'fitbot',
|
||||
password: 'fitbot123',
|
||||
database: 'fitbot',
|
||||
connectionLimit: 5,
|
||||
allowUnauthorized: true
|
||||
};
|
||||
|
||||
// Create connection pool
|
||||
const pool = mariadb.createPool(databaseCredentials);
|
||||
|
||||
// Register incoming HTTP request handlers
|
||||
require('./incoming_request_handlers')(app, pool);
|
||||
|
||||
// Start server
|
||||
app.listen(serverPort, () => {
|
||||
console.log(`Server running on port ${serverPort}`);
|
||||
});
|
37
docs/.pages
37
docs/.pages
@@ -14,44 +14,15 @@ nav:
|
||||
- Pepper: documentation/robots/pepper
|
||||
- Little Endian: documentation/robots/little-endian
|
||||
- 📚 Documentation:
|
||||
- 🧠 Brianstorm:
|
||||
- Ideas: documentation/brainstorm/ideas
|
||||
- 📱 Android:
|
||||
- Android Studio: documentation/android/androidStudio
|
||||
- app setup: documentation/android/appSetup
|
||||
- video view: documentation/android/Videoview
|
||||
- java classes: documentation/android/javaClasses
|
||||
- robot motion tracking: documentation/android/robot_motion_tracking_system
|
||||
- 🧠 Research:
|
||||
- Ideas: documentation/brainstorm/ideas
|
||||
- Motion tracking system analysis: documentation/research-questions/motion-tracking-system-analysis
|
||||
- position tracking : documentation/research-questions/position-tracking-research
|
||||
- robot comparison : documentation/robots/Comparisons
|
||||
- Colors research : documentation/brainstorm/colorsforlayout
|
||||
- 🗄️ Database:
|
||||
- EERD: documentation/database/EERD
|
||||
- ERD: documentation/database/ERD
|
||||
- Infrastructure: documentation/database/infrastructure
|
||||
- 📦 Hardware:
|
||||
- Sensors: documentation/hardware/sensors
|
||||
- Pcb : documentation/hardware/pcb
|
||||
- 🤖 Pepper:
|
||||
- Pepper Setup: documentation/pepper/pepperSetup
|
||||
- Pepper movement: documentation/android/robotmovement
|
||||
- 🍓 Raspberry Pi:
|
||||
- Raspberry Pi: documentation/raspberryPi/raspberryPiSetup
|
||||
- Apache:
|
||||
- Apache: documentation/raspberryPi/apache/apache
|
||||
- Apache Setup: documentation/raspberryPi/apache/apacheSetup
|
||||
- MariaDB:
|
||||
- MariaDB: documentation/raspberryPi/mariaDB/mariaDB
|
||||
- MariaDB Setup: documentation/raspberryPi/mariaDB/mariaDBSetup
|
||||
- NodeJs:
|
||||
- NodeJs: documentation/raspberryPi/nodeJs/nodeJs
|
||||
- NodeJs Setup: documentation/raspberryPi/nodeJs/nodeJsSetup
|
||||
- phpMyAdmin:
|
||||
- phpMyAdmin: documentation/raspberryPi/phpMyAdmin/phpMyAdmin
|
||||
- phpMyAdmin Setup: documentation/raspberryPi/phpMyAdmin/phpMyAdminSetup
|
||||
- 💻 Code documentation:
|
||||
- Vector3 : documentation/android/code_documentation/Vector3
|
||||
- Websocket : documentation/android/code_documentation/WebSocket
|
||||
- 👷♀️ Hardware:
|
||||
- Hardware: documentation/hardware/sensors
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -2,7 +2,7 @@
|
||||
|
||||
We wanted to show the various exercises in a video that everyone could replicate. We did not want to implement a YouTube function because we wanted to have our own videos rather than relying on YouTube. To begin, we need an empty activity file, which you can create using the Android Studio IDE. Then, navigate to the XML file you just created and the go-to widgets, and add the VideoView element.
|
||||
|
||||

|
||||

|
||||
|
||||
If you drag that into your activity, you can change the layout, but it will not function directly. To make it play videos, we need to write some Java code first.
|
||||
```java
|
||||
|
@@ -1,35 +0,0 @@
|
||||
# Creating Styles in android
|
||||
|
||||
Styles and themes on Android make it possible for you to separate the details of our app design from the UI structure and behavior, identical to stylesheets in web design. We will use this in our project to maintain a consistent style, so that we won't have to hardcode it to each element. A style is a set of attributes that determine the appearance of a single View. A style can define features like font color, font size, background color, and a lot more.
|
||||
|
||||
To make a style you want to navigate to res/values/styles.xml in this file you can make styles. Fot this example we will make a buttonstyle that we can implement across multiple buttons. To make a style you need to add this code to your style.xml file
|
||||
|
||||
```xml
|
||||
|
||||
<resources>
|
||||
<style name="ButtonStyle">
|
||||
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
```
|
||||
After that, you may add your styling items in the code.
|
||||
|
||||
|
||||
```xml
|
||||
<style name="ButtonStyle">
|
||||
<item name="android:textSize">24sp</item>
|
||||
<item name="android:textColor">#000000</item>
|
||||
<item name="android:background">#F0F0F0</item>
|
||||
<item name= "android:textStyle">bold</item>
|
||||
<item name="android:padding">16dp</item>
|
||||
<item name="android:layout_margin">8dp</item>
|
||||
</style>
|
||||
```
|
||||
If you have done this, return to your activity.xml file and add the style element to your object. You will need to connect your style to the element.
|
||||
```xml
|
||||
<Button
|
||||
android:id="@+id/homeButton"
|
||||
style="@style/ButtonStyle"/>
|
||||
```
|
||||
You can now add this to multiple buttons to keep the same style and avoid copying and pasting the same feature
|
@@ -1,86 +0,0 @@
|
||||
## Class Implementation - MotionProcessor
|
||||
|
||||
---
|
||||
|
||||
#### Methods
|
||||
|
||||
Creates a WebSocket server and starts listening for incoming MotionData messages
|
||||
```java
|
||||
public void startListening() { ... }
|
||||
```
|
||||
|
||||
Stops the WebSocket server and stops listening for incoming MotionData messages
|
||||
```java
|
||||
public void stopListening() { ... }
|
||||
```
|
||||
|
||||
Parses an incoming WebSocket message packet and processes the data.
|
||||
The data that is accepted is a string that can be of the following formats:
|
||||
```java
|
||||
// Sending data
|
||||
"data accelerationX;accelerationY;accelerationZ;rotationX;rotationY;rotationZ" // all values are floats
|
||||
|
||||
// Changing the sample rate
|
||||
"sampleRate rate" // rate is an integer
|
||||
|
||||
// Calibrating the zero point
|
||||
"zero x;y;z" // x, y, z are floats
|
||||
```
|
||||
```java
|
||||
public void parsePacket(@NotNull String message) { ... }
|
||||
```
|
||||
|
||||
Processes the provided MotionData object, uses it as a relative path point, and calls the
|
||||
motionDataEventHandler with the calculated vector.
|
||||
```java
|
||||
public void addMotionData(MotionData data) { ... }
|
||||
```
|
||||
|
||||
Sets the gesture path to the provided path.
|
||||
```java
|
||||
public void setGesturePath(GesturePath gesturePath) { ... }
|
||||
```
|
||||
|
||||
Updates the relative path to the provided path.
|
||||
```java
|
||||
public void setRelativePath(List<Vector3> relativePath) { ... }
|
||||
```
|
||||
|
||||
Sets the motionDataEventHandler to the provided handler.
|
||||
```java
|
||||
public void setMotionDataEventHandler(Consumer<Vector3> consumer) { ... }
|
||||
```
|
||||
|
||||
Calculate the relative vector given a MotionData object.
|
||||
This converts relative acceleration and rotation to a vector, taking the
|
||||
sample rate into account.
|
||||
```java
|
||||
public Vector3 getRelativeVector(MotionData motionData) { ... }
|
||||
```
|
||||
|
||||
Get a list of error values given the provided GesturePath.
|
||||
This compares the relative path (calibrated) to the provided path segments,
|
||||
and returns the offsets.
|
||||
```java
|
||||
public List<Double> getErrors(GesturePath referencePath) { ... }
|
||||
public List<Double> getErrors() { ... } // Using pre-set path
|
||||
```
|
||||
|
||||
Get the error offset of the provided vector to the provided path, or with the
|
||||
set path.
|
||||
This compares a given vector to the provided GesturePath object.
|
||||
```java
|
||||
public double getError(GesturePath path, Vector3 referencePoint) { ... }
|
||||
public double getError(Vector3 referencePoint) { ... } // Using pre-set path
|
||||
```
|
||||
|
||||
Get the average error offset of the relative path and the provided GesturePath object.
|
||||
```java
|
||||
public double getAverageError(GesturePath referencePath) { ... }
|
||||
public double getAverageError() { ... } // Using pre-set path
|
||||
```
|
||||
|
||||
Logs statistics to the console
|
||||
```java
|
||||
public void logStatistics(GesturePath referencePath) { ... }
|
||||
```
|
@@ -1,87 +0,0 @@
|
||||
# Vector3
|
||||
|
||||
This class represents a 3D vector with x, y, and z components.
|
||||
|
||||
## public Vector3(double x, double y, double z)
|
||||
|
||||
Constructor for creating a new vector.
|
||||
|
||||
## public Vector3 copy()
|
||||
|
||||
This method returns a new vector with the same values as the current vector.
|
||||
|
||||
## public static Vector3 zero()
|
||||
|
||||
This static method returns a new vector with all components set to zero.
|
||||
|
||||
## public double magnitude(): double
|
||||
|
||||
This method returns the magnitude of the vector.
|
||||
|
||||
## public Vector3 normalize()
|
||||
|
||||
This method returns the normalized vector. It throws an `IllegalArgumentException` if the vector is the zero vector.
|
||||
|
||||
## public Vector3 subtract(Vector3 other)
|
||||
|
||||
This method subtracts another vector from the current vector and returns the result as a new vector.
|
||||
|
||||
## public Vector3 add(Vector3 other)
|
||||
|
||||
This method adds another vector to the current vector and returns the result as a new vector.
|
||||
|
||||
## public Vector3 multiply(double scalar)
|
||||
|
||||
This method multiplies the vector by a scalar and returns the result as a new vector.
|
||||
|
||||
## public Vector3 divide(double scalar)
|
||||
|
||||
This method divides the vector by a scalar and returns the result as a new vector. It throws an `IllegalArgumentException` if the scalar is zero.
|
||||
|
||||
## public Vector3 negate()
|
||||
|
||||
This method negates the vector and returns the result as a new vector.
|
||||
|
||||
## public Vector3 rotate(double radX, double radY, double radZ)
|
||||
|
||||
This method rotates the vector around the X, Y, and Z axes by the specified angles in radians and returns the result as a new vector.
|
||||
|
||||
## public Vector3 rotate(Vector3 rotation)
|
||||
|
||||
This method rotates the vector around the X, Y, and Z axes.
|
||||
|
||||
## public Vector3 rotateX(double angle)
|
||||
|
||||
This method rotates the vector around the X axis by the specified angle in radians and returns the result as a new vector.
|
||||
|
||||
## public Vector3 rotateY(double angle)
|
||||
|
||||
This method rotates the vector around the Y axis by the specified angle in radians and returns the result as a new vector.
|
||||
|
||||
## public Vector3 rotateZ(double angle)
|
||||
|
||||
This method rotates the vector around the Z axis by the specified angle in radians and returns the result as a new vector.
|
||||
|
||||
## public double distanceSq(Vector3 compare)
|
||||
|
||||
This method returns the squared distance between the current vector and another vector.
|
||||
|
||||
## public double distance(Vector3 compare)
|
||||
|
||||
This method returns the distance between the current vector and another vector.
|
||||
|
||||
## public double distanceToLine(Vector3 lineStart, Vector3 lineEnd)
|
||||
|
||||
This method calculates the distance from the current vector to a line defined by two points and returns the result.
|
||||
|
||||
## public Vector3 closest(Vector3 ... vectors)
|
||||
|
||||
This method returns the closest vector to the current vector from a list of vectors.
|
||||
|
||||
## public Vector3 map(VectorMapFunction function)
|
||||
|
||||
This method applies a `VectorMapFunction` to the current vector and returns the result.
|
||||
|
||||
## public String toString()
|
||||
|
||||
This method returns a string representation of the vector.
|
@@ -1,64 +0,0 @@
|
||||
# WebSocket
|
||||
|
||||
This class represents a WebSocket server.
|
||||
|
||||
## private WebSocket()
|
||||
|
||||
Constructor for creating a new WebSocket server.
|
||||
|
||||
## public static WebSocket createServer()
|
||||
|
||||
Function for creating a new WebSocket server. Due to Android security restrictions,
|
||||
the server must be created both in a separate thread and with a non-predefined port.
|
||||
The port will be selected by the system.
|
||||
|
||||
## public void startListening()
|
||||
|
||||
Method for listening for incoming connections.
|
||||
This creates a new thread for the server.
|
||||
|
||||
## public void stop()
|
||||
|
||||
Method for stopping the WebSocket server.
|
||||
|
||||
## public void setEventHandler(IWebSocketHandler handler)
|
||||
|
||||
Method for setting the event handler for this WebSocket server.
|
||||
This event handler accepts all WebSocket events, such as:
|
||||
- onConnected(Socket socket)
|
||||
- onMessageReceived(WebSocket.Message message, WebSocket.MessageReply replier)
|
||||
- onDisconnected(Socket socket)
|
||||
- onError(Socket socket, String error)
|
||||
|
||||
## public ServerSocket getSocket()
|
||||
|
||||
Method for getting the ServerSocket connection.
|
||||
|
||||
## public boolean isConnected()
|
||||
|
||||
Method for checking whether this WebSocket connection is connected.
|
||||
|
||||
---
|
||||
|
||||
# WebSocket.Message
|
||||
|
||||
Class representing a message received from a WebSocket connection.
|
||||
|
||||
### Fields
|
||||
|
||||
- `WebSocketConnection connection`: The connection from which the message was received.
|
||||
- `String message`: The message content.
|
||||
|
||||
## Opcode decode(byte opcode)
|
||||
|
||||
Method for decoding the opcode of a message.
|
||||
|
||||
## public Message(WebSocketConnection connection, String message)
|
||||
|
||||
Constructor for a WebSocket message.
|
||||
|
||||
# MessageReply
|
||||
|
||||
Interface for a message reply.
|
||||
This can be used for sending back a response to the client, by calling
|
||||
`reply(String message)`.
|
@@ -1,114 +0,0 @@
|
||||
# Java class modifiers
|
||||
|
||||
## How are classes build in java?
|
||||
There are a lot of classes with a lot of parameters
|
||||
|
||||
A class always begins with either the public or default or abstract access modifier. Then comes the class name
|
||||
|
||||
Example:
|
||||
```java
|
||||
public class MyClass {
|
||||
//methods and atributes
|
||||
}
|
||||
|
||||
```
|
||||
Then in a class you can have Methods or Atributes where the actual code is.
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
0[~] --> a([Access Modifiers]) --> b([class]) --> c([Class name])
|
||||
0 --> b
|
||||
```
|
||||
|
||||
## Constructor
|
||||
A constructor in Java is a special method that is used to initialize objects. The constructor is called when an object of a class is created. It can be used to set initial values for object attributes.
|
||||
|
||||
The constructor Method is the first method that is called when a class is created. It has the same name as the class and no return type. It is automaticly called when a class is created.
|
||||
|
||||
### Methods
|
||||
A method is a block of code which only runs when it is called. You can pass data, known as parameters, into a method. Methods are used to perform certain actions, and they are also known as functions.
|
||||
|
||||
Methods are build like this
|
||||
```mermaid
|
||||
flowchart LR
|
||||
0([~]) --> A([Access Modifiers]) --> B([Method Modifier]) --> C([Return Type]) --> D([Method Name]) --> E([Parameters]) --> F([Method Body])
|
||||
A --> C
|
||||
0 --> C
|
||||
D --> F
|
||||
```
|
||||
|
||||
|
||||
Example:
|
||||
```java
|
||||
public class MyClass {
|
||||
// Method
|
||||
static void myMethod() {
|
||||
// print Hello World!
|
||||
System.out.println("Hello World!");
|
||||
}
|
||||
// Main method
|
||||
//access modifier, Method Modifier, return type, method name, parameters, method body
|
||||
public static void main(String[] args) {
|
||||
// Call the method
|
||||
myMethod();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Atributes
|
||||
Attributes are variables within a class. When an object is created from a class, the object will have these attributes.
|
||||
|
||||
Example:
|
||||
```java
|
||||
public class MyClass {
|
||||
int x = 5;
|
||||
}
|
||||
```
|
||||
|
||||
## Classes
|
||||
### Class modifiers
|
||||
|
||||
#### Non-access modifiers
|
||||
| Modifier | Description | | | |
|
||||
|---|---|---|---|---|
|
||||
| final | The class cannot be inherited by other classes (You will learn more about inheritance in the Inheritance chapter) | | | |
|
||||
| abstract | The class cannot be used to create objects (To access an abstract class, it must be inherited from another class. You will learn more about inheritance and abstraction in the Inheritance and Abstraction chapters) | | | |
|
||||
||||
|
||||
|
||||
#### Access modifiers
|
||||
| Modifier | Description | | | |
|
||||
|---|---|---|---|---|
|
||||
| public | The code is accessible for all classes | | | |
|
||||
| private | The code is only accessible within the declared class | | | |
|
||||
| default | The code is only accessible in the same package. This is used when you don't specify a modifier. You will learn more about packages in the Packages chapter | | | |
|
||||
| protected | The code is accessible in the same package and subclasses. You will learn more about subclasses and superclasses in the Inheritance chapter | | | |
|
||||
| | | | | |
|
||||
|
||||
|
||||
## Methods and attributes
|
||||
#### non access modifiers
|
||||
| Modifier | Description | | | |
|
||||
|---|---|---|---|---|
|
||||
| final | Attributes and methods cannot be overridden/modified | | | |
|
||||
| static | Attributes and methods belongs to the class, rather than an object. You don't really wanna use this one. | | | |
|
||||
| abstract | Can only be used in an abstract class, and can only be used on methods. The method does not have a body, for example abstract void run();. The body is provided by the subclass (inherited from). You will learn more about inheritance and abstraction in the Inheritance and Abstraction chapters | | | |
|
||||
| transient | Attributes and methods are skipped when serializing the object containing them | | | |
|
||||
| synchronized | Methods can only be accessed by one thread at a time | | | |
|
||||
| volatile | The value of an attribute is not cached thread-locally, and is always read from the "main memory" | | | |
|
||||
||||
|
||||
|
||||
#### Access modifiers
|
||||
| Modifier | Description | | | |
|
||||
|---|---|---|---|---|
|
||||
| public | The code is accessible for all classes | | | |
|
||||
| private | The code is only accessible within the declared class | | | |
|
||||
| default | The code is only accessible in the same package. This is used when you don't specify a modifier. You will learn more about packages in the Packages chapter | | | |
|
||||
| protected | The code is accessible in the same package and subclasses. You will learn more about subclasses and superclasses in the Inheritance chapter | | | |
|
||||
| | | | | |
|
||||
|
||||
|
||||
## Sources
|
||||
|
||||
* https://www.w3schools.com/java/java_modifiers.asp explanation of modifiers
|
||||
* https://en.wikipedia.org/wiki/Syntax_diagram For syntax diagram
|
@@ -1,108 +0,0 @@
|
||||
## Motion Tracking System
|
||||
|
||||
---
|
||||
|
||||
To capture the user's motion with the sensing devices, we'll need to use a tracking system that calculates the
|
||||
path the user makes to be able to determine the user's position and orientation, and therefore whether the movement
|
||||
that was made correlates to the provided path.
|
||||
This is done by some calculations in the `MotionProcessor` class. To get started, create an instance of the `MotionProcessor` class and call the `processMotion` method with the `MotionData` object as a parameter. This will return a `MotionResult` object that contains the calculated path.
|
||||
|
||||
```java
|
||||
// create the motion processor
|
||||
MotionProcessor motionProcessor = new MotionProcessor();
|
||||
```
|
||||
|
||||
To start listening for input, one must call the following method:
|
||||
|
||||
```java
|
||||
// start listening for input
|
||||
motionProcessor.startListening();
|
||||
```
|
||||
|
||||
Calling this function creates a WebSocket server, which the sensing devices can connect to.
|
||||
The `MotionProcessor` class will then start listening for a set of messages that start with specified kind of keywords.
|
||||
The messages always start with the keyword, separated by a space, and then the data is sent.
|
||||
The default data separator is `;`.
|
||||
An example of the message format is shown below:
|
||||
```java
|
||||
// Sending data
|
||||
"data accelerationX;accelerationY;accelerationZ;rotationX;rotationY;rotationZ" // all values are floats
|
||||
|
||||
// Changing the sample rate
|
||||
"sampleRate rate" // rate is an integer
|
||||
|
||||
// Calibrating the zero point
|
||||
"zero x;y;z" // x, y, z are floats
|
||||
```
|
||||
|
||||
To add a custom message received handler, one can simply call the following method:
|
||||
|
||||
```java
|
||||
// Add a custom message handler
|
||||
motionProcessor.setMotionDataEventHandler((Vector3 vector) -> { ... });
|
||||
```
|
||||
*Note: The message handler provides a vector as a parameter; this vector is already converted from relative acceleration and rotation.*
|
||||
|
||||
### Error checking
|
||||
|
||||
To check whether the made movements correlate with a given path, one must check for their differences.
|
||||
This can be done by a few implemented methods:
|
||||
|
||||
***Get the error of a vector compared to a path***
|
||||
```java
|
||||
GesturePath path = new GesturePath.Builder()
|
||||
.addVector(...)
|
||||
.build();
|
||||
|
||||
Vector3 referencePoint = new Vector3(...);
|
||||
double error = motionProcessor.getError(path, referencePoint);
|
||||
```
|
||||
|
||||
***Get the average error of a computed path to a `GesturePath`***
|
||||
```java
|
||||
GesturePath path = new GesturePath.Builder()
|
||||
.addVector(...)
|
||||
.build();
|
||||
|
||||
double error = motionProcessor.getAverageError(path);
|
||||
```
|
||||
|
||||
***Get a list of error values from a computed path to a `GesturePath`***
|
||||
```java
|
||||
GesturePath path = new GesturePath.Builder()
|
||||
.addVector(...)
|
||||
.build();
|
||||
|
||||
List<Double> errorList = motionProcessor.getErrors(path);
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
An example of how to use a motion tracking system is shown below:
|
||||
|
||||
```java
|
||||
|
||||
// create the motion processor
|
||||
MotionProcessor motionProcessor = new MotionProcessor();
|
||||
|
||||
// Create a gesture path
|
||||
GesturePath.Builder pathBuilder = new GesturePath.Builder();
|
||||
|
||||
for ( int i = 0; i < 100; i++ )
|
||||
pathBuilder.addVector(new Vector3(i, i, i));
|
||||
|
||||
GesturePath path = pathBuilder.build();
|
||||
|
||||
// Set the path
|
||||
for ( int i = 0; i < 100; i++ ) {
|
||||
motionProcessor.addMotionData(new MotionData(i, i, i, i, i, i));
|
||||
}
|
||||
|
||||
// Get error values
|
||||
List<Double> errorList = motionProcessor.getErrors(path);
|
||||
|
||||
// Get average error
|
||||
double averageError = motionProcessor.getAverageError(path);
|
||||
|
||||
// Now you can do whatever you want with these results.
|
||||
```
|
@@ -46,8 +46,4 @@ animate.async().run();
|
||||
```
|
||||
|
||||
|
||||
If you run this on the robot the animation should play.
|
||||
|
||||
## Additional stuff
|
||||
every 25 is 1 second so 100 is 4 seconds.
|
||||

|
||||
If you run this on the robot the animation should play.
|
Binary file not shown.
Before Width: | Height: | Size: 34 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user