mobilewireless.php3 33.6 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004, 2005 University of Utah and the Flux Group.
# All rights reserved.
#
chdir("..");
require("defs.php3");

# Page arguments.
$printable = $_GET['printable'];

# Pedantic page argument checking. Good practice!
if (isset($printable) && !($printable == "1" || $printable == "0")) {
    PAGEARGERROR();
}
if (!isset($printable))
    $printable = 0;

#
# Standard Testbed Header
#
if (!$printable) {
    PAGEHEADER("Emulab Tutorial - Mobile Wireless Networking");
}

if (!$printable) {
    echo "<b><a href=$REQUEST_URI?printable=1>
             Printable version of this document</a></b><br>\n";
}

function NLCH1($value)
{
	echo "<td align=\"right\" valign=\"top\" class=\"stealth\">
                <b>$value</b>
              </td>";
}

function NLCH2($value)
{
	echo "<td align=\"right\" valign=\"top\" class=\"stealth\">
                <font size=\"-1\"><i>$value</i></font>
              </td>";
}

function NLCBODYBEGIN()
{
	echo "<td align=\"left\" valign=\"top\" class=\"stealth\">";
}

51
52
53
54
55
function NLCBODYLONGBEGIN($cols)
{
	echo "<td align=\"left\" valign=\"top\" class=\"stealth\" colspan=\"$cols\" style=\"padding: 0px; \" >";
}

56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
function NLCBODYEND()
{
	echo "</td>";
}

function NLCFIGBEGIN()
{
	echo "<td align=\"center\" valign=\"top\" class=\"stealth\">";
}

function NLCFIGEND()
{
	echo "</td>";
}

function NLCFIG($value, $caption)
{
	echo "<td align=\"center\" valign=\"top\" class=\"stealth\">
                $value
                <font size=\"-2\">$caption</font>
              </td>";
}

function NLCLINKFIG($link, $value, $caption)
{
	echo "<td align=\"center\" valign=\"top\" class=\"stealth\">
                <a href=\"$link\" border=\"0\">
                  $value<br>
                  <font size=\"-2\">[$caption]</font></a>
              </td>";
}

88
89
90
91
92
93
94
95
96
97
function NLCLINKFIG2($link, $value, $caption, $explanation)
{
	echo "<td valign=\"top\" class=\"stealth\" width='50%'>
                <a href=\"$link\" border=\"1\">
                  <center>$value</center></a>
                  <font size=\"-2\"><b>$caption:</b>
                $explanation</font>
              </td>";
}

98
99
100
101
102
103
104
105
106
107
function NLCEMPTY()
{
	echo "<td class=\"stealth\"></td>";
}

#
# Drop into html mode
#
?>
<center>
108

109
110
    <h2>Emulab Tutorial - Mobile Wireless Networking</h2>

111
</center>
112

113
114
<script type="text/javascript">
default_text = "Click on an image to enlarge.";
115

116
117
118
119
if (document.all || document.getElementById || document.layers) {
  has_scripting = true;
  default_text = "(Move mouse over an image to see a caption here; click to enlarge.)";
}
120

121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
captions = new Array();
//captions[0] = 'Three of our Acroname Garcia robots.  Each robot has a ' + 
//	      'blue and orange marker from which the localization system ' +
//	      'extracts position and orientation.  All robots have a one ' +
//	      'antenna riser, beneath which is an Intel Stargate and ' +
//	      'Crossbow Mica2 mote.';
captions[0] = 'Three of our modified Acroname Garcia robots.  Fiducials for ' +
	      'vision system atop antenna riser mount; Intel ' +
	      'Stargate and Crossbow Mica2 beneath riser.';
captions[1] = 'A wall-mounted mote.  Mote is behind the serial programming ' +
	      'board; a sensor board is visible in front.';
captions[2] = 'A screenshot of our Java applet motion control interface, ' +
	      'enlarged webcam showing robot motion and position.';
captions[3] = 'Robots prior to antenna riser modifications.  Crosshatch ' +
	      'pattern used for localization system calibration.';
captions[4] = 'A ceiling-mounted mote.';

function imageinfo(msg) {
  mmsg = '<div style="text-align: center; font-size: 10px; font-style: italic;">' + msg +'</div>';
  //mmsg = msg;
  elm = (document.getElementById)?document.getElementById('captionLayer'):(document.all)?document.all['captionLayer']:null;

  if (elm && typeof elm.innerHTML != "undefined") {
    elm.innerHTML = mmsg;
  }
  else if (document.layers) {
    document.layers['captionLayer'].document.write(mmsg);
  }

//  if (document.all) {
//    elm.innerHTML = mmsg;
//  }
//  else if (document.getElementById) {
//    range = document.createRange();
//    range.setStartBefore(elm);
//    html = range.createContextualFragment(mmsg);
//    while (elm.hasChildNodes()) {
//      elm.removeChild(elm.lastChild);
//    }
//    elm.appendChild(html);
//  }
//  else {
//    elm.document.write(mmsg);
//  }
}

</script>
  
169
170
171
172
173

<table cellspacing=5 cellpadding=5 border=0 class="stealth" bgcolor="#ffffff">

<tr><td colspan="3" class="stealth"><hr size=1></td></tr>

174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<tr>
<td colspan="3" class="stealth" align=center>
<table cellspacing=5 cellpadding=5 class="stealth" width="100%">
<tr>
<td class="stealth" align=center>
  <a href="3bots.jpg" onmouseover="imageinfo(captions[0])" onmouseout="imageinfo(default_text)">
  <img src="3bots_thumb.jpg" border=1 alt="Our Robots.">
  </a>
</td>
<td class="stealth" align=center>
  <a href="wall_mote.jpg" onmouseover="imageinfo(captions[1])" onmouseout="imageinfo(default_text)">
  <img src="wall_mote_thumb.jpg" border=1 alt="Our Robots.">
  </a>
</td>
<td class="stealth" align=center>
  <a href="interface1.jpg" onmouseover="imageinfo(captions[2])" onmouseout="imageinfo(default_text)">
  <img src="interface1_thumb.jpg" border=1 alt="User Interface.">
  </a>
</td>
<td class="stealth" align=center>
  <a href="5bots.jpg" onmouseover="imageinfo(captions[3])" onmouseout="imageinfo(default_text)">
  <img src="5bots_thumb.jpg" border=1 alt="Our Robots.">
  </a>
</td>
<td class="stealth" align=center>
  <a href="ceiling_mote.jpg" onmouseover="imageinfo(captions[4])" onmouseout="imageinfo(default_text)">
  <img src="ceiling_mote_thumb.jpg" border=1 alt="Our Robots.">
  </a>
</td>
</tr>
<tr>
<td colspan=5 class=stealth align=center>
  <div id="captionLayer" name="captionLayer" style="text-align: center;">
    <script type="text/javascript">
      imageinfo(default_text);
    </script>
  </div>
</td>
</tr>
</table>
</center>
</td>
</tr>

<tr><td colspan="3" class="stealth"><hr size=1></td></tr>
219
220
221

<tr>

222
<?php NLCH1("Preface") ?>
223

224
225
226
227
<?php NLCBODYLONGBEGIN(2) ?>

<table class="stealth" cellpadding=0 cellspacing=0 style="padding: 0px; margin: 0px">
 <tr><td class="stealth">
228

Jay Lepreau's avatar
Tweak    
Jay Lepreau committed
229
We have deployed and opened to public external use a small version of
230
what will grow into a large mobile robotic wireless testbed.  The
231
small version (6 Motes and 6 Stargates on 6 robots, all remotely
232
controllable, plus 25 static Motes) is in an open area within our offices;
233
the big one will be elsewhere.
234

235
236
237
238
239
240
<p>
This manual is broken up into the following sections:

<ol>
<li><a href="#INTRO">Introduction</a>
<li><a href="#MOBILE">Mobile Experiments</a>
241
<li><a href="#WIRELESS">Wireless Traffic (Mobile motes and fixed motes)</a>
242
243
244
<li><a href="#FAQ">Frequently Asked Questions</a>
</ol>

Timothy Stack's avatar
Timothy Stack committed
245
246
<p>
If you are interested in how the mobile testbed works, you can read the
247
248
following paper (to appear at <a href="http://www.ieee-infocom.org/2006/">IEEE
Infocom</a>, April 2006):
Timothy Stack's avatar
Timothy Stack committed
249
250

<blockquote>
251
252
<a href="http://www.cs.utah.edu/flux/papers/robots-infocom06-base.html">
Mobile Emulab: A Robotic Wireless and Sensor Network Testbed</a> 
Timothy Stack's avatar
Timothy Stack committed
253
254
</blockquote>

255
256
257
258
259
260
261
262
<p>
You can read a shorter overview of the mobile testbed in this article:

<blockquote>
<a href="http://www.cs.utah.edu/flux/testbed-docs/teapot05-emulab-only.pdf">
Real Mobility, Real Wireless: A New Kind of Testbed</a>
</blockquote>

263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
  </td>

  <td valign="top" class="stealth">

  <table class="stealth">
  <tr><td style="padding: 5px; border: solid 2px #669; background-color: #F1FAFA;">

<b>Tools:</b>

<p style="text-indent: 0em;">

<a href="<?php echo $TBBASE?>/robotrack/robotrack.php3">Real-time Robot Tracking Applet</a>
<br>
<a href="<?php echo $TBBASE ?>/webcam.php3">Live Webcams</a>
<br>
<a href="<?php echo $TBBASE ?>/robotmap.php3">Static Robot Map</a>
<br>
<a href="<?php echo $TBBASE ?>/newimageid_ez.php3?nodetype=mote">Mote Image
Creation Page</a>
<br>
<a href="<?php echo $TBBASE ?>/wireless-stats/statsapp.php3">WSN Connectivity
Statistics Applet</a>

</ul>

  </td></tr></table>

  </td>
  </tr

</table>


296
297
<?php NLCBODYEND() ?>

298
<!-- ?php NLCEMPTY() ? -->
299
300
301
302

</tr>

<tr>
303

304
305
306
307
<?php NLCH1("Introduction") ?>

<?php NLCBODYBEGIN() ?>
<!-- Center -->
308

309
<a name="INTRO"></a>
310
In addition to <a href="docwrapper.php3?docname=wireless.html">fixed wireless
311
312
nodes</a> (currently predominantly 802.11), Emulab also features wireless nodes attached
to robots that can move
313
314
315
316
around a small area.  These robots consist of a small body (shown on the right)
with an <a href="http://www.xbow.com/Products/XScale.htm">Intel Stargate</a>
that hosts a mote with a wireless network interface.  The goal of this "mobile
wireless testbed" is to give users an opportunity to conduct experiments with
317
wireless nodes that are truly mobile. 
318
319
<!-- in configurable physical locations and while in motion. -->
For
320
example, mobile nodes could be used to realistically test and evaluate an
321
ad-hoc routing algorithm in a fairly repeatable manner.  This document is
322
intended as a tutorial for those interested in making use of this testbed;
323
324
there is also a short <a href="<?php echo
$TBBASE?>/doc/docwrapper.php3?docname=mobilewireless.html">reference manual</a>
325
available that gives a few details about the workings of the system.
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348

<br>
<br>
<?php NLCBODYEND() ?>

<?php NLCLINKFIG("http://www.acroname.com/garcia/garcia.html",
		 "<img src=\"garcia-thumb.jpg\" border=1
                       alt=\"Acroname Garcia\">",
		 "Acroname&nbsp;Garcia") ?>

</tr>

<tr>

<?php NLCH2("Features") ?>

<?php NLCBODYBEGIN() ?>

The current features of the mobile wireless testbed are:

<ul>
<li>Four <a href="http://www.acroname.com">Acroname Garcia</a> robots
<li><a href="http://www.xbow.com/Products/XScale.htm">Intel Stargate</a> single
Kirk Webb's avatar
   
Kirk Webb committed
349
board computers for each robot. (<b><a href="<?php echo $TBBASE?>/doc/docwrapper.php3?docname=stargatenotes.html">Important Notes!</a></b>)
350
<li>Roaming an area about 8 x 3.5 meters with a sheetrock-covered steel pillar in the middle.
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<li>Each robot has its own
    <a href="http://www.xbow.com/Products/productsdetails.aspx?sid=72">
    900MHz Mica2 mote</a> attached to the Stargate.
<li>25 statically-placed
    <a href="http://www.xbow.com/Products/productsdetails.aspx?sid=72">
    900MHz Mica2 motes</a>, two of which are attached to
    <a href="http://www.xbow.com/Products/productsdetails.aspx?sid=90">
    E-Mote</a> Ethernet gateways for Berkeley Motes.
<li><a href=http://www.xbow.com/Products/productsdetails.aspx?sid=75>
    Mica2 Multi-Sensor Module</a> boards attached to 10 floor level Motes,
    and to each Robot (Stargate) Mote.
<li>Six overhead cameras for vision-based position tracking of the robots.
<li>Three <a href="<?php echo $TBBASE ?>/webcam.php3">webcams</a> for viewing 
the robots in their habitat.
365
366
<li>An <a href="<?php echo $TBBASE ?>/robotmap.php3">abstract map</a> of the
current locations of the robots.
367
368
369
370
<li>A <a href="<?php echo $TBBASE ?>/robotrack/robotrack.php3">live robot
motion control applet</a> for drag and drop control and monitoring of robots.
<li>An <a href="<?php echo $TBBASE ?>/wireless-stats/statsapp.php3">applet for
viewing wireless link connectivity</a> in our WSN testbed.
371
<li>Open for public use weekdays 8am-6pm MST, with operations support.
372
373
374
375
376
377
378
379
380
381
382
383
384
385
</ul>

<?php NLCBODYEND() ?>

<?php NLCEMPTY() ?>

</tr>

<tr>

<?php NLCH2("Limitations") ?>

<?php NLCBODYBEGIN() ?>

386
387
Due to the "brand-new" nature of this part of Emulab, there are some
limitations you should be aware of:
388
389

<ul>
390
391
392
<li>Before you can use the mobile testbed, your project must be granted the
appropriate privileges.  You can request access by sending mail to <a
href="mailto:testbed-ops@flux.utah.edu">Testbed Operations</a>.
393
394
395
<li>The mobile testbed is currently open on non-holiday weekdays between
8am and 6pm mountain time, so we have staff available to assist with problems.
<li>There is no space sharing; only one mobile experiment can be swapped-in at
396
a time.
Timothy Stack's avatar
   
Timothy Stack committed
397
<li>Batteries must be replaced manually by the operator when levels are low.
398
399
</ul>

400
We expect to overcome these limitations over time; however, we are also eager to
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
introduce external users to the mobile testbed early on so we can integrate
their feedback.

<?php NLCBODYEND() ?>

<?php NLCEMPTY() ?>

</tr>

<tr><td colspan="3" class="stealth"><hr size=1></td></tr>

<tr>

<?php NLCH1("Mobile Experiments") ?>

<?php NLCBODYBEGIN() ?>

418
<a name="MOBILE"></a>
419
420
421
422
Creating a mobile wireless experiment is very similar to creating a regular
Emulab experiment: you construct an NS file, swap in the experiment, and then
you can log into the nodes to run your programs.  There are, of course, some
extra commands and settings that pertain to the physical manifestations of the
Timothy Stack's avatar
   
Timothy Stack committed
423
424
425
426
robots.  This tutorial will take you through the process of: creating a mobile
experiment, moving the robots to various destinations, creating random motion
scenarios, and "attaching" transmitter and receiver motes to the robots in your
experiment.
427
428
429

<?php NLCBODYEND() ?>

Timothy Stack's avatar
   
Timothy Stack committed
430
431
432
433
434
435
436
437
<?php NLCFIGBEGIN() ?>

<font size="-2">Sample Movie</font>
<img src="robot_anim.gif" border="1" alt="Robot Movie">
<a href="robot_divx.avi"><font size="-2">[DiVX (1.2M)]</font></a><br>
<a href="robot.mpg"><font size="-2">[MPG (5.3M)]</font></a>

<?php NLCFIGEND() ?>
438
439
440
441
442
443
444
445
446
447
448
449

</tr>

<tr>

<?php NLCH2("A First Experiment") ?>

<?php NLCBODYBEGIN() ?>

Lets start with a simple NS script that will allocate a single robot located in
our building:

Timothy Stack's avatar
   
Timothy Stack committed
450
<blockquote style="border-style:solid; border-color:#bbbbbb; border-width: thin">
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
<pre>set ns [new Simulator]
source tb_compat.tcl

set topo [new Topography]
$topo load_area MEB-ROBOTS

$ns node-config -topography $topo

set node(0) [$ns node]

$node(0) set X_ 3.01
$node(0) set Y_ 2.49

$ns run</pre>
</blockquote>
Timothy Stack's avatar
   
Timothy Stack committed
466
467
468
469
<center>
<font size="-2">Figure 1: Example NS file with mobile nodes.</font>
</center>
<br>
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498

Some parts of that example should be familiar to regular experimenters, so we
will focus mainly on the new bits of code.  First, we specified the physical
area where the robots will be roaming by creating a "topography" object and
loading it with the dimensions of that area:

<blockquote>
<pre><i>Line 4:</i>  set topo [new Topography]
<i>Line 5:</i>  $topo load_area MEB-ROBOTS</pre>
</blockquote>

In this case, the "MEB-ROBOTS" area is the name given to part of our office
space in the Merrill Engineering Building.  Next, we change the default node
configuration so any subsequent calls to "<code>[$ns node]</code>" will
automatically attach the node to the topography we just created:

<blockquote>
<pre><i>Line 7:</i>  $ns node-config -topography $topo</pre>
</blockquote>

Finally, after creating the robot, we need to set the initial position in the
area:

<blockquote>
<pre><i>Line 11:</i> $node set X_ 3.01
<i>Line 12:</i> $node set Y_ 2.49</pre>
</blockquote>

The values specified above are measured in meters and based on the map located
499
500
501
<a href="<?php echo $TBBASE ?>/robotmap.php3">here</a>, where the origin is in
the upper left hand corner, with positive X going right and positive Y going
down.  You can also click on the map to get a specific set of coordinates.
502
503
Note that any coordinates you specify must not fall inside an obstacle, or they will
be rejected by the system.  A Java applet that updates in real time is linked
Leigh B. Stoller's avatar
Leigh B. Stoller committed
504
505
from the above page, or can be accessed directly
<a href="<?php echo $TBBASE ?>/robotrack/robotrack.php3">here.</a>
506
507
508
509
510
511

<p>
With this NS file you can now create your first mobile experiment.  Actually
creating the experiment is the same as any other, except you might want to
check the "Do Not Swapin" checkbox so that the creation does not fail if
someone else is using the mobile testbed at the time.  Once the area is free
512
for use, you can swap-in your experiment and begin to work.
513
514
515
516
517
518
519
520
521
522
523
524
525

<?php NLCBODYEND() ?>

<?php NLCEMPTY() ?>

</tr>

<tr>

<?php NLCH2("Adding Motion") ?>

<?php NLCBODYBEGIN() ?>

526
527
Now that you have a node allocated, let's make it mobile.  During swap-in,
Emulab will start moving the node to its initial position.  You can watch its
Timothy Stack's avatar
   
Timothy Stack committed
528
progress by using the "Robot Map" menu item on the experiment page and checking
529
out the <a href="<?php echo $TBBASE ?>/webcam.php3">webcams</a> or
530
the <a href="<?php echo $TBBASE ?>/robotrack/robotrack.php3">applet version of the map</a>
531
that updates in real time.
532

Timothy Stack's avatar
Timothy Stack committed
533
534
535
<p>
<table width="100%" cellpadding=0 cellspacing=0 border=0 class="stealth">
<tr>
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
<?php NLCLINKFIG2("robotmap-ss.gif", 
		  "<img src=\"robotmap-ss-thumb.gif\" border=2
		  alt=\"Robot Map Screenshot\">",
		  "Sample Robot Map Screenshot",
		  "All four robots arranged in an 'L' shape.  The real world
		  coordinates for the robots are in the bottom middle table.")
		  ?>
<?php NLCLINKFIG2("webcam-ss.gif",
		  "<img src=\"webcam-ss-thumb.gif\" border=2
		  alt=\"Webcam Screenshot\">",
		  "Sample Webcam Screenshot",
		  "The real world view of the same four robots from the map
                  screenshot.  Note that the grid on the floor is used to
                  calibrate the overhead tracking cameras and not lines for the
                  robots to follow.") ?>
Timothy Stack's avatar
Timothy Stack committed
551
552
553
</tr>
</table>

Timothy Stack's avatar
   
Timothy Stack committed
554
555
556
<p>
Take a few moments to familiarize yourself with those pages since we'll be
making use of them during the rest of the tutorial.  One important item to note
557
558
559
560
561
562
563
on the robot map page is the "Elapsed event time" value, which displays how
much time has elapsed since the robots have reached their initial positions.
The elapsed time is also connected to when <code>"$ns at"</code> events in the
NS file are run.  In this case, there were no events in the NS file, so we'll
be moving the robot by sending dynamic SETDEST events, much like sending START
and STOP events to <a href="docwrapper.php3?docname=advanced.html">traffic
generators</a> and <a
Timothy Stack's avatar
   
Timothy Stack committed
564
565
566
href="docwrapper.php3?docname=advanced.html#ProgramObjects">program
objects</a>.

567
568
569
570
<!-- XXX We need to give them a clue on which way the webcam is pointing in -->
<!-- relation to the robot map. -->

<p>
Timothy Stack's avatar
   
Timothy Stack committed
571
572
Once the robot has reached its initial position, lets move it up a meter.  To
do this, you will need to log in to ops.emulab.net and run:
573

Timothy Stack's avatar
   
Timothy Stack committed
574
<blockquote style="border-style:solid; border-color:#bbbbbb; border-width: thin">
575
576
<pre>1 ops:~> /usr/testbed/bin/tevc -e <b>proj</b>/<b>exp</b> \
             now node-0 SETDEST X=3.0 Y=1.5</pre>
577
</blockquote>
Timothy Stack's avatar
   
Timothy Stack committed
578
579
580
581
582
583
584
<blockquote>
<center>
<font size="-2">Figure 2: Command to send an event that will move the robot to
the coordinates (3.0, 1.5).  Don't forget to change <b>proj</b>/<b>exp</b> to
match your project and experiment IDs.</font>
</center>
</blockquote>
585
586
587

<!-- mention that one setdest will override the previous. --> 

588
Then, check back with the map and webcams to see the results of your handiwork.
589
590
591
592
593
594
595
596
597
598
Try moving it around a few more times to get a feel for how things work and
where the robot can go.  Note that the robot should automatically navigate
around obstacles in the area, like the pole in the middle, so you do not have
to plot your own course around them.

<p>
In addition to driving the robot with dynamic events, you can specify a static
set of events in the NS file.  For example, you can issue the same move as
above at T +5 seconds by adding:

Timothy Stack's avatar
   
Timothy Stack committed
599
600
<blockquote style="border-style:solid; border-color:#bbbbbb; border-width: thin">
<pre>$ns at 5.0 "$node(0) setdest 3.01 1.5 0.1"</pre>
601
</blockquote>
Timothy Stack's avatar
   
Timothy Stack committed
602
603
604
605
606
<center>
<font size="-2">Figure 3: NS syntax that moves the robot to the same
destination as in Figure 2.</font>
</center>
<br>
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624

Note that "setdest" takes a third argument, the speed, in addition to the X and
Y coordinates.  The robot's speed is currently fixed at 0.1 meters per second.

<?php NLCBODYEND() ?>

<?php NLCEMPTY() ?>

</tr>

<tr>

<?php NLCH2("Random Motion") ?>

<?php NLCBODYBEGIN() ?>

Generating destination points for nodes can become quite a tedious task, so we
provide a modified version of the NS-2 "setdest" tool that will produce a valid
Timothy Stack's avatar
   
Timothy Stack committed
625
626
set of destination points for a given area.  The tool, called "tbsetdest", is
installed on ops and takes the following arguments:
627
628
629
630

<blockquote>
<ul>
<li><b>-n</b> <i>nodes</i> - The total number of nodes to generate motion for.
631
632
The format for the node variables in the generated code is,
"<code>$node(N)</code>", so write your NS file accordingly.
633
634
635
636
637
638
639
<li><b>-t</b> <i>secs</i> - The simulation time, in seconds.
<li><b>-a</b> <i>area</i> - The name of the area where the robots will be
roaming around.  Currently, MEB-ROBOTS is the only area available.
</ul>
</blockquote>

Now, taking your existing NS file, we'll add another node to make things more
Timothy Stack's avatar
   
Timothy Stack committed
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
interesting:

<blockquote style="border-style:solid; border-color:#bbbbbb; border-width: thin">
<pre><i>...</i>
$ns node-config -topography $topo

set node(0) [$ns node]
<b>set node(1) [$ns node]</b></pre>
</blockquote>
<center>
<font size="-2">Figure 4: Excerpt of the original NS file with an additional
node.
</font>
</center>
<br>

Then, use "tbsetdest" to produce some random motion for both robots:
657
658

<blockquote>
Timothy Stack's avatar
   
Timothy Stack committed
659
<pre>2 ops:~> /usr/testbed/bin/tbsetdest -n 2 -t 60 -a MEB-ROBOTS</pre>
660
661
662
663
</blockquote>

Here is some sample output from the tool:

Timothy Stack's avatar
   
Timothy Stack committed
664
<blockquote style="border-style:solid; border-color:#bbbbbb; border-width: thin">
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
<pre>$node(0) set X_ 3.01
$node(0) set Y_ 2.49
$node(1) set X_ 1.22
$node(1) set Y_ 3.61
set rtl [$ns event-timeline]
#
# nodes: 2, pause: 0.50, max x: 5.90, max y: 4.00
#
$rtl at 0.50 "$node(0) setdest 0.92 3.28 0.10"
$rtl at 0.50 "$node(1) setdest 0.61 3.02 0.10"
$rtl at 9.50 "$node(1) setdest 0.88 2.09 0.10"
$rtl at 19.64 "$node(1) setdest 2.80 2.07 0.10"
$rtl at 23.37 "$node(0) setdest 5.62 2.79 0.10"
$rtl at 39.43 "$node(1) setdest 4.98 1.65 0.10"
#
# Destination Unreachables: 0
#</pre>
</blockquote>
Timothy Stack's avatar
   
Timothy Stack committed
683
684
685
686
<center>
<font size="-2">Figure 5: Sample "tbsetdest" output.</font>
</center>
<br>
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711

You can then add the second node and motion events by clicking on the "Modify
Experiment" menu item on the experiment web page and:

<ol>
<li>Copying and pasting the "tbsetdest" output into the NS file before the
"<code>$ns run</code>" command; and
<li>Starting the modify.
</ol>

While the modify is working, lets take a closer look at the output of
"tbsetdest".  You may have noticed the following new syntax:

<blockquote>
<pre><i>Line 5:</i>  set rtl [$ns event-timeline]
<i>Lines 9+:</i> $rtl at ...</pre>
</blockquote>

These commands create a new "timeline" object and then add events to it, much
like adding events using "<code>$ns at</code>".  The difference is that the
events attached to a timeline object can be requeued by sending a START event
to the timeline, in contrast to the "<code>$ns at</code>" events which are only
queued when the event system starts up.  This feature can be useful for testing
your experiment by just (re)queueing subsets of events.

712
<p>
Timothy Stack's avatar
   
Timothy Stack committed
713
714
Once the modify completes, wait for the robots to reach their initial position
and then start the robots on their way by running the following on ops:
715

Timothy Stack's avatar
   
Timothy Stack committed
716
<blockquote style="border-style:solid; border-color:#bbbbbb; border-width: thin">
717
<pre>3 ops:~> /usr/testbed/bin/tevc -e <b>proj</b>/<b>exp</b> now rtl START</pre>
718
</blockquote>
Timothy Stack's avatar
   
Timothy Stack committed
719
720
721
722
723
724
725
<blockquote>
<center>
<font size="-2">Figure 6: Command to start the "rtl" timeline.  Again, don't
forget to change <b>proj</b>/<b>exp</b> to match your project and experiment
IDs.</font>
</center>
</blockquote>
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742

<?php NLCBODYEND() ?>

<?php NLCEMPTY() ?>

</tr>


<tr><td colspan="3" class="stealth"><hr size=1></td></tr>


<tr>

<?php NLCH1("Wireless Traffic") ?>

<?php NLCBODYBEGIN() ?>

743
<a name="WIRELESS"></a>
744
745
746
Now that you are getting the hang of the mobility part of this testbed, we can
move on to working with wireless network traffic.  As stated earlier, each of
the robots carries a Mica2 mote (pictured on the right), which is a popular
747
748
749
device used in wireless sensor networks.  We'll be using the motes on the
mobile nodes you already have allocated and loading them with <a
href="http://www.tinyos.net">TinyOS</a> demo kernels, one that will be sending
Timothy Stack's avatar
   
Timothy Stack committed
750
traffic and the other receiving.
751
752
753
754
755
756
757
758
759
760
761
762

<?php NLCBODYEND() ?>

<?php NLCLINKFIG("http://www.tinyos.net/scoop/special/hardware",
		 "<img src=\"mica2-thumb.jpg\" border=1
                       alt=\"Mica2 Mote\">",
		 "Mica2&nbsp;Mote") ?>

</tr>

<tr>

763
<?php NLCH2("Adding Mobile Motes") ?>
764
765
766
767
768
769

<?php NLCBODYBEGIN() ?>

Adding a couple of motes to your existing experiment can be done by doing a
modify and adding the following NS code:

Timothy Stack's avatar
   
Timothy Stack committed
770
771
772
<blockquote style="border-style:solid; border-color:#bbbbbb; border-width: thin">
<pre>## BEGIN mote nodes
$ns node-config -topography ""
773

Timothy Stack's avatar
   
Timothy Stack committed
774
775
776
777
set receiver [$ns node]
tb-set-hardware $receiver mica2
tb-set-node-os $receiver TinyOS-RfmLed
tb-fix-node $receiver $node(0)
778

Timothy Stack's avatar
   
Timothy Stack committed
779
780
781
782
783
set transmitter [$ns node]
tb-set-hardware $transmitter mica2
tb-set-node-os $transmitter TinyOS-CntRfm
tb-fix-node $transmitter $node(1)
## END mote nodes</pre>
784
</blockquote>
Timothy Stack's avatar
   
Timothy Stack committed
785
786
787
788
<center>
<font size="-2">Figure 7: NS syntax used to "attach" motes to a robot.</font>
</center>
<br>
789
790
791

This code creates two mote nodes and "attaches" each of them to one of the
mobile nodes.  The OSs to be loaded on the mote nodes are the receiver,
792
TinyOS-RfmLed, and the transmitter, TinyOS-CntRfm.  These are standard
793
TinyOS kernels supplied by Emulab; uploading your own is covered below.
794
The receiver kernel will
795
796
797
798
799
800
listen for packets containing a number from the transmitter and display the
number, in binary, on the mote's builtin LEDs.  The transmitter kernel will
then send packets every second containing the value of a counter that goes from
one to eight.  So, if the mote's radios are well within range of each other,
the receiver should pick up the packets and display the number on the LEDs.  Of
course, since you're not physically around to see that, you can click on the
801
802
"Show Blinky Lights" menu item on the experiment web page to bring up a webpage
with an applet that provides a near real-time view of the lights.
803
804

<p>
805
806
807
808
After the modify completes, try moving the nodes close to one another and far
away, to see the lights updating, or not.  You should also try running the
nodes through the random motion created earlier and watching for the same
effect on the lights.
809

810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861

<?php NLCBODYEND() ?>

<?php NLCEMPTY() ?>

</tr>


<tr>

<?php NLCH2("Adding Fixed Motes") ?>

<?php NLCBODYBEGIN() ?>

Adding a fixed mote to your experiment is slightly simpler than adding mobile
motes:

<blockquote style="border-style:solid; border-color:#bbbbbb; border-width: thin">
<pre>## BEGIN fixed mote nodes
set fixed-receiver [$ns node]
tb-set-hardware $fixed-receiver static-mica2
tb-set-node-os $fixed-receiver TinyOS-RfmLed
## END fixed mote nodes</pre>
</blockquote>
<center>
<font size="-2">Figure 8: NS syntax used to add a fixed mote.</font>
</center>
<br>

This code creates a single mote and loads the same TinyOS image as was
previously loaded onto the mobile receiver mote.  Since the fixed
motes are mounted on serial programming boards, you will not be able to access
their LEDs as you did when adding mobile motes.

If you want to choose a specific mote from the topology (view placement and
positions by looking at the <a href="/robotmap.php3">robot map</a>), add the
following NS code:

<blockquote style="border-style:solid; border-color:#bbbbbb; border-width: thin">
<pre>
tb-fix-node $fixed-receiver mote107
</pre>
</blockquote>
<center>
<font size="-2">Figure 9: NS syntax used to select a specific fixed mote.</font>
</center>
<br>

This code allows you to explicitly choose mote107, rather than allowing Emulab
to select a mote on your behalf.  Those who require very specific wireless network
topologies may wish to use this command.

862
863
864
865
866
867
868
<p>
You can use the 
<a href="<?php echo $TBBASE?>/wireless-stats/statsapp.php3">WSN Connectivity
Applet</a> to choose specific motes with desired 
link quality.  Then, using the mechanism above, you can bind the specific mote
you want to a node name in your experiment.

869
870
871
872
873
874
875
876
877
878
879
880
881
<?php NLCBODYEND() ?>

<?php NLCEMPTY() ?>

</tr>


<tr>

<?php NLCH2("Custom Mote Applications") ?>

<?php NLCBODYBEGIN() ?>

882
883
884
885
886
Uploading your own code to run on the motes is easy. Just build your TinyOS app
normally (ie. '<code>make mica2</code>').  Then, upload the binary that gets
placed in <code>build/mica2/main.srec</code> to our
<a href="<?php echo $TBBASE ?>/newimageid_ez.php3?nodetype=mote">mote image
    creation page</a>.  This page will ask you for a 'descriptor'.  This
887
descriptor can then be used in <code>tb-set-node-os</code> lines in your
888
889
890
NS files, and your app will be automatically loaded on the appropriate mote(s).

<p>
891
892
893
894
895
Alternatively, if you don't have a local TinyOS build environment, just load
ours onto an Emulab PC in your experiment.  You can do this by setting the node
operating system to <b>RHL90-TINYOS</b> using the <code>tb-set-node-os</code>
command (as shown in the Emulab <a
href="http://www.emulab.net/tutorial/docwrapper.php3?docname=tutorial.html">tutorial</a>).  This image is based off Emulab's
896
default RedHat 9.0 image and has an installation of a TinyOS 1.1.14 CVS
897
898
899
900
901
snapshot.  When you log in to the node, the $TOSROOT and $TOSDIR environment
variables will be set to /opt/tinyos-1.x and /opt/tinyos-1.x/tos,
respectively.  Your $CLASSPATH variable will also include the TinyOS Java paths
necessary to run many common Java applications supplied with TinyOS.
<!--
902
903
904
At this time, we don't have a TinyOS installation on the Emulab servers, so
you'll need to have a TinyOS installation to build from on your desktop
machine, or some other machine you control.  We hope to provide a way for you
905
906
907
build TinyOS apps on Emulab in the near future.  
-->
Also, at the current time, all
908
of our motes have radios in the 900MHz band, so see the TinyOS
909
910
911
912
913
<a href="http://www.tinyos.net/tinyos-1.x/doc/mica2radio/CC1000.html">CC1000
radio document</a> to make sure you're tuning the radios to the right band.

<p>
When you inevitably make changes to your code, you can simply place the new
Timothy Stack's avatar
   
Timothy Stack committed
914
kernel in the path that was automatically constructed for you by the image
915
916
917
918
919
920
creation page; the next time you use that OS in an NS file, the new version
will be loaded. If you'd like to load your node code onto your motes without
starting a new experiment, you have two options:
<ul>
  <li> <code>os_load</code> allows you to load an kernel that has already been
     defined as an image, as above. You give it the image descriptor with its
Timothy Stack's avatar
   
Timothy Stack committed
921
     <code>-i</code> argument, and you can either give the physical names of all
922
923
924
925
926
     motes you want to reload, or a <code>-e pid,eid</code> argument to reload
     all nodes in the given experiment.
  <li> <code>tbuisp</code> allows you to load a file directly onto your motes
     without having to register it as an image. This can be a quick way to do
     development/debugging. Just pass it the operation <code>upload</code>, the
Timothy Stack's avatar
   
Timothy Stack committed
927
     path to the file you wish to load, and the physical names of your motes.
928
929
930
931
932
933
934
935
</ul>
Both of these are commands in /usr/testbed/bin on ops.emulab.net.   They are
also available through our
<a href="<?php echo $TBBASE ?>/xmlrpcapi.php3">XML-RPC interface</a>, so you
can run them from your desktop machine to save time - the file given as an
argument to tbuisp is sent with the XML-RPC, so you don't need to copy it onto
our servers.

936
937
938
939
940
941
<?php NLCBODYEND() ?>

<?php NLCEMPTY() ?>

</tr>

942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
<tr>

<?php NLCH2("Mote Serial Interfaces") ?>

<?php NLCBODYBEGIN() ?>

To facilitate mote interaction, logging, and evaluation, we provide easy
access to each mote's serial programming board's serial interface.  By simply
adding a PC node to your experiment, and adding some NS code, you can
access each mote's serial port directly on that PC.  To access
<code>mote107</code>'s serial interface, add the following NS code to your
experiment: 

<blockquote style="border-style:solid; border-color:#bbbbbb; border-width: thin">
<pre>## BEGIN adding mote serial line access
set manager [$ns node]
tb-set-node-os $manager RHL-TINYOS

$ns connect [$fixed-receiver console] $manager
##END adding mote serial line access</pre>
</blockquote>
<center>
<font size="-2">Figure 10: Accessing mote serial interface.</font>
</center>
<br>

This code allocates a single PC, <code>manager</code>, which runs our
<emph>RHL-TINYOS</emph> image for convenience.  Emulab software exports the
serial port from the physical machine to the <code>manager</code> PC, where it
is available as a pseudo tty device.  You can read and write to the ptty
normally, except that some hardware-specific ioctl() syscalls may fail (this
happens because you are not working with the physical serial port).  The pseudo
tty will be available on your <code>manager</code> node as
<b>/dev/tip/MOTE_NAME</b> (in this case,
<b>/dev/tip/fixed-receiver</b>).  You can access other mote serial
interfaces by duplicating the above code, and changing the mote variable.  If
the software you are using to access the mote's serial interface insists on
using <b>/dev/ttyS1</b> or similar, you can simply run the following command on
your <code>manager</code> PC:

<blockquote style="border-style:solid; border-color:#bbbbbb; border-width: thin">
<pre>sudo rm /dev/ttyS1 && sudo ln -s /dev/tip/fixed-receiver /dev/ttyS1</pre>
</blockquote>
<center>
<font size="-2">Figure 11: Easing the pain for applications that use a specific
serial device.</font>
</center>
<br>

If you need to use <b>/dev/ttyS0</b> on our RHL-TINYOS images, you may remove
and relink the device as shown in Fig. 11, but background monitor scripts may
decide to restart the serial port getty.  This will remove your link.  However,
you should only need to relink /dev/ttyS0 when you restart your program.

<?php NLCBODYEND() ?>

<?php NLCEMPTY() ?>

</tr>


1003
1004
<tr><td colspan="3" class="stealth"><hr size=1></td></tr>

1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
<tr>

<?php NLCH1("Frequently Asked Questions") ?>

<?php NLCBODYBEGIN() ?>

<table class="stealth">

<a name="FAQ"></a>
<tr><th>How do the robots keep from running into each other/objects?</th></tr>
<tr><td>
The robots are equipped with proximity sensors that can sense objects in their
path.  We use these to detect and navigate around other robots and obstacles
that aren't known ahead of time.
</td></tr>

<tr><th>Do the robots follow the lines on the floor?</th></tr>
<tr><td>
No, the lines on the floor are used to calibrate the overhead cameras that
track the position of the robot.
</td></tr>

</table>

<?php NLCBODYEND() ?>

<?php NLCEMPTY() ?>

</tr>

<tr><td colspan="3" class="stealth"><hr size=1></td></tr>
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046

</table>

<?php
#
# Standard Testbed Footer
# 
if (!$printable) {
    PAGEFOOTER();
}
?>