simworldobjects
Class SimTouchSensor

java.lang.Object
  extended bysimworldobjects.SimSensor
      extended bysimworldobjects.SimTouchSensor
All Implemented Interfaces:
SimObject

public class SimTouchSensor
extends SimSensor

Simulates a light sensor

Author:
Graham Ritchie

Constructor Summary
SimTouchSensor(SimRCX r, double xOffset, double zOffset, char loc)
          Sets up a light sensor on the given SimRCX, and positions it at the the appropriate offset from the robot's position.
 
Method Summary
 boolean getBooleanValue()
          Returns the current boolean value of this sensor, a 'true' if it is touching something or 'false' if it is not.
 boolean getCurrentValue()
           
 boolean getPreviousValue()
           
 int getValue()
          Returns the current value of this sensor, a 1 if it is touching something or 0 if it is not.
 double getXOffset()
           
 double getZOffset()
           
 
Methods inherited from class simworldobjects.SimSensor
getActualBearingVelocityXY, getActualBearingVelocityXZ, getActualBearingXY, getActualBearingXZ, getActualVelocity, getDesiredBearingVelocityXY, getDesiredBearingVelocityXZ, getDesiredVelocity, getHeight, getLength, getOwner, getPosition, getType, getWidth, getXCoord, getYCoord, getZCoord, initSimSensor, setActualBearingVelocityXY, setActualBearingVelocityXZ, setActualBearingXY, setActualBearingXZ, setActualVelocity, setDesiredBearingVelocityXY, setDesiredBearingVelocityXZ, setDesiredVelocity, setXCoord, setYCoord, setZCoord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimTouchSensor

public SimTouchSensor(SimRCX r,
                      double xOffset,
                      double zOffset,
                      char loc)
Sets up a light sensor on the given SimRCX, and positions it at the the appropriate offset from the robot's position.

Parameters:
r - the SimRCX owner of this sensor
xOffset - the offest from the SimRCX's x position
zOffset - the offest from the SimRCX's z position
Method Detail

getValue

public int getValue()
Returns the current value of this sensor, a 1 if it is touching something or 0 if it is not.

Specified by:
getValue in class SimSensor
Returns:
1 or 0 accordingly

getBooleanValue

public boolean getBooleanValue()
Returns the current boolean value of this sensor, a 'true' if it is touching something or 'false' if it is not.

Returns:
'true' or 'false' accordingly

getXOffset

public double getXOffset()

getZOffset

public double getZOffset()

getPreviousValue

public boolean getPreviousValue()

getCurrentValue

public boolean getCurrentValue()