cz.cuni.amis.pogamut.usar2004.communication.messages.usarinfomessages
Class SensorMessage

Package class diagram package SensorMessage
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.usar2004.communication.messages.GBEvent
          extended by cz.cuni.amis.pogamut.usar2004.communication.messages.usarinfomessages.SensorMessage
All Implemented Interfaces:
cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent, cz.cuni.amis.pogamut.base.communication.translator.event.IWorldEventWrapper, cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEvent, IGBWorldEvent, cz.cuni.amis.utils.listener.Event

public class SensorMessage
extends GBEvent
implements cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEvent, cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent

Sensor messages contain the sensor data. Sensor message Every sensor message starts with “SEN”. After it is an optional Time segment, {Time float}, that reports the current time in seconds in the virtual world. Whether the Time segment will appear or not is decided by the sensor’s ?bWithTimeStamp’ variable. For details information, please read section 10 in USARSim manual v3.1.3. Please note that the Sensor message parameters depend on the type of sensor that the information is being reported. Corresponding GameBots message is SEN.


Field Summary
protected  cz.cuni.amis.pogamut.base3d.worldview.object.Velocity Acceleration
           
protected  double Corona
           
protected  double Density
           
protected  double Dist
           
protected  double Duration
           
protected  Map<String,Integer> EncoderTicks
           
protected  int Fix
           
protected  double FOV
           
protected  String Gas
           
protected  List<Integer> IDs
           
protected  List<Double> LaserRanges
           
protected  Latitude Latitude
           
protected  List<cz.cuni.amis.pogamut.base3d.worldview.object.Location> Locations
           
protected  Longitude Longitude
           
protected  double Loudness
           
protected  String Name
           
protected  OdometryPose OdoPose
           
protected  List<cz.cuni.amis.pogamut.base3d.worldview.object.Rotation> Orientations
           
protected  List<String> PartNames
           
protected  javax.vecmath.Point2d Pos2D
           
protected  cz.cuni.amis.pogamut.base3d.worldview.object.Location Pos3D
           
protected  javax.vecmath.Point4d Position
           
protected  double Prob
           
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  double Radius
           
protected  Map<String,Double> RangeRanges
           
protected  double Resolution
           
protected  int Satellites
           
protected  String Status
           
protected  double Time
           
protected  Map<String,Boolean> Touches
           
protected  String Type
           
protected  javax.vecmath.Point4d Velocity
           
protected  boolean Visible
           
 
Constructor Summary
SensorMessage()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
SensorMessage(SensorMessage original)
          Cloning constructor.
SensorMessage(String Type, double Time, String Name, double Duration, double FOV, int Fix, double Loudness, double Prob, double Resolution, int Satellites, String Status, String Gas, double Density, boolean Visible, double Dist, double Radius, double Corona)
           
 
Method Summary
 void addRange(String Name, Double Range)
          Used by Yylex to fill the RangeRanges Map.
 cz.cuni.amis.pogamut.base3d.worldview.object.Velocity getAcceleration()
          Acceleration from Acceleration Sensor.
 double getCorona()
          AIBO - ERS robot uses tracking ball sensor, that recognises a soccer ball from camera.
 double getDensity()
          Gas sensor measures type and density.
 double getDistance()
          AIBO - ERS robot uses tracking ball sensor, that recognises a soccer ball from camera.
 double getDuration()
          Duration of a sound from the sound sensor.
 Map<String,Integer> getEncoderTicks()
          String is the sensor name.
 int getFix()
          ?int’ indicates whether or not a position was acquired.
 double getFOV()
          FOV is the sensor’s field of view in radians.
 String getGas()
          Gas sensor measures type and density.
 List<Integer> getIDs()
          Used by RFID sensor.
 List<Double> getLaserRanges()
          LaserRanges is a series of range values in meters.
 Latitude getLatitude()
          ?int’, ’double’, ’char’ provide the latitude degree, minute (as a decimal), and cardinal description (i.e.
 List<cz.cuni.amis.pogamut.base3d.worldview.object.Location> getLocations()
          List of Locations used by RFID sensor to determine where are various RFID Tags or by Victiom sensor to determine locations of bodys.
 Longitude getLongitude()
          ?int’, ’float’, ’char’ provide the longitude degree, minute (as a decimal), and cardinal description (i.e.
 double getLoudness()
          Loudnes from the sound sensor.
 String getName()
          Name of the sensor.
 OdometryPose getOdoPose()
          OdoPose is the estimated robot position relative to the start point in meters.
 List<cz.cuni.amis.pogamut.base3d.worldview.object.Rotation> getOrientations()
          INS sensor entry in USARSim manual v3.1.3 suggests that it should need more than one record of Orienation, but the experience was different.
 List<String> getPartNames()
          PartName is the name of the victim part that was discovered by the sensor.
 javax.vecmath.Point2d getPos2D()
          AIBO - ERS robot uses tracking ball sensor, that recognises a soccer ball from camera.
 cz.cuni.amis.pogamut.base3d.worldview.object.Location getPos3D()
          AIBO - ERS robot uses tracking ball sensor, that recognises a soccer ball from camera.
 javax.vecmath.Point4d getPosition()
          Position of the robot measured by Tachometer.
 double getProb()
          Prob is the probability of it’s human motion.
 double getRadius()
          AIBO - ERS robot uses tracking ball sensor, that recognises a soccer ball from camera.
 Map<String,Double> getRangeRanges()
          Map indexed by string is used to collect data of range sensor.
 double getResolution()
          It is the sensor’s resolution in radians.
 int getSatellites()
          ?int’ gives the number of satellites tracked by the GPS sensor.
 String getStatus()
          Status is not in USARSim manual v3.1.3.
 double getTime()
          Timestamp form the UT since server start in seconds.
 Map<String,Boolean> getTouches()
          String is the sensor name.
 String getType()
          Type describes the sensor type.
 javax.vecmath.Point4d getVelocity()
          Velocity of the robot measured by Tachometer.
 boolean isVisible()
          AIBO - ERS robot uses tracking ball sensor, that recognises a soccer ball from camera.
 String toHtmlString()
          Gets all properties and values to create a HTML formated string;
 String toString()
           
 
Methods inherited from class cz.cuni.amis.pogamut.usar2004.communication.messages.GBEvent
getSimTime, getWorldEvent
 
Methods inherited from class cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
toJsonLiteral
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEvent
getSimTime
 
Methods inherited from interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent
getSimTime
 

Field Detail

PROTOTYPE

public static final String PROTOTYPE
Example how the message looks like - used during parser tests.

See Also:
Constant Field Values

Type

protected String Type

Time

protected double Time

Name

protected String Name

RangeRanges

protected Map<String,Double> RangeRanges

Resolution

protected double Resolution

FOV

protected double FOV

LaserRanges

protected List<Double> LaserRanges

OdoPose

protected OdometryPose OdoPose

Latitude

protected Latitude Latitude

Longitude

protected Longitude Longitude

Fix

protected int Fix

Satellites

protected int Satellites

Locations

protected List<cz.cuni.amis.pogamut.base3d.worldview.object.Location> Locations

Orientations

protected List<cz.cuni.amis.pogamut.base3d.worldview.object.Rotation> Orientations

EncoderTicks

protected Map<String,Integer> EncoderTicks

Touches

protected Map<String,Boolean> Touches

IDs

protected List<Integer> IDs

PartNames

protected List<String> PartNames

Status

protected String Status

Prob

protected double Prob

Loudness

protected double Loudness

Duration

protected double Duration

Velocity

protected javax.vecmath.Point4d Velocity

Position

protected javax.vecmath.Point4d Position

Acceleration

protected cz.cuni.amis.pogamut.base3d.worldview.object.Velocity Acceleration

Gas

protected String Gas

Density

protected double Density

Visible

protected boolean Visible

Pos2D

protected javax.vecmath.Point2d Pos2D

Pos3D

protected cz.cuni.amis.pogamut.base3d.worldview.object.Location Pos3D

Radius

protected double Radius

Dist

protected double Dist

Corona

protected double Corona
Constructor Detail

SensorMessage

public SensorMessage(String Type,
                     double Time,
                     String Name,
                     double Duration,
                     double FOV,
                     int Fix,
                     double Loudness,
                     double Prob,
                     double Resolution,
                     int Satellites,
                     String Status,
                     String Gas,
                     double Density,
                     boolean Visible,
                     double Dist,
                     double Radius,
                     double Corona)

SensorMessage

public SensorMessage(SensorMessage original)
Cloning constructor.


SensorMessage

public SensorMessage()
Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).

Method Detail

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.

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.

getName

public String getName()
Name of the sensor.

Returns:
Returns name of the sensor

getRangeRanges

public Map<String,Double> getRangeRanges()
Map indexed by string is used to collect data of range sensor. ?Dtring’ is the sensor name, ?Double’ is the range value in meters.

Returns:
Returns Map of ranges from range sensor(Sonar).

addRange

public void addRange(String Name,
                     Double Range)
Used by Yylex to fill the RangeRanges Map.

Parameters:
Name - Name of the range sensor.
Range - Valued of the range sensor.

getResolution

public double getResolution()
It is the sensor’s resolution in radians. With FOV, we can calculate the number of the data in the Range segment.

Returns:
Returns resolution of the sensor.

getFOV

public double getFOV()
FOV is the sensor’s field of view in radians.

Returns:
Returns field of view in radians.

getLaserRanges

public List<Double> getLaserRanges()
LaserRanges is a series of range values in meters.

Returns:
Returns List of double values representing distance in meters.

getOdoPose

public OdometryPose getOdoPose()
OdoPose is the estimated robot position relative to the start point in meters. ?theta’ is the head angle in radians relative to the start orientation.

Returns:
Returns OdometryPose value.

getLatitude

public Latitude getLatitude()
?int’, ’double’, ’char’ provide the latitude degree, minute (as a decimal), and cardinal description (i.e. ?N’ or ?S’), respectively. There are only two possible values for the ?char’ parameter: ?N’ for North and ?S’ for South.

Returns:
Returns Latitude value of the sensor.

getLongitude

public Longitude getLongitude()
?int’, ’float’, ’char’ provide the longitude degree, minute (as a decimal), and cardinal description (i.e. ?E’ or ?W’), respectively. There are only two possible values for the ?char’ parameter: ?E’ for East and ?W’ for West.

Returns:
Returns Longitude value of the sensor.

getFix

public int getFix()
?int’ indicates whether or not a position was acquired. The fix is the same as the GGA format. Namely, a value of 0 means that the GPS sensor failed to acquire a position and a value of 1 means that a position was acquired.

Returns:
Returns 0 - failed to acquire a position or 1 - success.

getSatellites

public int getSatellites()
?int’ gives the number of satellites tracked by the GPS sensor. This number is an inexplicit source of accuracy. The more satellites are tracked, the higher the position accuracy.

Returns:
Returns number of active GPS satellite connections.

getLocations

public List<cz.cuni.amis.pogamut.base3d.worldview.object.Location> getLocations()
List of Locations used by RFID sensor to determine where are various RFID Tags or by Victiom sensor to determine locations of bodys. Also used by INS sensor to determine robots location

Returns:
Returns list of Locations.

getOrientations

public List<cz.cuni.amis.pogamut.base3d.worldview.object.Rotation> getOrientations()
INS sensor entry in USARSim manual v3.1.3 suggests that it should need more than one record of Orienation, but the experience was different. Still we use list of Rotations to support multiple entry. Mainly used for determination of robots Orientation.

Returns:
Returns List of Rotations.

getEncoderTicks

public Map<String,Integer> getEncoderTicks()
String is the sensor name. Integer is the tick count. Example: SEN {Type Encoder} {Name ECLeft Tick -61} {Name ECRight Tick -282} {Name ECTilt Tick 0} {Name ECPan Tick 0}

Returns:
Returns Map of Encoder couples String-Integers.

getTouches

public Map<String,Boolean> getTouches()
String is the sensor name. Boolean indicates whether the sensor is touching something. Value ?True’ means the sensor is touching something.

Returns:
Returns map of touch names and values.

getIDs

public List<Integer> getIDs()
Used by RFID sensor. RFID tags are simulated by implementing the class USARBot.RFIDTag class in the Unreal Editor when editing a map. This class contains an integer id and a boolean bSingleshot variable that determines whether the tag is a single shot tag or a multi shot tag. They are deployed by placing them in UnrealEd. If the tag’s id is set to -1 (the default), then the tag id will be set to a unique value automatically. Other values for the id will not be changed. If the tags are within the MaxRange of the RFID sensor mounted on the robot then the server sends the following message to the client:

Returns:
Returns a list of RFID IDs.

getPartNames

public List<String> getPartNames()
PartName is the name of the victim part that was discovered by the sensor. It can be one of 7 values: “Head”, “Arm”, “Hand”, “Chest”, “Pelvis”, “Leg”, and “Foot”. Please note that the sensor does not differentiate between real victim’s part and false alarms. It is up to the controller to perform this task.

Returns:
Returns a list of victim body part names.

getStatus

public String getStatus()
Status is not in USARSim manual v3.1.3. And was added to full support of Victim sensor.

Returns:
Returns the status of Victim sensor.

getProb

public double getProb()
Prob is the probability of it’s human motion.

Returns:
Returns the probability of Human motion detector.

getLoudness

public double getLoudness()
Loudnes from the sound sensor.

Returns:
Returns loundness of a sound.

getDuration

public double getDuration()
Duration of a sound from the sound sensor.

Returns:
Returns a drutaion of a sound.

getVelocity

public javax.vecmath.Point4d getVelocity()
Velocity of the robot measured by Tachometer. Not in the USARSim manual v3.1.3.

Returns:
Returns velocity from Tachometer.

getPosition

public javax.vecmath.Point4d getPosition()
Position of the robot measured by Tachometer. Not in the USARSim manual v3.1.3.

Returns:
Returns position from Tachometer.

getAcceleration

public cz.cuni.amis.pogamut.base3d.worldview.object.Velocity getAcceleration()
Acceleration from Acceleration Sensor. Not in USARSim manual v3.1.3.

Returns:
Returns acceleration from accel sensor.

getGas

public String getGas()
Gas sensor measures type and density. Default value is CO2. There is Resolution and Range information offered by GetConf. Not in USARSim manual v3.1.3.

Returns:
Returns type of a gas measured by Gas sensor.

getDensity

public double getDensity()
Gas sensor measures type and density. There is Resolution and Range information offered by GetConf. Not in USARSim manual v3.1.3.

Returns:
Returns density of a gas measured by Gas sensor.

isVisible

public boolean isVisible()
AIBO - ERS robot uses tracking ball sensor, that recognises a soccer ball from camera. Not in USARSim manual v3.1.3.

Returns:
Returns wether the soccer ball is visible or not.

getPos2D

public javax.vecmath.Point2d getPos2D()
AIBO - ERS robot uses tracking ball sensor, that recognises a soccer ball from camera. Not in USARSim manual v3.1.3.

Returns:
Returns position on the camera of the soccer ball.

getPos3D

public cz.cuni.amis.pogamut.base3d.worldview.object.Location getPos3D()
AIBO - ERS robot uses tracking ball sensor, that recognises a soccer ball from camera. Not in USARSim manual v3.1.3.

Returns:
Returns location of the soccer ball in the environment.

getRadius

public double getRadius()
AIBO - ERS robot uses tracking ball sensor, that recognises a soccer ball from camera. Not in USARSim manual v3.1.3.

Returns:
Returns radius of the soccer ball.

getDistance

public double getDistance()
AIBO - ERS robot uses tracking ball sensor, that recognises a soccer ball from camera. Not in USARSim manual v3.1.3.

Returns:
Returns distance of the soccer ball from the robot.

getCorona

public double getCorona()
AIBO - ERS robot uses tracking ball sensor, that recognises a soccer ball from camera. Not in USARSim manual v3.1.3.

Returns:
Returns corona of the soccer ball.

toString

public String toString()
Overrides:
toString in class cz.cuni.amis.pogamut.base.communication.messages.InfoMessage

toHtmlString

public String toHtmlString()
Gets all properties and values to create a HTML formated string;

Returns:
Returns all properties in HTML format


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