| Package | org.MARS.robot.sensors |
| Class | public class AbstractSensor |
| Inheritance | AbstractSensor AbstractElectronicDevice |
| Implements | ISensor |
| Subclasses | EdgeSensor, IRDetector, LineSensor, TouchSensor |
NOTE: the abstract classes cannot be instantiated
| Property | Defined by | ||
|---|---|---|---|
![]() | numberOfPorts : Number
Get the number of IO ports in the device.
| AbstractElectronicDevice | |
| shape : Shape
[read-only] The shape of the sensor
| AbstractSensor | ||
| type : Class [read-only] The type of the sensor
| AbstractSensor | ||
| Property | Defined by | ||
|---|---|---|---|
![]() | _ports : Array | AbstractElectronicDevice | |
| _shape : Shape | AbstractSensor | ||
| _type : Class | AbstractSensor | ||
| Method | Defined by | ||
|---|---|---|---|
|
AbstractSensor(shape:Shape)
Creates a sensor with the given shape
| AbstractSensor | ||
![]() |
Get a certain IO port by its number
| AbstractElectronicDevice | |
|
getReading():void
The function which is called on every step of the physics engine.
| AbstractSensor | ||
| _shape | property |
protected var _shape:Shape
| shape | property |
| _type | property |
protected var _type:Class
| type | property |
type:Class [read-only]The type of the sensor
Implementation public function get type():Class
| AbstractSensor | () | constructor |
public function AbstractSensor(shape:Shape)Creates a sensor with the given shape
Parametersshape:Shape |
See also
| getReading | () | method |
public function getReading():voidThe function which is called on every step of the physics engine. Gets the reading depending on the type of the sensor.
NOTE: do not call this method of the AbstractSensor class, use the subclass