jarol
Class JarolCoreWithLink

java.lang.Object
  extended by jarol.JarolCore
      extended by jarol.JarolCoreWithLink
All Implemented Interfaces:
JarolCoreInterface

public abstract class JarolCoreWithLink
extends JarolCore

Abstract class for controlling a vehicle that is connected to a vehicle and a control terminal (terminal unit + navigation unit) via UDPLinks. It provides three synchronization points in form of signals. One to activate the controller, when the sensor has finished its execution. One to activate the terminal interface, when the controller has finished passing the display data to the terminal. The last one to activate the actuator interface, when the controller has finished computing the actuation data forwarded it to the actuator interface.
It should be noted that the controller doesn't wait for navigation data from the terminal. An additional Signal is needed for this kind of behavior, whereas the method awaitNavigation() is provided in the interface and called in the controlLoop(). Hence an additional Signal and the implementation of awaitNavigation() would make the controller wait for the navigation data.

Version:
0.1
Author:
Bernhard Kast

Field Summary
protected  Link terminalLink
          The Link that provides an input and output port to the terminal.
protected  Link vehicleLink
          The Link that provides an input and output port to the vehicle.
 
Fields inherited from class jarol.JarolCore
condition, portControllerActuator, portControllerTerminal, portNavigatorController, portSensorController, signalControllerActuator, signalControllerTerminal, signalSensorController
 
Constructor Summary
JarolCoreWithLink()
           
 
Method Summary
protected  UDPLink setupUDPLink(MessageFactory messageFactory, java.lang.String host, int localPort, int remotePort, int receiveBufferSize, int sendBufferSize)
          Creates an UDPLink on the localPort to a given host on its remotePort.
 
Methods inherited from class jarol.JarolCore
awaitNavigation, awaitSensor, computeActuationData, controlLoop, forwardToActuator, forwardToNavigation, forwardToTerminal, readFromNavigation, readFromSensor, signalActuator, signalNavigation, signalTerminal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vehicleLink

protected Link vehicleLink
The Link that provides an input and output port to the vehicle. Used for transfering the sensor and actuation data into and out of Jarol.


terminalLink

protected Link terminalLink
The Link that provides an input and output port to the terminal. NOTE: This assumes that the terminal also provides navigation data.

Constructor Detail

JarolCoreWithLink

public JarolCoreWithLink()
Method Detail

setupUDPLink

protected UDPLink setupUDPLink(MessageFactory messageFactory,
                               java.lang.String host,
                               int localPort,
                               int remotePort,
                               int receiveBufferSize,
                               int sendBufferSize)
Creates an UDPLink on the localPort to a given host on its remotePort.

Parameters:
messageFactory - a concrete MessageFactory
host - the hostname
localPort - the local port
remotePort - the remote port
receiveBufferSize - the size for the receiving buffer
sendBufferSize - the size for the sending buffer
Returns:
link the connected link, null if an error occured.