Packageorg.MARS.robot.sensors
Classpublic class IRDetector
InheritanceIRDetector Inheritance AbstractSensor Inheritance AbstractElectronicDevice

The IR range detector which uses modulated IR pulses to locate the walls or large objects on the surface of the table.

See also

getReading()


Public Properties
 PropertyDefined by
 InheritednumberOfPorts : Number
Get the number of IO ports in the device.
AbstractElectronicDevice
 Inheritedshape : Shape
The shape of the sensor
AbstractSensor
 Inheritedtype : Class
The type of the sensor
AbstractSensor
Protected Properties
 PropertyDefined by
 Inherited_ports : Array
AbstractElectronicDevice
 Inherited_shape : Shape
AbstractSensor
 Inherited_type : Class
AbstractSensor
Public Methods
 MethodDefined by
  
IRDetector(x:Number, y:Number, rotation:Number = 0, fieldOfView:Number = 30, size:Number = 100)
Constructor
IRDetector
 Inherited
getPort(portNumber:Number):IOPort
Get a certain IO port by its number
AbstractElectronicDevice
  
getReading():void
Determine if the sensor detects an object and set the output port accordingly: HIGH if the sensor detects a collision and LOW if the sensor does not.
IRDetector
Constructor detail
IRDetector()constructor
public function IRDetector(x:Number, y:Number, rotation:Number = 0, fieldOfView:Number = 30, size:Number = 100)

Constructor

Parameters
x:Number — - x coordinate of the sensor
 
y:Number — - y coordinate of the sensor
 
rotation:Number (default = 0) — - amount of rotation (in radians)
 
fieldOfView:Number (default = 30) — - field of view of the sensor (in degrees)
 
size:Number (default = 100) — - length of the detection area
Method detail
getReading()method
public override function getReading():void

Determine if the sensor detects an object and set the output port accordingly: HIGH if the sensor detects a collision and LOW if the sensor does not.

See also

Environment.isCollidingWithWall()