<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="http://theeyetribe.com/forum/feed.php?f=26&amp;t=309" />

<title>The Eye Tribe</title>
<subtitle>Developer Forum</subtitle>
<link href="http://theeyetribe.com/forum/index.php" />
<updated>2014-08-14T16:42:09+02:00</updated>

<author><name><![CDATA[The Eye Tribe]]></name></author>
<id>http://theeyetribe.com/forum/feed.php?f=26&amp;t=309</id>
<entry>
<author><name><![CDATA[pgba@dtu.dk]]></name></author>
<updated>2014-08-14T16:42:09+02:00</updated>
<published>2014-08-14T16:42:09+02:00</published>
<id>http://theeyetribe.com/forum/viewtopic.php?t=309&amp;p=1278#p1278</id>
<link href="http://theeyetribe.com/forum/viewtopic.php?t=309&amp;p=1278#p1278"/>
<title type="html"><![CDATA[Updated peyetribe]]></title>

<content type="html" xml:base="http://theeyetribe.com/forum/viewtopic.php?t=309&amp;p=1278#p1278"><![CDATA[
There now seems to be an abundance of python interfaces to the eye tribe <img src="http://theeyetribe.com/forum/images/smilies/icon_e_smile.gif" alt=":-)" title="Smile" /><br /><br />I have nevertheless updated the peyetribe interface a bit, to make it more robust and maybe also easier to use.<br /><br />It works with both python3 and python2, so you could use it with e.g. the PsychoPy toolbox and others that are not updated to python3 yet. Just copy the peyetribe.py file to the directory where you have your other python files (or install it as a module).<br /><br />It offers a very simple interface, and hides most of the complexity of multiple threads (listener and heartbeat).<br /><br />A very simple use case could be as follows, using the tracker in pull mode:<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>from peyetribe import eyetribe<br /><br />tracker = eyetribe()<br />tracker.connect()<br /><br />while True: # or some better condition...<br />    n = tracker.next()<br />    print(str(n))<br /><br />tracker.close()<br /></code></dd></dl><br /><br />Or a more elaborate example, using push mode and relying on multiple synchronised threads and internal queues that ensure you don't loose any data, and only printing the left eye coordinates:<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>from peyetribe import eyetribe<br /><br />tracker = eyetribe(host=&quot;your.host&quot;, port=1234)<br />tracker.connect()<br /><br />tracker.pushmode()<br />count = 0<br />while count &lt; 100:<br />    n = tracker.next()<br />    print(&quot;Left: %s&quot; % (str(n.geteye(left=True))))<br />    count += 1<br /><br />tracker.pullmode()<br /><br />tracker.close()</code></dd></dl><br /><br />It can still be found at <!-- m --><a class="postlink" href="https://github.com/baekgaard/peyetribe">https://github.com/baekgaard/peyetribe</a><!-- m --><br /><br />I may still clean up the code a bit; this has evolved some over time and could obviously be made smarter in some places.<br /><br />Comments or ideas for improvement are obviously welcome <img src="http://theeyetribe.com/forum/images/smilies/icon_e_smile.gif" alt=":-)" title="Smile" /><p>Statistics: Posted by <a href="http://theeyetribe.com/forum/memberlist.php?mode=viewprofile&amp;u=1848">skatapgba@dtu.dk</a> — 14 Aug 2014, 16:42</p><hr />
]]></content>
</entry>
</feed>