Skip to content

Commit 6445b67

Browse files
committed
Merge pull request #8 from arnebp/master
Release-v.0.9.77
2 parents ffb3caf + 5360d90 commit 6445b67

31 files changed

+545
-513
lines changed

CHANGELOG.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
# Change Log #
22
---
33

4+
Version 0.9.77 (2016-05-17)
5+
---
6+
- Moving all data types from 64-bit to 32-bit floating point precision
7+
- Fixing bug affecting all listener callbacks
8+
- Adapting to EyeTribe API changes, deprecating obsolete *GazeManager* method calls
9+
- Updated Gson to 2.5
10+
411
Version 0.9.60 (2015-11-18)
512
---
613
- Extensive rewrite of core classes
714
- Changed project structure to support Gradle
8-
- Added support for methods of async nature in GazeManager
9-
- Added support for debug mode via GazeManagerCore.IS\_DEBUG\_MODE
10-
- Added calibration evaluation class CalibUtils
15+
- Added support for methods of async nature in *GazeManager*
16+
- Added support for debug mode via *GazeManagerCore.IS\_DEBUG\_MODE*
17+
- Added calibration evaluation class *CalibUtils*
1118
- Added JavaFX calibration example
1219
- Added Unit Tests
1320

@@ -29,14 +36,14 @@ Version 0.9.49 (2014-12-09)
2936
- Refactored internal blocking queues
3037
- More consistent stacktrace output on callback errors
3138
- Unified constructors and operators for all data types
32-
- Added utility methods to GazeData class
39+
- Added utility methods to *GazeData* class
3340
- Updated Gson to 2.3
3441

3542
Version Version 0.9.35 (2014-05-20)
3643
---
3744

3845
- Updated license
39-
- Fixed bug related to ICalibrationResultListener
46+
- Fixed bug related to *ICalibrationResultListener*
4047

4148
Version 0.9.34 (2014-05-09)
4249
---
@@ -48,7 +55,7 @@ Version 0.9.34 (2014-05-09)
4855
Version 0.9.33 (2014-04-15)
4956
---
5057

51-
- Added support for listening to EyeTribe Server conneciton state (IConnectionStateListener)
58+
- Added support for listening to EyeTribe Server conneciton state (*IConnectionStateListener*)
5259
- Minor API timestamp change
5360
- Minor refactoring and formatting
5461
- Generel bug fixing and optimization
@@ -57,7 +64,7 @@ Version 0.9.27 (2014-02-12)
5764
---
5865

5966
- Fixed tab/space formatting
60-
- New methods to GazeUtils
67+
- New methods to *GazeUtils*
6168
- Minor internal refactoring
6269

6370
Version 0.9.26 (2014-01-30)

README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,43 @@
22

33
Java SDK for the EyeTribe Dev Kit
44
====
5+
<p>
6+
57

68
This is the Java library implementation for the [EyeTribe Dev Kit](https://theeyetribe.com/products/). This reference implementation provides a Java interface for communicating with the EyeTribe Server through the open [EyeTribe API](http://dev.theeyetribe.com/api/). The library allow developers to get started quickly and focus their efforts on creating truly immersive and innovative apps using our eye tracking technology.
79

10+
811
Download
912
----
10-
Download the [latest JAR](https://github.com/EyeTribe/tet-java-client/releases) or grab via Gradle through [JCenter](https://bintray.com/eyetribe/maven/eyetribe-java):
13+
Download the [latest JAR](https://search.maven.org/remote_content?g=com.theeyetribe.client&a=client&v=LATEST) or grab via Gradle:
1114

12-
buildscript {
13-
repositories {
14-
jcenter()
15-
}
16-
}
15+
compile 'com.theeyetribe:clientsdk:0.9.77'
1716

18-
dependencies {
19-
compile 'com.theeyetribe:eyetribe-java:0.9.60'
20-
}
17+
or Maven:
2118

19+
<dependency>
20+
<groupId>com.theeyetribe</groupId>
21+
<artifactId>clientsdk</artifactId>
22+
<version>0.9.77</version>
23+
</dependency>
2224

2325
Documentation
2426
----
25-
Find documentation of this library at [EyeTribe Java SDK Doc](http://eyetribe.github.io/tet-java-client). The EyeTribe API reference is found at [Eye Tribe Developer Website](http://dev.theeyetribe.com/api/).
27+
Find documentation of this library at [EyeTribe Java SDK Doc](http://eyetribe.github.io/tet-java-client). The EyeTribe API reference is found at our [Developer Website](http://dev.theeyetribe.com/api/).
2628

2729

2830
Samples
2931
----
3032
An essential part of using the [EyeTribe Dev Kit](https://theeyetribe.com/products/) is 'calibrating the system'. Doing so involves creating a UI that supports this library and guides the user through a series of mandatory steps.
3133

32-
![Steps of the JavaFX calibration samples](jfx_sample.png)
34+
![Steps of the JavaFX calibration samples](http://theeyetribe.com/github/javafx_sample.png)
3335

34-
This library holds a sample implementation of a Calibration UI using [JavaFX](docs.oracle.com/javase/8/javafx/get-started-tutorial/jfx-overview.htm). Find source code for this under [./javafx-sample](https://github.com/EyeTribe/tet-java-client/tree/master/javafx-sample) or download the prebuilt [EyeTribeJavaFx](https://github.com/EyeTribe/tet-java-client/releases). This sample runs on all platforms supported by the [EyeTribe Dev Kit](https://theeyetribe.com/products/) that have Java 8 version 65 or higher installed.
36+
This library holds a sample implementation of a Calibration UI using [JavaFX](docs.oracle.com/javase/8/javafx/get-started-tutorial/jfx-overview.htm). Find this under [/javafx-sample](https://github.com/EyeTribe/tet-java-client/tree/master/javafx-sample). This sample runs on all platforms supported by the [EyeTribe Dev Kit](https://theeyetribe.com/products/) that have Java 8 installed.
3537

3638

3739
Building (optional)
3840
----
39-
A prebuilt version of the library is available under [releases](https://github.com/EyeTribe/tet-java-client/releases). The EyeTribe Java SDK is backwards compatible to Java 6. Should you wish to build it yourself, please follow the below instructions:
41+
You can use the prebuilt version of this library though Maven. Should you wish to build it yourselfIn case you prefer to build it yourself,
4042

4143
Prerequisites:
4244

@@ -58,9 +60,9 @@ If you choose to build yourself and are using [Proguard](http://proguard.sourcef
5860

5961
-keepattributes Signature, *Annotation*
6062
-keep class sun.misc.Unsafe { *; }
61-
-keep class com.theeyetribe.clientsdk.response.* { *; }
62-
-keep class com.theeyetribe.clientsdk.request.* { *; }
63-
-keep class com.theeyetribe.clientsdk.data.* { *; }
63+
-keep class com.theeyetribe.client.response.* { *; }
64+
-keep class com.theeyetribe.client.request.* { *; }
65+
-keep class com.theeyetribe.client.data.* { *; }
6466
-dontwarn java.lang.invoke.*
6567
-dontwarn com.google.**
6668

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
buildscript {
44
repositories {
5-
mavenCentral()
65
jcenter()
76
}
87

98
dependencies {
10-
classpath 'me.tatarka:gradle-retrolambda:3.2.3'
11-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
9+
classpath 'me.tatarka:gradle-retrolambda:3.2.5'
10+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
11+
classpath 'com.google.code.findbugs:jsr305:3.0.1'
1212
}
1313
}
1414

@@ -19,5 +19,5 @@ allprojects {
1919
}
2020

2121
task wrapper(type: Wrapper) {
22-
gradleVersion = '2.9'
22+
gradleVersion = '2.13'
2323
}

eyetribe.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
currentVersion=0.9.60
2-
releaseDate=2015-11-18
1+
currentVersion=0.9.77
2+
releaseDate=2016-05-17

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip

javafx-sample/build.gradle

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,17 @@ dependencies {
55
compile 'com.google.guava:guava:19.0'
66
compile 'org.controlsfx:controlsfx:8.40.10'
77
compile 'com.google.code.findbugs:jsr305:3.0.1'
8-
compile 'com.theeyetribe:eyetribe-java:0.9.60'
8+
compile 'com.theeyetribe:eyetribe-java:0.9.77'
99
}
1010

1111
jar {
1212
archivesBaseName = 'EyeTribeJavaFx'
1313

14-
//we include everything from 'libs' folder
15-
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
16-
1714
//but exclude javafx classes
1815
exclude('javafx/**', 'netscape/**', 'com/sun/**')
1916

20-
//exclude dupes from 'javafx-sample' module
21-
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
17+
//we include everything from 'libs' folder
18+
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
2219
}
2320

2421
javafx {

javafx-sample/src/main/java/com/theeyetribe/javafx/Main.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ private Scene loadScene(SceneController current, String newScene) throws Excepti
124124
root.setOnMousePressed(new EventHandler<MouseEvent>() {
125125
@Override
126126
public void handle(MouseEvent event) {
127-
dragDelta.x = event.getSceneX();
128-
dragDelta.y = event.getSceneY();
127+
dragDelta.x = (float)event.getSceneX();
128+
dragDelta.y = (float)event.getSceneY();
129129
}
130130
});
131131
root.setOnMouseDragged(new EventHandler<MouseEvent>() {

javafx-sample/src/main/java/com/theeyetribe/javafx/scenes/SceneCalibrationController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ public void resampleCalibration(List<Point2D> anchors)
236236
mCalibrationSequence.play();
237237
}
238238
}
239+
239240
public void resetCalibration()
240241
{
241242
stopCalibration();

javafx-sample/src/main/java/com/theeyetribe/javafx/scenes/SceneMainController.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ public void onGazeUpdate(GazeData gazeData)
9898
}
9999

100100
double angle = GazeFrameCache.getInstance().getLastEyesAngle();
101-
double scale = null != GazeFrameCache.getInstance().getLastUserPosition() ? GazeFrameCache.getInstance().getLastUserPosition().z : 1d;
102-
scale *= 1.5d;
101+
double scale = 1 - GazeFrameCache.getInstance().getLastUserPosition().z;
103102

104103
if (null != GazeFrameCache.getInstance().getLastLeftEye())
105104
{

javafx-sample/src/main/java/com/theeyetribe/javafx/utils/GazeFrameCache.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public class GazeFrameCache
3434
public final static int DEFAULT_CACHE_TIME_FRAME_MILLIS = 500;
3535
private final static int NO_TRACKING_MASK = GazeData.STATE_TRACKING_FAIL | GazeData.STATE_TRACKING_LOST;
3636

37-
private double mMinEyesDistance = 0.1f;
38-
private double mMaxEyesDistance = 0.3f;
37+
private float mMinEyesDistance = 0.1f;
38+
private float mMaxEyesDistance = 0.4f;
3939

4040
protected GazeDataDeque mFrames;
4141

@@ -58,8 +58,8 @@ public class GazeFrameCache
5858
protected boolean mShouldUpdate;
5959

6060
//internals
61-
private Point2D mLastEyesVecHalf = new Point2D(.2,0d);
62-
private double mLastEyeDistance = mMaxEyesDistance - mMinEyesDistance / mMaxEyesDistance;
61+
private Point2D mLastEyesVecHalf = new Point2D(.2f,0f);
62+
private float mLastEyeDistance = (mMaxEyesDistance - mMinEyesDistance) / mMaxEyesDistance;
6363

6464
public static GazeFrameCache getInstance()
6565
{
@@ -75,6 +75,11 @@ private GazeFrameCache(int timeLimit)
7575
{
7676
mFrames = new GazeDataDeque(timeLimit);
7777
mValidFramePredicate = new ValidFrame();
78+
79+
//init user distance values
80+
mLastEyesVecHalf = new Point2D(.2f, 0f);
81+
mLastEyeDistance = 1f - ((mMinEyesDistance + ((mMaxEyesDistance - mMinEyesDistance) * .5f)) / mMaxEyesDistance);
82+
mLastUserPosition = new Point3D(GazeManager.getInstance().getScreenResolutionWidth() >> 1, GazeManager.getInstance().getScreenResolutionHeight() >> 1, mLastEyeDistance);
7883
}
7984

8085
public void setTimeLimit(int timeLimit)
@@ -88,7 +93,7 @@ public synchronized void update(@Nonnull GazeData frame)
8893
if(mFrames.contains(frame))
8994
return;
9095

91-
//set delta based on contineous stream and not valid frames only
96+
//set delta based on continuous stream and not valid frames only
9297
long now = System.currentTimeMillis();
9398
mFrameDelta = now - mFrameTimeStamp;
9499
mFrameTimeStamp = now;
@@ -102,7 +107,7 @@ public synchronized void update(@Nonnull GazeData frame)
102107
Point2D gazeCoords = null;
103108
Point2D gazeCoordsSmooth = null;
104109
Point2D userPos = null;
105-
double userDist = 0d;
110+
double userDist = 0f;
106111
Point2D eyeDistVecHalf = null;
107112
GazeData gd;
108113
Iterable<GazeData> valid = Iterables.filter(mFrames, mValidFramePredicate);
@@ -158,12 +163,12 @@ else if (null == userPos && right == null && !gd.rightEye.pupilCenterCoordinates
158163

159164
//update 'depth' measure
160165
if (userDist < mMinEyesDistance)
161-
mMinEyesDistance = userDist;
166+
mMinEyesDistance = (float)userDist;
162167

163168
if (userDist > mMaxEyesDistance)
164-
mMaxEyesDistance = userDist;
169+
mMaxEyesDistance = (float)userDist;
165170

166-
mLastEyeDistance = userDist / mMaxEyesDistance;
171+
mLastEyeDistance = 1f - ((float)userDist / mMaxEyesDistance);
167172

168173
//update user position
169174
mLastUserPosition = new Point3D(userPos.x, userPos.y, mLastEyeDistance);

0 commit comments

Comments
 (0)