<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fritz-Hut</title>
	<atom:link href="http://www.fritz-hut.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fritz-hut.com</link>
	<description>About Electronics and Informatics</description>
	<lastBuildDate>Sat, 13 Apr 2013 15:26:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Vector Field Histogram (VFH) Player/Stage</title>
		<link>http://www.fritz-hut.com/vector-field-histogram-vfh-playerstage/</link>
		<comments>http://www.fritz-hut.com/vector-field-histogram-vfh-playerstage/#comments</comments>
		<pubDate>Sun, 10 Mar 2013 09:29:23 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[Master Thesis]]></category>
		<category><![CDATA[Player/Stage]]></category>
		<category><![CDATA[VFH]]></category>

		<guid isPermaLink="false">http://www.fritz-hut.com/?p=521</guid>
		<description><![CDATA[<p>It&#8217;s been a long time since I blogged about anything, time to change that. I&#8217;ll force myself (glued to the desk) to write every week about my progress in my Master Thesis. Since I&#8217;m somewhat 6 weeks behind I&#8217;ll cover &#8230; <a href="http://www.fritz-hut.com/vector-field-histogram-vfh-playerstage/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.fritz-hut.com/vector-field-histogram-vfh-playerstage/">Vector Field Histogram (VFH) Player/Stage</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s been a long time since I blogged about anything, time to change that. I&#8217;ll force myself (glued to the desk) to write every week about my progress in my <a title="Master Thesis Subject DASH7" href="http://www.fritz-hut.com/master-thesis-subject-dash7/">Master Thesis</a>. Since I&#8217;m somewhat 6 weeks behind I&#8217;ll cover two blog posts, first one about obstacle avoidance and the <a title="Vector Field Histogram (VFH)" href="http://www.fritz-hut.com/vector-field-histogram-vfh/">VFH algorithm</a> and a second one about localization with a <a title="Monte-Carlo Localization" href="http://www.fritz-hut.com/monte-carlo-localization/">particle filter</a>.</p>
<h1>Avoiding Obstacles</h1>
<p>A small recap of my Master Thesis. I&#8217;m trying to improve the localization of a robot using DASH7 tags. The idea is that I can localize a robot using a laser and a map of the environment but that localization is somewhat inaccurate. Using the DASH7 tags I can tell the robot more about its environment and thus increase the localization.</p>
<p>But before all that can happen the robot first needs to drive around autonomously without hitting any static (closet, chair, table,&#8230;etc) or dynamic objects (humans, cats, dogs,&#8230;etc). This is the first part of my research, we already know that we are going to use the VFH algorithm now an important step is to configure it.</p>
<p>Heading over to the Player/Stage manually I found out that the VFH algorithm is implemented and allows to configure almost every calculation resulting in a staggering <a href="http://playerstage.sourceforge.net/doc/Player-cvs/player/group__driver__vfh.html">25+ different parameters</a>, holy cow.</p>
<h1>Settings up the different tests</h1>
<p>I decided to test two different parts, first the robot should drive to a specific location. When using the VFH algorithm we get a new interface (planner) that allows to send the robot to a specific location relative to its starting position (which is always 0,0).</p>
<p>The first test should drive the robot to a specific location (1,1). The second test will see if the robot can drive sequentially to different coordinates and the robot drives in a square.</p>

<a href='http://www.fritz-hut.com/vector-field-histogram-vfh-playerstage/test1-stage/' title='Test1: Drive to a specific location'><img width="150" height="150" src="http://www.fritz-hut.com/wp-content/uploads/2013/03/test1-stage-150x150.png" class="attachment-thumbnail" alt="Test1: Drive to a specific location" /></a>
<a href='http://www.fritz-hut.com/vector-field-histogram-vfh-playerstage/test2-stage/' title='Test 2: Drive in a Square'><img width="150" height="150" src="http://www.fritz-hut.com/wp-content/uploads/2013/03/test2-stage-150x150.png" class="attachment-thumbnail" alt="Test 2: Drive in a Square" /></a>

<p>The next three tests deal with obstacle avoidance. All the test are quite easy, the robot drives 5m straight and I place different objects in front of it and the robot should avoid them. If the robot drives into the objects or fails to avoid them in a reasonable time the parameters are changed and tested again.</p>
<p>Firstly, we should test and see if the robot can avoid typical domestic objects. I tested a flowerpot, closet, table with chairs, chairs and anything else I could find. Secondly, we should test and see if the robot can pass through a door (typically 80cm here in Belgium). Finally, we also test dynamic objects, I walk towards the robot and the robot should avoid me.</p>

<a href='http://www.fritz-hut.com/vector-field-histogram-vfh-playerstage/test3-stage-flowerpot/' title='Avoid a flowerpot'><img width="150" height="150" src="http://www.fritz-hut.com/wp-content/uploads/2013/03/test3-stage-flowerpot-150x150.png" class="attachment-thumbnail" alt="Avoid a flowerpot" /></a>
<a href='http://www.fritz-hut.com/vector-field-histogram-vfh-playerstage/test3-stage-closet/' title='Avoid a closet'><img width="150" height="150" src="http://www.fritz-hut.com/wp-content/uploads/2013/03/test3-stage-closet-150x150.png" class="attachment-thumbnail" alt="Avoid a closet" /></a>
<a href='http://www.fritz-hut.com/vector-field-histogram-vfh-playerstage/test3-stage-chair/' title='Avoid a typical chair'><img width="150" height="150" src="http://www.fritz-hut.com/wp-content/uploads/2013/03/test3-stage-chair-150x150.png" class="attachment-thumbnail" alt="Avoid a typical chair" /></a>
<a href='http://www.fritz-hut.com/vector-field-histogram-vfh-playerstage/test3-stage-table-chairs/' title='Avoid a table with 4 chairs'><img width="150" height="150" src="http://www.fritz-hut.com/wp-content/uploads/2013/03/test3-stage-table-chairs-150x150.png" class="attachment-thumbnail" alt="Avoid a table with 4 chairs" /></a>
<a href='http://www.fritz-hut.com/vector-field-histogram-vfh-playerstage/test3-stage-opening/' title='Pass between two objects (like a door)'><img width="150" height="150" src="http://www.fritz-hut.com/wp-content/uploads/2013/03/test3-stage-opening-150x150.png" class="attachment-thumbnail" alt="Pass between two objects (like a door)" /></a>

<h1>Results and Parameters changed</h1>
<p>I&#8217;m only going to talk about my findings and what parameters I changed to avoid a typical obstacle. If I don&#8217;t mention a parameter it means I never changed it and left the value default.</p>
<h3>max_speed</h3>
<p>I first changed this to 1.2 since the Pioneer robot could handle around 1.2m/s, boy I couldn&#8217;t be more wrong. I got a lot of warnings about exceeding speed and velocity and other crap in the console. After lowering the value drastically I ended up with a save 0.4 which is two times more than the default. In reality the robot drives blazing fast around obstacles so I&#8217;m happy.</p>
<h3>safety_dist</h3>
<p>The safety distance determines what distance the robot must keep from an object at all times (regardless of the free_space_cutoff). It comes in two versions, when standing still and moving at 1m/s. This parameter will greatly influence if the robot pass between two objects or not. If I change both to 0.10 (default) then the robot can pass between a door opening, and a chair. If I increase it to 0.20 it won&#8217;t go under the chair and avoids it but cannot pass between a door.</p>
<h3>free_space_cutoff</h3>
<p>The parameters come in two version, when standing still and when moving at 1m/s. The parameters influences when the robot starts avoiding an object. A high value (2000000.0) will drive the robot nearly against the obstacle before avoiding it while a lower value will make sure that the robot starts early with the obstacle avoiding. The parameter doesn&#8217;t have a unit so it&#8217;s a bit guessing, I picked the following values based on my test results: free_space_cutoff_1ms 100000 &amp; free_space_cutoff_0ms 200000.</p>
<h3>min_turnrate &amp; max_turnrate</h3>
<p>I changed them and then I got a lot of warnings about right wheel velocity and left wheel velocity. Not that good so I left them default.</p>
<h3>distance_epsilon &amp; angle_epsilon</h3>
<p>When the robot drives a goal the distance and angle epsilon will determine what error is acceptable. If I increase the parameters I don&#8217;t really care if the robot arrives exactly at the goal, if I lower both values then I want a precise result (based on the slipping odometry). The robot will keep driving around and turn till it arrives at it goal. So with a higher precision it can take a while till the robot thinks its at the goal. I increased the accuracy: distance_epsilon 0.2 &amp; angle_epsilon 5.</p>
<h1>Remarks about test results</h1>
<p>So all the test succeeded and the robot could avoid all the obstacles. A big problem remains, as mentioned in the safety_dist parameter, is that the robot can avoid a table with chairs (using 0.2 for safety_dist) but cannot through a door. Change the parameter so the robot can go through a door (using 0.1 for safety_dist) then the robot will also attempt to go through the table with chairs and gets stuck.</p>
<p>I still have to test and see if any other parameters can solve this problem. I&#8217;m thinking about obs_cutoff that doesn&#8217;t have an explanation on the VFH page of Player project.</p>
<p>The last test was a person walk towards the robot also works quite well. The VFH algorithm doesn&#8217;t take into account the velocity of objects, so a moving person towards the robot is quite difficult. The test showed that the person also needs to take a small step in a direction (right or left) and the robot will do the same. If you walk straight then you step on the robot or the robot drives over your toes.</p>
<h1>Conclusion</h1>
<p>The robot can avoid static and dynamic objects. If I found a solution for my door-table problem then I&#8217;ll post an update (it is quite important for a domestic environment).</p>
<p>The post <a href="http://www.fritz-hut.com/vector-field-histogram-vfh-playerstage/">Vector Field Histogram (VFH) Player/Stage</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.fritz-hut.com/vector-field-histogram-vfh-playerstage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Particle Filter Implementation in Player/Stage</title>
		<link>http://www.fritz-hut.com/particle-filter-implementation-in-playerstage/</link>
		<comments>http://www.fritz-hut.com/particle-filter-implementation-in-playerstage/#comments</comments>
		<pubDate>Thu, 31 Jan 2013 11:05:56 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[Master Thesis]]></category>
		<category><![CDATA[Player/Stage]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[particle filter]]></category>

		<guid isPermaLink="false">http://www.fritz-hut.com/?p=501</guid>
		<description><![CDATA[<p>Player/Stage has a particle filter build in called the Advanced Monte-Carlo Localization driver, I&#8217;ve done some tests with it but I&#8217;m not really happy with the results: A starting position and orientation has to be given (not really a requirement but the &#8230; <a href="http://www.fritz-hut.com/particle-filter-implementation-in-playerstage/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.fritz-hut.com/particle-filter-implementation-in-playerstage/">Particle Filter Implementation in Player/Stage</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Player/Stage has a <a title="Monte-Carlo Localization" href="http://www.fritz-hut.com/monte-carlo-localization/">particle filter</a> build in called the<a href="http://playerstage.sourceforge.net/doc/Player-2.0.0/player/group__driver__amcl.html"> Advanced Monte-Carlo Localization driver</a>, I&#8217;ve done some tests with it but I&#8217;m not really happy with the results:</p>
<ul>
<li><span style="line-height: 15px;">A starting position and orientation has to be given (not really a requirement but the algorithm tends to fail else)</span></li>
<li>Particles can move through walls or be placed on walls</li>
<li>The initial particle distribution does not fill the complete map</li>
</ul>
<p>This makes the algorithm quite useless. I have two options concerning my Master Thesis, create my own or change it so it does work as expected. I decided to create my particle filter from scratch, later on I&#8217;ll decide if I&#8217;ll adapt the AMCL driver or create my own. The code is based on the online lessons from <a href="https://www.udacity.com/">Udacity</a> (by Sebastian Thrun).</p>
<h1>The setup of the particle filter</h1>
<div id="attachment_503" class="wp-caption alignnone" style="width: 652px"><a href="http://www.fritz-hut.com/wp-content/uploads/2013/01/setup.png"><img class="size-full wp-image-503" alt="setup of particle filter" src="http://www.fritz-hut.com/wp-content/uploads/2013/01/setup.png" width="642" height="503" /></a><p class="wp-caption-text">The particle filter setup, including 6 landmarks</p></div>
<p>So we have a small area, the robot and 6 landmarks. As you can see is the Field of View (FOV) big enough so I always see one landmark.</p>
<h1>Bits and pieces</h1>
<p>So we got everything set up now the code. I started from the original python code from Udacity that I created. Now I just had to port the code from python to C++ Player/Stage style.</p>
<h3>Obstacle Avoidance &amp; Random Driving</h3>
<p>First I created some code so the robot could drive around (random) and avoid the walls in the setup. I decided to keep it very simple and basic. The wander code looks as follows:</p><pre class="crayon-plain-tag">void Wander (double *forwardSpeed ,double *turnSpeed)
{
  int maxSpeed = 1;
  int maxTurn = 60;
  double fspeed, tspeed;
  // fspeed is between 0 and 10
  fspeed = rand()%11;
  // (fspeed/10) is between 0 and 1
  fspeed = (fspeed/10)*maxSpeed;
  tspeed = rand()%(2*maxTurn);
  tspeed = tspeed-maxTurn;
  // tspeed is between -maxTurn and +maxTurn
  *forwardSpeed = fspeed;
  *turnSpeed = tspeed;
}</pre><p>So we create random variables and see that they are between the right ranges. Speed in player stage must always be between 0-1 and the turn speed should be in radians. The following code I used to avoiding obstacles (walls):</p><pre class="crayon-plain-tag">void AvoidObstacles(double *forwardSpeed, double *turnSpeed, RangerProxy &amp;rp) {

  double avoidDistance = 0.8;
  int avoidTurnSpeed = 50;
  double currDistance = 0.0;

  if(rp.GetRangeCount() == 0) {
    error("GetRangeCount of Sonars == 0");
    return;
  }

  for(uint32_t i = 1; i &lt;= rp.GetRangeCount(); i++) {
    currDistance = rp.GetRange(i-1);
    if(currDistance &lt; avoidDistance) {
      if(i &lt; 4) {
	*turnSpeed = -avoidTurnSpeed;
      } else {
	*turnSpeed = avoidTurnSpeed;
      }
      return;
    }
  }

}</pre><p>Again very basic, it works but that&#8217;s about it. Note the check I made to see if we got any range sensors (rp.GetRangeCount()). For some reason it&#8217;s possible that player crashes during the first iteration of your while/for loop because the ranger sensors are not completely initialized.</p>
<h3>Helpful bits and pieces</h3>
<p>I decided to keep track of my particles in a struct (pf_particle_t), it allows to easily add additional variables if need, my particles contain the following data: (x, y, yaw, weight). Next I should initialize an amount of particles with random location and spread them out over my map.</p><pre class="crayon-plain-tag">srand(unsigned(time(NULL)));
vector&lt;pf_particle_t&gt; particles;
const int pf_amount = 100;

// Generate random particles around the area.
for (int p = 0; p &lt; pf_amount; p++) {
      pf_particle_t particle;
      particle.pX = (double)rand()/(RAND_MAX)*(15)-7.5;
      particle.pY = (double)rand()/(RAND_MAX)*(8)-4;
      // particle.pYaw = (double)rand()/(RAND_MAX) * 2.0 * M_PI;
      particle.pYaw = 0.0;
      particle.pW = 0.0;

      particles.push_back(particle);
}</pre><p>As you can see I used a vector that holds all my particles. It&#8217;s really easy to use it, especially iterate over it. On line three you see that I multiply with 15 and then subtract with 7.5. My map has a dimension of 15 but the robot is placed on the origin of the map, this makes sure my particles are randomly generated in the map and not outside the map. Next I should also grab all the locations of the fiducials (landmarks). You can do this hard-coded (look at your world file) or you can request them in your code:</p><pre class="crayon-plain-tag">// Get all the fiducials from the Sim proxy
for (int f = 0; f &lt; 6; f++) {
      double x, y, a;
      sprintf(fidBuff, "Fid%d", f+1);
      simProxy.GetPose2d(fidBuff, x, y, a);
      FiducialObjects[f][0] = f;
      FiducialObjects[f][1] = x;
      FiducialObjects[f][2] = y;
}</pre><p>If you simulate in stage you can add the <a href="http://playerstage.sourceforge.net/doc/Player-svn/player/classPlayerCc_1_1SimulationProxy.html">SimulationProxy</a> and so request various properties of the objects in your world file. A little trick, you can also add the <a href="http://playerstage.sourceforge.net/doc/Player-cvs/player/classPlayerCc_1_1Graphics3dProxy.html">Graphics3dProxy</a> to draw your particles. This code should be in your main loop (while/for) and draws all the particles, again I used a vector to hold all the points to draw:</p><pre class="crayon-plain-tag">draw3D.Clear();
pts.clear();
// Now draw all the particles.
for(vector&lt;pf_particle_t&gt;::iterator pd = particles.begin(); pd != particles.end(); ++pd) {
	player_point_3d_t tmp_pnt;
	tmp_pnt.px = pd-&gt;pX;
	tmp_pnt.py = pd-&gt;pY;
	tmp_pnt.pz = 1;
	pts.push_back(tmp_pnt);
      }
draw3D.Color(green);
draw3D.Draw(PLAYER_DRAW_POINTS, &amp;pts[0], pf_amount);</pre><p></p>
<h1>The Particle Filter code</h1>
<p>Good now we the particle filter code. The idea is to measure the distance from the robot to the detected landmarks. Then measure the distance from the particles to the landmarks and apply a weight based on the correctness of those measurements. Finally re-sample the particles so that particles with lower weights are less likely to reappear in our new particle set.</p>
<h3>robot measurements</h3>
<p>First we request the position of the robot (using the Position2dProxy, note: in the configuration the robot should be set on <a href="http://playerstage.sourceforge.net/doc/stage-svn/group__model__position.html">odom for localization not gps</a>!) and then we get the location of the fiducials and calculate the <a href="http://en.wikipedia.org/wiki/Euclidean_distance">distance between the two coordinates</a>.</p><pre class="crayon-plain-tag">// Measurement Model pre calculations
double Z[6];
// Check if we found any fiducial at all
if(fidProxy.GetCount() &gt; 0) {
	// Loop through the detected fiducials
	for(uint32_t i = 0; i &lt; fidProxy.GetCount(); i++) {
	  // Grap the fiducial
	  player_fiducial_item_t fiducial = fidProxy[i];
	  // Calculate the distance from the robot (odom pos) and fiducial object (static)
	  double fdist = DistBetween(p2dProxy.GetXPos(), p2dProxy.GetYPos(), FiducialObjects[fiducial.id][1], FiducialObjects[fiducial.id][2]);
	  // Add it to the measurment array Z
	  Z[i] = fdist;
	}

}</pre><p></p>
<h3> Apply motion and measurement model</h3>
<p>Now we apply the same motion as the robot on the particles. First we keep track of our previous location and our current location and find the distance between them. Because every particle can be in another heading direction we also have to include this in our motion model. We add random Gaussian noise, a popular algorithm is <a href="http://www.bnikolic.co.uk/nqm/random/normal-boost.html">the Box-Muller algorithm</a>:</p>
<p><img src="//s0.wp.com/latex.php?latex=%5Crho+%3D+%5Csqrt%7B-2+log%281-Y%29%7D&#038;bg=ffffff&#038;fg=000&#038;s=1" alt="&#92;rho = &#92;sqrt{-2 log(1-Y)}" title="&#92;rho = &#92;sqrt{-2 log(1-Y)}" class="latex" /></p>
<p><img src="//s0.wp.com/latex.php?latex=X+%3D+%5Crho+cos%282+%5Cpi+Z%29&#038;bg=ffffff&#038;fg=000&#038;s=1" alt="X = &#92;rho cos(2 &#92;pi Z)" title="X = &#92;rho cos(2 &#92;pi Z)" class="latex" /></p>
<p>This accounts for small possible errors and spreads our particles. Finally we apply the motion of the robot on the particles, lines 1-17 in the following code:</p><pre class="crayon-plain-tag">// Variable used for max weight
double mw = 0.0;
// We apply the same forward and turnspeed that we gave the robot to all the particles
for(vector&lt;pf_particle_t&gt;::iterator pd = particles.begin(); pd != particles.end(); ++pd) {
	/// Motion Model
	// Calculate traveld distance
	double dist = DistBetween(oldX, oldY, newX, newY) + RandomGauss(0.0, forward_noise);
	// Reset the angle for every particle, else we keep counting it up.
	double oriantation = 0.0;

	// How much did we turn, make note of the starting angel
	oriantation = pd-&gt;pYaw + (newYaw - oldYaw) + RandomGauss(0.0, turn_noise);
	// make sure we are still in the 0-2*pi range
	oriantation = fmod(oriantation,2*M_PI);

	// apply the calculated motion
	pd-&gt;pX += (cos(oriantation) * dist);
	pd-&gt;pY += (sin(oriantation) * dist);
	pd-&gt;pYaw = oriantation;

	/// Measurement Model
	// Set the probability to one and the distribution to 0
	double prob = 1.0;
	double pdist = 0.0;
	// Factor in the measurement and update the weight
	if(fidProxy.GetCount() &gt; 0) {
	  for(uint32_t f = 0; f &lt; fidProxy.GetCount(); f++) {
	    player_fiducial_item_t fiducial = fidProxy[f];
	    // Calculate the distance from every particle to the fiducials found
	    pdist = DistBetween(pd-&gt;pX, pd-&gt;pY, FiducialObjects[fiducial.id][1], FiducialObjects[fiducial.id][2]) + RandomGauss(0.0, sense_noise);
	    // Calculate the weight for every particle, noise of 5.0 (maybe less?)
	    prob *= Gaussian(pdist, 1.0, Z[f]);

	  }
	}
	// Save the highest variable
	if(mw &lt; prob) mw = prob;

		      pd-&gt;pW = prob;

}</pre><p>After that we need to add a weight to every particle. So we go over every fiducial found, calculate the distance from the fiducial to the particle and then calculate the Gaussian distribution. We also keep track of the highest weight, we need this for the re-sampling.</p>
<h3>Resampling</h3>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='584' height='359' src='http://www.youtube.com/embed/wNQVo6uOgYA?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>So that movie explains the basic concept of this re-sampling step. Re-sampling can be done in multiple ways, this approach is the know as the Roulette wheel and as a complexity of O(n log n), not that good but its proven to better for localization.</p><pre class="crayon-plain-tag">/// RESAMPLE
int index = static_cast((double)rand()/(RAND_MAX) * pf_amount);
double beta = 0.0;
vector&lt;pf_particle_t&gt; particles_new;

for(vector&lt;pf_particle_t&gt;::iterator pd = particles.begin(); pd != particles.end(); ++pd) {
	beta += ((double)rand()/(RAND_MAX)) * 2.0 * mw;

	while(beta &gt; particles[index].pW) {  
	  beta -= particles[index].pW;
	  index = (index + 1) % pf_amount;
	}
	particles_new.push_back(particles[index]);
}
particles.clear();
particles.assign(particles_new.begin(), particles_new.end());</pre><p></p>
<h1>The Result</h1>
<p>My first experiment with a moving gif, better than another particle filter video on YouTube I guess.</p>
<div id="attachment_512" class="wp-caption alignnone" style="width: 650px"><a href="http://www.fritz-hut.com/wp-content/uploads/2013/01/animated.gif"><img class="size-full wp-image-512" alt="Animated gif" src="http://www.fritz-hut.com/wp-content/uploads/2013/01/animated.gif" width="640" height="450" /></a><p class="wp-caption-text">Little animated gif shows the robot and particle filter</p></div>
<p>Next is to see how I can remove particles that are invalid (they went through a wall), use the laser measurements instead of fixed landmarks and other improvements.</p>
<p>The post <a href="http://www.fritz-hut.com/particle-filter-implementation-in-playerstage/">Particle Filter Implementation in Player/Stage</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.fritz-hut.com/particle-filter-implementation-in-playerstage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Home Automation using DASH7</title>
		<link>http://www.fritz-hut.com/home-automation-using-dash7/</link>
		<comments>http://www.fritz-hut.com/home-automation-using-dash7/#comments</comments>
		<pubDate>Fri, 04 Jan 2013 15:05:20 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[School]]></category>
		<category><![CDATA[Dash7]]></category>
		<category><![CDATA[home automation]]></category>
		<category><![CDATA[RTLS]]></category>
		<category><![CDATA[wizzimote]]></category>

		<guid isPermaLink="false">http://www.fritz-hut.com/?p=477</guid>
		<description><![CDATA[<p>The goal of the project was to implement a basic Home Automation using DASH7. We had limited resources, worked in a group with 7 people and had only 8 days to finish the project. The goal of the project The &#8230; <a href="http://www.fritz-hut.com/home-automation-using-dash7/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.fritz-hut.com/home-automation-using-dash7/">Home Automation using DASH7</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>The goal of the project was to implement a basic Home Automation using DASH7. We had limited resources, worked in a group with 7 people and had only <strong>8 days</strong> to finish the project.</p>
<h1>The goal of the project</h1>
<div id="attachment_479" class="wp-caption alignnone" style="width: 1029px"><a href="http://www.fritz-hut.com/wp-content/uploads/2013/01/project-overview.png"><img class=" wp-image-479" alt="Project Overview" src="http://www.fritz-hut.com/wp-content/uploads/2013/01/project-overview.png" width="1019" height="373" /></a><p class="wp-caption-text">The project overview</p></div>
<p>The idea is illustrated in the following image. A server is used and utilises a <a href="http://en.wikipedia.org/wiki/Machine_learning" target="_blank">self-learning algorithm</a> that learns preferences of the user. The user has a smart phone and can adjust the environment, these adjustments are registered on the server and used in the self-learning algorithm.</p>
<p>So a little example, I walk in the room and the light turns on, I find it to bright so change it to 70% from the original 100%. I do this every day for 3 days and on day 4 the light switches on, but instead of the 100% illumination, it is only on for 70%. The system learned my preference and applied it.</p>
<p>The smart phone communicates with the server using WiFi and the server <strong>must</strong> communicate with the application (light bulb, oven, water heater  lamp, light strip &#8230;) using <a href="http://en.wikipedia.org/wiki/DASH7" target="_blank">DASH7 technology</a>.</p>
<p>We were free to choice the applications and the mobile application (dedicated, web-based universal or hybrid). There were only 8 days left and we were allowed to take short cuts (aka dirty code and tricks) to get a result.</p>
<h2>DASH7 Technology</h2>
<p>Everyone has an idea how a smart phone application might look. But the DASH7 part is a big unknown. There are developer kits from <a href="http://www.wizzilab.com/" target="_blank">WizziLab</a> for rather a hefty price (€100). A PhD student at my University made a smaller tag that only costs around €10, or even less.<br />

<a href='http://www.fritz-hut.com/home-automation-using-dash7/wizzibase/' title='WizziBase'><img width="150" height="150" src="http://www.fritz-hut.com/wp-content/uploads/2013/01/WizziBase-150x150.jpg" class="attachment-thumbnail" alt="wizzibase" /></a>
<a href='http://www.fritz-hut.com/home-automation-using-dash7/wizzimote_waffer/' title='WizziMote'><img width="150" height="150" src="http://www.fritz-hut.com/wp-content/uploads/2013/01/WizziMote_waffer-150x150.png" class="attachment-thumbnail" alt="wizzimote" /></a>
<br />
Combine those two items and you can program the <a href="http://www.wizzilab.com/shop/wizzimote/">DASH7 tags</a>. Right now the <a href="http://www.dash7.org/">DASH7 Alliance</a> is building a complete <a href="http://en.wikipedia.org/wiki/OSI_model">OSI stack</a> for DASH7 and writing the code with the help of researchers/PhD students. They already finished the Physical and Data-Link Layer, we programmed using this stack on the Data-Link Layer.</p>
<p>This also means that we had to program embedded devices, luckily we could use C code and the library from the DASH7 Alliance include most of the important commands to send receive and handle interrupts. Quite cool using cutting-edge technology.</p>
<h1>Task Assignment</h1>
<p>So we (me and 6 colleagues) started to draft out a general concept/flowchart so we could divide this project in subsections. Every subsection is developed by one person who is responsible. We came up with the following flowchart.</p>
<div id="attachment_485" class="wp-caption alignnone" style="width: 1014px"><a href="http://www.fritz-hut.com/wp-content/uploads/2013/01/schema-overzicht.png"><img class="size-full wp-image-485" alt="Flowchart" src="http://www.fritz-hut.com/wp-content/uploads/2013/01/schema-overzicht.png" width="1004" height="577" /></a><p class="wp-caption-text">Our basic flowchart, every colour represents a different person.</p></div>
<p>My job was to program the DASH7 tags and make sure the applications worked. Another student is on the same subsection as me but his task was to wire electronics on the GPIO pins of the DASH7 tags. I&#8217;ll only talk about my part because I don&#8217;t really know all the details.</p>
<h1>DASH7 Application</h1>
<p>We picked the following application. We have a house with 2 rooms, a living room with a TV and a workroom with a desk and a computer. When the users walks to the TV it should automatically play a video, if he walks away the video should pause. When the user enters the workroom the laptop should automatically open certain applications. Whenever the user leaves or enters the room the light should switch on or off accordingly.</p>
<div id="attachment_486" class="wp-caption alignnone" style="width: 1133px"><a href="http://www.fritz-hut.com/wp-content/uploads/2013/01/schema-overzicht-new.png"><img class="size-full wp-image-486" alt="DASH7 Application" src="http://www.fritz-hut.com/wp-content/uploads/2013/01/schema-overzicht-new.png" width="1123" height="794" /></a><p class="wp-caption-text">The DASH7 application with two rooms</p></div>
<p>A couple of things come together here. Firstly, we have an approximation application, meaning that if a user comes near a tag something should happen. Secondly, we defined three types of DASH7 tags, a server tag, application tag and mobile tag. Finally, we interact with 230v light bulbs using the 3.3v GPIO from the DASH7 tag.</p>
<h1>Communications in the DASH7 application</h1>
<p>A little note, I made this communication protocol because its easy dirty and the way to go for our little application. In no way this is useful if more than 3 tags are used and way to much overhead comes in the mind. Because of the time constrains I picked this easy, dirty solution.</p>
<h3>Commands</h3>
<p>Every command/message is send using the following protocol that I also used in my <a title="ArduinoPi 1.0 includes an API" href="http://www.fritz-hut.com/arduinopi-with-api/">ArduinoPi code</a> with one big difference every command is send in one byte (0&#215;00-0xFF). So small recap, every command starts with <strong>@</strong> and ends with <strong>:</strong>, the first number indicates the command and the second the value. I also included the <strong>comma</strong> between the command and value but it&#8217;s not really needed since every value is only one byte. The reason was that later on I could always change it back to dynamically allocate the command and value.</p>
<h3>Communications</h3>
<p>So the communication is based on the following image (yes I love images).</p>
<div id="attachment_487" class="wp-caption alignnone" style="width: 845px"><a href="http://www.fritz-hut.com/wp-content/uploads/2013/01/communicatie-schema.png"><img class="size-full wp-image-487" alt="Communications in DASH7" src="http://www.fritz-hut.com/wp-content/uploads/2013/01/communicatie-schema.png" width="835" height="622" /></a><p class="wp-caption-text">Communications in the DASH7 application</p></div>
<p>Dotted lines indicated wireless communication and solid lines include wired communication. It&#8217;s quite simple, every command has its own value followed by the value (if any). The mobile tag always sends out a one every second, the user wears this tag (can be a watch or small keychain).</p>
<p><strong>The application tag</strong> receives a one, pulls out the dbm value and sends it back as command 2 to the server tag. The server tag sends the dbm to the server over a serial connection and the server decides if the user is close enough to switch the light. Note that one short-cut is included, the application tag will also send the dbm value to the computer who will start the video if the user is close enough, normally the server should decide this (for various reasons we didn&#8217;t include this).</p>
<p><strong>The server tag</strong> also receives a one and sends his dbm value to the server, which decides if the user is close enough to switch the lamp or start-up the applications on the computer.</p>
<p>Other communication is also included because we had to read out a sensor (light sensor), I used the same way of communication for the two light sensors.</p>
<h1>Result</h1>
<p>The following video demonstrates our project. We failed to include the smart phone (HTML5 based jQuery mobile application) because we were unable to connect it with the server/DASH7 tags. We used a WCF Service Library and apparently it is unable to start, talk or do anything when it receives commands from the smart phone. We only figured this out on the last day and try to convert it to a WCF Service but we had no more time and decided to remove it, shame really.</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='584' height='359' src='http://www.youtube.com/embed/oZEcFYYPLkQ?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<h1>Conclusion</h1>
<p>It was a fun project and I&#8217;m pleased with the results. We already had to present this project and the promoters/teachers were quite pleased but had some comments, mainly about the extendibility of our project.</p>
<p>The post <a href="http://www.fritz-hut.com/home-automation-using-dash7/">Home Automation using DASH7</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.fritz-hut.com/home-automation-using-dash7/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Happy Holidays</title>
		<link>http://www.fritz-hut.com/happy-holidays/</link>
		<comments>http://www.fritz-hut.com/happy-holidays/#comments</comments>
		<pubDate>Wed, 02 Jan 2013 10:10:22 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.fritz-hut.com/?p=475</guid>
		<description><![CDATA[<p>Best wishes for 2013 and happy holidays! A new year and for me a time to reflect on my blog and I&#8217;m quite happy with the result. General I made one post a week (sometimes even more) and talked about &#8230; <a href="http://www.fritz-hut.com/happy-holidays/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.fritz-hut.com/happy-holidays/">Happy Holidays</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Best wishes for 2013 and happy holidays!</p>
<p>A new year and for me a time to reflect on my blog and I&#8217;m quite happy with the result. General I made one post a week (sometimes even more) and talked about various topics.</p>
<p>For 2013 I plan to blog actively on my <a title="Master Thesis Subject DASH7" href="http://www.fritz-hut.com/master-thesis-subject-dash7/">Master Thesis</a>. The next three weeks will be quite busy (or not) I still have 3 examinations to finish (why o why) that only count for 30% of the total marks for every course. The other 70% I already acquired during the year by making <a href="http://www.fritz-hut.com/all-projects/school/">projects</a>.</p>
<p>There is one blog post in process (for a while now) about <a href="http://www.youtube.com/watch?v=oZEcFYYPLkQ">DASH7 Home Automation</a>, a fast prototype (8 days) project.</p>
<p>The post <a href="http://www.fritz-hut.com/happy-holidays/">Happy Holidays</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.fritz-hut.com/happy-holidays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Augmented Reality &amp; Pattern Recognition Sources</title>
		<link>http://www.fritz-hut.com/augmented-reality-pattern-recognition-sources/</link>
		<comments>http://www.fritz-hut.com/augmented-reality-pattern-recognition-sources/#comments</comments>
		<pubDate>Thu, 27 Dec 2012 19:25:35 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[School]]></category>
		<category><![CDATA[augmented reality]]></category>
		<category><![CDATA[pattern recognition]]></category>
		<category><![CDATA[vision]]></category>

		<guid isPermaLink="false">http://www.fritz-hut.com/?p=464</guid>
		<description><![CDATA[<p>I think this title is bigger then the content of this post, anyway after some request here is the source code of the augmented reality projected and the pattern recognition project I (and my school colleagues) created for our Vision course. Augmented &#8230; <a href="http://www.fritz-hut.com/augmented-reality-pattern-recognition-sources/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.fritz-hut.com/augmented-reality-pattern-recognition-sources/">Augmented Reality &#038; Pattern Recognition Sources</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>I think this title is bigger then the content of this post, anyway after some request here is the source code of <a title="Web-based Augmented Reality 3D car Encyclopedia" href="http://www.fritz-hut.com/web-based-augmented-reality-3d-car-encyclopedia/">the augmented reality projected</a> and the <a title="Pattern Recognition continued" href="http://www.fritz-hut.com/pattern-recognition-continued/">pattern recognition project</a> I (and my school colleagues) created for our Vision course.</p>
<h1>Augmented Reality</h1>
<p>First you should host the application using XAMPP (Windows) or Apache and you also should use the latest chrome browser. I&#8217;ve never tested this on Firefox (don&#8217;t even bother trying to use IE or Safari). If you have a working apache/xampp installation then host the applications by copying all the files in <a href="http://www.fritz-hut.com/wp-content/uploads/2012/12/AR-Project.rar">the following archive</a> in your www or htdocs folder.</p>
<p>Now surf to localhost and accept the use of the webcam. Normally you should see that your browser detects and uses your webcam. If this fails then try another webcam. In the archive I also included a word file with the markers you should print before using the application.</p>
<h1>Pattern Recognition</h1>
<p>Before you can use the following code you should make sure you installed OpenCV, libconfig, ARToolKit and ARToolKitPlus. I don&#8217;t plan on giving out my complete Visual Studio project (the project is originally from somebody else), but my basic commands and the most important function (classify) is included. This ensures that lazy-copy-cats will fail and people looking for information will succeed.</p><pre class="crayon-plain-tag">// The gaussian distrubution of the features calculated
float cLike(float val, int feature) {
	return (1/sqrt(2*M_PI*(pow(circle_parm[feature][1], 2))))*exp((pow(val-circle_parm[feature][0], 2))/(-2*pow(circle_parm[feature][1], 2)));
}

float nLike(float val, int feature) {
	return (1/sqrt(2*M_PI*(pow(noise_parm[feature][1], 2))))*exp((pow(val-noise_parm[feature][0], 2))/(-2*pow(noise_parm[feature][1], 2)));
}

float aLike(float val, int feature) {
	return (1/sqrt(2*M_PI*(pow(animal_parm[feature][1], 2))))*exp((pow(val-animal_parm[feature][0], 2))/(-2*pow(animal_parm[feature][1], 2)));
}

// This is the main classify class, it will threshold the marker, add some transformations
// and then also classify it
void classify(ARToolKitPlus::ARMarkerInfo* markerinfo, IplImage* img, int i) {
	// Only continue if area is big enough
	if(markerinfo-&gt;area &lt; 1000) return;
	// First we must clear all temp data, just to prevent memory access issues
	cvZero(contMarkImage);
	cvZero(minCircleImage);
	cvZero(filledImage);
	cvZero(maskImage);
	cvZero(trainingset);

	// Warp the marker so that we obtain a square (undo the perspective transformation)
	// The resulting marker image can be used for classification
	IplImage* detectMarkImage = unWarp(img, markerinfo);
	cvSetImageROI(detectMarkImage, cvRect(markerinfo-&gt;pos[0]-50, markerinfo-&gt;pos[1]-50, markPixel, markPixel));
	cvShowImage("Detected Marker", detectMarkImage);
	cvResetImageROI(detectMarkImage);
	//Threshold the marker. Convenient for border detection
	IplImage* thresMarkImage = threshold(detectMarkImage, markerinfo);
	cvShowImage("Thresholded Marker", thresMarkImage);
	// return if the dimensions aren't correct, happens alot =&gt; cause of random crashes
	if(thresMarkImage-&gt;width != thresMarkImage-&gt;height) return;
	// Now we can copy everything
	cvCopy(thresMarkImage, trainingset);

	// Lets calculate a histogram and count the black and white pixels
	cvCalcHist(&amp;thresMarkImage, histogram);
	float black = (float)*cvGetHistValue_1D(histogram, 0);
	float white = (float)*cvGetHistValue_1D(histogram, 1);
	float whiteBlackRatio = white / black;

	// There must be some white pixels, but markers arent more then half white, so we can check that
	if(whiteBlackRatio &lt; 0.05 &amp;&amp; whiteBlackRatio &gt; 1) return;

	// Create a cross structur element 4x4 with a center of 2, 2
	IplConvKernel* crossStruct = cvCreateStructuringElementEx(4, 4, 2, 2, MORPH_CROSS);

	// Apply a closing and do it 3 times with the cross structure
	cvMorphologyEx(thresMarkImage, thresMarkImage, thresMarkImage, crossStruct, MORPH_CLOSE, 3);

	// Now expand the image with a border, attempt to remove the white small lines from the marker
	cvCopyMakeBorder(thresMarkImage, maskImage, cvPoint(border,border), 0);
	// Copy the image
	cvCopy(maskImage, filledImage);
	// Now apply the floodFill, flip it and combine the image to fill the holes
	cvFloodFill(maskImage, cvPoint(0,0), cvScalar(255));
	cvSubRS(maskImage, cvScalar(255), maskImage);
	cvAdd(maskImage, filledImage, filledImage);
	cvShowImage("Filled Marker", filledImage);

	// Some values for the parameters
	CvSeq* contour = 0;
	float areaTot = 0.0, lengthTot = 0.0, metric_cTot = 0.0, count = 0;
	float area = 0.0, areaMax = 0.0, metric_c = 0.0, metric_s = 0.0, metric_sTot = 0.0, length = 0.0, lengthMax = 0.0;

	cvZero(contMarkImage);
	CvMemStorage* storage = cvCreateMemStorage(0);
	// Find contours
	cvFindContours(filledImage, storage, &amp;contour, sizeof(CvContour), CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE);

	// Contour total doesn't work at all, strange, lets count it ourself
	for(; contour != 0; contour = contour-&gt;h_next) {
		// Also draw contours (so pritty)
		cvDrawContours(contMarkImage, contour, cvScalar(255), cvScalar(255), 0, 0, 8);
		// Calculate all the different features
		area = fabs(cvContourArea(contour, CV_WHOLE_SEQ));
		length = fabs(cvArcLength(contour, CV_WHOLE_SEQ));
		areaTot += area;
		lengthTot += length;

		// make sure we fetch the biggest area and length
		if(area &gt; areaMax) areaMax = area;
		if(length &gt; lengthMax) lengthMax = length;
		// Also count the amount of contours we have
		count++;
	}
	// If the total area is bigger then 8000 we clearly don't have a marker
	if(areaTot &gt; 8000) return;
	cvShowImage("Contour Function", contMarkImage);
	// The values will hold the probabilities for every class
	float cFeatures = 0.0, nFeatures = 0.0, aFeatures = 0.0;
	// Only continue if the values are above zero
	if(areaTot &gt; 0 &amp;&amp; lengthTot &gt; 0) {
		// Calculate the circularity and squareness
		metric_c = areaMax * 4 * M_PI / pow(lengthMax, 2);
		metric_s = areaMax * 16 / pow(lengthMax, 2);
		metric_cTot = areaTot * 4 * M_PI / pow(lengthTot, 2);
		metric_sTot = areaTot * 16 / pow(lengthTot, 2);

		if(!trainingset_bool) {
			// Naive bayesiaanse classifier, using the blob count, circularity and black and white ratio
			cFeatures = cLike(metric_cTot, 0) * cLike(count, 1) * cLike(whiteBlackRatio, 2);
			nFeatures = nLike(metric_cTot, 0) * nLike(count, 1) * nLike(whiteBlackRatio, 2);
			aFeatures = aLike(metric_cTot, 0) * aLike(count, 1) * aLike(whiteBlackRatio, 2);

			// Now check for the highest probability, and then save the class name in the type variable
			if(cFeatures &gt; nFeatures &amp;&amp; cFeatures &gt; aFeatures) {
				sprintf(type, "Circle");
			} else if(nFeatures &gt; cFeatures &amp;&amp; nFeatures &gt; aFeatures) {
				sprintf(type, "Noise");
			} else {
				sprintf(type, "Animal");
			}
		}
	}

	// setup the OpenGL transformation
	updateTransformationMatrix(markerinfo);
	glMatrixMode(GL_MODELVIEW);
	glLoadMatrixf(gl_para);
	// Switch the color depending on the number of markers in screen
	glColor3f(color[i%5][0], color[i%5][1], color[i%5][2]);
	glLineWidth(1.0f);
	glBegin(GL_LINE_LOOP);
	glVertex2f(-40.0f, 40.0f);
	glVertex2f(40.0f, 40.0f);
	glVertex2f(40.0f, -40.0f);
	glVertex2f(-40.0f, -40.0f);
	glEnd();
	// Now print the text on the screen
	sprintf(type_string, "Type: %s", type);
	renderString(markerinfo-&gt;pos[0]-40, markerinfo-&gt;pos[1]+60, GLUT_BITMAP_HELVETICA_18, type_string);

	// Check the configuration, if we have to save data for feature selection or confusion matrix
	if(trainingset_bool) {
		float data[] = {count, whiteBlackRatio, markerinfo-&gt;area, lengthTot, areaTot, metric_cTot, metric_sTot, areaMax, lengthMax, metric_c, metric_s};
		int data_size = (sizeof data)/sizeof(data[0]);
		saveData(trainingset, data, data_size);
	} else if(predictclass_bool) {
		float data[] = {count, whiteBlackRatio, markerinfo-&gt;area, lengthTot, areaTot, metric_cTot};
		int data_size = (sizeof data)/sizeof(data[0]);
		saveData(trainingset, data, data_size, type);
	}

	cvClearMemStorage(storage);
	cvReleaseMemStorage(&amp;storage);
	cvReleaseStructuringElement(&amp;crossStruct);

}</pre><p></p>
<p>The post <a href="http://www.fritz-hut.com/augmented-reality-pattern-recognition-sources/">Augmented Reality &#038; Pattern Recognition Sources</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.fritz-hut.com/augmented-reality-pattern-recognition-sources/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Monte-Carlo Localization</title>
		<link>http://www.fritz-hut.com/monte-carlo-localization/</link>
		<comments>http://www.fritz-hut.com/monte-carlo-localization/#comments</comments>
		<pubDate>Sun, 16 Dec 2012 13:30:59 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[Master Thesis]]></category>
		<category><![CDATA[MCL]]></category>
		<category><![CDATA[Monte-Carlo Localization]]></category>
		<category><![CDATA[robot localization]]></category>

		<guid isPermaLink="false">http://www.fritz-hut.com/?p=448</guid>
		<description><![CDATA[<p>Today a bit more about figuring out the robot position. Again I&#8217;ll try to explain the basics behind Monte-Carlo Localization without going into a bunch of maths or robotic jargon. My post is based on the following paper: Fox, D., &#8230; <a href="http://www.fritz-hut.com/monte-carlo-localization/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.fritz-hut.com/monte-carlo-localization/">Monte-Carlo Localization</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Today a bit more about figuring out the robot position. Again I&#8217;ll try to explain the basics behind Monte-Carlo Localization without going into a bunch of maths or robotic jargon.</p>
<p>My post is based on the following paper:</p>
<blockquote><p>Fox, D., Burgard, W., Dellaert, F. &amp; Thrun, S. Monte carlo localization: Efficient position estimation for mobile robots. Proceedings of the National Conference on Artificial Intelligence, 1999, pp. 343-349.</p></blockquote>
<h2>Monte-Carlo Localization</h2>
<p>Localization can be done in a couple of ways. A popular method was a grid-based approach, without going into details, the main disadvantage was updating the grid on 80s-90s computers. Also some problems like robot kidnapping (robot is moved by the user) were impossible to solve with a grid-based approach.</p>
<p>Monte-Carlo Localization is based on <a href="http://www.cs.cmu.edu/afs/cs/project/jair/pub/volume11/fox99a-html/node3.html#SECTION00021000000000000000">Markov localization</a>, the key concept is to represent the posterior belief <img src="//s0.wp.com/latex.php?latex=Bel%28l%29&#038;bg=ffffff&#038;fg=000&#038;s=0" alt="Bel(l)" title="Bel(l)" class="latex" /> by a set of <img src="//s0.wp.com/latex.php?latex=K&#038;bg=ffffff&#038;fg=000&#038;s=0" alt="K" title="K" class="latex" /> weighted, random particles</p>
<p><img src="//s0.wp.com/latex.php?latex=S%3D+s_i+%7C+i+%3D+1..K&#038;bg=ffffff&#038;fg=000&#038;s=1" alt="S= s_i | i = 1..K" title="S= s_i | i = 1..K" class="latex" /></p>
<p>A particle contains the following information <img src="//s0.wp.com/latex.php?latex=%5B%28x%2C+y%2C+%5Ctheta%29%2C+p%5D&#038;bg=ffffff&#038;fg=000&#038;s=0" alt="[(x, y, &#92;theta), p]" title="[(x, y, &#92;theta), p]" class="latex" /> it contains the robots <img src="//s0.wp.com/latex.php?latex=x%2Cy&#038;bg=ffffff&#038;fg=000&#038;s=0" alt="x,y" title="x,y" class="latex" /> position and heading <img src="//s0.wp.com/latex.php?latex=%5Ctheta&#038;bg=ffffff&#038;fg=000&#038;s=0" alt="&#92;theta" title="&#92;theta" class="latex" /> and also a weighting factor that&#8217;s analogous to a discrete probability. A sample set represents an approximation of a probability distribution, which means that the sum of all the particles in the sample set should equal to 1. Monte-Carlo Localization works in two steps: Robot motion and sensor readings.</p>
<h3>Step 1: Robot Motion</h3>
<p>When the robot drives, <img src="//s0.wp.com/latex.php?latex=K&#038;bg=ffffff&#038;fg=000&#038;s=0" alt="K" title="K" class="latex" /> new samples are generated that approximates the robot&#8217;s position after the motion. Each sample is generated randomly, by drawing a sample from the previous sample set with a likelihood that is determined by their <img src="//s0.wp.com/latex.php?latex=p&#038;bg=ffffff&#038;fg=000&#038;s=0" alt="p" title="p" class="latex" />-values.</p>
<h3>Step 2: Sensor Readings</h3>
<p>After the robot motion a sensor reading is done. When the robot sensors are available, the measurements are incorporated in the algorithm. The weight of every sample is recalculated, let <img src="//s0.wp.com/latex.php?latex=%28l%2C+p%29&#038;bg=ffffff&#038;fg=000&#038;s=0" alt="(l, p)" title="(l, p)" class="latex" /> be a sample then</p>
<p><img src="//s0.wp.com/latex.php?latex=p+%3D+%5Calpha+P%28s%7Cl%29&#038;bg=ffffff&#038;fg=000&#038;s=1" alt="p = &#92;alpha P(s|l)" title="p = &#92;alpha P(s|l)" class="latex" /></p>
<p>is the new weight were <img src="//s0.wp.com/latex.php?latex=%5Calpha&#038;bg=ffffff&#038;fg=000&#038;s=0" alt="&#92;alpha" title="&#92;alpha" class="latex" /> is a normalizing factor that enforces a probability distribution, meaning it enforces that the sum of all the weights is 1.</p>
<p>And that&#8217;s it, very easy very random and it works. I know that my explanation may still confuse people so I found a YouTube video that explains particle filters with pictures and drawings, making it easier to understand. The video is explained by Sebastian Thrun himself.</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='584' height='359' src='http://www.youtube.com/embed/H0G1yslM5rc?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>The post <a href="http://www.fritz-hut.com/monte-carlo-localization/">Monte-Carlo Localization</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.fritz-hut.com/monte-carlo-localization/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Player/Stage Compile on RaspberryPi</title>
		<link>http://www.fritz-hut.com/playerstage-compile-on-raspberrypi/</link>
		<comments>http://www.fritz-hut.com/playerstage-compile-on-raspberrypi/#comments</comments>
		<pubDate>Sun, 09 Dec 2012 14:55:18 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[Player/Stage]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[cmake]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[Master Thesis]]></category>
		<category><![CDATA[Raspberry PI]]></category>
		<category><![CDATA[robotics]]></category>

		<guid isPermaLink="false">http://www.fritz-hut.com/?p=440</guid>
		<description><![CDATA[<p>It&#8217;s easier to just compile the code on the raspberry pi, it&#8217;s a bit slow but not a real problem. This is a quick follow up post. Configuration of cmake First a CMakeLists.txt file should be made in the main &#8230; <a href="http://www.fritz-hut.com/playerstage-compile-on-raspberrypi/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.fritz-hut.com/playerstage-compile-on-raspberrypi/">Player/Stage Compile on RaspberryPi</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s easier to just compile the code on the raspberry pi, it&#8217;s a bit slow but not a real problem. This is a quick <a title="Installing Player (Player/Stage) on Raspberry Pi" href="http://www.fritz-hut.com/installing-player-playerstage-on-raspberry-pi/">follow up post</a>.</p>
<h2>Configuration of cmake</h2>
<p>First a CMakeLists.txt file should be made in the main project directory. For example I used <a href="http://playerstage.sourceforge.net/wiki/Player_and_CMake">the following file</a> from the documentation and changed it a bit.</p><pre class="crayon-plain-tag">CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
# Set your project name and version
PROJECT (playerstagetest)
SET(PROJECT_VERSION 0.0.1 CACHE STRING "CMake Example Project Version Number")

# Build flags for different configurations
# Use is determined by the option CMAKE_BUILD_TYPE
set(CMAKE_BUILD_TYPE "DEBUG")

set(CMAKE_C_FLAGS_DEBUG "-g -Wall ")
set(CMAKE_C_FLAGS_RELEASE "-O2 ")

set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall ")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 ")

# If Player isn't installed to /usr, you'll have to edit this path to point
# to the location of UserPlayerC++.cmake and UsePlayerPlugin.cmake
SET (CMAKE_MODULE_PATH "/usr/local/share/cmake/Modules")

# These files include macros that make building against Player easier.  They provide
# the PLAYER_ADD* macros
INCLUDE (UsePlayerC++)
INCLUDE (UsePlayerPlugin)

# This command adds an example PlayerC++ client called 'exampleclient', using
# the 'exampleclient.cc' source file.
PLAYER_ADD_PLAYERCPP_CLIENT (exampleclient SOURCES main.cpp)

# If you also want to include a Player plugin driver, use these directions:
# This command adds an example plugin driver which will be called 'libexampledriver.so'
# which uses the source file 'exampleplugin.cc'
# PLAYER_ADD_PLUGIN_DRIVER (exampledriver SOURCES exampleplugin.cc)

#add_executable(playerstagetest main.cpp)</pre><p>Now copy the complete project DIR to the Raspberry Pi and then create a build directory. In the build directory run the following command:</p><pre class="crayon-plain-tag">mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug /home/pi/PlayerProjects/PlayerStageTest/</pre><p>The last value is the location of your PlayerStage Project. We only need to run this command once for the project, if we change our main.cpp we don&#8217;t need to run this command. Next we can run <strong>make</strong> to create our program.</p><pre class="crayon-plain-tag">make</pre><p><a href="http://www.fritz-hut.com/wp-content/uploads/2012/12/result-of-compile.png"><img class="alignnone size-full wp-image-441" title="Result of the compiled program" alt="Result of the compiled program" src="http://www.fritz-hut.com/wp-content/uploads/2012/12/result-of-compile.png" width="537" height="495" /></a></p>
<p>The main advantage is that you can fully develop using Stage on your main computer and then export your source to the Raspberry Pi and run in there. One thing I don&#8217;t know if its possible to just run the player server and client at the same time. This means that you configure the player server for a specific robot and link it with the client file.</p>
<p>By changing the following line <strong>PlayerClient robot(&#8220;192.168.0.184&#8243;); </strong>I&#8217;m able to test out the player client on my Raspberry Pi and connect it with the player server running on my laptop.</p>
<p><a href="http://www.fritz-hut.com/wp-content/uploads/2012/12/Player-stage-working.png"><img class="alignnone size-full wp-image-443" title="Player running on the Pi, Stage on my Laptop" alt="Player running on the Pi, Stage on my Laptop" src="http://www.fritz-hut.com/wp-content/uploads/2012/12/Player-stage-working.png" width="1152" height="531" /></a></p>
<p>So I&#8217;ve successfully installed Player on the Raspberry Pi. Now it&#8217;s waiting for the robot too arrive.</p>
<p>The post <a href="http://www.fritz-hut.com/playerstage-compile-on-raspberrypi/">Player/Stage Compile on RaspberryPi</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.fritz-hut.com/playerstage-compile-on-raspberrypi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Player (Player/Stage) on Raspberry Pi</title>
		<link>http://www.fritz-hut.com/installing-player-playerstage-on-raspberry-pi/</link>
		<comments>http://www.fritz-hut.com/installing-player-playerstage-on-raspberry-pi/#comments</comments>
		<pubDate>Sun, 09 Dec 2012 14:13:49 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[Player/Stage]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Master Thesis]]></category>
		<category><![CDATA[Raspberry PI]]></category>
		<category><![CDATA[robotics]]></category>

		<guid isPermaLink="false">http://www.fritz-hut.com/?p=423</guid>
		<description><![CDATA[<p>A little heads up on how to install Player/Stage (but only Player) on the Raspberry Pi. First a complete updated system is required. Installing Player (Player/Stage) Player depends on the following packages that need to be installed using: [crayon-51c111d370f59/] This will take &#8230; <a href="http://www.fritz-hut.com/installing-player-playerstage-on-raspberry-pi/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.fritz-hut.com/installing-player-playerstage-on-raspberry-pi/">Installing Player (Player/Stage) on Raspberry Pi</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>A little heads up on how to install Player/Stage (but only Player) on the Raspberry Pi. First a complete updated system is required.</p>
<h2>Installing Player (Player/Stage)</h2>
<p>Player depends on the following packages that need to be installed using:</p><pre class="crayon-plain-tag">sudo apt-get install cmake g++ swig libboost-dev libboost-all-dev libltdl-dev libjpeg-dev libgstreamer0.10-dev libstatgrab-dev libusb-dev libasound2-dev libgsl0-dev libxmu-dev libxi-dev libfltk1.1-dev libopencv-contrib-dev libcv-dev freeglut3-dev</pre><p>This will take very long, apparently all the packages are found (crazy). I don&#8217;t really know if I included too many dependencies (I&#8217;m not really sure about the opencv) but it wont hurt! First time I had a file corruption problem (selected wrong package), now everything seems ok. After updating all the packages, restart the Raspberry Pi!</p>
<p>Download the trunk of player from the Player/Stage svn:</p><pre class="crayon-plain-tag">wget http://playerstage.svn.sourceforge.net/viewvc/playerstage/code/player/trunk/?view=tar -O player.tar.gz</pre><p>Decompress and expand the tarball, we also rename the output folder:</p><pre class="crayon-plain-tag">tar xzf player.tar.gz
mv trunk/ player/</pre><p>Create a build folder</p><pre class="crayon-plain-tag">cd player/
mkdir build
cd build/</pre><p>Great now its time to configure, we use the default configuration. <strong>Note that this can easily take 5-15min! </strong>Normally there shouldn&#8217;t be any errors (maybe some warnings):</p><pre class="crayon-plain-tag">cmake ../</pre><p>Next we compile and install. Also note that the first commando can <strong>take around 1h-2h</strong>. It&#8217;s possible that you see a couple of warnings, nothing to worry about.</p><pre class="crayon-plain-tag">make
sudo make install
sudo ldconfig</pre><p>Finally we test the installation using the Player help file. The following command should show the Player version number.</p><pre class="crayon-plain-tag">player -h</pre><p>And we get the following result:</p>
<p><a href="http://www.fritz-hut.com/wp-content/uploads/2012/12/result.png"><img class="alignnone size-full wp-image-438" title="Running player -h gives the following output" alt="Running player -h gives the following output" src="http://www.fritz-hut.com/wp-content/uploads/2012/12/result.png" width="543" height="512" /></a></p>
<p>The post <a href="http://www.fritz-hut.com/installing-player-playerstage-on-raspberry-pi/">Installing Player (Player/Stage) on Raspberry Pi</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.fritz-hut.com/installing-player-playerstage-on-raspberry-pi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Vector Field Histogram (VFH)</title>
		<link>http://www.fritz-hut.com/vector-field-histogram-vfh/</link>
		<comments>http://www.fritz-hut.com/vector-field-histogram-vfh/#comments</comments>
		<pubDate>Mon, 03 Dec 2012 19:47:24 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[Master Thesis]]></category>
		<category><![CDATA[obstacle avoidance]]></category>
		<category><![CDATA[Vector Field Histogram]]></category>
		<category><![CDATA[VFF]]></category>
		<category><![CDATA[VFH]]></category>
		<category><![CDATA[virtual force field]]></category>

		<guid isPermaLink="false">http://www.fritz-hut.com/?p=397</guid>
		<description><![CDATA[<p>Today I&#8217;ll talk about an interesting algorithm called Vector Field Histogram (VFH). This algorithm is developed by Johann Borenstein and Yoram Koren in 1991. This post is based on following article, including pictures and information: Borenstein, J. &#38; Koren, Y. The vector &#8230; <a href="http://www.fritz-hut.com/vector-field-histogram-vfh/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.fritz-hut.com/vector-field-histogram-vfh/">Vector Field Histogram (VFH)</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Today I&#8217;ll talk about an interesting algorithm called Vector Field Histogram (VFH). This algorithm is developed by Johann Borenstein and Yoram Koren in 1991. This post is based on following article, <a href="http://www-personal.umich.edu/~johannb/vff&amp;vfh.htm">including pictures and information</a>:</p>
<blockquote><p>Borenstein, J. &amp; Koren, Y. The vector field histogram-fast obstacle avoidance for mobile robots Robotics and Automation, IEEE Transactions on, IEEE, 1991, Vol. 7(3), pp. 278-288</p></blockquote>
<p>The original VFH algorithm is based on previous work on Virtual Force Field (VFF), a local path planning algorithm. Understanding VFH also requires a basic knowledge of the Virtual Force Field algorithm.</p>
<h2>The Purpose of VFH</h2>
<p>A robot should of course try to evade possible obstacles when driving around. A very basic approach can be used. For example lets look at our example robot. It has 3 ultrasonic range sensors mounted on the front side of the frame. The ultrasonic range sensors give back a distance measurement.</p>
<p><a href="http://www.fritz-hut.com/wp-content/uploads/2012/12/Ping-StingRay-Capteurs-Ultrasons.jpg"><img class="alignnone size-full wp-image-400" title="A Stingray Robot with 3 Ultrasonic Ranger Sensors" alt="A Stingray Robot with 3 Ultrasonic Ranger Sensors" src="http://www.fritz-hut.com/wp-content/uploads/2012/12/Ping-StingRay-Capteurs-Ultrasons.jpg" width="350" height="263" /></a></p>
<p>Simple algorithm would be, if the distance is lower than 0.5m then turn to other side with an angle of 60 degrees. Now the chances that the robot will drive in circles is pretty high. Also U-shaped corners are a no go for our little robot.</p>
<p>Creating a complex algorithm is also possible, but then again its possible that your robot will keep driving in the wrong direction (for example, you have to go from A to B but there is an obstacle in the way). VFH allows very accurate obstacle avoidance (using a laser) and plans a route to a specific goal.</p>
<h2>Virtual Force Field (VFF)</h2>
<p>First a bit about VFF, it&#8217;s important to understand the basic of this algorithm before understanding Vector Field Histogram. There are 3 steps in the VFF algorithm.</p>
<h3>Step 1</h3>
<p>VFF utilises a 2D Cartesians histogram to represent the obstacles. This grid moves along with the robot and has a specific size (33&#215;33 for example). Each range reading will update one cell in this histogram and so creates a <a href="http://en.wikipedia.org/wiki/Probability_distribution">probability distribution</a>. Only the cell that lies straight in front of the sensor will be updated, the surrounded cells are left alone. This seems as a very easy way, for example the ranger sensor detects an object and increases the probability of the specific cell. The trick lies in continuously and rapidly sampling for each sensor while moving and thus creating multiple readings for a specific cell and its neighbours. This creates a histogram probability distribution in which high certainty values are obtained in cells close to the actual location of the obstacle.</p>
<p><a href="http://www.fritz-hut.com/wp-content/uploads/2012/12/basics-of-vff.gif"><img class="alignnone size-full wp-image-410" title="Image from the VFH Article" alt="Image from the VFH Article" src="http://www.fritz-hut.com/wp-content/uploads/2012/12/basics-of-vff.gif" width="996" height="727" /></a></p>
<h3>Step 2</h3>
<p>The next step is applying the potential field idea to the histogram. It&#8217;s a simple idea. Every occupied cell in the histogram has a specific virtual force that works against the robot (pushing it away from the obstacle), those little virtual forces are combined in one big vector called <img src="//s0.wp.com/latex.php?latex=F_r&#038;bg=ffffff&#038;fg=000&#038;s=1" alt="F_r" title="F_r" class="latex" />. The goal that we try to reach also has a specific virtual force that pulls the robot in the goal&#8217;s direction. This force is called <img src="//s0.wp.com/latex.php?latex=F_t&#038;bg=ffffff&#038;fg=000&#038;s=1" alt="F_t" title="F_t" class="latex" />.</p>
<p><a href="http://www.fritz-hut.com/wp-content/uploads/2012/12/histogram-grid.gif"><img class="alignnone size-full wp-image-409" title="The different forces of the VFF algorithm" alt="The different forces of the VFF algorithm" src="http://www.fritz-hut.com/wp-content/uploads/2012/12/histogram-grid.gif" width="1126" height="1500" /></a></p>
<p>Combining the two repulsive and attractive forces gives us the new moving direction. Simple as that, more information and more mathematics can be found in the original paper but this explains the basic idea behind VFF.</p>
<h3> Step 3</h3>
<p>Step 1 and 2 are combined in a real-time algorithm. VFF introduces a new algorithm for updating the small grid cell. In 1991 processing power and memory were scarce to find.</p>
<h2>Vector Field Histogram</h2>
<p>Of course VFF has a couple of disadvantages that why VFF is used at the base of Vector Field Histogram. Mainly because VFF introduces a lot of data but wastes it by counting up all the different vectors in the grid cell. Hundred data points are reduces to only 2 values, the angle and magnitude of <img src="//s0.wp.com/latex.php?latex=F_r&#038;bg=ffffff&#038;fg=000&#038;s=1" alt="F_r" title="F_r" class="latex" />.</p>
<p>So Vector Field Histogram uses the same principle but reduces the information in two steps. There are three data levels in Vector Field Histogram:</p>
<ol>
<li>The highest level contains the histogram that continuously gets updated with sensor information, this is the same as in the VFF algorithm.</li>
<li>A polar histogram is constructed by reducing the histogram (from level 1) around the momentary location of the robot.</li>
<li>The lowest level contains the output of the Vector Field Histogram algorithm, the direction and the speed the robot must travel.</li>
</ol>
<p>The first data reduction step maps the active region of the histogram grid on the polar histogram. Like VFF an active window will follow the robot with a specific size (for example 32&#215;32 grid cells). But now we divide the polar histogram in different sectors K. If different cells have a higher number then the polar obstacle density will be higher in those sectors. A figure explains way better than words in my opinion.</p>

<a href='http://www.fritz-hut.com/vector-field-histogram-vfh/polar-obstacle-density/' title='The polar density histogram'><img width="150" height="150" src="http://www.fritz-hut.com/wp-content/uploads/2012/12/polar-obstacle-density-150x150.gif" class="attachment-thumbnail" alt="The polar density histogram" /></a>
<a href='http://www.fritz-hut.com/vector-field-histogram-vfh/polar-plot/' title='This shows the mapping of the polar plot'><img width="150" height="150" src="http://www.fritz-hut.com/wp-content/uploads/2012/12/polar-plot-150x150.gif" class="attachment-thumbnail" alt="This shows the mapping of the polar plot" /></a>

<p>If we have the histogram its possible to decide an optimal heading direction. The regions with very low values are possible directions were no obstacle is found. Now we only need to select the right direction, this direction should somewhat lead to the desired target.</p>
<p><a href="http://www.fritz-hut.com/wp-content/uploads/2012/12/finding-the-right-direction.png"><img class="alignnone size-full wp-image-414" title="Finding the right direction" alt="Finding the right direction" src="http://www.fritz-hut.com/wp-content/uploads/2012/12/finding-the-right-direction.png" width="870" height="499" /></a></p>
<p>The red regions indicate directions we should not travel, the green regions indicate save traveling directions.</p>
<p>Of course I totally ignored any formulas, but this overview gives the basic idea of the VFH algorithm. It uses virtual force vectors to decide the optimal heading direction, using the  polar obstacle density histogram. VFH is better than VFF because it takes more data into account. For more information, a little google scholar search should lead to the complete paper.</p>
<p>Next time I&#8217;ll talk about Particle Filters!</p>
<p>The post <a href="http://www.fritz-hut.com/vector-field-histogram-vfh/">Vector Field Histogram (VFH)</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.fritz-hut.com/vector-field-histogram-vfh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Master Thesis Subject DASH7</title>
		<link>http://www.fritz-hut.com/master-thesis-subject-dash7/</link>
		<comments>http://www.fritz-hut.com/master-thesis-subject-dash7/#comments</comments>
		<pubDate>Mon, 26 Nov 2012 08:31:56 +0000</pubDate>
		<dc:creator>Fritz</dc:creator>
				<category><![CDATA[Master Thesis]]></category>
		<category><![CDATA[Dash7]]></category>
		<category><![CDATA[robotics]]></category>
		<category><![CDATA[smart house]]></category>

		<guid isPermaLink="false">http://www.fritz-hut.com/?p=391</guid>
		<description><![CDATA[<p>Let&#8217;s talk about my Master Thesis. A Master Thesis always consist of two parts, screw one of them up and you will likely fail. First you do a technical/research study of the subject and gather as much as information as possible. During &#8230; <a href="http://www.fritz-hut.com/master-thesis-subject-dash7/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.fritz-hut.com/master-thesis-subject-dash7/">Master Thesis Subject DASH7</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Let&#8217;s talk about my Master Thesis. A Master Thesis always consist of two parts, screw one of them up and you will likely fail. First you do a technical/research study of the subject and gather as much as information as possible. During this part you try to understand what the hell you are going to do in the second part. And during the second part you execute what you studied in the first part.</p>
<p>Reading papers on your subject is always a good start. But I believe that telling a story, writing a blog, is even a better way to prepare yourself. Trying to explain a paper or algorithm in human-understandable words is a challenge. Enough introduction, lets start with my subject.</p>
<h2>The DASH7 work group (DASH7-Team)</h2>
<p>My Master Thesis is part of the DASH7-Team, this team aims to develop an intelligent &#8220;house&#8221; (Smart House) based on the wireless sensor network called DASH7. DASH7 is basically a new wireless technology like Bluetooth or ZigBee, but mainly used to send small packets of data (not a movie or pictures) like sensor information (light on or off?).</p>
<p>The team consist of 5 people who are actively involved in creating the Smart House. Two other people are also busy with DASH7 technology but have a subject that has nothing to do with the Smart House.</p>
<p>The idea is that we (me and my 4 colleagues) create a Smart House that basically disables the need for any type of button, switch, knob,&#8230; This means that the Smart House will automatically switch on the radio, adjust the volume, change the temperature in the House, switch on lights,&#8230;</p>
<h2>My Master Thesis</h2>
<p>My subject is not that involved in the global concept of a Smart House. I have to program a robot that will display information to the user, a sort of Butler Robot (with no arms, so no fetching beers&#8230;). The information displayed can be emails, Twitter status, Facebook spam and information about your current Smart Home settings and profile. The robot must locate itself using DASH7 technology. This seems easy, sure drive around, locate yourself using DASH7 and done. Nope not really.</p>
<p>Imagine you need to drive to an address where your never been before, you use your GPS right? Good now let&#8217;s assume you don&#8217;t have a GPS, you only know your current location and the location were you need to go. Still thinking about leaving?</p>
<p>The solution to this problem is known as SLAM (Simultaneous Localization And Mapping). To know were you are you need a map, but to acquire a map you need to know were you are. This calls for an <a href="http://knowyourmeme.com/memes/impossibru">IMPOSSIBRU</a> (know your internet meme&#8217;s).</p>
<p>My research focusses on acquiring the map. You can just draw a little floor plan, add this, and hope it will work. There are also other techniques for acquiring the map. After acquiring the map another part starts, how to avoid obstacles that are not on the map (MEOW!) and how to detect DASH7 tags that are placed all around the Smart House.</p>
<h2>Whats coming up</h2>
<p>In the next few weeks I&#8217;ll post more about my ongoing research and try to tackle some problems and technologies. I will mainly talk about robotics. Most of my information comes from papers I&#8217;ve read and studied. After the theory I&#8217;ll talk about my practical approach (robot, hardware, software,&#8230;).</p>
<p>The post <a href="http://www.fritz-hut.com/master-thesis-subject-dash7/">Master Thesis Subject DASH7</a> appeared first on <a href="http://www.fritz-hut.com">Fritz-Hut</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.fritz-hut.com/master-thesis-subject-dash7/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 5.458 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-06-19 03:05:08 -->

<!-- Compression = gzip -->