Network Bridge

CornerStone includes a network bridge that can be used when one needs to split the computer vision and application logic to different computers. The bridge is related to building C++ applications that link directly to the CornerStone libraries. The CornerStone Flash SDK uses the XML data stream which is different from the network bridge.

The network bridge should work starting from release 2419. Earlier releases included this feature but it was officially released with 2419.

Practical cases where this is useful are:

  • Large systems, where a single computer cannot handle the whole workload.
  • Systems where the tracking computer needs to be for some other reason (distance, operating system requirements) separate from the application computer

To do this, you need to set up the computer vision parameters on the tracking computer, set up the network bridge, and create a fast local-area network between the application computer and tracking computer.

Setting up the Tracking Computer

The computer vision PC is initially set up in the usual fashion, as described in the getting started section.

Once the basic setup is done, and the computer handles the touch tracking, you need to set up the network parameters in the config.txt that you are using. The parameters that are important are in the Globals section:

Globals {
  ...
  /* Hostname for the binary server socket. */
  binary-server-host = "localhost"
  /* Port number for binary server socket. */
  binary-server-port = "5502"
  ...
}

To the binary-server-host you need to set the network address of the tracking PC. Exemplary values could be:

  • multitouch-server.ourlab.ourcompany.com (a computer with a real network name)
  • 178.123.45.213 (a PC with real, unique IPV4 address)
  • 10.0.0.14 (a PC in the same LAN/intranet)
  • localhost (when routing the socket traffic through ssh between the application and tracking PC)

The port number is by default 5502. There is seldom need to change this, but if necessary, you can adjust the value from the file.

Setting up the Application Computer

In the application computer you need to set up the corresponding parameters, so that the network bridge can connect to the tracking software.

To do this, you edit the config.txt to contain nothing but:

NetBridge {
  host = "localhost"
  port = "5502"
}

Yes, there real is nothing more to it. The network bridge fetches all the other information automatically from the tracking PC. The network streaming is part of the basic computer vision system, so all applications (ViewBasic, Twinkle, HelloWorld) include the capability to send out touch data.

The host and port should match the parameters in the computer vision PC.

Running the System

The system is ran by:

  • Starting up the tracking server software (for example HelloWorld) in the computer vision PC
  • Starting up the application software in the application PC

The tracking server can serve multiple clients at the same time. The server does not shut down when a client disconnects, but keeps serving existing and new clients. In general you only need to start the server once, and you can then run the application many times.

Calibration

The basic computer vision calibration is done within the tracking PC. The only real issue is that the final five-point calibration needs to happen on the application PC, as it is the one producing the image. The calibration is carried out on the application PC as usual, by pressing "c"-key and hitting the calibration points. Once the calibration data is collected the network bridge will transmit the data over to the tracking software.

The tracking software is responsible for saving the new configuration, so you will need to save the tracking configuration as the server exits.

Caveats

The speed of data transmission depends on the server application. If this server is very slow, then the system will be unresponsive even if the actual application is fast. In particular one should note that the ViewBasic (or any application that shows the calibration screen all the time) is very slow, and should not be used as a server on a production system. For example the HelloWorld is a light-weight application that can be used as the server.

How Does it Perform?

Whenever one is using the network to transmit data there are questions about latency and reliability. The network bridge uses binary TCP/IP communication for streaming the data. TCP/IP was selected over UDP/IP, provides more reliable transmission channel. With the use of latency-reduction techniques* we believe the latency is practically identical with the UDP/IP-based solutions.

We recommend setting up a dedicated Gigabit Ethernet network for moving the tracking data. If there is other traffic in the network, one may experience fluctuations in the data transfer speeds, up a point where the end-users notice that there is something wrong.

Even with 60Hz tracking the volume of the data is not too great, usually in the range of tens of kilobytes per second.

*The TCP/IP data buffering is generally avoided by using the "TCP_NO_DELAY" option with the sockets, which removes a lot of the TCP-related latency.