<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6973548223914394528</id><updated>2011-07-08T07:42:45.084-04:00</updated><category term='lejos'/><category term='probability distrition'/><category term='weighting'/><category term='communication protocols'/><category term='tutorial thermostatic sensor'/><category term='robotic arm'/><category term='randomly generated multinomial vectors'/><category term='lego'/><category term='GUI customization NXT lejos M'/><category term='implements'/><category term='weighting function'/><category term='beta testing'/><category term='tutorial'/><category term='robot'/><category term='Wii'/><category term='Monte Carlo Localization'/><category term='ultrasonic sensor'/><category term='pose'/><category term='GMMs'/><category term='JPanel'/><category term='interfaces'/><category term='graphical user interface'/><category term='algorithm'/><category term='Java'/><category term='BlackBerry'/><category term='button'/><category term='uniform distribution'/><category term='MCL'/><category term='GUI'/><category term='remote control'/><category term='sensor hitechnic I2C'/><category term='bluetooth'/><category term='nxt'/><category term='nxt lejos'/><category term='normal distribution'/><category term='sensor'/><category term='normal distributions'/><category term='3D graphics'/><category term='Box-Muller algorithm'/><category term='distance computation'/><category term='mindstorms'/><category term='approximation'/><category term='randn'/><category term='Gaussian Mixture Models'/><category term='button listeners'/><category term='GMM'/><title type='text'>LEJOS:  Programming the NXT in Java</title><subtitle type='html'>This blog is for all those who program the NXT Mindstorms robot in Lejos or those who wish to know more about such programming.  &lt;a href="https://sites.google.com/site/lejosprogramming/Home"&gt; Source Code&lt;/a&gt; available for download</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-7844216395985214026</id><published>2011-03-20T12:58:00.000-04:00</published><updated>2011-03-20T12:58:54.139-04:00</updated><title type='text'>Where you can find my code</title><content type='html'>Some of my older posts have outdated links pointing to my old website at the University of Waterloo.&amp;nbsp; My code can be found at&lt;br /&gt;&lt;br /&gt;&amp;nbsp;https://sites.google.com/site/lejosprogramming/&lt;br /&gt;&lt;br /&gt;I apologize for any confusion that this may have caused.&amp;nbsp; One person wrote asking for the Java implementation of the Box-Muller algorithm.&amp;nbsp; It is included in the zip file, which is located at the link given above.&lt;br /&gt;&lt;br /&gt;..Allan&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-7844216395985214026?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='https://sites.google.com/site/lejosprogramming/' title='Where you can find my code'/><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/7844216395985214026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=7844216395985214026' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/7844216395985214026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/7844216395985214026'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2011/03/where-you-can-find-my-code.html' title='Where you can find my code'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-2410192440640634058</id><published>2010-08-30T02:08:00.002-04:00</published><updated>2010-08-30T19:50:39.321-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lego'/><category scheme='http://www.blogger.com/atom/ns#' term='lejos'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='tutorial thermostatic sensor'/><category scheme='http://www.blogger.com/atom/ns#' term='mindstorms'/><category scheme='http://www.blogger.com/atom/ns#' term='implements'/><category scheme='http://www.blogger.com/atom/ns#' term='communication protocols'/><category scheme='http://www.blogger.com/atom/ns#' term='interfaces'/><category scheme='http://www.blogger.com/atom/ns#' term='nxt lejos'/><category scheme='http://www.blogger.com/atom/ns#' term='sensor hitechnic I2C'/><category scheme='http://www.blogger.com/atom/ns#' term='nxt'/><title type='text'>Tutorial on Building a Thermostatic Sensor for your NXT</title><content type='html'>In this video, I take you step-by-step through the process of creating a thermostatic sensor for your NXT.  Enjoy!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;object height="385" width="480"&gt;&lt;param name="movie" value="http://www.youtube.com/v/4VEfZZGZUtc?fs=1&amp;amp;hl=en_US"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/4VEfZZGZUtc?fs=1&amp;amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-2410192440640634058?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.youtube.com/watch?v=4VEfZZGZUtc' title='Tutorial on Building a Thermostatic Sensor for your NXT'/><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/2410192440640634058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=2410192440640634058' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/2410192440640634058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/2410192440640634058'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2010/08/tutorial-on-building-thermostatic.html' title='Tutorial on Building a Thermostatic Sensor for your NXT'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-1883592637380095572</id><published>2010-08-28T22:33:00.000-04:00</published><updated>2010-08-28T22:33:17.181-04:00</updated><title type='text'>The NXT as a Home Thersomstat using the HiTechnic Experimenter's Kit</title><content type='html'>In my next blog entry, I'll show you how to use the NXT with the &lt;a href="http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&amp;amp;key=NPA1058"&gt;HitTechnic Experimenter's Kit&lt;/a&gt; to construct a household thermostat.&amp;nbsp; I am currently making the video.&amp;nbsp; I'll have code and a circuit diagram to show you.&amp;nbsp; Stay tuned!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-1883592637380095572?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/1883592637380095572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=1883592637380095572' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1883592637380095572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1883592637380095572'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2010/08/nxt-as-home-thersomstat-using-hitechnic.html' title='The NXT as a Home Thersomstat using the HiTechnic Experimenter&apos;s Kit'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-8267144337072171386</id><published>2010-08-23T07:15:00.000-04:00</published><updated>2010-08-23T07:15:19.008-04:00</updated><title type='text'>Monte Carlo Localization and Code Tutorial</title><content type='html'>I have been asked to explain how the MCL class works.  Rather than giving a long written explanation, I've chosen to give a video tutorial.  Remember that the source code that I am referring in the video is available for &lt;a href="https://sites.google.com/site/lejosprogramming/Home"&gt;download&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/4daCp_apFLo?fs=1&amp;amp;hl=en_US"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/4daCp_apFLo?fs=1&amp;amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-8267144337072171386?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/8267144337072171386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=8267144337072171386' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/8267144337072171386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/8267144337072171386'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2010/08/monte-carlo-localization-and-code.html' title='Monte Carlo Localization and Code Tutorial'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-4187069186661121700</id><published>2010-08-17T21:30:00.000-04:00</published><updated>2010-08-17T21:30:25.812-04:00</updated><title type='text'>Build your own Sound Meter with Lights</title><content type='html'>Using the &lt;a href="http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&amp;amp;key=NPA1058"&gt;HiTechnic Experimenter's Kit&lt;/a&gt;, you can easily create a sound meter with lights.&amp;nbsp; Here is my YouTube video illustrating how this can be done!&amp;nbsp; Download the &lt;a href="https://sites.google.com/site/lejosprogramming/Home"&gt;source code&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/k3Y6Zgv8gCE&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/k3Y6Zgv8gCE&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-4187069186661121700?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/4187069186661121700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=4187069186661121700' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/4187069186661121700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/4187069186661121700'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2010/08/build-your-own-sound-meter-with-lights.html' title='Build your own Sound Meter with Lights'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-992931956230913775</id><published>2010-08-16T19:58:00.000-04:00</published><updated>2010-08-16T19:58:56.237-04:00</updated><title type='text'>Robot Building Instructions</title><content type='html'>I have been asked what robot design I use.&amp;nbsp; Actually, I use the &lt;a href="http://www.education.rec.ri.cmu.edu/content/lego/building/build_shows/rem.pdf"&gt;Robot Educator Model&lt;/a&gt; courtesy of Carnegie Mellon University's &lt;a href="http://www.education.rec.ri.cmu.edu/content/index.htm"&gt;Robot Academy&lt;/a&gt;.&amp;nbsp; It's a simple design and it can be constructed quite easily and rapidly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-992931956230913775?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.education.rec.ri.cmu.edu/content/lego/building/build_shows/rem.pdf' title='Robot Building Instructions'/><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/992931956230913775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=992931956230913775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/992931956230913775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/992931956230913775'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2010/08/robot-building-instructions.html' title='Robot Building Instructions'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-5865567014670952052</id><published>2010-08-15T20:33:00.004-04:00</published><updated>2010-08-17T21:43:39.149-04:00</updated><title type='text'>Lejos and the HiTechnic Experiment Kit</title><content type='html'>I recently purchased the &lt;a href="http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&amp;amp;key=NPA1058"&gt;HiTechnic Experiment Kit&lt;/a&gt;.&amp;nbsp; I'm having a lot of fun with it.&amp;nbsp; Even though the code for the eight experiments is written in NXT-G and NXTC, I have found that the kit is perfectly suitable for use with Lejos.&amp;nbsp; You can &lt;a href="https://sites.google.com/site/lejosprogramming/Home?pli=1"&gt;download&lt;/a&gt; my example code for Experiments 1 and 2 as shown in the &lt;a href="http://www.hitechnic.com/downloadnew.php?category=19"&gt;book&lt;/a&gt; that comes with the kit.&lt;br /&gt;&lt;br /&gt;Also, please view my video tutorial, which explains Experiment 2 in detail, including the code that supports it.&amp;nbsp; The experiment deals with having the NXT control 6 LEDs based upon the setting of a potentiometer.&lt;br /&gt;&lt;br /&gt;It's a product certainly worth purchasing!&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/V4QoGZudh5o&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/V4QoGZudh5o&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-5865567014670952052?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&amp;key=NPA1058' title='Lejos and the HiTechnic Experiment Kit'/><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/5865567014670952052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=5865567014670952052' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/5865567014670952052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/5865567014670952052'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2010/08/lejos-and-hitechnic-experiment-kit.html' title='Lejos and the HiTechnic Experiment Kit'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-766494424149228657</id><published>2010-08-14T20:32:00.000-04:00</published><updated>2010-08-14T20:32:10.445-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bluetooth'/><category scheme='http://www.blogger.com/atom/ns#' term='robot'/><category scheme='http://www.blogger.com/atom/ns#' term='GUI customization NXT lejos M'/><category scheme='http://www.blogger.com/atom/ns#' term='nxt lejos'/><category scheme='http://www.blogger.com/atom/ns#' term='nxt'/><title type='text'>Customizing the GUI</title><content type='html'>I have been asked how to change the GUI’s connect panel to change the name and Bluetooth address of the NXT or NXTs you want to connect to.&lt;br /&gt;&lt;br /&gt;In the &lt;a href="https://sites.google.com/site/lejosprogramming/Home"&gt;ConnectPanel.java&lt;/a&gt; file, you need to change these two lines of code:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: small;"&gt;private static final String[] _robotNames = {"MONTE", "Wayfinder"};&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: small;"&gt;private static final String[] _robotAddresses = {"00:16:53:00:57:37","00:16:53:08:82:3a"};&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;/div&gt;In my particular case, my NXTs are called MONTE and Wayfinder; their Bluetooth addresses are 00:16:53:00:57:37 and 00:16:53:08:82:3a respectively.&lt;br /&gt;&lt;br /&gt;For example, if your NXT is called Delta with a Bluetooth address of 00:16:53:00:00:00, then the two lines of java code should read:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: small;"&gt;private static final String[] _robotNames = {"Delta"};&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: small;"&gt;private static final String[] _robotAddresses = {"00:16:53:00:00:00"};&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Thank you for your feedback.&lt;br /&gt;&lt;br /&gt;In my next posts, I’ll show you how to change the NXT’s map, and how to build the robot in Lego.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-766494424149228657?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='https://sites.google.com/site/lejosprogramming/Home' title='Customizing the GUI'/><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/766494424149228657/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=766494424149228657' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/766494424149228657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/766494424149228657'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2010/08/customizing-gui.html' title='Customizing the GUI'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-7352150816724537629</id><published>2010-08-09T19:27:00.001-04:00</published><updated>2010-08-17T21:44:16.988-04:00</updated><title type='text'>Video Tutorial</title><content type='html'>My video tutorial can be found below.&amp;nbsp; Enjoy!&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;object height="385" width="480"&gt;&lt;param name="movie" value="http://www.youtube.com/v/2ZbhpW59YAU&amp;amp;hl=en_US&amp;amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/2ZbhpW59YAU&amp;amp;hl=en_US&amp;amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-7352150816724537629?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.youtube.com/watch?v=2ZbhpW59YAU' title='Video Tutorial'/><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/7352150816724537629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=7352150816724537629' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/7352150816724537629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/7352150816724537629'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2010/08/video-tutorial.html' title='Video Tutorial'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-5234610976569839582</id><published>2010-08-08T12:03:00.003-04:00</published><updated>2010-08-08T15:59:26.528-04:00</updated><title type='text'>Download My Code</title><content type='html'>You can download my full project code &lt;a href="https://sites.google.com/site/lejosprogramming/Home"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;A tutorial video will become available once it's uploaded to YouTube.&lt;br /&gt;&lt;br /&gt;Let me know what you think of my project.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-5234610976569839582?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='https://sites.google.com/site/lejosprogramming/Home' title='Download My Code'/><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/5234610976569839582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=5234610976569839582' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/5234610976569839582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/5234610976569839582'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2010/08/download-my-code.html' title='Download My Code'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-1188231993587163899</id><published>2010-08-03T22:42:00.000-04:00</published><updated>2010-08-03T22:42:26.756-04:00</updated><title type='text'>Finding a New Place to Post my Code</title><content type='html'>I know that some of you have been sending me emails requesting my project code.&amp;nbsp; I am currently looking for a place where the code could be hosted, ideally for free.&amp;nbsp; Unfortunately, apart for images, this blogging service does not permit the posting of documents.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once I figure out where I can post my project code, I'll let everyone know.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-1188231993587163899?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/1188231993587163899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=1188231993587163899' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1188231993587163899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1188231993587163899'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2010/08/finding-new-place-to-post-my-code.html' title='Finding a New Place to Post my Code'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-6230013969740150006</id><published>2010-07-31T20:13:00.002-04:00</published><updated>2010-07-31T21:02:54.718-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bluetooth'/><category scheme='http://www.blogger.com/atom/ns#' term='communication protocols'/><category scheme='http://www.blogger.com/atom/ns#' term='tutorial'/><title type='text'>NXT Bluetooth Tutorial</title><content type='html'>This blog is the first of many as a tutorial on using the NXT with Bluetooth.&amp;nbsp; First, I’ll speak to the issue of programming the robot because it’s the easiest to understand.&amp;nbsp; The following program is intended to be run on the NXT.&amp;nbsp; This code will &lt;b&gt;not&lt;/b&gt; run on your PC.&lt;br /&gt;&lt;br /&gt;The steps for your NXT are quite simple&lt;br /&gt;&lt;br /&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp; Declare all of the class’s instance variables.&lt;br /&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp; Display a message on the NXT’s LCD display that the NXT is waiting for a connection.&amp;nbsp; I also like the NXT to sound two beeps in case the NXT is not near enough to read the LCD.&lt;br /&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp; Make a blocking call to wait for a Bluetooth connection from your PC.&amp;nbsp; I'll explain in future blogs how to make the PC initiate the Bluetooth connection.&lt;br /&gt;4.&amp;nbsp;&amp;nbsp;&amp;nbsp; Once the connection is made, set up the input and output streams.&amp;nbsp; I also like the NXT to sound a tune so that I know that the connection is ready.&lt;br /&gt;5.&amp;nbsp;&amp;nbsp;&amp;nbsp; Next, send the NXT into a while loop controlled by a Boolean flag.&amp;nbsp; The stuff inside the while loop is what you want the NXT to do.&amp;nbsp; &lt;br /&gt;6.&amp;nbsp;&amp;nbsp;&amp;nbsp; When your PC signals the NXT that it is through with the Bluetooth connection, the NXT should set the Boolean flag mentioned in step 5 to false.&amp;nbsp; Consequently, the while loop will cease.&lt;br /&gt;7.&amp;nbsp;&amp;nbsp;&amp;nbsp; Close the input and output buffers to close the Bluetooth connection.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 1:&amp;nbsp; Declare all of the class’s instance variables&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;import lejos.nxt.*;&lt;br /&gt;import lejos.nxt.comm.*;&lt;br /&gt;import lejos.robotics.navigation.*;&lt;br /&gt;&lt;br /&gt;import java.io.*;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class Robot {&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String [] args) throws Exception &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; int[] command = new int[3];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; int[] reply = new int[8];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; boolean keepItRunning = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; String connected = "Connected";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String waiting = "Waiting...";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String closing = "Closing...";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataInputStream dis = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataOutputStream dos = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BTConnection btc = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UltrasonicSensor sonic = new UltrasonicSensor(SensorPort.S1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pilot piloting = new TachoPilot(56.0f, 121.0f, Motor.C, Motor.A);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;The two integer arrays are used to hold the commands sent by the PC to the NXT, and the reply is used to hold the NXT's reply to the command. &lt;br /&gt;&lt;br /&gt;The Boolean flag is used to indicate if the while loop is to keep looping.&lt;br /&gt;&lt;br /&gt;The strings are used to display status messages on the LCD screen.&lt;br /&gt;&lt;br /&gt;The streams are used to facilitate communication between the PC and the NXT.&lt;br /&gt;&lt;br /&gt;The ultrasonic sensor and pilot objects are used within the while loop to control the NXT.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 2:&amp;nbsp; Display a Message and Sound two Beeps&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; LCD.drawString(waiting,0,0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; LCD.refresh();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Sound.twoBeeps();&lt;br /&gt;&lt;br /&gt;These simple commands put the words “Waiting…” on the NXT’s LCD and sounds two beeps.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 3:&amp;nbsp; Wait for a Bluetooth Connection&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; btc = Bluetooth.waitForConnection();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;Remember that this is a blocking method call.&amp;nbsp; The NXT will not go beyond this step until it makes a Bluetooth connection.&amp;nbsp; I’ll explain in future blog posts how the PC initiates the Bluetooth connection.&amp;nbsp; If you try to run this program on your NXT, it will stop at this point and go no further.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 4:&amp;nbsp; Set up the Streams&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; dis = btc.openDataInputStream();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; dos = btc.openDataOutputStream();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Sound.beepSequenceUp();&lt;br /&gt;&lt;br /&gt;With the Bluetooth connection established the streams can be opened.&amp;nbsp; I make the NXT play a tune as an audible reminder that a Bluetooth connection has been successfully made.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Steps 5 and 6:&amp;nbsp; Go into a while loop&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (keepItRunning){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // put your stuff here including code to change the Boolean&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // flag to false once the PC signals to end the connection&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 7:&amp;nbsp; Close the Streams and the Bluetooth Connection&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; dis.close();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; dos.close();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.sleep(100); // wait for data to drain&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; LCD.clear();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; LCD.drawString(closing,0,0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; LCD.refresh();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; btc.close();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; LCD.clear();&lt;br /&gt;&amp;nbsp; } // end of main&lt;br /&gt;&lt;br /&gt;} // end of class Robot&lt;br /&gt;&lt;br /&gt;Closing the streams and the Bluetooth connection is very simple.&amp;nbsp; I also have status messages displayed on the NXT’s LCD.&lt;br /&gt;&lt;br /&gt;In my next blog entry I’ll elaborate on Steps 5 and 6; that is, the “stuff” you want your NXT to do.&lt;br /&gt;&lt;br /&gt;Go questions?&amp;nbsp; Post a comment.&amp;nbsp; I’ll reply.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-6230013969740150006?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/6230013969740150006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=6230013969740150006' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/6230013969740150006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/6230013969740150006'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2010/07/nxt-bluetooth-tutorial.html' title='NXT Bluetooth Tutorial'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-8645171152038343241</id><published>2010-07-26T20:34:00.000-04:00</published><updated>2010-07-26T20:34:58.634-04:00</updated><title type='text'>Still Fixing my Code</title><content type='html'>This weekend, I was fixing up my code for my Monte Carlo localization project.&amp;nbsp; Unfortunately, the Lejos API was changed so much so that much of the functionality was broken.&lt;br /&gt;&lt;br /&gt;While it didn't take long to change the code over, now I have to test it to ensure that the new libraries that I'm accessing produce similar results.&lt;br /&gt;&lt;br /&gt;I'll probably get back to more fixing of my code this weekend coming up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-8645171152038343241?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/8645171152038343241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=8645171152038343241' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/8645171152038343241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/8645171152038343241'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2010/07/still-fixing-my-code.html' title='Still Fixing my Code'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-4160124990033420747</id><published>2010-07-20T07:49:00.000-04:00</published><updated>2010-07-20T07:49:17.990-04:00</updated><title type='text'>API Changes have broken my code</title><content type='html'>Since I've been away, changes have been made to the Lejos API.  Unfortunately, the removal of some classes, and the changes in other classes have broken my code.  This code used Bluetooth, and I wanted to illustrate the use of my code to you.&lt;br /&gt;&lt;br /&gt;In my next blog entry, I'll demonstrate why changing a public interface in an API can adversely affect users.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-4160124990033420747?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/4160124990033420747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=4160124990033420747' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/4160124990033420747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/4160124990033420747'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2010/07/api-changes-have-broken-my-code.html' title='API Changes have broken my code'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-4284041223773092552</id><published>2010-07-18T19:28:00.004-04:00</published><updated>2010-07-18T20:11:59.984-04:00</updated><title type='text'>Back in Business</title><content type='html'>After a long time away from blogging about the NXT and LEJOS programming in the Java programming language, I'm back.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I'm a software developer at Research in Motion, the makers of the BlackBerry smartphone.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;My major interest with the NXT is using Bluetooth to use the PC and the NXT together.&amp;nbsp; The PC is dedicated to do complex calculations, while the NXT is used as, essentially, a mobile sensor platform.&amp;nbsp; I am particularly interested in the Monte Carlo localization.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Go questions. Send me a reply to this post.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Stay tuned for new blog posts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-4284041223773092552?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/4284041223773092552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=4284041223773092552' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/4284041223773092552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/4284041223773092552'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2010/07/back-in-business.html' title='Back in Business'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-1392623536046673451</id><published>2009-09-07T12:12:00.006-04:00</published><updated>2009-09-07T12:22:10.011-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bluetooth'/><category scheme='http://www.blogger.com/atom/ns#' term='nxt lejos'/><category scheme='http://www.blogger.com/atom/ns#' term='BlackBerry'/><title type='text'>The BlackBerry Simulator</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Soam3WFaJtw/SqUxwLpiS-I/AAAAAAAAALA/x79IJhjALmk/s1600-h/bb_simulator.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 229px; height: 400px;" src="http://2.bp.blogspot.com/_Soam3WFaJtw/SqUxwLpiS-I/AAAAAAAAALA/x79IJhjALmk/s400/bb_simulator.bmp" alt="" id="BLOGGER_PHOTO_ID_5378760033794411490" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I have been working with the BlackBerry simulator for the past while, working on arguably simple code to better understand and appreciate how BlackBerry applications are written using J2ME.  Here is one example of code that I have had running successfully, based upon an example given in the &lt;a href="http://na.blackberry.com/eng/developers/"&gt;BlackBerry Developer Zone&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I am intrigued by the BlackBerry.  Would I be able to use the BlackBerry as a remote control for the NXT robot?  While I can certainly write an application for the PC to control the NXT over Bluetooth, the PC is necessarily stationary.  The robot cannot move outside of the Bluetooth broadcast range.  On the other hand, if the BlackBerry were used as the remote control device, the remote control is now portable.  The user can now move along with the NXT.  The NXT's range of movement is theoretically unlimited.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-1392623536046673451?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/1392623536046673451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=1392623536046673451' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1392623536046673451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1392623536046673451'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/09/blackberry-simulator.html' title='The BlackBerry Simulator'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Soam3WFaJtw/SqUxwLpiS-I/AAAAAAAAALA/x79IJhjALmk/s72-c/bb_simulator.bmp' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-5889130650307732262</id><published>2009-04-21T16:42:00.003-04:00</published><updated>2009-04-21T16:51:58.765-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GMMs'/><category scheme='http://www.blogger.com/atom/ns#' term='randomly generated multinomial vectors'/><category scheme='http://www.blogger.com/atom/ns#' term='normal distributions'/><category scheme='http://www.blogger.com/atom/ns#' term='GMM'/><category scheme='http://www.blogger.com/atom/ns#' term='Gaussian Mixture Models'/><title type='text'>Generating 2D, 3D, and nD Multinomials randomly</title><content type='html'>I have been much engrossed with the idea of Gaussian Mixture Models (GMMs) and their applicability to computer vision, especially in segmentation.&lt;br /&gt;&lt;br /&gt;However, to be able to test a GMM, it is necessary to generate random vectors from Gaussian distributions.  While it is true that Matlab has a function call mvnrnd() for this purpose, I have developed a function that produces a very similar result with great ease.  You can click &lt;a href="http://www.cs.uwaterloo.ca/~adcaine/multinomial.pdf"&gt;here&lt;/a&gt; for a detailed explanation of the code:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;%% Function&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;% Generates normally distributed values&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;function p = normalMulti(mu, sigma, cases)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;[row col] = size(mu);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;if(col ~= 1)&lt;/div&gt;&lt;div&gt;    mu = mu';&lt;/div&gt;&lt;div&gt;    [row col] = size(mu);&lt;/div&gt;&lt;div&gt;end&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;[V D] = eig(sigma);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A = V*sqrt(D);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;p = A*randn(row,cases) + repmat(mu,1,cases);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-5889130650307732262?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.cs.uwaterloo.ca/~adcaine/multinomial.pdf' title='Generating 2D, 3D, and nD Multinomials randomly'/><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/5889130650307732262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=5889130650307732262' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/5889130650307732262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/5889130650307732262'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/04/generating-2d-3d-and-nd-multinomials.html' title='Generating 2D, 3D, and nD Multinomials randomly'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-7752503359784995513</id><published>2009-02-20T17:04:00.002-05:00</published><updated>2009-02-20T17:06:57.406-05:00</updated><title type='text'>Controlling the NXT with Matlab</title><content type='html'>Here is an interesting &lt;a href="http://realterm.sourceforge.net/mindstorms.html"&gt;link&lt;/a&gt; that I found, if you want to try and control the NXT using &lt;a href="http://www.mathworks.com/"&gt;Matlab&lt;/a&gt;.  I have not tried this approach myself, but it is something interesting to consider.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-7752503359784995513?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/7752503359784995513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=7752503359784995513' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/7752503359784995513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/7752503359784995513'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/02/controlling-nxt-with-matlab.html' title='Controlling the NXT with Matlab'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-7205900652661416571</id><published>2009-02-18T19:41:00.005-05:00</published><updated>2009-02-18T19:46:43.890-05:00</updated><title type='text'>Link to an MCL Project that may interest others</title><content type='html'>Here is a &lt;a href="http://www.cs.hmc.edu/%7Edodds/projects/RobS04/MCL_Wireless/index.html"&gt;link&lt;/a&gt; to another MCL project that readers may find interesting.  Thanks Juan for bringing the link to my attention.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-7205900652661416571?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/7205900652661416571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=7205900652661416571' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/7205900652661416571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/7205900652661416571'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/02/link-to-mcl-project-that-may-interest.html' title='Link to an MCL Project that may interest others'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-1101674824833990070</id><published>2009-02-15T13:18:00.003-05:00</published><updated>2010-08-10T07:31:06.922-04:00</updated><title type='text'>Link to Sample Code</title><content type='html'>I have included in the banner of my blog a link to my &lt;a href="https://sites.google.com/site/lejosprogramming/Home"&gt;sample code&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-1101674824833990070?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/1101674824833990070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=1101674824833990070' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1101674824833990070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1101674824833990070'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/02/link-to-sampe-code.html' title='Link to Sample Code'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-2695656394543498849</id><published>2009-02-07T18:03:00.001-05:00</published><updated>2009-02-07T18:04:45.068-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nxt lejos'/><category scheme='http://www.blogger.com/atom/ns#' term='nxt'/><title type='text'>The Reason for not Blogging Lately</title><content type='html'>I have been unable to blog lately because I have been away.  However, I will soon be back to my normal routine.  Once I'm back, I'll be blogging once again on LEJOS:  Programming the NXT in Java.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-2695656394543498849?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/2695656394543498849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=2695656394543498849' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/2695656394543498849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/2695656394543498849'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/02/reason-for-not-blogging-lately.html' title='The Reason for not Blogging Lately'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-5325702504154670666</id><published>2009-01-12T20:53:00.002-05:00</published><updated>2009-03-10T09:32:21.879-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Monte Carlo Localization'/><category scheme='http://www.blogger.com/atom/ns#' term='MCL'/><category scheme='http://www.blogger.com/atom/ns#' term='nxt'/><title type='text'>Localization Video</title><content type='html'>Here is a video from an unrelated MCL project.  I am posting it so that you can see the basic idea.&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/7K8dZwqBSSA&amp;amp;hl=en&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/7K8dZwqBSSA&amp;amp;hl=en&amp;amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-5325702504154670666?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/5325702504154670666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=5325702504154670666' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/5325702504154670666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/5325702504154670666'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/localization-video.html' title='Localization Video'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-5156096871798990655</id><published>2009-01-12T08:02:00.006-05:00</published><updated>2009-01-12T08:12:39.894-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Box-Muller algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='randn'/><title type='text'>Added new BoxMuller.java Class</title><content type='html'>I have added a new class called &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/BoxMuller.java"&gt;BoxMuller.java&lt;/a&gt;.  Its sole static method &lt;span style="font-family:courier new;"&gt;randn(float mu, float sigma)&lt;/span&gt; returns a random floating-point number drawn from a normal distribution of mean mu and standard deviation sigma.   Essentially, it produces the same result as Matlab's randn function.&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-family:courier new;"&gt;BoxMuller.randn&lt;/span&gt; method is used in the &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/MCL.java"&gt;MCL.java&lt;/a&gt; class to add noise to a newly chosen particle in the &lt;span style="font-family:courier new;"&gt;chooseNewPoseSet&lt;/span&gt; method.  I have corrected this method so that it now refers to the &lt;span style="font-family:courier new;"&gt;randn&lt;/span&gt; method.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-5156096871798990655?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/5156096871798990655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=5156096871798990655' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/5156096871798990655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/5156096871798990655'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/added-new-boxmullerjava-class.html' title='Added new BoxMuller.java Class'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-1363642469981071601</id><published>2009-01-11T14:55:00.010-05:00</published><updated>2009-01-11T19:16:09.344-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Box-Muller algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='uniform distribution'/><category scheme='http://www.blogger.com/atom/ns#' term='normal distribution'/><title type='text'>The Box-Muller Algorithm</title><content type='html'>Many thanks to &lt;a href="http://www.itee.uq.edu.au/%7Ewyeth/NXT/"&gt;Professior &lt;span style="font-size:100%;"&gt;Gordon Wyeth&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; at the &lt;a href="http://www.uq.edu.au/"&gt;University of Queensland&lt;/a&gt; and his &lt;a href="http://www.itee.uq.edu.au/%7Ewyeth/NXT/nxt_particles.c"&gt;MCL code&lt;/a&gt;.  I am grateful to him for bringing the Box-Muller algorithm to my attention.  It is a way of generating &lt;span style="font-style: italic;"&gt;normally&lt;/span&gt; distributed random variables  with mean zero and standard deviation one, given a set of &lt;span style="font-style: italic;"&gt;uniformly&lt;/span&gt; generated random variables in the range 0 to 1.  This algorithm is important when adding Gaussian noise to a process in the MCL algorithm.  Unfortunately, Java's Math class has no method to generate random numbers from a normal distribution.  However, Java does have a uniform random number generator function, which can be used to generate a normal distribution by applying the Box-Muller algorithm.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;You can download &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/Muller.java"&gt;my code&lt;/a&gt; to test this algorithm.  Here is a frequency histogram of the data that I generated from my program:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Soam3WFaJtw/SWpWvrULxmI/AAAAAAAAAHo/aycyXXVwyAs/s1600-h/boxMuller.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_Soam3WFaJtw/SWpWvrULxmI/AAAAAAAAAHo/aycyXXVwyAs/s400/boxMuller.jpg" alt="" id="BLOGGER_PHOTO_ID_5290136089381291618" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This frequency distribution has a mean of 0.0036 and a standard deviation of 1.0008.  Of course, your own results will be different, but the mean and standard deviation should come close to 0 and 1, respectively.&lt;br /&gt;&lt;br /&gt;The best explanation of why the Box-Muller algorithm works as it does is in this &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/GaussianSampling.pdf"&gt;document&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-1363642469981071601?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/1363642469981071601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=1363642469981071601' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1363642469981071601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1363642469981071601'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/box-muller-algorithm.html' title='The Box-Muller Algorithm'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Soam3WFaJtw/SWpWvrULxmI/AAAAAAAAAHo/aycyXXVwyAs/s72-c/boxMuller.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-1134508921026505475</id><published>2009-01-11T10:28:00.004-05:00</published><updated>2009-01-11T10:41:53.217-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='probability distrition'/><category scheme='http://www.blogger.com/atom/ns#' term='approximation'/><title type='text'>Trying to Find a Java Graphics Package</title><content type='html'>&lt;span class="postbody"&gt;In my &lt;a href="http://lejosnxt.blogspot.com/2009/01/beta-version-of-mcl-released.html"&gt;Monte Carlo Localization project&lt;/a&gt;, it would be ideal if I could draw 2D histograms on the Graphics User Interface of the particles, which represent an approximation of the probability distribution function of the location of the robot. At present, I have a 2D plot of the position of the particles.&lt;br /&gt;&lt;br /&gt;Because drawing 3D graphs is a bit beyond the scope of my project, I really don't want to implement this functionality from scratch. Does anyone know of any pre-built java code that supports this kind of display?&lt;br /&gt;&lt;br /&gt;I have tried google, but there seems to be many choices. I'm looking for a specific recommendation please of one that works better than the others.   If you should have a recommendation, please send it to &lt;a href="mailto:adcaine@gmail.com"&gt;adcaine@gmail.com&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Thank you.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-1134508921026505475?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/1134508921026505475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=1134508921026505475' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1134508921026505475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1134508921026505475'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/trying-to-find-java-graphics-package.html' title='Trying to Find a Java Graphics Package'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-2554605484484545092</id><published>2009-01-10T13:08:00.003-05:00</published><updated>2009-01-10T13:12:39.867-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Monte Carlo Localization'/><category scheme='http://www.blogger.com/atom/ns#' term='robot'/><category scheme='http://www.blogger.com/atom/ns#' term='beta testing'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='nxt'/><title type='text'>Test my New Program</title><content type='html'>Over the next few days, I'm going to be testing my new &lt;a href="http://lejosnxt.blogspot.com/2009/01/beta-version-of-mcl-released.html"&gt;Monte Carlo Localization (MCL) &lt;/a&gt;application on different kinds of enclosures  I want to see if the algorithm can handle different situations, localizing the robot correctly within the enclosure.  Once I have some results, I will share them with you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-2554605484484545092?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/2554605484484545092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=2554605484484545092' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/2554605484484545092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/2554605484484545092'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/test-my-new-program.html' title='Test my New Program'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-1315069978789182831</id><published>2009-01-09T10:41:00.005-05:00</published><updated>2009-01-09T10:54:06.818-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='weighting function'/><category scheme='http://www.blogger.com/atom/ns#' term='pose'/><category scheme='http://www.blogger.com/atom/ns#' term='distance computation'/><category scheme='http://www.blogger.com/atom/ns#' term='weighting'/><category scheme='http://www.blogger.com/atom/ns#' term='MCL'/><title type='text'>Finding a Pose's Distance to a Boundary</title><content type='html'>In the particle localization algorithm, it is crucial for each particle to know its distance to the closest boundary.  That distance is compared to the distance measured by the ultrasonic sensor on the robot.  If the difference in distances is small, the particle is given a high weight.  The particle is seen as a potentially good approximation of the robot's true pose.&lt;br /&gt;&lt;br /&gt;On the other hand, if the difference between the particle's computed distance and the distance recorded by the sensor is great, the particle is given a low weight.  The particle is seen as being a poor approximation of the robot's true pose.&lt;br /&gt;&lt;br /&gt;In this &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/boundary.pdf"&gt;document&lt;/a&gt;, I give the details of how the algorithm in the &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/MCL.java"&gt;MCL.java&lt;/a&gt; class computes the particle distances.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-1315069978789182831?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/1315069978789182831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=1315069978789182831' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1315069978789182831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1315069978789182831'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/finding-poses-distance-to-boundary.html' title='Finding a Pose&apos;s Distance to a Boundary'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-1980004367367801680</id><published>2009-01-08T21:08:00.013-05:00</published><updated>2009-01-09T09:46:47.945-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MCL'/><title type='text'>Beta Version of the MCL Released</title><content type='html'>Here is the Beta Version of the Monte Carlo Localization project that I have been working on.  You can find all of the source code in the table at the end of this post.  Here is an example of the output one gets.  Further testing is needed in more complicated maps.  If you should find any bugs, I will sincerely appreciate it if you report any bugs to &lt;a href="mailto:adcaine@cs.uwaterloo.ca"&gt;adcaine@gmail.com&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Soam3WFaJtw/SWdjM3UfqzI/AAAAAAAAAHc/Zq-_DrqgA7U/s1600-h/betaScreen.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 260px;" src="http://4.bp.blogspot.com/_Soam3WFaJtw/SWdjM3UfqzI/AAAAAAAAAHc/Zq-_DrqgA7U/s400/betaScreen.JPG" alt="" id="BLOGGER_PHOTO_ID_5289305360029428530" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;span style="font-weight: bold;"&gt;NXT Program&lt;/span&gt; &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/Robot.java"&gt;Robot.java&lt;/a&gt;&lt;br /&gt;This is the program that should be uploaded onto the brick&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;span style="font-weight: bold;"&gt;Ordinary Java Classes&lt;/span&gt; &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/Tester.java"&gt;Tester.java&lt;/a&gt;&lt;br /&gt;Run this class to initiate the GUI&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/Localization.java"&gt;Localization.java&lt;/a&gt;&lt;br /&gt;This class is reponsible for putting the main window on the screen.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/BTCommPC.java"&gt;BTCommPC.java&lt;/a&gt;&lt;br /&gt;Responsible for maintaining communication between the PC and the NXT&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/CommandPanel.java"&gt;CommandPanel.java&lt;/a&gt;&lt;br /&gt;Defines the command panel portion of the GUI.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/ConnectPanel.java"&gt;ConnectPanel.java&lt;/a&gt;&lt;br /&gt;Defines the connection panel portion of the GUI.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/DisplayPanel.java"&gt;DisplayPanel.java&lt;/a&gt;&lt;br /&gt;Defines the display panel portion of the GUI.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/EventHandler.java"&gt;EventHandler.java&lt;/a&gt;&lt;br /&gt;Handles all action events fired by the GUI's panels.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/Gaussian.java"&gt;Gaussian.java&lt;/a&gt;&lt;br /&gt;Defines a Gaussian function used in particle weighting.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/Line.java"&gt;Line.java&lt;/a&gt;&lt;br /&gt;Defines a line, used for boundaries in the map.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/MCL.java"&gt;MCL.java&lt;/a&gt;&lt;br /&gt;Defines the routines used in the Monte Carlo Localization&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/Point.java"&gt;Point.java&lt;/a&gt;&lt;br /&gt;Defines a point as used in the map, lines, and poses.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/Pose.java"&gt;Pose.java&lt;/a&gt;&lt;br /&gt;Defines a pose as used in the particle set&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/Statistics.java"&gt;Statistics.java&lt;/a&gt;&lt;br /&gt;Defines the statistics panel of the GUI.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-1980004367367801680?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/1980004367367801680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=1980004367367801680' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1980004367367801680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/1980004367367801680'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/beta-version-of-mcl-released.html' title='Beta Version of the MCL Released'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Soam3WFaJtw/SWdjM3UfqzI/AAAAAAAAAHc/Zq-_DrqgA7U/s72-c/betaScreen.JPG' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-122767918669729047</id><published>2009-01-07T21:45:00.002-05:00</published><updated>2009-01-07T21:48:48.875-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Wii'/><category scheme='http://www.blogger.com/atom/ns#' term='robotic arm'/><category scheme='http://www.blogger.com/atom/ns#' term='remote control'/><title type='text'>A Wii Controlled Robot Arm</title><content type='html'>Credit for this project goes to LaFabrick Flash Platform Fan Club Member:&lt;br /&gt;&lt;br /&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/wJuNVgshSDI&amp;amp;hl=en&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/wJuNVgshSDI&amp;amp;hl=en&amp;amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-122767918669729047?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/122767918669729047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=122767918669729047' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/122767918669729047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/122767918669729047'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/wii-controll-robot-arm.html' title='A Wii Controlled Robot Arm'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-5079974173010035468</id><published>2009-01-06T16:17:00.008-05:00</published><updated>2009-01-06T23:16:48.907-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='implements'/><category scheme='http://www.blogger.com/atom/ns#' term='interfaces'/><title type='text'>How to Change a Class without Recoding It</title><content type='html'>When I was an undergrad studying Java programming, I found the explanation of interfaces to be rather unsatisfying.  The instructor’s explanation would often begin like this:&lt;br /&gt;&lt;br /&gt;Suppose we have a Java interface defined as&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package abstraction;&lt;br /&gt;&lt;br /&gt;public interface Formula {&lt;br /&gt; &lt;br /&gt; public float getResultOfFormula(float x);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Therefore, any class that implements the interface called Formula must provide the method body for getResultOfFormula.  It must take a floating point number as a parameter and return a floating point number.  An implementing class might take the form:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package abstraction;&lt;br /&gt;&lt;br /&gt;public class ImplementedFormula implements Formula {&lt;br /&gt;&lt;br /&gt; public float getResultOfFormula(float x) {&lt;br /&gt;  return (float)Math.exp(x);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In this implementation, the method returns the exponential of x.  Well, so what?  It seems that we have accomplished so very little.&lt;br /&gt;&lt;br /&gt;To understand how this idea might be very powerful, let’s consider a concrete example.  Let’s suppose that we want to create a class called Computational.  It has a method called getValue(float x).  By default, the method returns 2*x.   However, we also want the user to be able to define the formula without having to rewrite the Computational class.  Here is how it is done:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package abstraction;&lt;br /&gt;&lt;br /&gt;public class Computational {&lt;br /&gt; &lt;br /&gt; private abstraction.Formula userDefinedFormula = null;&lt;br /&gt; &lt;br /&gt; public void defineFormula(abstraction.Formula f){&lt;br /&gt;  userDefinedFormula = f;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public float getValue(float y){&lt;br /&gt;  if(userDefinedFormula == null){&lt;br /&gt;   return 2*y;&lt;br /&gt;  }else{&lt;br /&gt;   return userDefinedFormula.getResultOfFormula(y);&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In the first line, we provide for a variable of the type Formula and initially set it to null.  While it is true that interfaces cannot be instantiated, classes that implement interfaces can certainly be instantiated.   So, an instantiation of the class ImplementedFormula is of the type Formula.&lt;br /&gt;&lt;br /&gt;Indeed, the method defineFormula(Formula f) allows the user to pass a class that has implemented the Formula interface, and the userDefinedFormula variable is set to the parameter.&lt;br /&gt;&lt;br /&gt;The method getValue(float y) has an if-statement to check the nullity of the variable userDefinedFormula.  If it is null, then the user has not defined the formula and the default of 2*y is used.  Otherwise, the method returns the user’s definition.  The class called Computational is guaranteed that the method getResultsOfFormula(float y) exists because it must have implemented the Formula interface.&lt;br /&gt;&lt;br /&gt;To see how the Computational class might be used in practice, consider this code:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package abstraction;&lt;br /&gt;&lt;br /&gt;public class WorkingClass {&lt;br /&gt;&lt;br /&gt; public void runThisClass(){&lt;br /&gt;  Computational comp = new Computational();&lt;br /&gt;  comp.defineFormula(new ImplementedFormula());&lt;br /&gt;  System.out.println(comp.getValue(30.0f));&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;  WorkingClass wc = new WorkingClass();&lt;br /&gt;  wc.runThisClass();&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If this class is run, the output will be 1.06864742E13, which is the exponential of 30.  However, if the second line in the runThisClass() method is commented out so that the formula is not user-defined, the output is 60, 2*30.  The Computational class has used the default formula of 2*x.&lt;br /&gt;&lt;br /&gt;The Computational class could be enhanced by adding another method called removeFormula() such as:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; public void removeFormula(){&lt;br /&gt;  userDefinedFormula = null;&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;By resetting the variable userDefinedFormula back to null, the method getValue() will use the default.&lt;br /&gt;&lt;br /&gt;Finally, the user is not restricted to a single implementation of the Formula interface.  Indeed, the user might implement it several times, with the user re-defining the getValue(float x) as the user wishes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-5079974173010035468?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/5079974173010035468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=5079974173010035468' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/5079974173010035468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/5079974173010035468'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/when-i-was-undergrad-studying-java.html' title='How to Change a Class without Recoding It'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-4932600220652015430</id><published>2009-01-05T12:40:00.003-05:00</published><updated>2009-01-05T12:51:08.378-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='robot'/><category scheme='http://www.blogger.com/atom/ns#' term='MCL'/><category scheme='http://www.blogger.com/atom/ns#' term='ultrasonic sensor'/><category scheme='http://www.blogger.com/atom/ns#' term='sensor'/><category scheme='http://www.blogger.com/atom/ns#' term='GUI'/><category scheme='http://www.blogger.com/atom/ns#' term='graphical user interface'/><title type='text'>The GUI is Implemented</title><content type='html'>The GUI for the Monte Carlo localization is largely implemented.  The directory for the files can be found &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/"&gt;here&lt;/a&gt;.  The most recently updated files are CommandPanel.java, EventHandler.java, Statistics.java, FileDump.java, ConnectPanel.java, and Localization.java.&lt;br /&gt;&lt;br /&gt;I have also added a new class called Robot.java.  This class is meant to be run on the NXT brick.  Consequently, it should be placed in a separate project, with the project being turned into a Lejos project.  I assume here that you are using Eclipse.  Link and upload Robot.java to your brick.&lt;br /&gt;&lt;br /&gt;To establish the Bluetooth connection, first run Robot.java on the brick.  You should hear two beeps, which indicates that the brick is waiting for a Bluetooth connection from the PC.&lt;br /&gt;&lt;br /&gt;Next, start Tester.java running.  The GUI should open.  Recall that the Bluetooth field has been primed with the Bluetooth address of my brick.  Your Bluetooth address will be different, and you should enter your brick’s Bluetooth address in the field.  Now, press the connect button.&lt;br /&gt;&lt;br /&gt;Once the Bluetooth connection is established, you should hear the robot chime, which indicates that it is connected.  On the GUI, the connect button should turn red and read disconnect.  The status field should read connected.  All of the buttons on the GUI should become active.&lt;br /&gt;&lt;br /&gt;You can make the robot turn and move using the appropriate buttons and by supplying an angle in degrees or a distance in millimeters, as the case may be.  You can request the battery voltage, or manually ping the ultrasonic sensor.  After every turn or move, the latest ultrasonic sensor readings should appear on the GUI.&lt;br /&gt;&lt;br /&gt;You can dump the statistics of the MCL algorithm into a csv file.  However, please note that the file path and file names are hard coded in the Event Handler class.  I welcome suggestions on how to make this more flexible.&lt;br /&gt;&lt;br /&gt;The Robot class assumes 56 mm diameter wheels with a 121 mm wheel base.  The left motor is connected to the C port; the right to the A port.  If your robot’s configuration is different than mine, you will have to change the line of code in the Robot class, which instantiates the Pilot class.  The Robot class also assumes that the ultrasonic sensor is connected to sensor port S1.  Additionally, I assume that the ultrasonic sensor will point directly straight ahead along the robot's line of forward travel.  I welcome suggestions on how to make the configuration of the physical parameters more flexible for the user.&lt;br /&gt;&lt;br /&gt;Because the MCL algorithm is not yet fully implemented, the particles on the display do not appear to change in response to movements or turns of the robot.  This is to be expected.  However, if you do want to see the display change, click on the initialize button to restart the MCL algorithm.&lt;br /&gt;&lt;br /&gt;To disconnect the PC and the robot, click on the disconnect button, and click on the yes button to confirm.  Once the disconnection cycle is complete, the robot should chime.  On the GUI, the disconnect button should now read connect in green lettering, and the status field should now read disconnected.&lt;br /&gt;&lt;br /&gt;To bring the localization program to an end, click on the close button, and then click on the yes button to confirm.&lt;br /&gt;&lt;br /&gt;Happy roboting!&lt;br /&gt;&lt;br /&gt;To submit suggestions or report bugs, please email me at &lt;a href="mailto:adcaine@gmail.com"&gt;adcaine@gmail.com&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Thank you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-4932600220652015430?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/4932600220652015430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=4932600220652015430' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/4932600220652015430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/4932600220652015430'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/gui-is-implemented.html' title='The GUI is Implemented'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-3022807160658008239</id><published>2009-01-04T19:24:00.002-05:00</published><updated>2009-01-04T19:33:26.048-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Monte Carlo Localization'/><category scheme='http://www.blogger.com/atom/ns#' term='lejos'/><category scheme='http://www.blogger.com/atom/ns#' term='bluetooth'/><category scheme='http://www.blogger.com/atom/ns#' term='mindstorms'/><category scheme='http://www.blogger.com/atom/ns#' term='communication protocols'/><category scheme='http://www.blogger.com/atom/ns#' term='nxt'/><title type='text'>The Communication Protocol</title><content type='html'>In communicating with the NXT robot, we want to keep our communication protocol as simple as possible.  Through simplicity, the PC can direct more of its attention to the problem of Monte Carlo Localization (MCL), and less of its time on Bluetooth connection.  The PC sends its command in the form of three integers.  The first integer is the command itself, an integer from 0 to 4.  The two integers that follow the command are optional parameters.&lt;br /&gt;&lt;br /&gt;The robot’s reply is always eight integers.  We need eight integers to accommodate the eight echoes that we obtain from the ultrasonic sensor.  &lt;br /&gt;&lt;br /&gt;There are five cases to consider:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Description:  The user requests the battery voltage&lt;br /&gt;Command          0, 0, 0&lt;br /&gt;Reply   millivoltage, 0, 0, 0, 0, 0, 0, 0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Description:  The user asks for the ultrasonic sensor to ping and report back&lt;br /&gt;Command          1,0,0&lt;br /&gt;Reply   A series of 8 integers being the echo values&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Description:  The user requests that the robot move forward/backward&lt;br /&gt;Command          2,distance,speed&lt;br /&gt;Reply     A series of 8 integers being the echo values&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Description  The user requests that the robot turn left/right&lt;br /&gt;Command          3,angle,speed&lt;br /&gt;Reply   A series of 8 integers being the echo values&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Description  The user requests that the Bluetooth connection be terminated&lt;br /&gt;Command          4,0,0&lt;br /&gt;Reply   255,255,255,255,255,255,255,255&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The responsibility for sending the command to the robot and receiving a reply from it is shared between the Event Handler and BTCommPC classes.  Upon detecting that an action event has been fired on the GUI, it is the Event Handler’s responsibility to gather the necessary information, compose the three-integer command and pass a reference to the integer array to the BTCommPC class.  BTCommPC is responsible for sending the command one integer at a time to the robot and await a reply.  Once a reply starts being sent, BTCommPC reads each integer, one at a time, placing them in an eight-integer array.  BTCommPC then passes a reference to the array to the Event Handler.&lt;br /&gt;&lt;br /&gt;Once the Event Handler receives a reference to the reply array, it is handler’s responsibility to disseminate it.  Usually, this involves passing values back to the GUI panels and passing the ultrasonic sensor readings to the MCL class so that the MCL class can update its statistics.  This command/reply process continues until the user requests that the Bluetooth connection be terminated either explicitly by pressing the disconnect button, or implicitly by terminating the program.&lt;br /&gt;&lt;br /&gt;The robot’s program is complementary to BTCommPC’s algorithm.  At first, the robot waits for a Bluetooth connection.  Once a connection is made, it waits to receive its three-integer command.  Once the command is received, the robot moves or turns, if necessary, and then sends back its eight-integer reply one integer at a time.  The robot then waits for its next command.  If the robot is commanded to terminate its Bluetooth connection, the robot sends back its acknowledgement, disconnects, and its program terminates on the brick.&lt;br /&gt;&lt;br /&gt;More implementation to come.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-3022807160658008239?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/3022807160658008239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=3022807160658008239' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/3022807160658008239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/3022807160658008239'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/communication-protocol.html' title='The Communication Protocol'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-7546013079028098273</id><published>2009-01-04T16:46:00.010-05:00</published><updated>2009-01-04T18:28:40.451-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lego'/><category scheme='http://www.blogger.com/atom/ns#' term='Monte Carlo Localization'/><category scheme='http://www.blogger.com/atom/ns#' term='MCL'/><category scheme='http://www.blogger.com/atom/ns#' term='graphical user interface'/><title type='text'>Putting it all Together:  A working GUI</title><content type='html'>In this blog, I will explain &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/DisplayPanel.java"&gt;DisplayPanel.java&lt;/a&gt; and then put everything together to make up the final GUI.&lt;br /&gt;&lt;br /&gt;To understand and run the Display Panel, you must download &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/Point.java"&gt;Point.java&lt;/a&gt;, &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/Line.java"&gt;Line.java&lt;/a&gt;, and &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/Pose.java"&gt;Pose.java&lt;/a&gt;.  A point is a location in two-dimensional space; the class is the aggregate of two double precision numbers.  In our implementation, a line is defined in terms of two points:  a starting point and an ending point.  A pose is a particular guess at the location and heading of the robot.  It is defined in terms of heading, a point, and three other variables.  Those three other variables are the pose’s distance, the shortest distance to the nearest boundary of the enclosure; its weight, the extent to which we believe that the pose is a correct estimate of the robot’s true heading and position; and finally its cumulative weight, the sum of the weights of all of the poses before it and itself.&lt;br /&gt;&lt;br /&gt;The display panel looks like this&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Soam3WFaJtw/SWEvEGr225I/AAAAAAAAAGc/lGFqmpMad_M/s1600-h/displayPanel.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 400px;" src="http://2.bp.blogspot.com/_Soam3WFaJtw/SWEvEGr225I/AAAAAAAAAGc/lGFqmpMad_M/s400/displayPanel.JPG" alt="" id="BLOGGER_PHOTO_ID_5287559185070218130" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Admittedly, it’s not very impressive.  No pose or boundary line information has been given to it to display.  So, the panel simply shows its white background.  Once pose and boundary information is given to the display panel, it will show the poses as red dots, and the boundaries and black lines.&lt;br /&gt;&lt;br /&gt;Still, we’re now in a position to start putting everything together to get a GUI that looks like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Soam3WFaJtw/SWEv2DqCe0I/AAAAAAAAAGk/oUL1z9Gv__A/s1600-h/GUI.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 260px;" src="http://2.bp.blogspot.com/_Soam3WFaJtw/SWEv2DqCe0I/AAAAAAAAAGk/oUL1z9Gv__A/s400/GUI.JPG" alt="" id="BLOGGER_PHOTO_ID_5287560043250744130" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The directory to the source code is &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/"&gt;here&lt;/a&gt;.  To get the GUI running, execute it from Tester.java.&lt;br /&gt;&lt;br /&gt;I have implemented the Connect button.  Remember to substitute your own Bluetooth address for your own NXT in the Bluetooth address field of the GUI.  Turn on your NXT.  Click on the Connect button.  You should be connected.  The disconnect aspect of the button has not yet been implemented.  However, you can achieve a disconnection by pressing on the enter and escape keys of your NXT to reset it.  The Bluetooth connection will be lost.&lt;br /&gt;&lt;br /&gt;The Localization class is the class responsible for assembling the GUI.  It instantiates the panels and, using absolute positioning, places them on the content pane.  Because we are using absolute positioning, we make the GUI non-resizable.  If we left the GUI resizable, a resizing on the part of the user could cause panels to become hidden from the user.&lt;br /&gt;&lt;br /&gt;The Localization class also instantiates the Event Handler, passing a reference to it to all of the panels.  The implementation of the Bluetooth connection routine can be found in the Event Handler class.&lt;br /&gt;&lt;br /&gt;As well, the Localization class instantiates the BTCommPC class.  This class is responsible for opening the Bluetooth connection between the PC and the robot, closing the connection, and negotiating communication between the two.  As soon as the Event Handler detects that a connect action event has been fired, the Event Handler calls BTCommPC’s open method to take the necessary steps to open the Bluetooth connection, if it can.&lt;br /&gt;&lt;br /&gt;Because problems can arise in establishing a Bluetooth connection, exceptions can be thrown.  When these exceptions are thrown, we want to put error messages up on the GUI, such as&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Soam3WFaJtw/SWExOsbP43I/AAAAAAAAAGs/lsISpO1gyzY/s1600-h/exception.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 271px; height: 125px;" src="http://1.bp.blogspot.com/_Soam3WFaJtw/SWExOsbP43I/AAAAAAAAAGs/lsISpO1gyzY/s400/exception.JPG" alt="" id="BLOGGER_PHOTO_ID_5287561566023050098" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;To do this, we use the JOptionPane’s static showMessageDialog() method.  However, that method requires that it know in which JFrame to draw the dialog box.  Consequently, the Localization class passes a reference to itself when it instantiates the BTCommPC class.&lt;br /&gt;&lt;br /&gt;Finally, the Localization class is responsible for listening to the user clicking on the close window button in the upper right-hand corner, because the close button is regarded as part of the JFrame and not as part of any of the JPanels.  Before terminating the program, the Localization class puts put a confirmation window on the screen.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Soam3WFaJtw/SWExrA9Kw7I/AAAAAAAAAG0/U91xOEmrqPo/s1600-h/confirmation.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 271px; height: 125px;" src="http://2.bp.blogspot.com/_Soam3WFaJtw/SWExrA9Kw7I/AAAAAAAAAG0/U91xOEmrqPo/s400/confirmation.JPG" alt="" id="BLOGGER_PHOTO_ID_5287562052570366898" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;If the user clicks on the yes button, the Localization class attempts to programmatically click the disconnect button if it currently appears on the GUI.  Only when the Bluetooth connection is closed does the program finally terminate.&lt;br /&gt;&lt;br /&gt;If you should have any questions, please write to me at &lt;a href="mailto:adcaine@gmail.com"&gt;adcaine@gmail.com&lt;/a&gt;.  See you next time when I will show you additional implementations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-7546013079028098273?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/7546013079028098273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=7546013079028098273' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/7546013079028098273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/7546013079028098273'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/putting-it-all-together-working-gui.html' title='Putting it all Together:  A working GUI'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Soam3WFaJtw/SWEvEGr225I/AAAAAAAAAGc/lGFqmpMad_M/s72-c/displayPanel.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-6312071988668869123</id><published>2009-01-04T12:57:00.011-05:00</published><updated>2009-01-04T13:36:28.569-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Monte Carlo Localization'/><category scheme='http://www.blogger.com/atom/ns#' term='bluetooth'/><category scheme='http://www.blogger.com/atom/ns#' term='mindstorms'/><category scheme='http://www.blogger.com/atom/ns#' term='nxt lejos'/><category scheme='http://www.blogger.com/atom/ns#' term='MCL'/><category scheme='http://www.blogger.com/atom/ns#' term='JPanel'/><title type='text'>Connection, Command, and File Dump Panels</title><content type='html'>This blog entry is the continuation of my discussion of my project to demonstrate the idea behind Monte Carlo Localization (MCL) for robots using the NXT Mindstorms robot.  The PC will run the MCL algorithm with the robot acting essentially like a mobile sensor platform.  The PC and robot will communicate with each other over a Bluetooth connection. Here, I am going to discuss the connection panel, the command panel, and the file dump panel.&lt;br /&gt;&lt;br /&gt;We want the Connection Panel to look like this&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Soam3WFaJtw/SWD5Ax4wM8I/AAAAAAAAAGE/IfJX6i1fOOA/s1600-h/connectPanel.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 225px;" src="http://2.bp.blogspot.com/_Soam3WFaJtw/SWD5Ax4wM8I/AAAAAAAAAGE/IfJX6i1fOOA/s400/connectPanel.JPG" alt="" id="BLOGGER_PHOTO_ID_5287499754319655874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The single button at the top will act as both the connect and the disconnect button.  The text on the button will alternate between the words connect, printed in green, and disconnect, printed in red.  The status field, which cannot be edited by the user, will read either disconnected when the PC is not connected to the NXT robot, or connected when a Bluetooth connection has been established between the PC and the robot.&lt;br /&gt;&lt;br /&gt;The only method that might need some explanation is this one:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public void clickConnectButton(){&lt;br /&gt; if(connectButton.getText().equals("Disconnect")){&lt;br /&gt;  connectButton.doClick();&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This method is needed in case the user attempts to terminate the program before the robot is disconnected from the PC.  If this should happen, we need a way to programmatically click the disconnect button before the program terminates.  The &lt;span style="font-family:courier new;"&gt;doClick() &lt;/span&gt;method of the &lt;span style="font-family:courier new;"&gt;connectButton&lt;/span&gt; component does just exactly that.&lt;br /&gt;&lt;br /&gt;I have primed the Bluetooth address field with my own NXT's Bluetooth address for the sake of personal convenience.  You can change this by either commenting out or amending the following line of code.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  addressField.setText("00:16:53:00:57:37");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You can download ConnectPanel.java &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/ConnectPanel.java"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Another panel that we need is the Command panel.  We want it to look like this&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Soam3WFaJtw/SWD5l69QfzI/AAAAAAAAAGM/kg0EASBGakE/s1600-h/commandPanel.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 225px;" src="http://2.bp.blogspot.com/_Soam3WFaJtw/SWD5l69QfzI/AAAAAAAAAGM/kg0EASBGakE/s400/commandPanel.JPG" alt="" id="BLOGGER_PHOTO_ID_5287500392409628466" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;It has three buttons:  initialize, move, and turn.  The initialize button is used to re-start the MCL algorithm from scratch.  The move button is used the move the robot a specified number of millimeters forward, if the distance is positive; backwards if the distance is negative.  The turn button is used to turn the robot in place a specified number of degrees to the right, if the angle is negative; to the left if the angle is positive.  The speed slider is used to adjust the robot’s speed.&lt;br /&gt;&lt;br /&gt;We should emphasize that we are not trying to develop a remote control robot.  Rather, the robot moves or turns in distinct stages.  After each move or turn, students can observe how that move or turn has impacted the MCL algorithm.  I am hoping that in this way students can learn how the MCL algorithm works through experimentation and feedback.&lt;br /&gt;&lt;br /&gt;The following method may need some additional explanation:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public void setButtonsEnabled(boolean setting){&lt;br /&gt; initialize.setEnabled(setting);&lt;br /&gt; move.setEnabled(setting);&lt;br /&gt; turn.setEnabled(setting);&lt;br /&gt; speedSlider.setEnabled(setting);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;A similar method also appears in the Statistics panel.  This method is used to enable or disable the input components.  The components are disabled whenever there is no connection between the PC and the robot; enabled whenever there is a connection between the PC and the robot.  You can download CommandPanel.java &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/CommandPanel.java"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Another panel that we need is called the File Dump panel.  We want the panel to look like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Soam3WFaJtw/SWD5zppcZfI/AAAAAAAAAGU/5DuPTx1RUFs/s1600-h/fileDumpPanel.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 225px;" src="http://1.bp.blogspot.com/_Soam3WFaJtw/SWD5zppcZfI/AAAAAAAAAGU/5DuPTx1RUFs/s400/fileDumpPanel.JPG" alt="" id="BLOGGER_PHOTO_ID_5287500628281288178" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;When the user clicks on the File Dump button, all of the statistics currently held by the MCL algorithm are written to a comma-separated value (csv) file using the index number on the spinner as part of the file’s file name.  The spinner is automatically incremented to the next integer to avoid an accidental file overwrite.  If the auto dump box is checked by the user, then the statistics are written to a csv file automatically after every move or turn of the robot.  The spinner is automatically incremented to prevent an accidental file overwrite.&lt;br /&gt;&lt;br /&gt;The purpose of the file dump panel is to allow the user to study the MCL algorithm's statistical data in another application such as Matlab or Excel to name two examples.&lt;br /&gt;&lt;br /&gt;The File Dump button is always enabled, because there is always statistics to be written out to a file, even when the program is first initialized.  You can download FileDump.java &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/FileDump.java"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The last panel that we will need is the Display Panel.  I want to defer discussion of that panel until the next time I blog, because that panel touches very closely upon the MCL algorithm.  While the class itself is not complicated as far as Java code goes, some of the things that the panel is doing might be unclear and require some explanation.   If you should have any questions, please contact me at &lt;a href="mailto:adcaine@gmail.com"&gt;adcaine@gmail.com&lt;/a&gt;.  See you next time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-6312071988668869123?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/6312071988668869123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=6312071988668869123' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/6312071988668869123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/6312071988668869123'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/connection-command-and-file-dump-panels.html' title='Connection, Command, and File Dump Panels'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Soam3WFaJtw/SWD5Ax4wM8I/AAAAAAAAAGE/IfJX6i1fOOA/s72-c/connectPanel.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-383830924263683085</id><published>2009-01-03T20:27:00.014-05:00</published><updated>2009-10-07T17:17:55.254-04:00</updated><title type='text'>Monte Carlo Localization of Robots</title><content type='html'>In this and future blog entries, I want to discuss my current project with the NXT.  I want to develop a program, written in Java, which demonstrates the concept of Monte Carlo robot localization (MCL).  For now, I’ll defer any discussion about MCL to another blog entry.  However, for those of you who want to read about MCL now, please read the paper by &lt;a href="http://www.ri.cmu.edu/pub_files/pub1/dellaert_frank_1999_2/dellaert_frank_1999_2.pdf"&gt;Dellaert, Fox, Burgard, and Thrun&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The problem with demonstrating MCL to a group of students is that the program cannot be run locally on the NXT brick itself.  True, the students will be able to see my robot moving around, but they will not be able to understand how the MCL program works.&lt;br /&gt;&lt;br /&gt;In my project, the MCL algorithm will be implemented on a PC, which has Bluetooth capability.  Using Bluetooth, the PC will send commands to the robot.  In response to these commands, the robot, which also has Bluetooth capability, will perform the action -- such as move forward, move backward, turn left, turn right -- and then send back to the PC the reading from the robot’s only sensor, the ultrasonic sensor.&lt;br /&gt;&lt;br /&gt;Using the reading from the ultrasonic sensor together with a map of the walls of the enclosure in which the robot is found, the PC will try to localize the robot; i.e. determine its position within the enclosure.&lt;br /&gt;&lt;br /&gt;The most challenging part of the project is actually the development of the graphical user interface (GUI).  We cannot be content to use the RConsole class as mentioned in my &lt;a href="http://lejosnxt.blogspot.com/2009/01/powerful-rconsole-class.html"&gt;January 1st blog entry&lt;/a&gt;.  RConsole is too primitive.  What we want and need is a professional and attractive display of the current state of the MCL algorithm.&lt;br /&gt;&lt;br /&gt;In Java, the main window is called a JFrame.  Every JFrame consists of a number of JPanels.  Every JPanel consists of a number of Components.  Components are such things as buttons, labels, text boxes, sliders, spinners, progress bars, radio buttons, check boxes and other such widgets commonly found on GUIs.&lt;br /&gt;&lt;br /&gt;The idea behind this project is that we will define a series of JPanels.  Another class, to be defined later, will instantiate each of these JPanels and arrange them in a JFrame, which will act as our project’s GUI.&lt;br /&gt;&lt;br /&gt;For our GUI, we’re going to need four panels:  a connection panel for handling the Bluetooth connection; a command panel for issuing commands to the robot; a statistics panel for collecting and displaying sensor readings from the robot; and a display panel for displaying the current state of the MCL algorithm.  In this blog entry, we’ll focus on the statistics panel.&lt;br /&gt;&lt;br /&gt;Before coding the statistics panel, we must consider that every panel can fire what Java calls action events.  These action events fire, usually, in response to clicks on buttons, moving a slider, or changing the value of a spinner to name a few examples.  We need a mechanism to capture these action events and respond appropriately to them.  If we do not listen for these action events, our GUI will be unresponsive and useless to the user.&lt;br /&gt;&lt;br /&gt;Unlike my &lt;a href="http://lejosnxt.blogspot.com/2009/01/efficient-programs-and-button-listeners.html"&gt;blog entry of January 2nd&lt;/a&gt;, we do not want each panel to handle its own events through the use of the code &lt;span style="font-family: courier new;"&gt;addActionListener(this);&lt;/span&gt;.  Otherwise, our action event handling code will be spread over several classes making our code very difficult to maintain.  Instead, we want a single class to centrally handle all of the action events for all of the panels.  The event handler class is:&lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;&lt;b&gt;package local;&lt;br /&gt;&lt;br /&gt;import java.awt.event.*;&lt;br /&gt;&lt;br /&gt;public class EventHandler implements ActionListener {&lt;br /&gt;&lt;br /&gt;public void actionPerformed(ActionEvent e){&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/b&gt;&lt;/pre&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;For now, the actionPerformed method has an empty implementation, which we will fill in as we need to code up the steps the EventHandler should take in response to the various action events sent to it by the various panels.  Whenever an action event is fired, the actionPerformed method will be called to handle the action event.&lt;br /&gt;&lt;br /&gt;However, each panel will need a reference to the EventHandler as instantiated by the class responsible for assembling the JFrame together.  This is accomplished by defining each panel’s constructor as&lt;span style="font-family: courier new;"&gt; public panelName(EventHandler eventH){&lt;span style="font-style: italic;"&gt;code&lt;/span&gt;}&lt;/span&gt;.  In other words, for a panel to be instantiated, the panel must be passed a reference to the EventHandler.  The class responsible for assembling the JFrame would do something like this:&lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;&lt;b&gt;EventHandler eventHndl = new EventHandler();&lt;br /&gt;Statistics statsPanel = new Statistics(eventHndl);&lt;br /&gt;&lt;/b&gt;&lt;/pre&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;We want the statistics panel to show the battery voltage and the ultrasonic sensor readings as vertical progress bars.  We want the first echo from the ultrasonic sensor to appear in a textbox as a numerical value.  We want two buttons:  one button to call for the battery voltage and a second button to manually cause the ultrasonic sensor to be pinged and the result displayed on the GUI.  The panel should look like this:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_Soam3WFaJtw/SWASvEvYFqI/AAAAAAAAAF8/zTx6HLIpxwo/s1600-h/statisticsPanel.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5287246562468566690" src="http://3.bp.blogspot.com/_Soam3WFaJtw/SWASvEvYFqI/AAAAAAAAAF8/zTx6HLIpxwo/s400/statisticsPanel.JPG" style="cursor: pointer; display: block; height: 290px; margin: 0px auto 10px; text-align: center; width: 249px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The code at the end of this blog entry is meant to be run on your PC.  Consequently you should &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; change your project into a Lejos project.  The main method can be called to display the panel, but it must be borne in mind that this main method is strictly for testing and debugging purposes.  The real main method will appear in another class.  In practice, the main method of the Statistics class will never be run.&lt;br /&gt;&lt;br /&gt;Note that the Statistics class extends JPanel --- not JFrame.  This is important.  Many examples of GUIs given in web tutorials show classes extending JFrame, because these examples typically involve components being added directly to the JFrame.  While this approach is fine in simple applications, it is difficult to use when the GUI becomes complex. So, we are not taking that approach here.  Components are being added to each JPanel, and each JPanel is being added to a single JFrame.&lt;br /&gt;&lt;br /&gt;Finally, the Statistics class owns its components in the sense that its components are private.  The state of components can only be changed by users of the panel through the class’s set methods; the values stored in the components can only be accessed through the class's get methods.  This approach ensures that the correct data types are used when passing data to and from the JPanel.  This approach also prevents the user of the class from changing the state of components that should not be changed; i.e. components like text labels that are purely decorative in nature.&lt;br /&gt;&lt;br /&gt;If you wish to see the panel with the two buttons in the active state, add this line of code to the main method.&lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;&lt;b&gt;statsPanel.setButtonsEnabled(true);&lt;br /&gt;&lt;/b&gt;&lt;/pre&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;The next time I blog, I will discuss the connection panel, the second panel which makes up the four panels of our GUI.  If you have any questions, please do not hesitate to contact &lt;a href="mailto:adcaine@gmail.com"&gt;me&lt;/a&gt;.  The code for the Statistics class can be found &lt;a href="http://www.cs.uwaterloo.ca/%7Eadcaine/MCL/Statistics.java"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-383830924263683085?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/383830924263683085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=383830924263683085' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/383830924263683085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/383830924263683085'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/monte-carlo-localization-of-robots.html' title='Monte Carlo Localization of Robots'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Soam3WFaJtw/SWASvEvYFqI/AAAAAAAAAF8/zTx6HLIpxwo/s72-c/statisticsPanel.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-881988185759804300</id><published>2009-01-02T10:58:00.017-05:00</published><updated>2009-01-02T16:17:41.823-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='button listeners'/><category scheme='http://www.blogger.com/atom/ns#' term='nxt'/><category scheme='http://www.blogger.com/atom/ns#' term='button'/><title type='text'>Efficient Programs and Button Listeners</title><content type='html'>In my blog on &lt;a href="http://lejosnxt.blogspot.com/2009/01/powerful-rconsole-class.html"&gt;January 1st&lt;/a&gt;, I explained how the RConsole class can be used to easily send output from the NXT brick over a Bluetooth connection to your PC.  However, the program has a deficiency.  The escape button must be pressed &lt;span style="font-style: italic;"&gt;and held&lt;/span&gt; for the program to stop.&lt;br /&gt;&lt;br /&gt;True, the while loop is terminated whenever the brick’s escape button is pressed.  But, after reading the raw and processed values of the Electro Optical Proximity Detector (EOPD) and printlning those results to the RConsole, the loop pauses for five seconds.  This pausing means that the escape button’s state is checked approximately once every five seconds at the top of the while loop.&lt;br /&gt;&lt;br /&gt;So, to stop the program, the user has to press and hold down the escape button until the while loop has an opportunity to read the button’s state.  Pressing and releasing the escape button is insufficient.  If the escape button is in the released position when the while loop checks the button’s state, the while loop will execute again even though the button might have been pressed and released when the loop was paused.&lt;br /&gt;&lt;br /&gt;This problem is best solved by using the &lt;a href="http://lejos.sourceforge.net/nxt/nxj/api/lejos/nxt/ButtonListener.html"&gt;ButtonListener&lt;/a&gt; interface.  The interface has two methods: &lt;span style="font-family:courier new;"&gt; buttonPressed(Button b)&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;buttonReleased(Button b)&lt;/span&gt;.   Once a button has been registered with a listener, these methods fire whenever the button is pressed or released, as the case may be.  Furthermore, these methods fire regardless of what other things the program might be currently doing.&lt;br /&gt;&lt;br /&gt;In the new version of the program, given at the end of this blog entry, the while loop is now controlled by a boolean variable, &lt;span style="font-family:courier new;"&gt;keepItRunning&lt;/span&gt;.  The variable is initialized to true.  The program implements the buttonPressed method such that it changes the keepItRunning variable to false.  Although we are not explicitly using the buttonReleased method, we are obliged to implement it because it is part of the &lt;a href="http://lejos.sourceforge.net/nxt/nxj/api/index.html"&gt;ButtonListener&lt;/a&gt; interface.   So, we give the buttonReleased method an empty implementation.&lt;br /&gt;&lt;br /&gt;The program line &lt;span style="font-family:courier new;"&gt;Button.ESCAPE.addButtonListener(this);&lt;/span&gt;  registers the escape button with a listener.  The &lt;span style="font-family:courier new;"&gt;this&lt;/span&gt; keyword indicates that the buttonPressed and buttonReleased methods are implemented in &lt;span style="font-style: italic;"&gt;this&lt;/span&gt; class.  (It is possible for the methods to be in another class; so, the addButtonListener method must know where these methods can be found.)&lt;br /&gt;&lt;br /&gt;To try this new idea out, upload this program, as given below, to your NXT and start it running.  Now, get your &lt;span style="font-family:courier new;"&gt;nxjconsole&lt;/span&gt; running from a command prompt.  The program works in exactly the same way as described in my &lt;a href="http://lejosnxt.blogspot.com/2009/01/powerful-rconsole-class.html"&gt;January 1st&lt;/a&gt; post.  However, if the escape button is pressed and released, the program will end after its five-second pause.  The program ends because the pressing of the escape button fires an event, which in turn calls the buttonPressed method.  That method changes the keepItRunning boolean variable from true to false.  The while loop ends because the while loop will only run as long as keepItRunning is true.&lt;br /&gt;&lt;br /&gt;What follows next is the code for EOPDSensor2:&lt;b&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import lejos.nxt.Button;&lt;br /&gt;import lejos.nxt.LCD;&lt;br /&gt;import lejos.nxt.SensorPort;&lt;br /&gt;import lejos.nxt.comm.*;&lt;br /&gt;import lejos.nxt.addon.*;&lt;br /&gt;import lejos.nxt.*;&lt;br /&gt;&lt;br /&gt;public class EOPDSensor2 implements ButtonListener{&lt;br /&gt;&lt;br /&gt;    private boolean keepItRunning = true;&lt;br /&gt;&lt;br /&gt;    public void buttonPressed(Button b){&lt;br /&gt;       keepItRunning = false;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void buttonReleased(Button b){}&lt;br /&gt;&lt;br /&gt;    public void runProgram(){&lt;br /&gt;&lt;br /&gt;       Button.ESCAPE.addButtonListener(this);&lt;br /&gt;&lt;br /&gt;       RConsole.openBluetooth(40000);&lt;br /&gt;&lt;br /&gt;       LCD.drawString("Connected", 0, 2);&lt;br /&gt;&lt;br /&gt;       EOPD electroSensor = new EOPD(SensorPort.S1);&lt;br /&gt;&lt;br /&gt;       while(keepItRunning){&lt;br /&gt;          electroSensor.setModeLong();&lt;br /&gt;          RConsole.println(Integer.toString(&lt;br /&gt;                          electroSensor.readRawValue()));&lt;br /&gt;          RConsole.println(Integer.toString(&lt;br /&gt;                          electroSensor.processedValue()));&lt;br /&gt;&lt;br /&gt;          try{&lt;br /&gt;          Thread.sleep(5000);&lt;br /&gt;          }catch(InterruptedException e){&lt;br /&gt;             System.exit(0);&lt;br /&gt;          }&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       RConsole.println("Closing...");&lt;br /&gt;&lt;br /&gt;       RConsole.close();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public static void main(String[] args){&lt;br /&gt;      EOPDSensor2 programInstance = new EOPDSensor2();&lt;br /&gt;      programInstance.runProgram();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-881988185759804300?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/881988185759804300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=881988185759804300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/881988185759804300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/881988185759804300'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/efficient-programs-and-button-listeners.html' title='Efficient Programs and Button Listeners'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-9036138811312990742</id><published>2009-01-01T16:21:00.018-05:00</published><updated>2009-01-01T19:21:21.569-05:00</updated><title type='text'>The Powerful RConsole Class</title><content type='html'>The RConsole class is a very useful way of sending output from the nxt brick over a Bluetooth connection to the PC.  Consider the following Java code, which runs on the brick.  The class EOPDSensor reads the raw and processed values of the Electro Optical Proximity Detector (EOPD) available from &lt;a href="http://www.hitechnic.com/"&gt;HiTechnic&lt;/a&gt; and sends those sensor readings back to the console:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;import lejos.nxt.Button;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;import lejos.nxt.LCD;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;import lejos.nxt.SensorPort;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;import lejos.nxt.comm.*;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;import lejos.nxt.addon.*;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;public class EOPDSensor {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; /**&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  * @param args&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  */&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; public static void main(String[] args) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  RConsole.openBluetooth(40000);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  LCD.drawString("Connected", 0, 2);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  EOPD electroSensor = new EOPD(SensorPort.S1);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  while(!Button.ESCAPE.isPressed()){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   electroSensor.setModeLong();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   RConsole.println(Integer.toString(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;                       electroSensor.readRawValue()));&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   RConsole.println(Integer.toString(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;                       electroSensor.processedValue()));&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   try{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    Thread.sleep(5000);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   }catch(InterruptedException e){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    System.exit(0);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  RConsole.println("Closing...");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  RConsole.close();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;The methods of the RConsole class are all static; the methods belong to the class and not to any instance of the class.  So, the RConsole class should not be instantiated with the &lt;span style="font-family:courier new;"&gt;new&lt;/span&gt; keyword.  The methods should be called in the form&lt;span style="font-family:courier new;"&gt; RConsole.&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-family:courier new;"&gt;method(&lt;/span&gt;)&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;In the first line of the main method, RConsole waits 40 seconds (40,000 milliseconds) for the master (i.e the PC) to attempt to open a Bluetooth connection.  Once the connection is established, the second and third lines of the while loop &lt;span style="font-family:courier new;"&gt;println&lt;/span&gt; the raw and processed values of the EOPD sensor, respectively.  If the user presses the brick’s escape button, the tiny square gray button on the brick, the loop ends.  The brick invokes the RConsole's close() method to close the Bluetooth connection.&lt;br /&gt;&lt;br /&gt;To establish the connection in practice, do the following things.  First, get to a command prompt on your PC.  Next, run the Java program on the brick.  Remember that the brick will wait only 40 seconds for the PC to attempt a connection.  So, you must work quickly once the brick's Java program has started running.&lt;br /&gt;&lt;br /&gt;At the PC’s command prompt, enter the command &lt;span style="font-family:courier new;"&gt;nxjconsole&lt;/span&gt;.  Your PC will now go out and try to establish a connection with the brick.  Once the connection is established, output similar to the following should appear.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Soam3WFaJtw/SV03cgWzoSI/AAAAAAAAAEE/OPv0FrWsn5g/s1600-h/RConsole.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 204px;" src="http://1.bp.blogspot.com/_Soam3WFaJtw/SV03cgWzoSI/AAAAAAAAAEE/OPv0FrWsn5g/s400/RConsole.JPG" alt="" id="BLOGGER_PHOTO_ID_5286442500464288034" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To sum it up, the RConsole class is a very quick and easy way of getting output from your brick and onto your PC.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Soam3WFaJtw/SV04VAeTNcI/AAAAAAAAAEU/S25scTMqpsM/s1600-h/TILE_02.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 82px; height: 82px;" src="http://3.bp.blogspot.com/_Soam3WFaJtw/SV04VAeTNcI/AAAAAAAAAEU/S25scTMqpsM/s200/TILE_02.gif" alt="" id="BLOGGER_PHOTO_ID_5286443471158326722" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-9036138811312990742?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/9036138811312990742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=9036138811312990742' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/9036138811312990742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/9036138811312990742'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2009/01/powerful-rconsole-class.html' title='The Powerful RConsole Class'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Soam3WFaJtw/SV03cgWzoSI/AAAAAAAAAEE/OPv0FrWsn5g/s72-c/RConsole.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-7102454227178117906</id><published>2008-12-31T21:55:00.002-05:00</published><updated>2008-12-31T22:20:06.018-05:00</updated><title type='text'>Self-balancing Robots</title><content type='html'>&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/4ulBRQKCwd4&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/4ulBRQKCwd4&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br&gt;&lt;br&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/V40ScvJeFxg&amp;amp;hl=en&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/V40ScvJeFxg&amp;amp;hl=en&amp;amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-7102454227178117906?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/7102454227178117906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=7102454227178117906' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/7102454227178117906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/7102454227178117906'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2008/12/self-balancing-robot.html' title='Self-balancing Robots'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6973548223914394528.post-4543871232746691287</id><published>2008-12-31T17:21:00.000-05:00</published><updated>2008-12-31T19:05:43.751-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lego'/><category scheme='http://www.blogger.com/atom/ns#' term='lejos'/><category scheme='http://www.blogger.com/atom/ns#' term='mindstorms'/><category scheme='http://www.blogger.com/atom/ns#' term='nxt'/><title type='text'>Important Links</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Soam3WFaJtw/SVwIt6gFcyI/AAAAAAAAAAU/E2Poi8B_-wA/s1600-h/LOGO_SENSOR.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 189px; height: 115px;" src="http://3.bp.blogspot.com/_Soam3WFaJtw/SVwIt6gFcyI/AAAAAAAAAAU/E2Poi8B_-wA/s320/LOGO_SENSOR.gif" alt="" id="BLOGGER_PHOTO_ID_5286109647517086498" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Here are some very useful links to get information about programming the NXT in the Java Language:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://lejos.sourceforge.net/"&gt;SourceForge&lt;/a&gt;  From here, you can download the jar files as well as the brick's firmware to get you started programming in Lejos -- Java for the Mindstorms NXT brick&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.bartneck.de/2008/03/04/java-lego-nxt-eclipse-tutorial/#installJava"&gt;Setup Tutorial&lt;/a&gt;  From this website, you can learn how to properly set up your brick with the firmware, and correctly get Eclipse (a Java development environment) working properly&lt;/li&gt;&lt;li&gt;&lt;a href="http://lejos.sourceforge.net/forum/index.php"&gt;Forum&lt;/a&gt;  In this forum, you can communicate with other developers who use Lejos to program the NXT brick&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6973548223914394528-4543871232746691287?l=lejosnxt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lejosnxt.blogspot.com/feeds/4543871232746691287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6973548223914394528&amp;postID=4543871232746691287' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/4543871232746691287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6973548223914394528/posts/default/4543871232746691287'/><link rel='alternate' type='text/html' href='http://lejosnxt.blogspot.com/2008/12/important-links.html' title='Important Links'/><author><name>clemency</name><uri>http://www.blogger.com/profile/01021218685032619049</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwOxkrq86I/AAAAAAAAAAg/gwV-mgJkYG8/S220/October+19+2008+010.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Soam3WFaJtw/SVwIt6gFcyI/AAAAAAAAAAU/E2Poi8B_-wA/s72-c/LOGO_SENSOR.gif' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
