All Packages Class Hierarchy This Package Previous Next Index
Class EDU.gatech.cc.is.abstractrobot.SealedSphereSim
java.lang.Object
|
+----EDU.gatech.cc.is.abstractrobot.Simple
|
+----EDU.gatech.cc.is.abstractrobot.SealedSphereSim
- public class SealedSphereSim
- extends Simple
- implements SealedSphere, SimulatedObject
Implements SealedSphere for simulation.
You should see the specifications in SealedSphere for details on
how to use these methods.
Copyright
(c)1997, 1998 Tucker Balch
- Version:
- $Revision: 1.6 $
- Author:
- Tucker Balch
- See Also:
- SealedSphere
-
DEBUG
-
-
SealedSphereSim()
- Instantiate a SealedSphereSim object.
-
clearTrail()
- Clear the trail.
-
draw(Graphics, int, int, double, double, double, double)
- Draw the robot.
-
draw(Vec2, Graphics, int, int, double, double, double, double)
- Draw the robot in a specific spot.
-
drawID(Graphics, int, int, double, double, double, double)
- Draw the robot's ID.
-
drawState(Graphics, int, int, double, double, double, double)
- Draw the robot's state.
-
drawTrail(Graphics, int, int, double, double, double, double)
- Draw the robot's Trail.
-
getCenter(Vec2)
-
-
getClosestPoint(Vec2)
-
-
getObstacles(long)
- Get an array of Vec2s that point egocentrically from the
center of the robot to the obstacles currently sensed by the
bumpers and sonars.
-
getOpponents(long)
- Get an array of Vec2s that point egocentrically from the
center of the robot to the Opponents currently sensed by the
robot
-
getPlayerNumber(long)
-
-
getPosition()
- Get the position of the robot in global coordinates.
-
getPosition(long)
- Get the position of the robot in global coordinates.
-
getSteerHeading(long)
-
-
getTeammates(long)
- Get an array of Vec2s that point egocentrically from the
center of the robot to the teammates currently sensed by the
robot
-
getTime()
- Gets time elapsed since the robot was instantiated.
-
getVisionClass()
-
-
init(double, double, double, double, Color, Color, int, int, long)
- Initialize a SealedSphereSim object.
-
isObstacle()
-
-
isPickupable()
-
-
isPushable()
-
-
pickUp(SimulatedObject)
-
-
push(Vec2, Vec2)
-
-
putDown(Vec2)
-
-
quit()
- Clean up.
-
receive(Message)
- NOT IMPLEMENTED
-
resetPosition(Vec2)
- Reset the odometry of the robot in global coordinates.
-
resetSteerHeading(double)
-
-
setBaseSpeed(double)
-
-
setDisplayString(String)
- Set the String that is printed on the robot's display.
-
setKinMaxRange(double)
- Set the maximum range at which a sensor reading should be considered
kin.
-
setObstacleMaxRange(double)
- Set the maximum range at which a sensor reading should be considered
an obstacle.
-
setSpeed(long, double)
-
-
setSteerHeading(long, double)
-
-
setTrailLength(int)
- Set the length of the trail (in movement steps).
-
setVisionClass(int)
-
-
takeStep(long, SimulatedObject[])
- Take a simulated step;
DEBUG
public static final boolean DEBUG
SealedSphereSim
public SealedSphereSim()
- Instantiate a SealedSphereSim object. Be sure
to also call init with proper values.
- See Also:
- init
init
public void init(double xp,
double yp,
double tp,
double ignore,
Color f,
Color b,
int v,
int i,
long s)
- Initialize a SealedSphereSim object.
- Parameters:
- yp - ignored.
- tp - ignored.
- ignore - ignored.
- f - color 1 for the robot.
- b - color 2 for the robot.
- v - vision class of the robot
- i - unique simulation id
(NOT the same as player number!).
takeStep
public void takeStep(long time_increment,
SimulatedObject all_objs[])
- Take a simulated step;
isObstacle
public boolean isObstacle()
isPushable
public boolean isPushable()
isPickupable
public boolean isPickupable()
getClosestPoint
public Vec2 getClosestPoint(Vec2 from)
getCenter
public Vec2 getCenter(Vec2 from)
push
public void push(Vec2 d,
Vec2 v)
pickUp
public void pickUp(SimulatedObject o)
putDown
public void putDown(Vec2 p)
setVisionClass
public void setVisionClass(int v)
getVisionClass
public int getVisionClass()
draw
public void draw(Vec2 pos,
Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
- Draw the robot in a specific spot.
drawTrail
public void drawTrail(Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
- Draw the robot's Trail.
setDisplayString
public void setDisplayString(String s)
- Set the String that is printed on the robot's display.
For simulated robots, this appears printed below the agent
when view "Robot State" is selected.
- Parameters:
- s - String, the text to display.
- Overrides:
- setDisplayString in class Simple
drawState
public void drawState(Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
- Draw the robot's state.
setTrailLength
public void setTrailLength(int l)
- Set the length of the trail (in movement steps).
- Parameters:
- l - int, the length of the trail.
clearTrail
public void clearTrail()
- Clear the trail.
drawID
public void drawID(Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
- Draw the robot's ID. Note, since Pebbles robots
do not have a kin sensor, we just draw the unique_id.
draw
public void draw(Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
- Draw the robot.
quit
public void quit()
- Clean up.
- Overrides:
- quit in class Simple
getTime
public long getTime()
- Gets time elapsed since the robot was instantiated.
Since this is simulation, it may not match real elapsed time.
- Overrides:
- getTime in class Simple
getOpponents
public Vec2[] getOpponents(long timestamp)
- Get an array of Vec2s that point egocentrically from the
center of the robot to the Opponents currently sensed by the
robot
- Parameters:
- timestamp - only get new information if timestamp > than last call
or timestamp == -1 .
- Returns:
- the sensed Opponents.
getTeammates
public Vec2[] getTeammates(long timestamp)
- Get an array of Vec2s that point egocentrically from the
center of the robot to the teammates currently sensed by the
robot
- Parameters:
- timestamp - only get new information
if timestamp > than last call or timestamp == -1 .
- Returns:
- the sensed teammates.
getPlayerNumber
public int getPlayerNumber(long timestamp)
getObstacles
public Vec2[] getObstacles(long timestamp)
- Get an array of Vec2s that point egocentrically from the
center of the robot to the obstacles currently sensed by the
bumpers and sonars.
- Parameters:
- timestamp - only get new information
if timestamp > than last call
or timestamp == -1 .
- Returns:
- the sensed obstacles.
- Overrides:
- getObstacles in class Simple
setKinMaxRange
public void setKinMaxRange(double range)
- Set the maximum range at which a sensor reading should be considered
kin. Beyond this range, the readings are ignored.
The default range on startup is 1 meter.
- Parameters:
- range - the range in meters.
setObstacleMaxRange
public void setObstacleMaxRange(double range)
- Set the maximum range at which a sensor reading should be considered
an obstacle. Beyond this range, the readings are ignored.
The default range on startup is 1 meter.
- Parameters:
- range - the range in meters.
- Overrides:
- setObstacleMaxRange in class Simple
getPosition
public Vec2 getPosition(long timestamp)
- Get the position of the robot in global coordinates.
- Parameters:
- timestamp - only get new information
if timestamp > than last call or timestamp == -1.
- Returns:
- the position.
- Overrides:
- getPosition in class Simple
- See Also:
- resetPosition
getPosition
public Vec2 getPosition()
- Get the position of the robot in global coordinates.
- Returns:
- the position.
resetPosition
public void resetPosition(Vec2 posit)
- Reset the odometry of the robot in global coordinates.
This might be done when reliable sensor information provides
a very good estimate of the robot's location, or if you
are starting the robot in a known location other than (0,0).
Do this only if you are certain you're right!
- Parameters:
- position - the new position.
- Overrides:
- resetPosition in class Simple
- See Also:
- getPosition
getSteerHeading
public double getSteerHeading(long timestamp)
- Overrides:
- getSteerHeading in class Simple
resetSteerHeading
public void resetSteerHeading(double heading)
- Overrides:
- resetSteerHeading in class Simple
setSteerHeading
public void setSteerHeading(long timestamp,
double heading)
- Overrides:
- setSteerHeading in class Simple
setSpeed
public void setSpeed(long timestamp,
double speed)
- Overrides:
- setSpeed in class Simple
- See Also:
- setSpeed
setBaseSpeed
public void setBaseSpeed(double speed)
- Overrides:
- setBaseSpeed in class Simple
- See Also:
- setBaseSpeed
receive
public void receive(Message m)
- NOT IMPLEMENTED
All Packages Class Hierarchy This Package Previous Next Index