Running Ratatosk

A Ratatosk installation usually consist of a number of Ratatosk components. These are independent executables communicating over DDS. Such an executable may interface a system or sensor over a certain protocol, enabling communication with it over DDS. But more specialised executables also exist, such as logging, calculations and statistics.

Environment setup

To add the OSPL lib folder to LD_LIBRARY_PATH, run the following command in a terminal:

source /opt/sfh/bin/openspliceSetMinimalEnv.sh

This will not set the LD_LIBRARY_PATH permanently, which can be done by editing the appropriate configuration file (e.g. .bashrc or .bash_profile).

The OSPL.xml file is a OpenSplice DDS configuration file, used to specify the architectural mode of OpenSplice. In Ratatosk, it is used for e.g. configuring the network interface. You can read more about the OSPL.xml file at Adlinktech

Verifying installation

To verify the installation, we will run an example with two communicating RatatoskCalculator components.

Copy the contents of the files calculatorsimple1.yaml and calculatorsimple2.yaml. into two separate YAML-files. Each of the two files will be an input to its own Ratatosk component. The RatatoskCalculator components can be run in their own terminal, in the background of the same terminal, or using e.g. tmux.

Run the DDS_ListSignals component to be able to see the output from the example:

/opt/sfh/bin/DDS_ListSignals

Run a RatatoskCalculator with calculatorsimple1.yaml as input:

/opt/sfh/bin/RatatoskCalculator calculatorsimple1.yaml

Run a RatatoskCalculator with calculatorsimple2.yaml as input:

/opt/sfh/bin/RatatoskCalculator calculatorsimple2.yaml

You should now be able to see the output in the terminal where you ran the DDS_ListSignals. The following is an example snippet of the output:

Contents on DDS bus:
------------------------------------------------------------
AsinNumber = -0.57000
DecimalNumber = -0.57000
SinusNumber = -0.53963

Running individual components

The individual executables can be run according to their documentation. In general, they require the following arguments:

  1. inputfile
  2. screenverbosity (optional)
  3. logfileverbosity (optional)
  4. logfile (optional)

Verbosity is defined as:

0: Nolog
1: Error
2: Warning
3: Info
4: Debug

The following command will run a RatatoskCalculator component with the file calculator4.yaml as input, screenverbosity set to debug, logfile verbosity set to info, and logging to a file called my_log.txt:

/opt/sfh/bin/RatatoskCalculator calculator4.yaml 4 3 my_log.txt

Using the Ratatosk Manager

Usually, an installation will be comprised of multiple components running simultaneously. It is also often necessary to start recurring tasks e.g. for transferring log files to shore. The Ratatosk Manager has been created for handling such cases. Its config file specifies which processes to start, how to monitor them and restrart policies. It can monitor the health of started applications and take the appropriate steps if an application is deemed unhealthy.

Ratatosk as a service

Ratatosk is often installed as a service, using operative system functionality to e.g. start the Ratatosk Manager at boot time.

Todo:
Describe how to set up Ratatosk as a service

Examples