|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
dlife.robot.Robot
dlife.robot.player.PlayerRobot
dlife.robot.khepera3.Khepera3Player
public class Khepera3Player
Class for communicating with a simulated Khepera 3 in the Player/Stage system. A Khepera3Player creates a connection to a Player server with a Khepera3 model simulation running. This class can be used just as a regular Khepera3 robot as long as a valid Player server is running. This class uses a PlayerClient to communicate with the server. The provided playerclient2.jar contains the necessary class files to run.
| Field Summary | |
|---|---|
static PlayerDeviceConfiguration |
PLAYER_PROXIMITY_CONFIG
The configuration data for player for the proximity sensor. |
static PlayerDeviceConfiguration |
PLAYER_SONAR_CONFIG
The configuration data for player for the Sonar sensor. |
static int |
PROX_GROUND_CONSTANT
Since player cannot use the ground proximity sensors, a default value will be returned each time for that sensor. |
| Fields inherited from class dlife.robot.player.PlayerRobot |
|---|
PLAYER_POSITION_CONFIG, TIMEOUT |
| Constructor Summary | |
|---|---|
Khepera3Player()
Construct a new Khepera3Player. |
|
Khepera3Player(File dLifePlayerConfig,
int port,
boolean noise)
Connect to a Khepera3Player with the given DLP configuration file, port to attempt to connect to, and if we should load and use the noise profile for this robot. |
|
Khepera3Player(File dLifePlayerConfig,
int port,
boolean noise,
String playerCmd)
Connect to a Khepera3Player with the given DLP configuration file, port to attempt to connect to, if we should load and use the noise profile for this robot, and absolute player command.. |
|
Khepera3Player(PlayerSimulation sim,
int port,
boolean noise)
Connect to a Khepera3Player using the configuration contained in the PlayerSimuation object. |
|
Khepera3Player(PlayerSimulation sim,
String playerCmd,
int port,
boolean noise)
Connect to a Khepera3Player using the configuration contained in the PlayerSimuation object. |
|
Khepera3Player(String address,
int port)
Creates a new Khepera3Player and connects to a Player Server at the supplied address and port number. |
|
| Method Summary | |
|---|---|
static String[] |
getPlayerConfigBody()
Get the main body definition for player. |
static PlayerRobotIconInfo |
getPlayerSimulationBuilderIcon()
This will return a PlayerRobotIconInfo containing the icon of this robot to be used in a PlayerSimulationBuilder. |
protected boolean |
isValidDevice(Device newDevice)
Checks if the device is valid for a Khepera3Player. |
String |
sendMessage(String msg)
Interprets the message given and sends an appropriate command to the PlayerClient. |
| Methods inherited from class dlife.robot.player.PlayerRobot |
|---|
addDevice, getAddress, getAngle, getGripperData, getPlayerClient, getPort, getRotation, getSonarValues, getTranslation, getXPos, getYPos, hasGripper, resetPositionData, setGripper, setPositionData, setPositionUnits, setSonarUnits, setSpeed, shutDown, startUp |
| Methods inherited from class dlife.robot.Robot |
|---|
freeze, getDevices, getRunTime, isAlive, removeDevice, setAlive |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final PlayerDeviceConfiguration PLAYER_SONAR_CONFIG
public static final PlayerDeviceConfiguration PLAYER_PROXIMITY_CONFIG
public static final int PROX_GROUND_CONSTANT
| Constructor Detail |
|---|
public Khepera3Player()
RobotCreationCanceledException - if the user cancels the creation
of the robot via the dialog box.
UnknownHostException - thrown if the host name cannot be resolved
public Khepera3Player(PlayerSimulation sim,
int port,
boolean noise)
sim - the PlayerSimulation used to setup playerport - the port to connect tonoise - if noise should be used
public Khepera3Player(PlayerSimulation sim,
String playerCmd,
int port,
boolean noise)
sim - the PlayerSimulation used to setup playerplayerCmd - the absolute system command to start playerport - the port to connect tonoise - if noise should be used
public Khepera3Player(File dLifePlayerConfig,
int port,
boolean noise)
dLifePlayerConfig - the DLP file for this simulationport - the port of the robot to connect to in Playernoise - if a noise profile should be loaded and used
public Khepera3Player(File dLifePlayerConfig,
int port,
boolean noise,
String playerCmd)
dLifePlayerConfig - the DLP file for this simulationport - the port of the robot to connect to in Playernoise - if a noise profile should be loaded and usedplayerCmd - the absolute system command to start player
public Khepera3Player(String address,
int port)
throws UnknownHostException
address - the address where the Player Server is runningport - the port number that the Player Server is using
UnknownHostException - thrown if the host name cannot be resolved.| Method Detail |
|---|
protected boolean isValidDevice(Device newDevice)
isValidDevice in class PlayerRobotnewDevice - the sensor to check
public String sendMessage(String msg)
sendMessage in class Robotmsg - the message interpret for the PlayerClient
public static String[] getPlayerConfigBody()
public static PlayerRobotIconInfo getPlayerSimulationBuilderIcon()
PlayerConfigurationDataException - if this method was not
overridden
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||