simworldobjects
Class SimLightSensor

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

public class SimLightSensor
extends SimSensor

Simulates a light sensor

Author:
Graham Ritchie modified by Simon Zienkiewicz

Constructor Summary
SimLightSensor(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
 int getCurrentValue()
          Returns the present value of the sensor.
 int getPreviousValue()
          Returns the previous value read by the sensor.
 int getValue()
          Returns the current brightness of the world at this sensor's position modified by: Simon Zienkiewicz
 double getXOffset()
          Returns the offset from the owning SimRCX's x coordinate
 double getZOffset()
          Returns the offset from the owning SimRCX's y coordinate
 
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

SimLightSensor

public SimLightSensor(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:
loc - the location of the sensor
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 brightness of the world at this sensor's position modified by: Simon Zienkiewicz

Specified by:
getValue in class SimSensor
Returns:
the light level as an int

getXOffset

public double getXOffset()
Returns the offset from the owning SimRCX's x coordinate

Returns:
the x offset

getZOffset

public double getZOffset()
Returns the offset from the owning SimRCX's y coordinate

Returns:
the y offset

getPreviousValue

public int getPreviousValue()
Returns the previous value read by the sensor.

Returns:
the previous value of the sensor

getCurrentValue

public int getCurrentValue()
Returns the present value of the sensor.

Returns:
the present value of the sensor