|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--khepera.KheperaConnection
|
+--khepera.SerialConnection
Allows communication with the Khepera robot via the serial-port using the via the KheperaConnection class. Serial
ports on the system are reffered to by name which is system dependent. Use minicom to find out which port you are using.
IMPORTANT
Since Java has no native support for the serial ports this class uses
Java Communications API to communicate with the robot. This
API must therefore be installed in the system you use this class on.
| Constructor Summary | |
SerialConnection()
Creates a connection to the Khepera via the serial port using the default port name on the lab computers at Lunds Department of Computer Sience ie. |
|
SerialConnection(int portSpeed)
Creates a connection to the Khepera via the serial port using the default port name on the lab computers at Lunds Department of Computer Sience ie. |
|
SerialConnection(java.lang.String portName)
Creates a connection to the Khepera via the serial port using the default speed ie. 19200 baud. |
|
SerialConnection(java.lang.String portName,
int portSpeed)
Creates a connection to the Khepera via the serial port. |
|
| Method Summary | |
void |
close()
Disconnects the robot releasing the serial port. |
void |
open(java.lang.String robotName)
Opens a connection to the serial port as specified by the constructor call. |
java.lang.String |
send(java.lang.String command)
Sends the given command and waits for the robot response, which is then returned. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SerialConnection(java.lang.String portName,
int portSpeed)
robotName - The name of your robot.portName - Name of the serial port connected to the robot (see above for a list of port names).portSpeed - The speed of the port. Use the jumpers on the Khepera to match the speed of your systems
serial port. The higher the better.public SerialConnection(java.lang.String portName)
robotName - The name of your robot.portName - Name of the serial port connected to the robot (see above for a list of port names).public SerialConnection(int portSpeed)
robotName - The name of your robot.portSpeed - The speed of the port. Use the jumpers on the Khepera to match the speed of your systems
serial port. The higher the better.public SerialConnection()
robotName - The name of your robot.| Method Detail |
public void open(java.lang.String robotName)
throws KheperaException
open in class KheperaConnectionrobotName - The name of the robot.KheperaException - If a problem occurs when setting up the serial port.public void close()
close in class KheperaConnectionkhepera.KheperaConnectionKheperaCommunicationException - When a communications error occurs.
public java.lang.String send(java.lang.String command)
throws KheperaException
send in class KheperaConnectionKheperaException - If an error occurs while reading from the serial port.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||