Commit 55ef77e6 authored by Leigh Stoller's avatar Leigh Stoller

Checkpoint first real version of the real time robot tracker applet.

Note that the java compiler on boss is too old to compile this applet
(not that I am using anything special) so I am committing a compiled
version. Use the jar target in the robots/tracker build directory if
you happen to have a modern version of java on your machine.
parent 3ae3df72
......@@ -2189,6 +2189,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
robots/mezzanine/libfg/GNUmakefile \
robots/mezzanine/libmezz/GNUmakefile \
robots/mezzanine/mezzanine/GNUmakefile \
robots/tracker/GNUmakefile \
robots/mezzanine/mezzcal/GNUmakefile robots/robomonitord "
#
......
......@@ -772,6 +772,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
robots/mezzanine/libfg/GNUmakefile \
robots/mezzanine/libmezz/GNUmakefile \
robots/mezzanine/mezzanine/GNUmakefile \
robots/tracker/GNUmakefile \
robots/mezzanine/mezzcal/GNUmakefile robots/robomonitord "
#
......
......@@ -29,7 +29,7 @@ else
TBSETDESTDIR=
endif
SUBDIRS = $(TBSETDESTDIR) $(MEZZDIR) mtp $(EMCDIR) vmcd primotion rmcd
SUBDIRS = $(TBSETDESTDIR) $(MEZZDIR) mtp $(EMCDIR) vmcd primotion rmcd tracker
all: robomonitord all-subdirs
client: client-subdirs
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004, 2005 University of Utah and the Flux Group.
# All rights reserved.
#
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ../..
SUBDIR = robots/tracker
include $(OBJDIR)/Makeconf
ifeq ($(JAVAC),)
JARS =
else
JARS = $(TESTBED_SRCDIR)/www/robotrack/tracker.jar
endif
all:
jar: $(JARS)
include $(TESTBED_SRCDIR)/GNUmakerules
RoboTrack.class: $(SRCDIR)/RoboTrack.java
$(JAVAC) -deprecation -d . $^
$(TESTBED_SRCDIR)/www/robotrack/tracker.jar: RoboTrack.class
$(JAR) cvf $@ *.class
install:
clean:
/bin/rm -f *.class *.jar
$(INSTALL_WWWDIR)/robotrack/%: %
@echo "Installing $<"
-mkdir -p $(patsubst %/,%,$(dir $@))
$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)
This diff is collapsed.
......@@ -54,6 +54,10 @@ AUTOICONS += $(wildcard $(SRCDIR)/autostatus-icons/*.png)
FLOORMAPFILES = $(wildcard $(SRCDIR)/floormap/*.jpg)
FLOORMAPFILES += $(wildcard $(SRCDIR)/floormap/*.gif)
ROBOTRACKFILES = $(wildcard $(SRCDIR)/robotrack/*.php3)
ROBOTRACKFILES += $(wildcard $(SRCDIR)/robotrack/*.jpg)
ROBOTRACKFILES += $(wildcard $(SRCDIR)/robotrack/*.jar)
PIXFILES = $(wildcard $(SRCDIR)/pix/*.jpg)
PIXFILES += $(wildcard $(SRCDIR)/pix/*.gif)
......@@ -134,6 +138,7 @@ ALLBUI = $(notdir $(BUIFILES))
ALLNL = $(notdir $(NLFILES))
ALLHY = $(notdir $(HYFILES))
ALLUSRP = $(notdir $(USRPFILES))
ALLROBO = $(notdir $(ROBOTRACKFILES))
install: $(addprefix $(INSTALL_WWWDIR)/, $(ALLFILES)) \
$(addprefix $(INSTALL_WWWDIR)/floormap/, $(ALLFLOORMAPS)) \
......@@ -146,6 +151,7 @@ install: $(addprefix $(INSTALL_WWWDIR)/, $(ALLFILES)) \
$(addprefix $(INSTALL_WWWDIR)/netlab/, $(ALLNL)) \
$(addprefix $(INSTALL_WWWDIR)/hyperviewer/, $(ALLHY)) \
$(addprefix $(INSTALL_WWWDIR)/usrp/, $(ALLUSRP)) \
$(addprefix $(INSTALL_WWWDIR)/robotrack/, $(ALLROBO)) \
$(addprefix $(INSTALL_WWWDIR)/autostatus-icons/, $(ALLICONS)) \
$(addprefix $(INSTALL_LIBEXECDIR)/, websearch) \
$(addprefix $(INSTALL_WWWDIR)/cvsweb/, $(ALLCVSWEB)) \
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002, 2004, 2005 University of Utah and the Flux Group.
# All rights reserved.
#
chdir("..");
include("defs.php3");
#
# Only known and logged in users can watch LEDs
#
$uid = GETLOGIN();
LOGGEDINORDIE($uid);
#
# One robot map right now ...
#
$building = "MEB-ROBOTS";
$floor = 4;
# Initial goo.
header("Content-Type: text/plain");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
flush();
#
# Clean up when the remote user disconnects
#
function SPEWCLEANUP()
{
exit(0);
}
register_shutdown_function("SPEWCLEANUP");
if (!isset($real)) {
#
# Just loop forever writing out some stuff.
#
$x1 = 100;
$y1 = 100;
$x2 = 700;
$y2 = 200;
$i = 0;
do {
echo "garcia1, robbie, $x1, $y1, 90.0, 700, 300, -90.0, 10, 20\n";
echo "garcia2, mary, $x2, $y2, 0.0, 200, 100, 90.0, 50, 60\n";
flush();
sleep(1);
$x1 +=2;
$y1 +=2;
$x2 -=2;
$y2 -=2;
} while ($i < 100);
return;
}
# Loop forever.
while (1) {
$query_result =
DBQueryFatal("select loc.*,r.pid,r.eid,r.vname, ".
" n.battery_voltage,n.battery_percentage, ".
" n.destination_x,n.destination_y, ".
" n.destination_orientation ".
" from location_info as loc ".
"left join reserved as r on r.node_id=loc.node_id ".
"left join nodes as n on n.node_id=loc.node_id ".
"where loc.building='$building' and ".
" loc.floor='$floor'");
while ($row = mysql_fetch_array($query_result)) {
$pname = $row["node_id"];
$vname = $row["vname"];
$x = $row["loc_x"];
$y = $row["loc_y"];
$or = $row["orientation"];
$dx = $row["destination_x"];
$dy = $row["destination_y"];
$dor = $row["destination_orientation"];
$bvolts= $row["battery_voltage"];
$bper = $row["battery_percentage"];
if (!isset($vname))
$vname = $pname;
if (!isset($or))
$or = "";
if (!isset($dx)) {
$dx = "";
$dy = "";
$dor = "";
}
if (!isset($bvolts))
$bvolts = "";
if (!isset($bper))
$bper = "";
echo "$pname, $vname, $x, $y, $or, $dx, $dy, $dor, $bvolts, $bper\n";
}
flush();
sleep(1);
}
?>
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
chdir("..");
include("defs.php3");
$uid = GETLOGIN();
LOGGEDINORDIE($uid);
PAGEHEADER("Real Time Robot Tracking Applet");
#
# One robot map right now ...
#
$building = "MEB-ROBOTS";
$floor = 4;
#
# Create a tempfile to use as a unique prefix; it is not actually used but
# serves the same purpose (The script uses ${prefix}.jpg and ${prefix}.map .)
#
$prefix = tempnam("/tmp", "floormap");
#
# Get the unique part to send back.
#
if (!preg_match("/^\/tmp\/([-\w]+)$/", $prefix, $matches)) {
TBERROR("Bad tempnam: $prefix", 1);
}
$uniqueid = $matches[1];
$perl_args = "-o $prefix -t -z -n -x -y -f $floor $building";
$retval = SUEXEC($uid, "nobody", "webfloormap $perl_args",
SUEXEC_ACTION_IGNORE);
if ($retval) {
SUEXECERROR(SUEXEC_ACTION_USERERROR);
# Never returns.
die("");
}
$auth = $HTTP_COOKIE_VARS[$TBAUTHCOOKIE];
$pipeurl = "robopipe.php3?foo=bar";
$baseurl = "../floormap_aux.php3?prefix=$uniqueid";
# Temp for debugging.
if (isset($real))
$pipeurl .= "&real=yes";
echo "<applet code='RoboTrack.class'
archive='tracker.jar'
width='900' height='600'
alt='You need java to run this applet'>
<param name='pipeurl' value='$pipeurl'>
<param name='baseurl' value='$baseurl'>
<param name='uid' value='$uid'>
<param name='auth' value='$auth'>
</applet>\n";
PAGEFOOTER();
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment