simworldobjects
Class SimTouchSensor

java.lang.Object
  |
  +--simworldobjects.SimSensor
        |
        +--simworldobjects.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)
          Sets up a light sensor on the given SimRCX, and positions it at the the appropriate offset from the robot's position.
 
Method Summary
 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, 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)
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.
Overrides:
getValue in class SimSensor
Returns:
1 or 0 accordingly

getXOffset

public double getXOffset()

getZOffset

public double getZOffset()