Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Model maker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
s5_linde_o
Model maker
Commits
84e0b9a0
Commit
84e0b9a0
authored
May 24, 2019
by
Oskars Linde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IMplement fine plots for interpolation
parent
9d46dd3f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
190483 additions
and
49 deletions
+190483
-49
JawRollPitch-checkpoint.ipynb
...ct_files/.ipynb_checkpoints/JawRollPitch-checkpoint.ipynb
+124
-0
interpolate_data-checkpoint.ipynb
...iles/.ipynb_checkpoints/interpolate_data-checkpoint.ipynb
+104
-23
JawRollPitch.ipynb
project_files/JawRollPitch.ipynb
+3
-3
accData-02-24_klibo_P20_.txt
project_files/data/accData-02-24_klibo_P20_.txt
+190148
-0
interpolate_data.ipynb
project_files/interpolate_data.ipynb
+104
-23
No files found.
project_files/.ipynb_checkpoints/JawRollPitch-checkpoint.ipynb
0 → 100644
View file @
84e0b9a0
{
"cells": [
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Done. Total elapsed time: 0.03s\n",
"(14.568, 59.012, 41.106)\n",
"(29.481, 60.481, -2.774)\n",
"(18.019, 71.888, -5.666)\n",
"DONE\n"
]
}
],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"import time\n",
"from math import atan, sqrt\n",
"\n",
"inputData = 'data/jrp/accData-02-27_jrp_test.txt'\n",
"outputData = 'data/jrp/jrp_Data_test.txt'\n",
"\n",
"start = time.time()\n",
"columns = ['user','activity','timestamp', 'x-axis', 'y-axis', 'z-axis']\n",
"df = pd.read_csv(inputData, header = None, names = columns)\n",
"df = df.dropna()\n",
"\n",
"xList = list(df['x-axis'])\n",
"yList = list(df['y-axis'])\n",
"zList = list(df['z-axis'])\n",
"\n",
"#print(xList[0], yList[0], zList[0])\n",
"\n",
"M_PI = 3.14159265358979323846\n",
"for i in range(0,df['x-axis'].size):\n",
" tempX = xList[i]* 3.9\n",
" tempY = yList[i]* 3.9\n",
" tempZ = zList[i]* 3.9\n",
" \n",
" if((tempY*tempY + tempZ*tempZ) == 0):\n",
" pitch = 180 * 1.570796/M_PI\n",
" else:\n",
" pitch = 180 * atan(tempX/sqrt(tempY*tempY + tempZ*tempZ))/M_PI\n",
" \n",
" if((tempX*tempX + tempZ*tempZ) == 0):\n",
" roll = 180 * 1.570796/M_PI\n",
" else:\n",
" roll = 180 * atan(tempY/sqrt(tempX*tempX + tempZ*tempZ))/M_PI \n",
" \n",
" if((tempX*tempX + tempZ*tempZ) == 0):\n",
" yaw = 180 * 1.570796/M_PI\n",
" else:\n",
" yaw = 180 * atan(tempZ/sqrt(tempX*tempX + tempZ*tempZ))/M_PI\n",
"\n",
" xList[i] = round(pitch, 3)\n",
" yList[i] = round(roll, 3)\n",
" zList[i] = round(yaw, 3)\n",
" \n",
" if (i % 1000 == 0):\n",
" end = time.time()\n",
" #print(\"%.2f%% Done. Elapsed time: %.2fs\" % (i*100/df['x-axis'].size, end - start))\n",
" \n",
"end = time.time() \n",
"print(\"Done. Total elapsed time: %.2fs\" % (end - start))\n",
"print(xList[0], yList[0], zList[0])\n",
"print(xList[1], yList[1], zList[1])\n",
"print(xList[2], yList[2], zList[2])\n",
"\n",
"x_vector = np.asarray(xList)\n",
"x_vector.T\n",
"\n",
"y_vector = np.asarray(yList)\n",
"y_vector.T\n",
"\n",
"z_vector = np.asarray(zList)\n",
"z_vector.T\n",
"\n",
"\n",
"df['x-axis'] = x_vector\n",
"df['y-axis'] = y_vector\n",
"df['z-axis'] = z_vector\n",
"\n",
"\n",
"df.to_csv(outputData, header=False, index=False) \n",
"#print(df)\n",
"print(\"DONE\")\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
project_files/.ipynb_checkpoints/interpolate_data-checkpoint.ipynb
View file @
84e0b9a0
This diff is collapsed.
Click to expand it.
project_files/JawRollPitch.ipynb
View file @
84e0b9a0
...
...
@@ -109,14 +109,14 @@
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version":
2
"version":
3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython
2
",
"version": "
2.7.12
"
"pygments_lexer": "ipython
3
",
"version": "
3.6.7
"
}
},
"nbformat": 4,
...
...
project_files/data/accData-02-24_klibo_P20_.txt
View file @
84e0b9a0
This diff is collapsed.
Click to expand it.
project_files/interpolate_data.ipynb
View file @
84e0b9a0
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment