Commit 194773ba authored by Leigh Stoller's avatar Leigh Stoller

Add exclusion and camera bound checking.

parent 274cc4bb
This diff is collapsed.
<?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");
# Get the obstacle information.
$query_result =
DBQueryFatal("select * from cameras ".
"where building='$building' and floor='$floor'");
while ($row = mysql_fetch_array($query_result)) {
$name = $row["name"];
$x1 = $row["loc_x"];
$y1 = $row["loc_y"];
$x2 = $x1 + $row["width"];
$y2 = $y1 + $row["height"];
echo "$name, $x1, $y1, $x2, $y2\n";
}
?>
<?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");
#
# Get the obstacle information. This stuff is in pixels, but we want to
# always send meters to the applet.
#
$query_result =
DBQueryFatal("select o.*,f.pixels_per_meter from obstacles as o ".
"left join floorimages as f on ".
" o.building=f.building and o.floor=f.floor ".
"where o.building='$building' and o.floor='$floor'");
while ($row = mysql_fetch_array($query_result)) {
$id = $row["obstacle_id"];
$x1 = $row["x1"];
$y1 = $row["y1"];
$x2 = $row["x2"];
$y2 = $row["y2"];
$desc = $row["description"];
$ppm = $row["pixels_per_meter"];
if (!isset($desc))
$desc = "";
$meters_x1 = sprintf("%.4f", $x1 / $ppm);
$meters_y1 = sprintf("%.4f", $y1 / $ppm);
$meters_x2 = sprintf("%.4f", $x2 / $ppm);
$meters_y2 = sprintf("%.4f", $y2 / $ppm);
echo "$id, $meters_x1, $meters_y1, $meters_x2, $meters_y2, $desc\n";
}
?>
......@@ -77,7 +77,7 @@ if (!preg_match("/^\/tmp\/([-\w]+)$/", $prefix, $matches)) {
}
$uniqueid = $matches[1];
$perl_args = "-o $prefix -t -z -n -x -y -f $floor $building";
$perl_args = "-o $prefix -t -z -n -x -v -y -f $floor $building";
$retval = SUEXEC($uid, "nobody", "webfloormap $perl_args",
SUEXEC_ACTION_IGNORE);
......@@ -122,7 +122,10 @@ echo "<br>
moves (start the robots on their way), or cancel the moves.
<li> Only one move per robot at a time.
<li> To change just the orientation (no drag), edit the destination
orientation column in the table.
orientation column in the table.
<li> A robot destination must not overlap an obstacle (shaded area,
blue border), and it must be fully within the field of view of at
least one camera (orange boxes).
</ul>
<blockquote><blockquote>\n";
......
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