Last modified on 17 December 2009, at 22:51

SwisTrack/Multi-Camera Client


IntroductionEdit

AbstractEdit

SwisTrack Multi-Camera Client is a client tool to communicate with several SwisTrack instances. It is written in C++ using wxWidgets. Data received by a TCP connection will be merged and synchronized before displaying it on a window. SwisTrack is the server part of the connection and SwisTrack Multi-Camera Client is the client.


Zoom / focus functionEdit

You can zoom in and out using the scroll wheel of the mouse. To focus on a specific region click with the right mouse button on that region. The left mouse button is to get several information if clicked on a robot. By clicking the mouse wheel the view will be reset.


Class hierarchyEdit

We have 10 classes, where "ClientFrame" is the mean one.


SwisTrack Multi-Camera Client class hierarchy


Name Explanation
ClientFrame Defines a new frame type (main class)
CommunicationMessage Creates new messages that can be send to the robots and the SwisTrack instances.
CommunicationNMEAInterface Interface to parse incoming messages and send outgoing messages
MapPanel Responsible for painting the panel
Robot Creates new robots for communication and painting
RobotSocketManager Responsible for the communication between the robots and the SwisTrack Multi-Camera Client
SavePosition If enabled, saves the positions of the robots each separated in a file
STClient Defines the application type
SwisTrack Creates new SwisTrack objects for communication and painting the camera areas
SwisTrackSocketManager Responsible for the communication between the SwisTrack instances and the SwisTrack Multi-Camera Client


Edit SettingsEdit

If you select the menu "Edit/Edit settings" a editing window will pop up and you will be able to change the settings. Beware to the syntax, otherwise the program won't run correctly. Lines that begins with "#" are treated like comments.

The proper syntax of the SwisTrack Multi-Camera Client settings is (with example)):


SwisTrackEdit

Type Adress:port; Reference point (x,y); Vector 1 (x,y); Vector 2 (x,y); Width, height (w,h);
cam: localhost:3000; 2,3; 1,0; 0,1; 4,6


RobotEdit

Type Adress:port; id
robot: 127.0.0.1:4002; 5


Watch that after a type follows always a ":" and else after every entry follows a ";" except for the last one where nothing follows. Have a look on the screenshots for an real example.


Save tracking positions: file syntaxEdit

If desired, the movements of the robots can be saved on a "robotX.txt" file (X is the id of the robot). A line per frame will be used. The syntax is the following:


frame number, position in x, position in y, angle

example: 217,0.669787,8.297836, 6.210000


Camera area definitionEdit

As seen above we use a reference point with 2 vectors, a width and height for defining a camera area.


SwisTrack Multi-Camera Client camera setting


NMEA 0183 protocolEdit

The SwisTrack Multi-Camera Client uses the NMEA 0183 protocol to communicate with the SwisTrack instances and the robots.


SwisTrackEdit

Keep in mind that every command is encapsulated in a message with a message header (command) and a list of arguments according to the specific command. Every command begins with a $ and is in capitals.


Sending commandsEdit

Command Arguments Description
$START None Initiates the SwisTrack instances and sets the current frame number to 0, but doesn't process anything till $STEP is send.
$STOP None Stops the current tracking and resets the current frame number to 0.
$STEP None Indicates to the SwisTrack instances to process a next image frame.

The program can be paused (not sending $STEP commands any more) and be resumed by the menu commands under "ST controls/Pause tracking" and "ST controls/Resume tracking".


Receiving commandsEdit

Command Arguments Description
$PARTICLE int id, double x, double y, double angle Every robot recognized on a frame is send separately with these parameters
$BEGINFRAME int frameNb Indicates that the data that arrives after this command belongs to the frame number send
$ENDFRAME None Indicates that the current processing frame is completed and finished

Remark: One or several $PARTICLE commands can only be received between a $BEGINFRAME and a $ENDFRAME command!


RobotEdit

Sending commandsEdit

Command Arguments Description
$STATUS None Get the current status of the robot (for example: tracking, idle, searching).
$POSITION double position x, double position y Reset the current position of the robot.

Receiving commandsEdit

Command Arguments Description
$STATUS string status Returns its current status.


ScreenshotsEdit

Here are some screenshots taken from the SwisTrack Multi-Camera Client:

SwisTrack Multi-Camera Client "main" window SwisTrack Multi-Camera Client "edit" window