Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
embodiment-learning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SoftwareProjectVR17
embodiment-learning
Commits
6859dcef
Commit
6859dcef
authored
7 years ago
by
Alexis Iakovenko
Browse files
Options
Downloads
Patches
Plain Diff
Separate GestureLoader from Gesture class
parent
f2d77e9b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Assets/Gesture/Gesture.cs
+7
-35
7 additions, 35 deletions
Assets/Gesture/Gesture.cs
Assets/Gesture/GestureLoader.cs
+41
-0
41 additions, 0 deletions
Assets/Gesture/GestureLoader.cs
Assets/Gesture/GestureLoader.cs.meta
+13
-0
13 additions, 0 deletions
Assets/Gesture/GestureLoader.cs.meta
with
61 additions
and
35 deletions
Assets/Gesture/Gesture.cs
+
7
−
35
View file @
6859dcef
...
@@ -118,42 +118,14 @@ public class Gesture
...
@@ -118,42 +118,14 @@ public class Gesture
Debug
.
Log
(
"[VerifyNormalization] furthestDistance: "
+
furthestDistance
);
Debug
.
Log
(
"[VerifyNormalization] furthestDistance: "
+
furthestDistance
);
}
}
public
void
Load
()
public
void
Load
()
{
{
StreamReader
reader
=
new
StreamReader
(
directoryPath
+
name
+
".txt"
);
states
=
GestureLoader
.
Load
(
FullPath
());
CSVOutputGrid
csvGrid
=
CSVReader
.
SplitCsvGrid
(
reader
.
ReadToEnd
());
}
string
[,]
csvStrings
=
csvGrid
.
grid
;
//Debug.Log("csvStrings " + name + " length:" + csvGrid.linesLength);
states
=
new
List
<
GestureState
>();
for
(
int
i
=
0
;
i
<
csvGrid
.
linesLength
;
i
++)
{
if
(
i
<
2
)
//dont take 2 first lines into account
continue
;
if
(
csvStrings
==
null
)
break
;
//we need timestamp, x, y, z of palm
string
[]
line
=
csvStrings
[
0
,
i
].
Split
(
' '
);
//for now we only save the left palm's coordinates
GestureState
state
=
new
GestureState
();
state
.
timestamp
=
float
.
Parse
(
line
[
0
]);
state
.
position
.
x
=
float
.
Parse
(
line
[
1
]);
state
.
position
.
y
=
float
.
Parse
(
line
[
2
]);
state
.
position
.
z
=
float
.
Parse
(
line
[
3
]);
state
.
rotation
.
x
=
float
.
Parse
(
line
[
4
]);
state
.
rotation
.
y
=
float
.
Parse
(
line
[
5
]);
state
.
rotation
.
z
=
float
.
Parse
(
line
[
6
]);
state
.
rotation
.
w
=
float
.
Parse
(
line
[
7
]);
states
.
Add
(
state
);
//Debug.Log(state);
}
reader
.
Close
();
//Debug.Log("Gesture " + name + " loaded.");
private
string
FullPath
()
{
return
directoryPath
+
name
+
".txt"
;
}
}
public
override
string
ToString
()
public
override
string
ToString
()
...
...
This diff is collapsed.
Click to expand it.
Assets/Gesture/GestureLoader.cs
0 → 100644
+
41
−
0
View file @
6859dcef
using
System.Collections
;
using
System.Collections.Generic
;
using
System.IO
;
public
class
GestureLoader
{
public
static
List
<
GestureState
>
Load
(
string
fullpath
)
{
StreamReader
reader
=
new
StreamReader
(
fullpath
);
CSVOutputGrid
csvGrid
=
CSVReader
.
SplitCsvGrid
(
reader
.
ReadToEnd
());
string
[,]
csvStrings
=
csvGrid
.
grid
;
List
<
GestureState
>
states
=
new
List
<
GestureState
>();
for
(
int
i
=
0
;
i
<
csvGrid
.
linesLength
;
i
++)
{
if
(
i
<
2
)
//dont take 2 first lines into account
continue
;
if
(
csvStrings
==
null
)
break
;
//we need timestamp, x, y, z of palm
string
[]
line
=
csvStrings
[
0
,
i
].
Split
(
' '
);
//for now we only save the left palm's coordinates
GestureState
state
=
new
GestureState
();
state
.
timestamp
=
float
.
Parse
(
line
[
0
]);
state
.
position
.
x
=
float
.
Parse
(
line
[
1
]);
state
.
position
.
y
=
float
.
Parse
(
line
[
2
]);
state
.
position
.
z
=
float
.
Parse
(
line
[
3
]);
state
.
rotation
.
x
=
float
.
Parse
(
line
[
4
]);
state
.
rotation
.
y
=
float
.
Parse
(
line
[
5
]);
state
.
rotation
.
z
=
float
.
Parse
(
line
[
6
]);
state
.
rotation
.
w
=
float
.
Parse
(
line
[
7
]);
states
.
Add
(
state
);
}
reader
.
Close
();
return
states
;
}
}
This diff is collapsed.
Click to expand it.
Assets/Gesture/GestureLoader.cs.meta
0 → 100644
+
13
−
0
View file @
6859dcef
fileFormatVersion: 2
guid: 61939fbdd2bf91345bc9f441d1980429
timeCreated: 1515598830
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment