Commit 0b54cd3a authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Control demo is scripted.

parent bfecc19f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -26,6 +26,11 @@ The virtual machine is bridged to the physical interface where the hosts are att

### States

#### Demo

* Execute `demo.control` to deploy the control demo.
* Execute `demo.video` to deploy the video demo.

#### Gstreamer

Gstreamer is installed from the sources, which are fetched from GitHub. We are using `gst-uninstalled`, a environment system much as virtualenv for Python. As we are using many different gstreamer elements, we build all plugins together with Gstreamer.
Compare e193e8e6 to 681398a0
Original line number Diff line number Diff line
Subproject commit e193e8e6af924689c946d1d6ad53e514519be6c5
Subproject commit 681398a0bc275b4122e1fa568bd3b4e5c8ec1bff
+26 −0
Original line number Diff line number Diff line
#!/bin/bash

rounds=180

killall python3

if [ "$1" != "plant" ] && [ "$1" != "controller" ]; then
    echo "Usage: control_demo.sh [mode]"
    echo "    mode = plant, controller"
    exit;
fi

while true; do
    if [[ $1 == "controller" ]]; then
        python3 /opt/rna/apps/sine.py ctrl -t 10.8.0.102 -c udp -r $rounds &
        python3 /opt/rna/apps/sine.py ctrl -t 10.8.0.102 -c prrt -r $rounds &
        wait
        sleep 1;
    fi
    if [[ $1 == "plant" ]]; then
        tmux new-session -d "python3 /opt/rna/apps/sine.py plant -t 10.8.0.102 -c prrt -r $rounds"
        tmux split-window -h "python3 /opt/rna/apps/sine.py plant -t 10.8.0.102 -c udp -r $rounds"
        tmux -2 attach-session -d
    fi
    sleep 1;
done
+8 −0
Original line number Diff line number Diff line
@@ -9,3 +9,11 @@ rna_apps:
dependencies:
    cmd.run:
        - name: pip3 install drawille

demo_script:
    file.managed:
        - name: /home/rna/control_demo.sh
        - source: salt://apps/files/control_demo.sh
        - user: rna
        - group: rna
        - file_mode: keep

salt/demo/control.sls

0 → 100644
+2 −0
Original line number Diff line number Diff line
include:
    - apps.deploy
Loading