diff --git a/README.md b/README.md index 477a063..7d82234 100644 --- a/README.md +++ b/README.md @@ -66,3 +66,8 @@ Or you can use a runner to execute the experiments multiple times (check SUAVE r ```bash ./rosa_runner.sh true rosa time 20 ``` + +build: +``` +docker build --ssh default -t suave_rosa -f docker/Dockerfile . +``` diff --git a/docker/Dockerfile b/docker/Dockerfile index c9f5817..e18fb9b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -12,18 +12,12 @@ COPY --chown=kasm-user:kasm-user docker/install_typedb.sh $HOME/suave_ws/src/sua WORKDIR $HOME/suave_ws/src/suave_rosa/docker/ RUN ["/bin/bash", "-c", "./install_typedb.sh"] -COPY --chown=kasm-user:kasm-user ./bts/ $HOME/suave_ws/src/suave_rosa/bts/ -COPY --chown=kasm-user:kasm-user ./cmake/ $HOME/suave_ws/src/suave_rosa/cmake/ -COPY --chown=kasm-user:kasm-user ./config/ $HOME/suave_ws/src/suave_rosa/config/ -COPY --chown=kasm-user:kasm-user ./include/ $HOME/suave_ws/src/suave_rosa/include/ -COPY --chown=kasm-user:kasm-user ./launch/ $HOME/suave_ws/src/suave_rosa/launch/ -COPY --chown=kasm-user:kasm-user ./src/ $HOME/suave_ws/src/suave_rosa/src/ -COPY --chown=kasm-user:kasm-user CMakeLists.txt $HOME/suave_ws/src/suave_rosa/CMakeLists.txt -COPY --chown=kasm-user:kasm-user package.xml $HOME/suave_ws/src/suave_rosa/package.xml +COPY --chown=kasm-user:kasm-user suave_rosa/ $HOME/suave_ws/src/suave_rosa/ +COPY --chown=kasm-user:kasm-user suave_rosa_bt/ $HOME/suave_ws/src/suave_rosa_bt/ +COPY --chown=kasm-user:kasm-user suave_rosa_plansys/ $HOME/suave_ws/src/suave_rosa_plansys/ COPY --chown=kasm-user:kasm-user suave_rosa.rosinstall $HOME/suave_ws/src/suave_rosa/suave_rosa.rosinstall WORKDIR $HOME/suave_ws -# RUN --mount=type=ssh,uid=1000 git clone git@github.com:kas-lab/rosa.git RUN --mount=type=ssh,uid=1000 vcs import src < src/suave_rosa/suave_rosa.rosinstall --force diff --git a/docker/install_typedb.sh b/docker/install_typedb.sh index 73489d9..515be09 100755 --- a/docker/install_typedb.sh +++ b/docker/install_typedb.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash sudo apt install software-properties-common apt-transport-https gpg -gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 8F3DA4B5E9AEF44C -gpg --export 8F3DA4B5E9AEF44C | sudo tee /etc/apt/trusted.gpg.d/vaticle.gpg > /dev/null -echo "deb https://repo.vaticle.com/repository/apt/ trusty main" | sudo tee /etc/apt/sources.list.d/vaticle.list > /dev/null +gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 17507562824cfdcc +gpg --export 17507562824cfdcc | sudo tee /etc/apt/trusted.gpg.d/vaticle.gpg > /dev/null +echo "deb https://repo.typedb.com/public/public-release/deb/ubuntu trusty main" | sudo tee /etc/apt/sources.list.d/vaticle.list > /dev/null sudo apt update sudo apt install openjdk-11-jre -sudo apt install typedb-server=2.24.17 typedb-console=2.24.15 typedb-bin=2.24.16 -pip3 install typedb-driver==2.24.15 +sudo apt install typedb=2.27.0 +pip3 install typedb-driver==2.27.0 diff --git a/runner/rosa_conf_results_run.sh b/runner/rosa_conf_results_run.sh index f87ca20..e703365 100644 --- a/runner/rosa_conf_results_run.sh +++ b/runner/rosa_conf_results_run.sh @@ -2,15 +2,19 @@ MTYPE="time" GUI="false" +RUNS=10 MANAGER="rosa" -./rosa_runner.sh $GUI $MANAGER $MTYPE 20 +./rosa_runner.sh $GUI $MANAGER $MTYPE $RUNS MANAGER="metacontrol" -./rosa_runner.sh $GUI $MANAGER $MTYPE 20 +./rosa_runner.sh $GUI $MANAGER $MTYPE $RUNS + +MANAGER="bt" +./rosa_runner.sh $GUI $MANAGER $MTYPE $RUNS MANAGER="none" -./rosa_runner.sh $GUI $MANAGER $MTYPE 20 +./rosa_runner.sh $GUI $MANAGER $MTYPE $RUNS -MANAGER="random" -./rosa_runner.sh $GUI $MANAGER $MTYPE 20 +# MANAGER="random" +# ./rosa_runner.sh $GUI $MANAGER $MTYPE $RUNS diff --git a/runner/rosa_runner.sh b/runner/rosa_runner.sh index 300f7e7..68f59cd 100644 --- a/runner/rosa_runner.sh +++ b/runner/rosa_runner.sh @@ -3,7 +3,7 @@ if [ $# -lt 1 ]; then echo "usage: $0 gui adaptation_manager mission_type runs" echo example: - echo " "$0 "[true | false] [metacontrol | random | none | rosa] [time | distance] runs(integer)" + echo " "$0 "[true | false] [metacontrol | random | none | bt | rosa] [time | distance] runs(integer)" exit 1 fi @@ -30,7 +30,7 @@ else exit 1 fi -if [ "$2" == "metacontrol" ] || [ "$2" == "random" ] || [ "$2" == "none" ] || [ "$2" == "rosa" ]; +if [ "$2" == "metacontrol" ] || [ "$2" == "random" ] || [ "$2" == "none" ] || [ "$2" == "bt" ] || [ "$2" == "rosa" ]; then MANAGER=$2 else @@ -112,18 +112,18 @@ run_missions(){ xfce4-terminal --execute ./scripts/launch_sim.sh $GUI & sleep 30 #let it boot up - rm -f ~/suave_ws/mission.done + rm -f /tmp/mission.done xfce4-terminal --execute ./scripts/launch_mission.sh $MANAGER $MTYPE $FILENAME & sleep 30 #let it boot up echo "start waiting for mission to finish" start_time=$SECONDS - while [ ! -f ~/suave_ws/mission.done ] + while [ ! -f /tmp/mission.done ] do - if [ -f ~/suave_ws/mission.done ] + if [ -f /tmp/mission.done ] then echo "mission done" - rm ~/suave_ws/mission.done + rm /tmp/mission.done break; fi current_time=$SECONDS @@ -145,7 +145,7 @@ cd ~/ardupilot ./waf configure && make sub cd $CURDIR -NOW=$(date +"%d_%m_%y_%H_%M_%S") +NOW=$(date +"%y_%m_%d_%H_%M") MISSIONCONFIG=${NOW}"_mission_config.yaml" mkdir -p ~/suave/results cp ~/suave_ws/install/suave_missions/share/suave_missions/config/mission_config.yaml ~/suave/results/${MISSIONCONFIG} diff --git a/runner/scripts/launch_mission.sh b/runner/scripts/launch_mission.sh index fe11b15..dd69712 100644 --- a/runner/scripts/launch_mission.sh +++ b/runner/scripts/launch_mission.sh @@ -12,7 +12,7 @@ fi MANAGER="" MTYPE="" -if [ "$1" == "metacontrol" ] || [ "$1" == "random" ] || [ "$1" == "none" ] || [ "$1" == "rosa" ]; +if [ "$1" == "metacontrol" ] || [ "$1" == "random" ] || [ "$1" == "none" ] || [ "$1" == "bt" ] || [ "$1" == "rosa" ]; then MANAGER=$1 else @@ -33,14 +33,18 @@ else fi fi - +FILE=$3 +MCFILE=${FILE}"_mc_reasoning_time" if [ "$1" == "metacontrol" ] || [ "$1" == "random" ] || [ "$1" == "none" ]; then - ros2 launch suave_missions mission.launch.py adaptation_manager:=$MANAGER mission_type:=$MTYPE result_filename:=$3 -elif [ "$1" == "rosa" ] + ros2 launch suave_missions mission.launch.py adaptation_manager:=$MANAGER mission_type:=$MTYPE result_filename:=$FILE mc_reasoning_time_filename:=$MCFILE +elif [ "$1" == "bt" ]; +then + ros2 launch suave_bt suave_bt.launch.py result_filename:=$3 +elif [ "$1" == "rosa" ] then xfce4-terminal --execute typedb server & - ros2 launch suave_rosa suave_rosa.launch.py mission_type:=$MTYPE result_filename:=$3 + ros2 launch suave_rosa_bt suave_rosa_bt.launch.py mission_type:=$MTYPE result_filename:=$3 else echo "adaptation_manager invalid or missing" exit 1