cz.cuni.amis.pogamut.usar2004.agent.module.sensor
Class SuperSensor

Package class diagram package SuperSensor
java.lang.Object
  extended by cz.cuni.amis.pogamut.usar2004.agent.module.sensor.SuperSensor
Direct Known Subclasses:
SensorAcceleration, SensorEncoder, SensorGPS, SensorGroundTruth, SensorHelper, SensorHumanMotionDetector, SensorINS, SensorLaser, SensorOdometry, SensorRange, SensorRFID, SensorSound, SensorTachometer, SensorTouch, SensorVictim

public class SuperSensor
extends Object

It was initially abstract, but ctor with one parameter was inserted and now this class is used not only as base class for sensor modules, but also as class carrying elementary info about unknown sensors.

Author:
vejmanm

Field Summary
protected  SensorMessage lastMessage
           
protected  SensorType sensorType
           
 
Constructor Summary
  SuperSensor()
          Ctor.
protected SuperSensor(SensorType type)
          Ctor.
 
Method Summary
 String getName()
          Name of the sensor.
 SensorType getSensorType()
          SensorType is a descriptor used for creating particular instance and for getting type information about particular sensor.
 double getTime()
          Timestamp form the UT since server start in seconds.
 String getType()
          Type describes the sensor type.
 Boolean isReady()
          Used to make sure the object is filled.
 void updateMessage(SensorMessage message)
          Method used for updating the message object that provides particular properties for given type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastMessage

protected SensorMessage lastMessage

sensorType

protected SensorType sensorType
Constructor Detail

SuperSensor

public SuperSensor()
Ctor. Sensor type describes particular subject about which we want to know about. It is used to distinguish incoming message from the server.


SuperSensor

protected SuperSensor(SensorType type)
Ctor.

Parameters:
type - Sensor type describes particular subject about which we want to know about. It is used to distinguish incoming message from the server.
Method Detail

updateMessage

public void updateMessage(SensorMessage message)
Method used for updating the message object that provides particular properties for given type. Note that this object is created by yylex parser and contains properties for all configuration subject types. But only relevat to individual Sensor are filled.

Parameters:
message - Sensor message from server.

getTime

public double getTime()
Timestamp form the UT since server start in seconds. Note that time is optional parameter.

Returns:
Returns seconds elapsed from the start of the server.

isReady

public Boolean isReady()
Used to make sure the object is filled.

Returns:
Returns true if the object is filled with sen. message.

getType

public String getType()
Type describes the sensor type. It will be one of the following values: "RFID”, “RangeScanner”, “IR”, "IRScanner", "Tachometer", "Helper", "Sonar", "Odometry", "GPS", "INS", "INU", "Encoder", "Touch", "VictSensor","HumanMotion", "Sound" or "GroundTruth".

Returns:
Type of the sensor.

getSensorType

public SensorType getSensorType()
SensorType is a descriptor used for creating particular instance and for getting type information about particular sensor.

Returns:
Returns SensorType.

getName

public String getName()
Name of the sensor.

Returns:
Returns name of the sensor


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.