robot
Class Robot

java.lang.Object
  extended by device.Device
      extended by robot.Robot
All Implemented Interfaces:
IDevice, java.lang.Runnable, IRobot
Direct Known Subclasses:
Pioneer

public class Robot
extends Device
implements IRobot

The Robot class represents a robot that can move in two dimensions, that is in x and y direction. It will dynamically use if possible any devices provided by the device list given. A robot can have a current location and a goal position (in global coordinate system).


Field Summary
(package private)  Blobfinder bloFi
           
(package private)  Position goal
           
(package private)  IGripper gripper
           
(package private)  Localize localizer
           
(package private)  java.util.logging.Logger logger
          Logging support
(package private)  Planner planner
           
(package private)  Position2d posi
          List of devices this robot can use if any of them are present.
(package private)  Position position
           
(package private)  Ranger ranger0
           
(package private)  Ranger ranger1
           
(package private)  RangerLaser rLaser
           
(package private)  java.lang.String robotId
           
(package private)  RangerSonar rSonar
           
(package private)  Simulation simu
           
(package private)  double speed
           
(package private)  double turnrate
           
 
Fields inherited from interface device.external.IDevice
DEVICE_ACTARRAY_CODE, DEVICE_AIO_CODE, DEVICE_AUDIO_CODE, DEVICE_AUDIODSP_CODE, DEVICE_AUDIOMIXER_CODE, DEVICE_BLINKENLIGHT_CODE, DEVICE_BLOBFINDER_CODE, DEVICE_BUMPER_CODE, DEVICE_CAMERA_CODE, DEVICE_DEVICE_CODE, DEVICE_DIO_CODE, DEVICE_ENERGY_CODE, DEVICE_FIDUCIAL_CODE, DEVICE_GPS_CODE, DEVICE_GRAPHICS2D_CODE, DEVICE_GRAPHICS3D_CODE, DEVICE_GRIPPER_CODE, DEVICE_HEALTH_CODE, DEVICE_IMU_CODE, DEVICE_IR_CODE, DEVICE_JOYSTICK_CODE, DEVICE_LASER_CODE, DEVICE_LIMB_CODE, DEVICE_LOCALIZE_CODE, DEVICE_LOG_CODE, DEVICE_MAP_CODE, DEVICE_MCOM_CODE, DEVICE_NOMAD_CODE, DEVICE_NULL_CODE, DEVICE_OPAQUE_CODE, DEVICE_PLANNER_CODE, DEVICE_POINTCLOUD3D_CODE, DEVICE_POSITION1D_CODE, DEVICE_POSITION2D_CODE, DEVICE_POSITION3D_CODE, DEVICE_POWER_CODE, DEVICE_PTZ_CODE, DEVICE_RANGER_CODE, DEVICE_RFID_CODE, DEVICE_SERVICE_ADV_CODE, DEVICE_SIMULATION_CODE, DEVICE_SONAR_CODE, DEVICE_SOUND_CODE, DEVICE_SPEECH_CODE, DEVICE_SPEECH_RECOGNITION_CODE, DEVICE_TRUTH_CODE, DEVICE_WAVEFORM_CODE, DEVICE_WIFI_CODE, DEVICE_WSN_CODE
 
Constructor Summary
Robot()
          Creates a Robot with initialized position and goal.
Robot(Device deviceNode)
          Deprecated. Use Robot(Device[]) instead. This constructor has to be overwritten in any subclasses! It will parse all devices from the given device and connects it to the internal device list.
Robot(Device[] robotDevList)
          Creates a robot and provides the given devices to it.
 
Method Summary
(package private)  void connectDevices(Device[] deviceList)
          Initiate standard variables to this robot for the devices Note that if there are duplicate devices in the list always the last one of the same device code will be chosen!
 Blobfinder getBloFi()
           
 Position getGoal()
           
 IGripper getGripper()
           
 Ranger getLaser()
           
 Localize getLocalizer()
           
 Planner getPlanner()
          Returns the current Planner.
 Position2d getPosi()
           
 Position getPosition()
           
 java.lang.String getRobotId()
           
 Simulation getSimu()
           
 Ranger getSonar()
           
 double getSpeed()
           
 double getTurnrate()
           
 void setGoal(Position newGoal)
          Sets a goal if the robot possesses a navigation device.
 void setPosition(Position newPosition)
          Sets the position if the robot possesses an position device.
 void setRobotId(java.lang.String name)
          Sets this robot's string identifier.
 void setSpeed(double speed)
           
 void setTurnrate(double turnrate)
           
 void shutdown()
          Shuts down this (and any sub-) device.
 java.lang.String toString()
           
 
Methods inherited from class device.Device
equals, getDevice, getDeviceIterator, getDeviceList, getDeviceListArray, getHost, getId, getIndex, getLogger, getPort, getSleepTime, getThreadName, isInList, isRunning, isSupported, isThreaded, matches, matchesList, run, runThreaded, setDeviceList, setHost, setName, setPort, setSleepTime, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

java.util.logging.Logger logger
Logging support


posi

Position2d posi
List of devices this robot can use if any of them are present. They will be detected in a dynamical way during runtime.


ranger1

Ranger ranger1

rLaser

RangerLaser rLaser

ranger0

Ranger ranger0

rSonar

RangerSonar rSonar

planner

Planner planner

localizer

Localize localizer

gripper

IGripper gripper

bloFi

Blobfinder bloFi

simu

Simulation simu

speed

double speed

turnrate

double turnrate

position

Position position

goal

Position goal

robotId

java.lang.String robotId
Constructor Detail

Robot

public Robot()
Creates a Robot with initialized position and goal.


Robot

public Robot(Device deviceNode)
Deprecated. Use Robot(Device[]) instead. This constructor has to be overwritten in any subclasses! It will parse all devices from the given device and connects it to the internal device list.


Robot

public Robot(Device[] robotDevList)
Creates a robot and provides the given devices to it.

Parameters:
robotDevList - The provided devices.
Method Detail

getRobotId

public java.lang.String getRobotId()
Returns:
The robot's Id string.

setRobotId

public void setRobotId(java.lang.String name)
Sets this robot's string identifier.

Parameters:
name - The robot identifier.

connectDevices

void connectDevices(Device[] deviceList)
Initiate standard variables to this robot for the devices Note that if there are duplicate devices in the list always the last one of the same device code will be chosen!

Parameters:
deviceList - The device list to search for applicable devices.

setGoal

public void setGoal(Position newGoal)
Sets a goal if the robot possesses a navigation device.

Specified by:
setGoal in interface IRobot
Parameters:
newGoal - New @see Position goal.

getGoal

public Position getGoal()
Specified by:
getGoal in interface IRobot
Returns:
Current goal @see Position or null.

setPosition

public void setPosition(Position newPosition)
Sets the position if the robot possesses an position device.

Specified by:
setPosition in interface IRobot
Parameters:
newPosition - New @see Position.

getPosition

public Position getPosition()
Specified by:
getPosition in interface IRobot
Returns:
Current robot @see Position or null.

shutdown

public void shutdown()
Description copied from class: Device
Shuts down this (and any sub-) device.

Specified by:
shutdown in interface IDevice
Overrides:
shutdown in class Device

getPlanner

public Planner getPlanner()
Returns the current Planner.

Returns:
The @see Planner or 'null' if no one is available.

getLocalizer

public Localize getLocalizer()
Returns:
the current @see Localize @see Device or 'null' if no such device.

getGripper

public IGripper getGripper()
Returns:
The @see Gripper @see Device or 'null' if no such device.

getPosi

public Position2d getPosi()
Returns:
the posi

getLaser

public Ranger getLaser()
Returns:
the laser

getSonar

public Ranger getSonar()
Returns:
the sonar

getBloFi

public Blobfinder getBloFi()
Returns:
the bloFi

getSimu

public Simulation getSimu()
Returns:
the simu

getSpeed

public double getSpeed()
Returns:
the speed

getTurnrate

public double getTurnrate()
Returns:
the turnrate

setSpeed

public void setSpeed(double speed)
Parameters:
speed - the speed to set

setTurnrate

public void setTurnrate(double turnrate)
Parameters:
turnrate - the turnrate to set

toString

public java.lang.String toString()
Overrides:
toString in class Device