requiring more standard libraries
[ixm-repl.git] / README.html
blob7b2f289d64c2114f8e61ad1767edb39c75c81c21
1 <style type="text/css">
2 <!--
3 pre {
4 padding: 0.5em;
5 color: #E6E1DC;
6 background-color: #232323;
8 .slime-repl-input {
9 /* slime-repl-input-face */
10 font-weight: bold;
12 .slime-repl-output {
13 /* slime-repl-output-face */
14 color: #A5C261;
16 .slime-repl-prompt {
17 /* slime-repl-prompt-face */
18 color: #CC7833;
20 .slime-repl-result {
23 a {
24 color: inherit;
25 background-color: inherit;
26 font: inherit;
27 text-decoration: inherit;
29 a:hover {
30 text-decoration: underline;
32 -->
33 </style>
34 <div id="content">
36 <h1 class="title">IXM repl</h1>
38 <p>See <a href="http://illuminatolabs.com/IlluminatoXMachina.htm">here</a> information on the <i>Illuminato X Machina</i> (IXM)
39 </p>
40 <p>
41 Functions for interacting with a tribe of IXM through <code>sfbprog</code> from
42 inside of an <a href="http:clojure.org">Clojure</a> repl. Allows for accepting input from the tribe
43 and printing to the tribe programmatically, also provides for the
44 definition of reflexes associating different actions (e.g. printing to
45 the repl, logging to a file, etc&hellip;) with different packet types.
46 </p>
47 <p>
48 Here is an example session&hellip;
49 </p><ol>
50 <li>
51 create a persistent connection to the boards through "sfbprog"
55 <pre class="src src-slime-repl">
56 </span><span class="slime-repl-prompt">user&gt; </span>
57 <span class="slime-repl-prompt">user&gt; </span><span class="slime-repl-input">(load-file "/home/eschulte/research/ixm/ixm-repl/src/ixm_repl.clj")</span>
58 <span class="slime-repl-result">#'ixm-repl/connect
59 </span><span class="slime-repl-prompt">user&gt; </span><span class="slime-repl-input">(in-ns 'ixm-repl)</span>
60 <span class="slime-repl-result">#&lt;Namespace ixm-repl&gt;
61 </span><span class="slime-repl-prompt">ixm-repl&gt; </span><span class="slime-repl-input">(connect)</span>
62 </span><span class="slime-repl-prompt">ixm-repl&gt; </span><span class="slime-repl-input">tribe</span>
63 <span class="slime-repl-result">{:sfbprog-cmd "sfbprog", :usb-dev "/dev/ttyUSB0"}
64 </span><span class="slime-repl-prompt">ixm-repl&gt; </span>
65 <span class="slime-repl-output">Ln Sun Apr 18 11:22:54 2010 [Running in server mode]
66 Ln Sun Apr 18 11:22:54 2010 [Loaded EMS:MFL/20100418-172245 Size=72408 CS=B3B15106-58012D1E Copyright=GPL V3]
67 Ln Sun Apr 18 11:22:56 2010 [North baud rate set to 115200]
68 Ln Sun Apr 18 11:23:01 2010 [North baud rate set to 9600]
69 Ln Sun Apr 18 11:23:02 2010 [North baud rate set to 115200]
70 Ln Sun Apr 18 11:23:03 2010 [North seeking arch 2 code, responding]
71 Ln 4.235 Best offer so far: EMS:MFL/20100418-172245 (size 72404) from North ESCHUL/SFBPRG
72 Ln 5.733 About to burn: 0/0 bootCount=1185; burnCount=585 (+1); powerOnHours=889; flags=0
73 Ln Sun Apr 18 11:23:04 2010 [Sending checksum North for 0x10014+32748=C6DDEDD8-F56B9A5]
74 Ln Sun Apr 18 11:23:10 2010 [Sending checksum North for 0x18000+32768=C9DB2E22-ECB85E4F]
75 Ln Sun Apr 18 11:23:10 2010 [Sending checksum North for 0x20000+6868=5CFB5CB9-2317F28C]
76 Ln Sun Apr 18 11:23:11 2010 [North burned successfully!]
77 Ln Sun Apr 18 11:23:15 2010 [North baud rate set to 9600]
78 Ln Sun Apr 18 11:23:34 2010 [North baud rate set to 115200]
79 Ln 33.466 [East seeking arch 2 code, responding]
80 i +35
81 Ln 35.126 [Sending checksum East for 0x10014+32748=C6DDEDD8-F56B9A5]
82 i 99+529-9676*1014y
83 Ln 48.341 [Sending checksum East for 0x18000+32768=C9DB2E22-ECB85E4F]
84 Ln 48.574 [Sending checksum East for 0x20000+6868=5CFB5CB9-2317F28C]
85 Ln 49.496 [East burned successfully!]
86 i 2*2005-y*///
87 </span><span class="slime-repl-result">#&lt;Object$IDeref$Future$2b9be1f9@5c2a25: :pending&gt;
88 </pre>
90 </li>
91 <li>
92 output from the boards appears in the repl, reflexes can be defined
93 to handle output, the following uses the <code>dump</code> function to drop
94 all <code>i</code> packets without displaying them to the repl.
98 <pre class="src src-slime-repl">
99 </span><span class="slime-repl-prompt">ixm-repl&gt; </span><span class="slime-repl-input">(add-reflex :i dump)</span>
100 <span class="slime-repl-result">#'ixm-repl/reflexes
102 </pre>
105 </li>
106 <li>
107 the following initiates the collector, which results in a flood of
108 data from the boards, which can be redirected to a file using the
109 <code>log</code> function as follows
113 <pre class="src src-slime-repl">
114 </span><span class="slime-repl-prompt">ixm-repl&gt; </span><span class="slime-repl-input">(tribe-print "c4")</span>
115 <span class="slime-repl-output">c (0,0) seconds: 84
116 c (0,0) goal: 55+55+xs*
117 c (0,0) position: (0.00, 0.00)
118 c (0,0) horizon_x: 10.00
119 c (0,0) horizon_y: 0.00
120 c (0,0) neighbor_fitness: -1.00
121 c (0,0) mean_fitness: 16841.17
122 c (0,0) best_fitness: 15091.01
123 c (0,0) fittest_individual: 526x4y7/*
124 c (-1,0) seconds: 36
125 c (-1,0) goal: 55+55+xs*
126 c (-1,0) position: (0.00, 0.00)
127 c (-1,0) horizon_x: 10.00
128 c (-1,0) horizon_y: 0.00
129 c (-1,0) neighbor_fitness: -1.00
130 c (-1,0) mean_fitness: 29855.63
131 c (-1,0) best_fitness: 15091.01
132 c (-1,0) fittest_individual: 23/047-9-*92y3-0y
133 </span><span class="slime-repl-result">nil
134 </span><span class="slime-repl-prompt">ixm-repl&gt; </span><span class="slime-repl-input">(add-reflex :c (log "/home/eschulte/Desktop/collected"))</span>
135 <span class="slime-repl-result">#'ixm-repl/reflexes
136 </pre>
137 </li>
138 </ol>
140 <p>This program is free software; you can redistribute it and/or modify
141 it under the terms of the GNU General Public License as published by
142 the Free Software Foundation; either version 3, or (at your option)
143 any later version.
144 </p>
146 This program is distributed in the hope that it will be useful, but
147 WITHOUT ANY WARRANTY; without even the implied warranty of
148 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
149 General Public License for more details.
150 </p>
152 See the file COPYING for a copy of the GNU General Public License or
153 write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
154 Floor, Boston, MA 02110-1301, USA.
155 </p>
157 <img src="http://www.gnu.org/graphics/gplv3-88x31.png"/>
158 <div id="postamble">
159 <p class="author"> Author: Eric Schulte
160 </p>
161 <p class="date"> Date: 2010-04-18 11:36:34 MDT</p>
162 <p class="creator">HTML generated by org-mode 6.35trans in emacs 24</p>
163 </div>
164 </div>