at.ac.sbg.cosy.soccerbot.rcxdrive
Class RCXDrive

java.lang.Object
  extended by at.ac.sbg.cosy.soccerbot.rcxdrive.RCXDrive
All Implemented Interfaces:
IRCXDrive

public class RCXDrive
extends java.lang.Object
implements IRCXDrive

Communications api for driving the RCX

Author:
Georg Klima

Field Summary
 
Fields inherited from interface at.ac.sbg.cosy.soccerbot.rcxdrive.IRCXDrive
MAX_SPEED, MIN_SPEED, NORMAL_SPEED
 
Method Summary
 void close()
          Terminates the Tower and Communitation, readies the programm to exit.
 boolean getBumper()
          Checks the bumper for an event.
static IRCXDrive getInstance()
          Returns the actual instance of an RCXDrive
static void newInstance()
          Get a new singelton instance of the RCXDrive.
 void sendCommand(byte command)
          Sends a command to the brick
 void setPower(byte power)
          Sets the power
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static void newInstance()
Get a new singelton instance of the RCXDrive.


getInstance

public static IRCXDrive getInstance()
Returns the actual instance of an RCXDrive

Returns:
current instance

close

public void close()
Description copied from interface: IRCXDrive
Terminates the Tower and Communitation, readies the programm to exit.

Specified by:
close in interface IRCXDrive
See Also:
IRCXDrive.close()

setPower

public void setPower(byte power)
Description copied from interface: IRCXDrive
Sets the power

Specified by:
setPower in interface IRCXDrive
Parameters:
power - the power value
See Also:
IRCXDrive.setPower(byte power)

sendCommand

public void sendCommand(byte command)
Description copied from interface: IRCXDrive
Sends a command to the brick

Specified by:
sendCommand in interface IRCXDrive
Parameters:
command - the command from CommandEvent
See Also:
IRCXDrive.sendCommand(byte command)

getBumper

public boolean getBumper()
Description copied from interface: IRCXDrive
Checks the bumper for an event.

Specified by:
getBumper in interface IRCXDrive
Returns:
returns true if bumped
See Also:
IRCXDrive.getBumper()