|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdlife.robot.player.StageSimulationControl
public class StageSimulationControl
A StageSimulationControl object allows direct access to robots within the Stage simulation. This will allow to user to place a specific robot anywhere in the world or read its absolute position. Robots are identified by the name that was given to them when creating the simulation. Only one object can be created per host and connects to the simulation via port 6665. The call to 'getStageSimulationControl' will return a reference to a StageSimulationControl for the given host.
| Method Summary | |
|---|---|
void |
connect()
Connect to the Stage simulation if a connection has not already been made. |
void |
disconnect()
Disconnect from the Stage simulation if a connection has already been made. |
StagePositionData |
getPosition(String identifier,
int timeout)
Get the StagePositionData for the robot with the given identifier. |
static StageSimulationControl |
getStageSimulationControl(String host)
Get a reference to a StageSimulationControl. |
double |
getStageTime()
Get the amount of simulated time in seconds that have passed since Stage was started. |
boolean |
isConnected()
Returns if there is a connection to the Stage simulation. |
void |
setPosition(String identifier,
StagePositionData pos)
Set the position of the robot with the given identifier to the position specified in the given StagePositionData. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static StageSimulationControl getStageSimulationControl(String host)
host - the host the Player/Stage simulation is running on
public void connect()
public void disconnect()
public boolean isConnected()
public StagePositionData getPosition(String identifier,
int timeout)
identifier - the name of the robot to get the position data fromtimeout - the maximum number of time in milliseconds to wait
RobotCommunicationException - thrown if no connection to Player has been made, or if
communication to Player has been lost.
public void setPosition(String identifier,
StagePositionData pos)
identifier - the name of the robot to movepos - the position information to move the robot
RobotCommunicationException - thrown if we are not connected or we loose communication with
Player in this callpublic double getStageTime()
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||