Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
7b5e1055
Commit
7b5e1055
authored
May 24, 2005
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Another small fix; Do not check the exclusion zone around a robot when
moving that robot!
parent
e545cc0f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
6 deletions
+29
-6
robots/emc/locpiper.in
robots/emc/locpiper.in
+7
-0
robots/tracker/RoboTrack.java
robots/tracker/RoboTrack.java
+22
-6
www/robotrack/tracker.jar
www/robotrack/tracker.jar
+0
-0
No files found.
robots/emc/locpiper.in
View file @
7b5e1055
...
...
@@ -356,6 +356,13 @@ sub callbackFunc($$$) {
$val
=
int
(
$val
*
$PPM
);
push
(
@event
,
"
YMAX=
$val
");
}
elsif
(
$key
eq
"
ROBOT
"
||
$key
eq
"
robot
")
{
if
(
exists
(
$nodeids
{
$val
}))
{
//
Convert
to
phys
nodeid
.
$val
=
$nodeids
{
$val
};
}
push
(
@event
,
"
ROBOT=
$val
");
}
}
my
$evstr
=
"
TYPE=AREA,ID=
$id
,ACTION=
$evtype
";
$evstr
.=
"
,
"
.
join
("
,
"
,
@event
)
...
...
robots/tracker/RoboTrack.java
View file @
7b5e1055
...
...
@@ -350,6 +350,7 @@ public class RoboTrack extends JApplet {
boolean
dynamic
=
false
;
// A dynamically created Obstacle.
Rectangle
rectangle
=
null
;
// Only for dynamic obstacles.
Rectangle
exclusion
=
null
;
// Ditto, for the grey area.
String
robbie
=
null
;
// Set to nodeid if a robot obstacle.
}
Vector
Obstacles
=
new
Vector
(
10
,
10
);
Dictionary
ObDynMap
=
new
Hashtable
();
// Temp Obstacles only.
...
...
@@ -585,6 +586,7 @@ public class RoboTrack extends JApplet {
int
index
;
String
action
=
""
;
int
x1
=
0
,
y1
=
0
,
x2
=
0
,
y2
=
0
,
id
;
String
robotag
=
null
;
id
=
Integer
.
parseInt
(
obid
);
...
...
@@ -616,6 +618,9 @@ public class RoboTrack extends JApplet {
else
if
(
key
.
equals
(
"YMAX"
))
{
y2
=
Integer
.
parseInt
(
val
);
}
else
if
(
key
.
equals
(
"ROBOT"
))
{
robotag
=
val
;
}
}
if
(
action
.
equals
(
"CREATE"
))
{
// Is this (left over ID) going to happen? Remove old one.
...
...
@@ -632,6 +637,7 @@ public class RoboTrack extends JApplet {
oby
.
x2
=
x2
;
oby
.
y2
=
y2
;
oby
.
description
=
"Dynamic Obstacle"
;
oby
.
robbie
=
robotag
;
oby
.
dynamic
=
true
;
oby
.
rectangle
=
new
Rectangle
(
x1
,
y1
,
x2
-
x1
,
y2
-
y1
);
oby
.
exclusion
=
new
Rectangle
(
x1
-
OBSTACLE_BUFFER
,
...
...
@@ -725,8 +731,8 @@ public class RoboTrack extends JApplet {
int
rx2
=
robbie
.
drag_x
;
int
ry2
=
robbie
.
drag_y
;
System
.
out
.
println
(
"CheckforObstacles: "
+
rx1
+
","
+
ry1
+
","
+
rx2
+
","
+
ry2
);
//
System.out.println("CheckforObstacles: " + rx1 + "," +
//
ry1 + "," + rx2 + "," + ry2);
/*
* Check for overlap of this robot with each obstacle.
...
...
@@ -761,13 +767,23 @@ public class RoboTrack extends JApplet {
while
(
e
.
hasMoreElements
())
{
Obstacle
obstacle
=
(
Obstacle
)
e
.
nextElement
();
/*
* Skip this Obstacle if its a robot Obstacle
* that was generated on the fly, and it refers
* to our self.
*/
if
(
obstacle
.
robbie
!=
null
&&
obstacle
.
robbie
.
equals
(
robbie
.
pname
))
{
continue
;
}
int
ox1
=
obstacle
.
x1
-
OBSTACLE_BUFFER
;
int
oy1
=
obstacle
.
y1
-
OBSTACLE_BUFFER
;
int
ox2
=
obstacle
.
x2
+
OBSTACLE_BUFFER
;
int
oy2
=
obstacle
.
y2
+
OBSTACLE_BUFFER
;
System
.
out
.
println
(
" "
+
ox1
+
","
+
oy1
+
","
+
ox2
+
","
+
oy2
);
//
System.out.println(" " + ox1 + "," +
//
oy1 + "," + ox2 + "," + oy2);
if
(!
(
oy2
<
ry1
||
ry2
<
oy1
||
...
...
www/robotrack/tracker.jar
View file @
7b5e1055
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment