summaryrefslogtreecommitdiffstats
path: root/README.md
blob: 872f3c0823d995c5ff49c722d7ed6eb9e72919d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# OnlineDetectorSimulator
This little tool will simulate the online capabilities of the new detector. Therefore, a dataset has been created which offers the same structure as the data from the new detector. The software sends out the packages via UDP.

## Build instructions

1. Dependencies:

  - Boost >= 1.58.0
  - libconfig
  - cmake
  - A C++11 compiler like gcc

  On debian-based systems install using the given commands:

  `$ sudo apt-get install libboost-all-dev libconfig++-dev`

2. Clone the repository:

  `$ git clone git@github.com:HZDR-FWDF/OnlineDetectorSimulator.git && cd OnlineDetectorSimulator`

3. Run cmake:

  ```bash
  # Create build directory
  $ mkdir build && cd build
  $ cmake -DCMAKE_BUILD_TYPE=Release ../src/.
  ```

4. Build the software

  `$ make`

5. In the `bin` directory there will be two executables (`onlineDetectorSimulatorClient`, `onlineDetectorSimulatorServer`).

## Usage

The executable `onlineDetectorSimulatorClient` sends the UDP packages and `onlineDetectorSimulatorServer` receives them.

The usage of the program will be shown using `localhost`:

1. Copy the file `config.cfg` into the binary directory of your executables and make sure you have test data around.
2. Start `onlineDetectorSimulatorServer`:

  ```bash
  $ ./onlineDetectorSimulatorServer <address>
  ```

  In case of localhost it would be:

  ```bash
  $ ./onlineDetectorSimulatorServer localhost
  ```

3. Start `onlineDetectorSimulatorClient`:

  ```bash
  $ ./onlineDetectorSimulatorClient <packets_per_second> <address>
  ```

  Take into account, that currently `packets_per_secon`d value is not equal to the images per second sent out. If you reduce the packet size in `config.cfg` you need to increase the `packets_per_second` value by the same factor to keep the same images per second rate.

  ```bash
  $ ./onlineDetectorSimulatorClient 1000 localhost
  ```

  The above command using the standard configuration in the repository sends  approximately 1000 images per second via UDP.

  After some time, quit the client program using `ctrl+c`. The server program will stop after a timeout of `10 s`