gamepadを利用する場合はCの手順、Webコントローラーを利用する場合はDの手順を実施します
-
sshでRaspberry Piに接続
-
gamepadコントローラのベースファイルの取得
rasberrypi$ git clone https://github.com/RoboticBase/fiware-gamepad-controller.git
-
証明書ファイルのコピー
$ scp ${PJ_ROOT}/secrets/DST_Root_CA_X3.pem ${user}@${raspberry_pi}:${repogitory_root}/secrets/ca.crt
-
mqttファイルの編集
raspberrypi$ conf/pxkwcr-azure.yaml.template conf/pxkwcr-azure.yaml raspberrypi$ vi conf/pxkwcr-azure.yaml
※host,username,passwordの項目を編集してください
name: "FUJIWORK PXKWCR Controller" controller: buttons: - key: 0 value: "triangle" - key: 1 value: "circle" - key: 2 value: "cross" - key: 3 value: "square" hats: - x: 0 y: 1 value: "up" - x: 0 y: -1 value: "down" - x: 1 y: 0 value: "right" - x: -1 y: 0 value: "left" mqtt: host: "${MQTT_HOST}" port: 8883 cafile: "secrets/ca.crt" username: "raspberrypi" password: "${RASPI_PASSWORD}" topics: - key: "controller" value: "/gamepad/gamepad/attrs"
-
bridge node用のPythonライブラリのインストール
raspoberypi$ pip install -r requirements/common.txt
-
gemepadの起動
raspberrypi$ ./main.py pxkwcr-azure
-
実行結果(例)
2018/07/19 14:20:12 [ INFO] src.controller - connected mqtt broker[mqtt.cloudconductor.jp:8883], response_code=0
※response_codeが0以外の場合は、pxkwcr-azure.yamlかca.crtあるいは、その両方が無効です
-
-
gamepadの「〇」をクリック
-
turtlebot3が移動したことを確認
-
環境変数の設定
$ export CORE_ROOT=$HOME/core $ export PJ_ROOT=$HOME/example-turtlebot3 $ cd $PJ_ROOT;pwd
-
実行結果(例)
/home/fiware/example-turtlebot3
-
-
環境ファイルの実行
$ source $CORE_ROOT/docs/environments/azure_aks/env $ source $PJ_ROOT/docs/environments/azure_aks/env
-
エイリアスの設定
$ if [ "$(uname)" == 'Darwin' ]; then alias openbrowser='open' elif [ "$(expr substr $(uname -s) 1 5)" == 'Linux' ]; then alias openbrowser='xdg-open' else echo "Your platform ($(uname -a)) is not supported." exit 1 fi
-
ユーザ名とパスワードの確認
$ cat ${CORE_ROOT}/secrets/auth-tokens.json | jq '.[]|select(.host == "web\\..+$")|.settings.basic_auths[0].username' -r
$ cat ${CORE_ROOT}/secrets/auth-tokens.json | jq '.[]|select(.host == "web\\..+$")|.settings.basic_auths[0].password' -r
-
web controllerの表示
$ openbrowser https://web.${DOMAIN}/controller/web/
-
turtlebot3の動作確認【turtlebot3-pc】
-
tagを指定
$ export OPERATOR_GIT_REV="0.3.0"
-
fiware-ros-turtlebot3-operator-deployment-acr-wideを削除
$ TOKEN=$(cat ${CORE_ROOT}/secrets/auth-tokens.json | jq '.[0].settings.bearer_tokens[0].token' -r) $ docker run -it --rm -v ${PJ_ROOT}:${PJ_ROOT} -w ${PJ_ROOT} example_turtlebot3:0.0.1 \ ${PJ_ROOT}/tools/deploy_yaml.py --delete ${PJ_ROOT}/ros/fiware-ros-turtlebot3-operator/yaml/fiware-ros-turtlebot3-operator-deployment-acr-wide.yaml https://api.${DOMAIN} ${TOKEN} ${FIWARE_SERVICE} ${DEPLOYER_SERVICEPATH} ${DEPLOYER_TYPE} ${DEPLOYER_ID}
-
実行結果(例)
delete /home/fiware/example-turtlebot3/ros/fiware-ros-turtlebot3-operator/yaml/fiware-ros-turtlebot3-operator-deployment-acr-wide.yaml to https://api.example.com status_code=204, body=
-
-
turtlebot3-operatorのpodを確認【turtlebot3-pc】
turtlebot3-pc$ kubectl get pods -l app=turtlebot3-operator
-
実行結果(例)
No resources found.
-
-
fiware-ros-turtlebot3-operator-deployment-acr-narrowを作成
$ envsubst < ${PJ_ROOT}/ros/fiware-ros-turtlebot3-operator/yaml/fiware-ros-turtlebot3-operator-deployment-acr-narrow.yaml > /tmp/fiware-ros-turtlebot3-operator-deployment-acr-narrow.yaml $ TOKEN=$(cat ${CORE_ROOT}/secrets/auth-tokens.json | jq '.[0].settings.bearer_tokens[0].token' -r) $ docker run -it --rm -v ${PJ_ROOT}:${PJ_ROOT} -v /tmp:/tmp -w ${PJ_ROOT} example_turtlebot3:0.0.1 \ ${PJ_ROOT}/tools/deploy_yaml.py /tmp/fiware-ros-turtlebot3-operator-deployment-acr-narrow.yaml https://api.${DOMAIN} ${TOKEN} ${FIWARE_SERVICE} ${DEPLOYER_SERVICEPATH} ${DEPLOYER_TYPE} ${DEPLOYER_ID} $ rm /tmp/fiware-ros-turtlebot3-operator-deployment-acr-narrow.yaml
-
実行結果(例)
apply /tmp/fiware-ros-turtlebot3-operator-deployment-acr-narrow.yaml to https://api.example.com status_code=204, body=
-
-
turtlebot3-operatorのpodを確認【turtlebot3-pc】
turtlebot3-pc$ kubectl get pods -l app=turtlebot3-operator
-
実行結果(例)
NAME READY STATUS RESTARTS AGE turtlebot3-operator-7bd5895459-m544p 1/1 Running 0 1h
-
-
turtlebot3の動作確認【turtlebot3-pc】
-
fiware-ros-turtlebot3-operator-deployment-acr-narrowを削除
$ TOKEN=$(cat ${CORE_ROOT}/secrets/auth-tokens.json | jq '.[0].settings.bearer_tokens[0].token' -r) $ docker run -it --rm -v ${PJ_ROOT}:${PJ_ROOT} -w ${PJ_ROOT} example_turtlebot3:0.0.1 \ ${PJ_ROOT}/tools/deploy_yaml.py --delete ${PJ_ROOT}/ros/fiware-ros-turtlebot3-operator/yaml/fiware-ros-turtlebot3-operator-deployment-acr-narrow.yaml https://api.${DOMAIN} ${TOKEN} ${FIWARE_SERVICE} ${DEPLOYER_SERVICEPATH} ${DEPLOYER_TYPE} ${DEPLOYER_ID}
-
実行結果(例)
delete /home/fiware/example-turtlebot3/ros/fiware-ros-turtlebot3-operator/yaml/fiware-ros-turtlebot3-operator-deployment-acr-narrow.yaml to https://api.example.com status_code=204, body=
-
-
turtlebot3-operatorのpodを確認【turtlebot3-pc】
turtlebot3-pc$ kubectl get pods -l app=turtlebot3-operator
-
実行結果(例)
No resources found.
-
-
fiware-ros-turtlebot3-operator-deployment-acr-wideを作成
$ envsubst < ${PJ_ROOT}/ros/fiware-ros-turtlebot3-operator/yaml/fiware-ros-turtlebot3-operator-deployment-acr-wide.yaml > /tmp/fiware-ros-turtlebot3-operator-deployment-acr-wide.yaml $ TOKEN=$(cat ${CORE_ROOT}/secrets/auth-tokens.json | jq '.[0].settings.bearer_tokens[0].token' -r) $ docker run -it --rm -v ${PJ_ROOT}:${PJ_ROOT} -v /tmp:/tmp -w ${PJ_ROOT} example_turtlebot3:0.0.1 \ ${PJ_ROOT}/tools/deploy_yaml.py /tmp/fiware-ros-turtlebot3-operator-deployment-acr-wide.yaml https://api.${DOMAIN} ${TOKEN} ${FIWARE_SERVICE} ${DEPLOYER_SERVICEPATH} ${DEPLOYER_TYPE} ${DEPLOYER_ID} $ rm /tmp/fiware-ros-turtlebot3-operator-deployment-acr-wide.yaml
-
実行結果(例)
apply /tmp/fiware-ros-turtlebot3-operator-deployment-acr-wide.yaml to https://api.example.com status_code=204, body=
-
-
turtlebot3-operatorのpodを確認【turtlebot3-pc】
turtlebot3-pc$ kubectl get pods -l app=turtlebot3-operator
-
実行結果(例)
NAME READY STATUS RESTARTS AGE turtlebot3-operator-b5c598bb-7bdnb 1/1 Running 0 35s
-
-
turtlebot3の動作確認【turtlebot3-pc】