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

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

Response message reports the message that user's been asking for. Please note that the robot Response message parameters depend on the type of robot that you are driving. For example, a robot of type “GroundVehicle” will not have the same Response message as a robot of type “AerialVehicle.” * Corresponding GameBots message is RES. A response message is delivered to describe the status of a command that has been sent to USARSim. Response messages are used so that users can tell whether or not particular commands were successfully executed. There are three different response messages. The first response message is issued after a SET {Type Viewports} command. The second response messaged is issued after a SET {Type Camera} command. The third response message is a generic message used for sensors and effecters. After a SET {Type Viewports} command, the response message will be issued.


Field Summary
protected  String Config
           
protected  List<String> FOVs
           
protected  List<String> Names
           
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  List<String> Statuses
           
protected  double Time
           
protected  String Type
           
protected  List<String> Viewports
           
 
Constructor Summary
ResponseMessage()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
ResponseMessage(double Time, String Type, String Config, String Status)
           
ResponseMessage(ResponseMessage original)
          Cloning constructor.
 
Method Summary
 String getConfig()
          Describes the current viewport configuration.
 List<String> getFOVs()
          Each value is the current field of view of the camera being described, in radians.
 List<String> getNames()
          Name of the camera that will be described by the next two parameters: FOV and Status.
 List<String> getStatuses()
          Status of the viewport configuration after the SET command has been issued.
 double getTime()
          Timestamp form the UT since server start in seconds.
 String getType()
          Type of the response will be one of the following: "ViewPorts”, “Camera”, or some type of sensor or effecter.
 List<String> getViewports()
          Each value is the name of the camera currently attached to viewportN, where N is 1..4.
 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

Time

protected double Time

Type

protected String Type

Config

protected String Config

Statuses

protected List<String> Statuses

Viewports

protected List<String> Viewports

Names

protected List<String> Names

FOVs

protected List<String> FOVs
Constructor Detail

ResponseMessage

public ResponseMessage(double Time,
                       String Type,
                       String Config,
                       String Status)

ResponseMessage

public ResponseMessage(ResponseMessage original)
Cloning constructor.


ResponseMessage

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

Method Detail

getTime

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

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

getType

public String getType()
Type of the response will be one of the following: "ViewPorts”, “Camera”, or some type of sensor or effecter.

Returns:
Returns Type of the response.

getConfig

public String getConfig()
Describes the current viewport configuration. This parameter will be either “SingleView” or “QuadView”

Returns:
Returns configuration of current viewport.

getStatuses

public List<String> getStatuses()
Status of the viewport configuration after the SET command has been issued. The status will be “OK” when the viewport configuration was successfully changed. Otherwise, the status will be “Failed”. List of statuses is also used when setting cameras. Each value is then the status for the camera’s field of view after the SET command has been issued. The status will be “OK” when the camera’s field of view was successfully changed. Otherwise, the status will be “Failed”. When responsing to SET command for sensor or effecter, single value describing the status of the transaction will be present in the list.

Returns:
Returns List of status results.

getViewports

public List<String> getViewports()
Each value is the name of the camera currently attached to viewportN, where N is 1..4. If viewportN has been disabled, this parameter will be “Disabled”. If viewportN has been attached to a non- existent camera, this parameter will be “None”.

Returns:
Returns List of viewport values. Size of four.

getNames

public List<String> getNames()
Name of the camera that will be described by the next two parameters: FOV and Status. When responsing to SET command for sensor or effecter, single value will be present in the list.

Returns:
Returns List of names of cameras.

getFOVs

public List<String> getFOVs()
Each value is the current field of view of the camera being described, in radians. The current field of view is the field of view after a SET {Type Camera} has been issued.

Returns:
Returns List of fields of views of cameras.

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.