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

Package class diagram package StateMessage
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.StateMessage
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 StateMessage
extends GBEvent
implements cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEvent, cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent

A State message is the message class that reports the robot or mission package’s state. State message reports the robot's actual state. Please note that the robot state message parameters depend on the type of robot that you are driving. For example, a robot of type “GroundVehicle” will not have the same state message as a robot of type “AerialVehicle.” A robot state message looks like (for a ground vehicle): STA {Type string} {Time float} {FrontSteer float} {RearSteer float}{LightToggle bool} {LightIntensity int} {Battery int} Corresponding GameBots message is STA.


Field Summary
protected  int Battery
           
protected  double FrontSteer
           
protected  int LightIntensity
           
protected  boolean LightToggle
           
protected  Map<String,String> PartsValues
           
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  double RearSteer
           
protected  double RudderAngle
           
protected  double SternPlaneAngle
           
protected  double Time
          Timestamp form the UT since server start in seconds.
protected  String Type
          Type describes the vehicle type.
protected  int View
           
 
Constructor Summary
StateMessage()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
StateMessage(StateMessage original)
          Cloning constructor.
StateMessage(String Type, double Time, double FrontSteer, double RearSteer, double SternPlaneAngle, double RudderAngle, boolean LightToggle, int LightIntensity, int Battery)
           
 
Method Summary
 int getBattery()
          Power state of the battery.
 double getFrontSteer()
          Note: parameter only available for robots of “GroundVehicle” type.
 int getLightIntensity()
          Light intensity of the headlight.
 Map<String,String> getPartsValues()
          Kenaf robot uses these to describe state of its Flippers.
 double getRearSteer()
          Note: parameter only available for robots of “GroundVehicle” type.
 double getRudderAngle()
          Note: parameter only available for robots of “NauticVehicle” type.
 double getSternPlaneAngle()
          Note: parameter only available for robots of “NauticVehicle” type.
 double getTime()
          Timestamp form the UT since server start in seconds.
 String getType()
          Type will be one of the following values: "GroundVehicle”, “LeggedRobot”, “NauticVehicle”, or “AerialVehicle”.
 int getView()
          This was added for UT2004 version.
 boolean isLightToggle()
          Indicate whether the headlight has been turned on.
 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
Type describes the vehicle type. It will be one of the following values: "GroundVehicle”, “LeggedRobot”, “NauticVehicle”, or “AerialVehicle”.


Time

protected double Time
Timestamp form the UT since server start in seconds.


FrontSteer

protected double FrontSteer

RearSteer

protected double RearSteer

SternPlaneAngle

protected double SternPlaneAngle

RudderAngle

protected double RudderAngle

LightToggle

protected boolean LightToggle

LightIntensity

protected int LightIntensity

Battery

protected int Battery

View

protected int View

PartsValues

protected Map<String,String> PartsValues
Constructor Detail

StateMessage

public StateMessage(String Type,
                    double Time,
                    double FrontSteer,
                    double RearSteer,
                    double SternPlaneAngle,
                    double RudderAngle,
                    boolean LightToggle,
                    int LightIntensity,
                    int Battery)

StateMessage

public StateMessage(StateMessage original)
Cloning constructor.


StateMessage

public StateMessage()
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 will be one of the following values: "GroundVehicle”, “LeggedRobot”, “NauticVehicle”, or “AerialVehicle”.

Returns:
Returns Type of the vehicle.

getTime

public double getTime()
Timestamp form the UT since server start in seconds.

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

getFrontSteer

public double getFrontSteer()
Note: parameter only available for robots of “GroundVehicle” type. Current front steer angle of the robot, in radians.

Returns:
Returns front steer angle value

getRearSteer

public double getRearSteer()
Note: parameter only available for robots of “GroundVehicle” type. Current rear steer angle of the robot, in radians.

Returns:
Returns rear steer angle value.

getSternPlaneAngle

public double getSternPlaneAngle()
Note: parameter only available for robots of “NauticVehicle” type. Current stern plane angle of the robot, in radians.

Returns:
Returns sern plane angle.

getRudderAngle

public double getRudderAngle()
Note: parameter only available for robots of “NauticVehicle” type. Current rudder angle of the robot, in radians.

Returns:
Returns rudder angle.

isLightToggle

public boolean isLightToggle()
Indicate whether the headlight has been turned on.

Returns:
Returns wether the Headlight is on or not.

getLightIntensity

public int getLightIntensity()
Light intensity of the headlight. Right now, it always is 100.

Returns:
Returns the intensity of the Headlight.

getBattery

public int getBattery()
Power state of the battery. It is the battery lifetime in second. It’s the total time remaining for the robot to run.

Returns:
Returns remaining battery life.

getView

public int getView()
This was added for UT2004 version. Represents number of views when Multiview(Multiple Cameras) is used.

Returns:
Returns number of views if MultiView used, else -1;

getPartsValues

public Map<String,String> getPartsValues()
Kenaf robot uses these to describe state of its Flippers.

Returns:
Returns a map containing data about Kenafs flippers.

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.