diff --git a/README.md b/README.md
index 7403d1ab3..83efcb06f 100644
--- a/README.md
+++ b/README.md
@@ -8,33 +8,16 @@
* [configure_software](#configure_software)
* [install_software](#install_software)
* [install_python3](#install_python3)
-- [Development](#development)
- * [Development Docker](#development-docker)
-- [Testing](#testing)
- * [Test creation](#test-creation)
- * [Unlimited scroll in terminator](#unlimited-scroll-in-terminator)
- * [Testing with molecule_docker](#testing-with-molecule_docker)
- * [Debugging and Lint](#debugging-and-lint)
- * [Private docker images](#private-docker-images)
- * [Testing with molecule_ec2](#testing-with-molecule_ec2)
- * [Credentials](#credentials)
- * [Automatic tests](#automatic-tests)
- * [Testing on real hardware](#testing-on-real-hardware)
- [Structure of files](#structure-of-files)
* [Roles](#roles)
* [Docker](#docker)
* [Installation](#installation)
* [Products](#products)
* [Common](#common)
- * [Templating](#templating)
- * [Dependencies](#dependencies)
-- [Playbooks](#playbooks)
- * [Playbook creation](#playbook-creation)
-- [Inventories](#inventories)
-- [Syntax and rules](#syntax-and-rules)
-- [Special variables](#special-variables)
-- [Tutorial 1 desktop icon](#tutorial-1-desktop-icon)
-- [Troubleshooting](#troubleshooting)
+
+# Other useful pages
+- [Aurora Development Page](/docs/development.md)
+- [Molecule Docker Page](/docs/molecule_dockers.md)
# Introduction #
@@ -48,7 +31,7 @@ Molecule user guide is available [here](https://molecule.readthedocs.io/en/lates
# Multiple Aurora Installations on one device #
-We can now easily have multiple Aurora setups on one device, you simply need to define a unique name for the variable container_name by adding "container_name=new_container_name" to your oneliner when running each Aurora oneliner. This is because Aurora creates icons and scripts in the folder ".shadow_launcher_app_{container_name}" and stores shortcut these icons at "Shadow Launcher {container_name}.desktop".
+We can now easily have multiple Aurora setups on one device, you simply need to define a unique name for the variable container_name by adding "container_name=new_container_name" to your oneliner when running each Aurora oneliner. This is because Aurora creates icons and scripts in the folder ".shadow_launcher_app_{container_name}" and stores shortcut to these icons at "{container_name}.desktop".
By having the name of the container attached to where we store the icons and scripts we can have more control over which icons get removed and reinstalled when rerunning Aurora, as we can just remove the folders that contain the containers name. This will leave the previous run's icons and scripts intact.
@@ -69,32 +52,35 @@ You will first need to ensure that you have entered your customer_key into the o
Open a terminal with Ctrl+Alt+T and run:
```bash
-bash <(curl -Ls bit.ly/run-aurora) teleop_deploy --inventory name_of_inventory --read-secure customer_key option1=value1 option2=value2 option3=value3
+bash <(curl -Ls https://raw.githubusercontent.com/shadow-robot/aurora/{release_tag}}/bin/run-ansible.sh) teleop_deploy --branch {release_tag} --inventory name_of_inventory --read-secure customer_key option1=value1 option2=value2 option3=value3
```
-name_of_inventory can be staging_a, staging_b, production or simulation.
+name_of_inventory corresponds to fixed IP addresses as shown here:
+* [development](ansible/inventory/teleop/development)
+* [development_remote](ansible/inventory/teleop/development_remote)
+* [production](ansible/inventory/teleop/production)
+* [production_remote](ansible/inventory/teleop/production_remote)
+* [simulation](ansible/inventory/teleop/simulation)
+
+Example for real robots with teleop-polhemus bimanual teleop:
+
+```bash
+bash <(curl -Ls https://raw.githubusercontent.com/shadow-robot/aurora/v2.2.5/bin/run-ansible.sh) teleop_deploy --branch v2.2.5 --inventory production --read-secure customer_key reinstall=true bimanual=true upgrade_check=true image="080653068785.dkr.ecr.eu-west-2.amazonaws.com/shadow-teleop-polhemus-binary" tag="noetic-v0.1.16" glove="shadow_glove" use_steamvr=true arm_ip_right="10.8.1.1" arm_ip_left="10.8.2.1" ethercat_right_arm="eno1" ethercat_left_arm="enx000ec6bfe175"
+```
+**_NOTE:_** you may need to change `ethercat_right_arm` depending on the default interface on the NUC (for instance, to `enp1s0`)
Example for real robots with haptx bimanual teleop:
```bash
-bash <(curl -Ls bit.ly/run-aurora) teleop_deploy --inventory production --read-secure customer_key reinstall=true bimanual=true upgrade_check=true image="080653068785.dkr.ecr.eu-west-2.amazonaws.com/shadow-teleop-haptx-binary" tag="noetic-v0.0.23" glove="haptx" use_steamvr=false arm_ip_right="10.8.1.1" arm_ip_left="10.8.2.1" ethercat_right_arm="eno1" ethercat_left_arm="enx000ec6bfe175"
+bash <(curl -Ls https://raw.githubusercontent.com/shadow-robot/aurora/v2.2.5/bin/run-ansible.sh) teleop_deploy --branch v2.2.5 --inventory production --read-secure customer_key reinstall=true bimanual=true upgrade_check=true image="080653068785.dkr.ecr.eu-west-2.amazonaws.com/shadow-teleop-haptx-binary" tag="noetic-v0.1.11" glove="haptx" use_steamvr=false arm_ip_right="10.8.1.1" arm_ip_left="10.8.2.1" ethercat_right_arm="eno1" ethercat_left_arm="enx000ec6bfe175"
```
+**_NOTE:_** you may need to change `ethercat_right_arm` depending on the default interface on the NUC (for instance, to `enp1s0`)
Example for simulated robots without a real vive system or real gloves:
```bash
-bash <(curl -Ls bit.ly/run-aurora) teleop_deploy --inventory simulation --read-secure customer_key reinstall=true upgrade_check=true image="080653068785.dkr.ecr.eu-west-2.amazonaws.com/shadow-teleop-haptx-binary" tag="noetic-v0.0.23" glove="haptx" real_glove=false real_vive=false
+bash <(curl -Ls https://raw.githubusercontent.com/shadow-robot/aurora/v2.2.5/bin/run-ansible.sh) teleop_deploy --branch v2.2.5 --inventory simulation --read-secure customer_key reinstall=true upgrade_check=true image="080653068785.dkr.ecr.eu-west-2.amazonaws.com/shadow-teleop-haptx-binary" tag="noetic-v0.1.11" glove="haptx" real_glove=false real_vive=false
```
-Inventories correspond to fixed IP addresses as shown here:
-* [staging_b](ansible/inventory/teleop/staging_b)
-* [staging_b_remote](ansible/inventory/teleop/staging_b_remote)
-* [staging_a](ansible/inventory/teleop/staging_a)
-* [staging_a_remote](ansible/inventory/teleop/staging_a_remote)
-* [production](ansible/inventory/teleop/production)
-* [production_remote](ansible/inventory/teleop/production_remote)
-* [simulation](ansible/inventory/teleop/simulation)
-* [events_1](ansible/inventory/teleop/events_1)
-
Options for teleop_deploy playbook are here for the following machines:
* [server](ansible/inventory/teleop/group_vars/server.yml)
* [control-machine](ansible/inventory/teleop/group_vars/control_machine.yml)
@@ -102,13 +88,12 @@ Options for teleop_deploy playbook are here for the following machines:
Run a playbook against one or more members of that group using the --limit tag:
-* --limit rules (e.g. --limit 'all:!server' please use single quotes. More details could be found
-[here](https://ansible-tips-and-tricks.readthedocs.io/en/latest/ansible/commands/#limit-to-one-or-more-hosts))
+* --limit rules (e.g. --limit 'all:!server' - this would run ansible on all machines that aren't the server. Please use single quotes. More details could be found [here](https://ansible-tips-and-tricks.readthedocs.io/en/latest/ansible/commands/#limit-to-one-or-more-hosts))
For assigning input and secure input to playbook variables you can use the tags: --read-input var1, var2, var3 ... and --read-secure secure_var1, secure_var2, secure_var3 ... respectively
* --read-input vars (vars = comma-separated list, e.g. --read-input docker_username - To allow aurora script to prompt for docker username)
-* --read-secure secure_vars (secure_vars = comma-separated list, e.g. --read_secure customer_key - To allow aurora script to prompt for docker password, or e.g. --read-secure docker_password,customer_key - To allow aurora script to prompt for ROS logs upload key)
+* --read-secure secure_vars (secure_vars = comma-separated list, e.g. --read_secure customer_key - To allow aurora script to prompt for customer key, to upload ROS logs and pull AWS docker images. Or e.g. --read-secure docker_password,customer_key - To allow aurora script to prompt for docker password and customer_key)
**VAULT password:**
@@ -120,7 +105,7 @@ For Hand E software deployments on a laptop (called "server" in this playbook) a
To begin with, the server_and_nuc_deploy playbook checks the installation status of docker. If docker is not installed then a new clean installation is performed. If the required image is private, then a valid customer_key is required. Then the specified docker image is pulled and a docker container is initialized. Finally, a desktop shortcut is generated. This shortcut starts the docker container and launches the hand.
-Within the server_and_nuc playbook you can install 3 types of shadow products, hand_e on its own, hand_e and arm and hand_e and glove.
+Within the server_and_nuc playbook you can install 3 types of shadow products, hand_e, hand_lite, hand_extra_lite on their own, hand_e and arm and hand_e and glove.
The variables that you set when running the playbook determine the icons created. For example setting product=glove_hand_e uses the
hand and glove product, or setting product=arm_hand_e will install the hand and arm product.
@@ -131,17 +116,16 @@ You will be asked for a sudo_password (i.e. the password of the user with sudo p
Open a terminal with Ctrl+Alt+T and run:
```bash
-bash <(curl -Ls bit.ly/run-aurora) server_and_nuc_deploy option1=value1 option2=value2 option3=value3
+bash <(curl -Ls https://raw.githubusercontent.com/shadow-robot/aurora/v2.2.5/bin/run-ansible.sh) server_and_nuc_deploy --branch v2.2.5 --read-secure customer_key option1=value1 option2=value2 option3=value3
```
Example:
```bash
-bash <(curl -Ls bit.ly/run-aurora) server_and_nuc_deploy product=hand_e
+bash <(curl -Ls https://raw.githubusercontent.com/shadow-robot/aurora/v2.2.5/bin/run-ansible.sh) server_and_nuc_deploy --branch v2.2.5 --read-secure customer_key product=hand_e tag="noetic-v1.0.31"
```
Inventories correspond to fixed IP addresses as shown here:
-* [staging_b](ansible/inventory/server_and_nuc/staging_b)
-* [staging_a](ansible/inventory/server_and_nuc/staging_a)
+* [development](ansible/inventory/server_and_nuc/development)
* [production](ansible/inventory/server_and_nuc/production)
Options for server_and_nuc_deploy playbook are here for the following machines:
@@ -150,13 +134,12 @@ Options for server_and_nuc_deploy playbook are here for the following machines:
Run a playbook against one or more members of that group using the --limit tag:
-* --limit rules (e.g. --limit 'all:!server' please use single quotes. More details could be found
-[here](https://ansible-tips-and-tricks.readthedocs.io/en/latest/ansible/commands/#limit-to-one-or-more-hosts))
+* --limit rules (e.g. --limit 'all:!server' - this would run ansible on all machines that aren't the server. Please use single quotes. More details could be found [here](https://ansible-tips-and-tricks.readthedocs.io/en/latest/ansible/commands/#limit-to-one-or-more-hosts))
For assigning input and secure input to playbook variables you can use the tags: --read-input var1, var2, var3 ... and --read-secure secure_var1, secure_var2, secure_var3 ... respectively
* --read-input vars (vars = comma-separated list, e.g. --read-input docker_username - To allow aurora script to prompt for docker username)
-* --read-secure secure_vars (secure_vars = comma-separated list, e.g. --read-secure docker_password,customer_key - To allow aurora script to prompt for the docker hub password and the ROS logs upload key)
+* --read-secure secure_vars (secure_vars = comma-separated list, e.g. --read_secure customer_key - To allow aurora script to prompt for customer key, to upload ROS logs and pull AWS docker images. Or e.g. --read-secure docker_password,customer_key - To allow aurora script to prompt for docker password and customer_key)
**VAULT password:**
@@ -169,16 +152,16 @@ Hand and Arm is one of the main use-cases of the server_and_nuc playbook. It req
Example:
```bash
-bash <(curl -Ls bit.ly/run-aurora) server_and_nuc_deploy --branch v2.1.5 --inventory production --read-secure customer_key reinstall=true bimanual=true product="arm_hand_e" image="public.ecr.aws/shadowrobot/dexterous-hand" tag="noetic-release" arm_ip_right="10.8.1.1" arm_ip_left="10.8.2.1" ethercat_right_arm="eno1" ethercat_left_arm="enx000ec6bfe175"
+bash <(curl -Ls https://raw.githubusercontent.com/shadow-robot/aurora/v2.2.5/bin/run-ansible.sh) server_and_nuc_deploy --branch v2.2.5 --read-secure customer_key reinstall=true bimanual=true product="arm_hand_e" image="public.ecr.aws/shadowrobot/dexterous-hand" tag="noetic-v1.0.31" arm_ip_right="10.8.1.1" arm_ip_left="10.8.2.1" ethercat_right_arm="eno1" ethercat_left_arm="enx000ec6bfe175"
```
### Hand and Glove ###
-Hand and Glove is another main product of the server_and_nuc playbook. This also takes in a new product type with product=glove_hand_e now, it also has extra parameters relating to the glove that you are using for the product. These variables are found in ansible/inventory/server_and_nuc/group_vars. The hand and glove specific variables are glove, real_glove, biotacs and polhemus_type. Another thing to denote about this product is that it's not based on the dexterous-hand image, but instead the shadow-dexterous-hand-glove image.
+Hand and Glove is another main product of the server_and_nuc playbook. This also takes in a new product type with product=glove_hand_e now, it also has extra parameters relating to the glove that you are using for the product. These variables are found in ansible/inventory/server_and_nuc/group_vars. The hand and glove specific variables are glove, real_glove and polhemus_type. Another thing to denote about this product is that it's not based on the dexterous-hand image, but instead the shadow-dexterous-hand-glove image.
Example:
```bash
-bash <(curl -Ls bit.ly/run-aurora) server_and_nuc_deploy --branch v2.1.5 --inventory production --read-secure customer_key reinstall=true bimanual=true product="glove_hand_e" image="080653068785.dkr.ecr.eu-west-2.amazonaws.com/shadow-dexterous-hand-glove" tag="noetic-release" glove="shadow_glove" biotacs=true polhemus_type="viper"
+bash <(curl -Ls https://raw.githubusercontent.com/shadow-robot/aurora/v2.1.7/bin/run-ansible.sh) server_and_nuc_deploy --branch v2.1.7 --read-secure customer_key reinstall=true bimanual=true product="glove_hand_e" image="080653068785.dkr.ecr.eu-west-2.amazonaws.com/shadow-dexterous-hand-glove" tag="noetic-v0.0.8" glove="shadow_glove" polhemus_type="viper"
```
## docker_deploy ##
@@ -192,20 +175,20 @@ To begin with, the docker_deploy playbook checks the installation status of dock
Open a terminal with Ctrl+Alt+T and run:
```bash
-bash <(curl -Ls bit.ly/run-aurora) docker_deploy option1=value1 option2=value2 option3=value3
+bash <(curl -Ls https://raw.githubusercontent.com/shadow-robot/aurora/v2.2.5/bin/run-ansible.sh) docker_deploy --branch v2.2.5 option1=value1 option2=value2 option3=value3
```
Example:
```bash
-bash <(curl -Ls bit.ly/run-aurora) docker_deploy product=hand_e
+bash <(curl -Ls https://raw.githubusercontent.com/shadow-robot/aurora/v2.2.5/bin/run-ansible.sh) docker_deploy --branch v2.2.5 product=hand_e tag=noetic-v1.0.31
```
Options for docker_deploy playbook are [here](ansible/inventory/local/group_vars/docker_deploy.yml)
For assigning input and secure input to playbook variables you can use the tags: --read-input var1, var2, var3 ... and --read-secure secure_var1, secure_var2, secure_var3 ... respectively
* --read-input vars (vars = comma-separated list, e.g. --read-input docker_username - To allow aurora script to prompt for docker username)
-* --read-secure secure_vars (secure_vars = comma-separated list, e.g. --read_secure docker_password - To allow aurora script to prompt for docker password, or e.g. --read-secure docker_password,customer_key - To allow aurora script to prompt for ROS logs upload key)
+* --read-secure secure_vars (secure_vars = comma-separated list, e.g. --read_secure customer_key - To allow aurora script to prompt for customer key, to upload ROS logs and pull AWS docker images. Or e.g. --read-secure docker_password,customer_key - To allow aurora script to prompt for docker password and customer_key)
**BECOME password:**
@@ -213,7 +196,7 @@ If you are prompted for a BECOME password, enter the sudo password of the comput
## configure_software ##
-This runs the docker/setup-ui role (details are [here](ansible/roles/docker/setup-ui/tasks/main.yml) when it is passed a list of software which includes 'setup-docker'. This is used in the AWS ECR Docker image builds for Aurora
+This runs the docker/setup-ui role (details are [here](ansible/roles/docker/setup-ui/tasks/main.yml) when it is passed a list of software which includes 'setup-docker'. This is used in the AWS ECR Docker image builds for Aurora.
**How to run:**
@@ -252,180 +235,6 @@ Open a terminal with Ctrl+Alt+T and run:
bash <(curl -Ls bit.ly/run-aurora) install_python3
```
-# Development #
-
-The recommended way to develop code for this project is to pull a certain docker image ([Development Docker](#development-docker)) with a lot of tools already installed and open a container of this image, then clone the aurora GitHub repository inside it. It is not recommended to clone aurora directly on your local machine while you do development and testing.
-
-## Development Docker ##
-
-The docker images used for aurora development are [here](https://gallery.ecr.aws/shadowrobot/aurora-molecule-devel).
-
-Currently both bionic and focal tags are working well.
-
-Use the tag that matches your host operating system.
-
-The rest of the document assumes the user is using bionic tag.
-
-Instructions on how to use this:
-1. Use Ubuntu 16.04 or Ubuntu 18.04 computer
-
-2. Install Docker (using instructions from [here](https://docs.docker.com/install/linux/docker-ce/ubuntu/))
-
-3. Run the following command in terminal to create a container for aurora development:
-
-```
-docker run -it --name aurora_dev -e DISPLAY -e QT_X11_NO_MITSHM=1 -e LOCAL_USER_ID=$(id -u) -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/.X11-unix:/tmp/.X11-unix:rw public.ecr.aws/shadowrobot/aurora-molecule-devel:bionic
-```
-4. Once the container has launched, clone aurora to home directory:
-```
-git clone https://github.com/shadow-robot/aurora.git
-```
-5. Go into the aurora folder:
-```
-cd aurora
-```
-6. Open Visual Studio Code which is already installed inside the Docker container:
-```
-code .
-```
-
-# Testing #
-
-## Test creation ##
-
-Create test case for both docker in ansible/playbooks/molecule_docker/molecule folder and for AWS EC2 in ansible/playbooks/molecule_ec2/molecule folder. For additional molecule_docker tests, copy the folder structure from other tests and modify the .py, converge.yml and molecule.yml files in tests folder.For additional molecule_ec2 tests, copy the folder structure of another EC2 test and modify the molecule.yml file inside. The EC2 tests just run the same tests as the Docker tests, but they do it in AWS EC2, using virtual machines, not Docker.
-
-## Unlimited scroll in terminator ##
-
-Before executing any tests, it is very useful to make sure you have unlimited scroll in terminator, because Molecule produces a lot of debug logs. Follow these steps to enable it: right click on the Terminator -> Preferences -> Profiles -> Scrolling and select Infinite scrollback.
-
-## Testing with molecule_docker ##
-
-Once you have written your code for aurora in your branch, test it locally with Molecule first before pushing to GitHub.
-
-There are some molecule_docker tests which require connecting to AWS to download files (such as downloading the hand manual). For this reason, before running any Molecule tests, ask the system administrator for your AWS access key and secret access key. Then, in the docker container terminal, type:
-```
-export AWS_ACCESS_KEY=your_key
-export AWS_SECRET_KEY=your_secret
-```
-
-1. In the docker container terminal execute the following command:
-
-```
-cd /home/user/aurora/ansible/playbooks/molecule_docker
-```
-
-2. Start with testing only your test case, without extra debug statements:
-
-```
-molecule test -s name_of_your_test_case
-```
-
-3. Fix any errors. If you want more debug information, execute the following:
-```
-molecule --debug test -s name_of_your_test_case
-```
-The --debug flag produces a lot of information. Remember to scroll up to see any possible lint or other errors that might have occurred.
-
-4. Now test all test cases to check for effects on other aurora components and knock-on-effects:
-```
-molecule test --all
-```
-5. Fix any errors. If you want more debug information, execute the following:
-```
-molecule --debug test all
-```
-
-6. Often it is useful to run Molecule in stages (create, converge, verify, login (if necessary), and finally destroy) for better debugging (so you can inspect every stage yourself). See [this](https://molecule.readthedocs.io/en/stable/usage.html) page, and do, for example:
-```
-molecule create -s name_of_your_test_case
-molecule converge -s name_of_your_test_case
-molecule verify -s name_of_your_test_case
-molecule login -s name_of_your_test_case
-molecule destroy -s name_of_your_test_case
-```
-
-## Debugging and Lint ##
-
-1. For a successful test, Molecule requires that all lint checks (yaml lint, flake8 python lint and ansible lint) pass. The AWS EC2 build will fail if any lint check fails or if any Molecule test fails.
-
-2. In the Molecule logs, do a text search for "error" or "error occurred" as well as "failure" and "fatal".
-
-3. You can add the --debug flag after molecule for more debug information, but remember to scroll up to see any possible lint or other errors that might have happened.
-
-4. It's useful to enable [Unlimited scroll in terminator](#unlimited-scroll-in-terminator)
-
-## Private docker images ##
-
-At the moment, we don't want to give Molecule access to private docker hub / AWS private ECR credentials for private docker images (e.g. shadow-teleop). That is why, in every converge.yml inside the test cases in the molecule_docker folder, we override the image with image="public.ecr.aws/shadowrobot/dexterous-hand" for any teleop-related test cases. When we actually deploy Aurora, the user will be asked to fill in their private Docker hub credentials.
-
-## Testing with molecule_ec2 ##
-
-Once you have written your code for aurora in your branch, and tested it locally with molecule_docker, you can test it with AWS EC2 (initiated from local), by following the steps here:
-
-## Credentials ##
-
-1. Ask the system administrator for your AWS access key and secret access key. Then, in the docker container terminal, type:
-
-```
-aws configure
-```
-2. Paste the access key and the secret access key
-
-3. Default region name must be: eu-west-2
-
-4. Press enter on the Default format
-
-
-Then continue testing with molecule_ec2:
-
-1. In the docker container terminal go to /ansible/playbooks/molecule_ec2 folder
-
-```
-cd /home/user/aurora/ansible/playbooks/molecule_ec2
-```
-
-2. Start with testing only your test case, without extra debug statements:
-
-```
-molecule test -s name_of_your_test_case
-```
-
-3. Fix any errors. If you want more debug information, execute the following:
-```
-molecule --debug test -s name_of_your_test_case
-```
-The --debug flag produces a lot of information. Remember to scroll up to see any possible lint or other errors that might have occurred.
-
-4. Now test all test cases to check for effects on other aurora components and knock-on-effects:
-```
-molecule test --all
-```
-5. Fix any errors. If you want more debug information, execute the following:
-```
-molecule --debug test all
-```
-
-6. Often it is useful to run Molecule in stages (create, converge, verify, login (if necessary), and finally destroy) for better debugging (so you can inspect every stage yourself). See [this](https://molecule.readthedocs.io/en/stable/usage.html) page, and do, for example:
-```
-molecule create -s name_of_your_test_case
-molecule converge -s name_of_your_test_case
-molecule verify -s name_of_your_test_case
-molecule login -s name_of_your_test_case
-molecule destroy -s name_of_your_test_case
-```
-## Automatic tests ##
-
-The buildspec.yml file in the root of the project defines what AWS CodeBuild should run when a PR is created or updated or when a daily build runs. It is configured to run all tests in /ansible/playbooks/molecule_ec2 folder. AWS buildspec specification is [here](https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html)
-
-Note that AWS EC2 tests take about 1 hour to complete a build due to provisioning a new AWS virtual machines for each test and for each test running in a separate virtual machine and each virtual machine needing to pull the right Docker images and then execute the tests
-
-## Testing on real hardware ##
-
-For debugging (not using the master branch), you can add the following immediately after playbook name (for example docker_deploy or teleop_deploy):
-
-* --branch name_of_aurora_repo_branch (e.g. --branch F#SRC-2603_add_ansible_bootstrap)
-
# Structure of files #
# Roles #
@@ -447,6 +256,8 @@ The docker folder contains some general roles that are used after docker install
- aws: this is used for installing our shadow-upload.sh script and AWS customer key which uploads ROS logs to AWS. It has a dependency of installation/aws-cli
+ - ecr: this role is used to pull the login credentials from AWS to allow Aurora to login to AWS CLI and authenticate with DockerHub so that you can pull our private and public ECR images.
+
- docker-image: this is used for pulling the docker image (nvidia_docker [group_var](ansible/inventory/teleop/group_vars/server.yml) is a boolean which specifies whether nvidia-container-toolkit should be used)
- setup-ui: this is used to install various UI libraries, terminator, vim, git, subversion, bash-completion, etc., to create the /usr/local/bin/entrypoint.sh file and setting up a new Docker user
@@ -455,17 +266,30 @@ The docker folder contains some general roles that are used after docker install
Any programs that need to be installed are placed in the installation role. It has the following folders:
- - aws-cli
+ - aws-cli-v2
+ - chrome
- chrony-client
- chrony-server
+ - dhcp
- docker
+ - install_common_tools
+ - install_licence_tools
+ - libglvnd
+ - lxml
+ - mongodb
+ - mplabx
+ - net-tools
- nvidia-docker
- - openvpn-client
- - openvpn-server
+ - prepareshadowvpn
+ - production_tools
- pycharm
- qtcreator
+ - rabbitvcs
+ - resolvconf
+ - shadow_glove_driver
- steamvr
- vscode
+ - warehouse_ros
## Products ##
@@ -484,442 +308,27 @@ The common role contains any common task or roles that is used repeatedly in man
It contains the following roles:
+ - arm-interfaces
+ - bimanual-icons
+ - clear-icons
+ - close-everything-icon
+ - default-icon
+ - default-icon-no-terminator
- demo-icons
- docker-container
+ - dolphin-icons
+ - get-system-variables
+ - hand_config
+ - hand-manual
+ - local-hand-launch
+ - local-zero-force-mode-launch
+ - record-hand-data
- resources
+ - roslaunch-icon
- save-logs-icons
+ - validation
+ - web-gui-icon
For example, since docker-container contains the Ansible scripts for creating a Docker container, and it is a very common task shared by many products, it makes sense to have it in common so it can be referred to by other products.
Whenever you create a role, if it will likely be used by other products (e.g. it's not very specific to your product), please put it under common roles, or if it's for installing some commonly used program, put it under installation.
-
-## Templating ##
-
-For various bash/docker/etc. scripts, it's often useful to use Jinja2 templates (.j2 files). You can read more about .j2 files [here](https://docs.ansible.com/ansible/latest/user_guide/playbooks_templating.html)). They are stored either in /products/common/resources/ or if they are specific to a particular product, they should be in that products /templates/scripts folder.
-
-## Dependencies ##
-
-There are 2 main way of including dependencies in Ansible roles. The preferred way we use is the "include_role" method because it is dynamic (see [here](https://docs.ansible.com/ansible/latest/modules/include_role_module.html) for documentation).
-
-E.g. if we want to include a particular role to install Docker, we do:
-
-```bash
-- name: Include installation/docker role
- include_role:
- name: installation/docker
-```
-The other way of having dependencies in Ansible is by using the meta folder and main.yml inside the meta folder. Please note: any meta dependencies are static only and will not take into account any group_vars or dynamic variables. That means that meta dependencies will only use the default/main.yml default value, nothing else. Any tasks in meta/main.yml are run before the task/main.yml. An example of meta/main.yml:
-
-```bash
-dependencies:
- - { role: installation/aws-cli-v2 }
-```
-
-# Playbooks #
-
-Playbooks are "the main thing that runs"/"main executable" in Aurora.
-
-From the Ansible [website](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html): "Playbooks are the basis for a really simple configuration management and multi-machine deployment system, unlike any that already exist, and one that is very well suited to deploying complex applications."
-
-## Playbook creation ##
-
-Create your playbook in ansible/playbooks folder. It has be a .yml file with no hyphens (underscores are allowed).
-
-You can read more about playbooks [here](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html)
-
-It has to have a similar structure to this (let's say your playbook is called "my_playbook")
-
-```bash
----
-
-- name: Install Python 3
- import_playbook: ./install_python3.yml
-
-- name: Install product Docker container and icons
- hosts: docker_deploy
- pre_tasks:
-
- - name: include products/common/validation role
- include_role:
- name: products/common/validation
- vars:
- playbook: "my_playbook"
-
- - name: check if customer_key is provided and not false
- when: customer_key is defined and customer_key| length > 0
- set_fact:
- use_aws: true
-
- roles:
- - {role: installation/docker}
- - {role: installation/nvidia-docker, when: nvidia_docker | bool}
- - {role: products/hand-e/deploy, when: product == 'hand_e'}
- - {role: docker/aws, when: use_aws|bool}
-```
-Key points:
-
-Always start by having:
-
-```bash
-- name: Install Python 3
- import_playbook: ./install_python3.yml
-```
-This is to ensure Python3 is installed. Aurora uses Python3.
-
-Then you need to have one or more of task sections (or pre-task sections, which are executed before tasks) and an optional role section. Another example of a task section in a playbook (without role section):
-
-```bash
-- name: Check which hosts are available for teleop system Install
- hosts: all
- gather_facts: no
- tasks:
- - name: ping all the machines
- ping:
- become: yes
-```
-Some task sections specify "hosts", which tells Ansible which hosts to limit the execution to. You can read more about hosts in playbooks [here](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#hosts-and-users)
-
-An example of a role section:
-
-```bash
- roles:
- - {role: installation/docker}
- - {role: installation/nvidia-docker, when: nvidia_docker | bool}
- - {role: products/hand-e/deploy, when: product == 'hand_e'}
- - {role: docker/aws, when: use_aws|bool}
-```
-
-# Inventories #
-
-An inventory is a file with group names and fixed IP addresses and some limited connection-related variables of the machines where we want the playbook to run. The inventory group names are required in playbooks in the hosts parameter (e.g. hosts: all). You can read more about hosts in playbooks [here](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#hosts-and-users)
-
-Inventories for teleop correspond to fixed IP addresses as shown here:
-* [staging_b](ansible/inventory/teleop/staging_b)
-* [staging_a](ansible/inventory/teleop/staging_a)
-* [production](ansible/inventory/teleop/production)
-* [simulation](ansible/inventory/teleop/simulation)
-
-More information available [here](https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html)
-
-# Syntax and rules #
-
-1. Use lower case, words_separated_by_underscore file, folder, task, role, inventory group, playbook and any other names
-2. Spaces are very important! Don't leave extra, unnecessary spaces anywhere, but also remember to add a newline to the end of all files
-3. Follow [this](https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html) YAML syntax, paying special attention to the "Gotchas" [here](https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html#gotchas)
-
-# Special variables #
-
-Ansible has several special variables which can be accessed in playbooks, roles and tasks. E.g. if the special variable is ansible_user, you can access it using {{ ansible_user }}. Full list of special variables is [here](https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html)
-
-# Tutorial 1 desktop icon #
-
-Aim: to create a branch of aurora which has an Ansible role to install a desktop icon. When the user clicks on the desktop icon, a terminal window will open and say: "Hello, User!". The user can supply a different username as an extra vars parameter, so e.g. if the user runs the playbook with username=Peter, the terminal window will show "Hello, Peter!"
-
-Requirements: you need a laptop/PC with internet, Ubuntu 16.04 or 18.04 installed.
-
-Steps:
-
-1. Go to [Development Docker](#development-docker) section and follow instructions there to set up your development environment
-
-2. Create your own branch of aurora (from master). You can call your branch: Tutorial_YourName
-
-3. Follow instructions in the [Playbook creation](#playbook-creation) section to create your own playbook, you can call it tutorial_icon_deploy.yml. Remember use the Install Python3 import as documented in [Playbook creation](#playbook-creation) and include a roles section. Your playbook should look something like this (yes, use hosts: docker_deploy for this tutorial):
-
-```bash
----
-
-- name: Install Python 3
- import_playbook: ./install_python3.yml
-
-- name: Tutorial 1 installation
- hosts: docker_deploy
- roles:
- - {role: products/tutorial/deploy }
-```
-
-4. Create a role in roles/products/tutorial folder (you will have to create the tutorial folder). Inside the tutorial folder, create the following folder structure and empty files where indicated. You should have the following file structure:
-
- 
-
-5. You deploy/defaults/main.yml should look like this:
-```bash
----
-user: "{{ ansible_user_id }}"
-user_folder: "/home/{{ user }}"
-
-```
-6. Your deploy/tasks/main.yml should look like this:
-```bash
----
-- name: Include products/tutorial/desktop-icons role
- include_role:
- name: products/tutorial/desktop-icons
-```
-7. Your desktop-icons/defaults/main.yml should look like this:
-```bash
----
-user: "{{ ansible_user_id }}"
-user_folder: "/home/{{ user }}"
-username: "{{ user }}"
-tutorial_launcher_folder: "{{ user_folder }}/.tutorial/tutorial_1"
-```
-8. Your desktop-icons/tasks/main.yml should look like this:
-```bash
----
-- name: Ensures that Desktop folder exists
- file:
- path: "{{ desktop_path }}"
- mode: '755'
- state: directory
-
-- name: Ensures that tutorial directory exists
- file:
- path: "{{ tutorial_launcher_folder }}"
- state: directory
-
-- name: Copy the tutorial desktop icon
- copy:
- src: files/tutorial_1_icon.png
- dest: "{{ tutorial_launcher_folder }}/tutorial_1_icon.png"
- mode: '664'
-
-- name: Create the executable launch script
- template:
- src: templates/scripts/show_terminal.j2
- dest: "{{ tutorial_launcher_folder }}/show_terminal.sh"
- mode: '755'
-
-- name: Create the tutorial desktop icon
- template:
- src: ../../../common/resources/templates/desktop-icons/standard-icon.j2
- dest: "{{ desktop_path }}/Launch_Tutorial_1.desktop"
- mode: '755'
- vars:
- desktop_shortcut_name: Launch_Tutorial_1
- comment: "This is application launches Tutorial 1 of Aurora"
- folder: "{{ tutorial_launcher_folder }}"
- shell_script_file_name: show_terminal.sh
- icon_file_name: tutorial_1_icon.png
-
-- name: Make Desktop icon trusted
- shell: gio set "{{ desktop_path }}/Launch_Tutorial_1.desktop" "metadata::trusted" yes
- when:
- - ansible_distribution|string == 'Ubuntu'
- - ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
-```
-9. Download a suitable image (.jpg or .png) (e.g min 64x64 resolution, max 1000x1000 resolution) from the internet to be your tutorial_1_icon.png (or .jpg but then remember to change the extension to .jpg in your Ansible scripts as well). Place this image in the desktop-icons/files folder
-
-10. Your desktop-icons/templates/scripts/show_terminal.j2 should look like this:
-(you can read more about .j2 files in [Templating](#templating))
-```bash
-#jinja2: trim_blocks:False
-#! /bin/bash
-echo -e \"Hello, {{ username }}!\"
-sleep infinity
-
-```
-11. Now, let's add a Molecule test, which tests if the desktop icon exists. In /playbooks/molecule_docker folder, copy an existing folder (e.g. teleop_empty_server_docker) and paste it and then change the name to e.g. tutorial_1_docker. Inside tutorial_1_docker folder you should have the following folders and files (change file and folder names when necessary)
-
- 
-
-12. You don't need to edit the Dockerfile.j2. Just edit the molecule.yml so it looks like this:
-```bash
----
-driver:
- name: docker
-lint: |
- set -e
- yamllint .
- ansible-lint
- flake8
-platforms:
- - name: tutorial_1_docker
- image: public.ecr.aws/shadowrobot/aurora-test-ubuntu-docker:focal
- groups:
- - docker_deploy
- volumes:
- - /var/run/docker.sock:/var/run/docker.sock:rw
-provisioner:
- name: ansible
- env:
- ANSIBLE_ROLES_PATH: ../../../../roles
- AWS_ACCESS_KEY: ${AWS_ACCESS_KEY}
- AWS_SECRET_KEY: ${AWS_SECRET_KEY}
- inventory:
- links:
- group_vars: ../../../../inventory/local/group_vars
-verifier:
- name: testinfra
-scenario:
- create_sequence:
- - create
- check_sequence:
- - destroy
- - create
- - converge
- - check
- - destroy
- converge_sequence:
- - create
- - converge
- destroy_sequence:
- - destroy
- test_sequence:
- - lint
- - destroy
- - syntax
- - create
- - converge
- - idempotence
- - verify
- - destroy
-```
-13. Edit the converge.yml so it looks like this:
-```bash
----
-- name: Tutorial 1 playbook
- import_playbook: ../../../tutorial_icon_deploy.yml
-
-```
-
-14. Edit the test_tutorial_1.py so it looks like this (we are using a general pattern here, which is why we have for loops for icons and scripts).
-```bash
-import os
-import testinfra.utils.ansible_runner
-
-testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
- os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
-
-
-def test_icons_in_docker(host):
- desktop_path = '/home/' + str(host.user().name) + '/Desktop/'
- script_path = '/home/' + str(host.user().name) + \
- '/.tutorial/tutorial_1/'
- icons = (
- 'Launch_Tutorial_1'
- )
- scripts = (
- 'show_terminal'
- )
- for icon in icons:
- assert host.file(desktop_path+icon+'.desktop').exists
- for script in scripts:
- assert host.file(script_path+script+'.sh').exists
-
-```
-15. Now that your Docker test is ready, create the EC2 test which tests if the desktop icon exists, but it runs on an AWS virtual machine (not in Docker). In /playbooks/molecule_ec2 folder, copy an existing folder (e.g. teleop_server_chrony_ec2) and paste it and then change the name to e.g. tutorial_1_ec2. Inside tutorial_1_ec2 folder you should have the following folders and files (change file and folder names when necessary):
-
- 
-
-16. Edit the molecule.yml so it looks like this:
-```bash
----
-dependency:
- name: galaxy
-driver:
- name: ec2
-lint: |
- set -e
- yamllint .
- ansible-lint
- flake8
-platforms:
- # Adding CODEBUILD_BUILD_ID to instance name in order to allow parallel EC2 execution of tests from CodeBuild
- - name: tutorial_1_ec2_${CODEBUILD_BUILD_ID}
- image: ami-0820357ff5cf2333d
- instance_type: t2.micro
- region: eu-west-2
- vpc_id: vpc-0f8cc2cc245d57eb4
- vpc_subnet_id: subnet-0c8cfe80927f04845
- groups:
- - docker_deploy
-provisioner:
- name: ansible
- env:
- ANSIBLE_ROLES_PATH: ../../../../roles
- connection_options:
- ansible_python_interpreter: /usr/bin/python3
- inventory:
- links:
- group_vars: ../../../../inventory/local/group_vars
- playbooks:
- create: ../resources/ec2/create.yml
- destroy: ../resources/ec2/destroy.yml
- prepare: ../../../install_python3.yml
- converge: ../../../molecule_docker/molecule/tutorial_1_docker/converge.yml
-verifier:
- name: testinfra
- directory: ../../../molecule_docker/molecule/tutorial_1_docker/tests/
-scenario:
- create_sequence:
- - dependency
- - create
- - prepare
- check_sequence:
- - dependency
- - destroy
- - create
- - prepare
- - converge
- - check
- - destroy
- converge_sequence:
- - dependency
- - create
- - prepare
- - converge
- destroy_sequence:
- - dependency
- - destroy
- test_sequence:
- - dependency
- - lint
- - destroy
- - syntax
- - create
- - prepare
- - converge
- - idempotence
- - verify
- - destroy
-
-```
-17. Now all the Ansible code is done and both Docker and EC2 tests added. Next step is to execute the Docker test locally: follow the steps here: [Testing with molecule_docker](#testing-with-molecule_docker) (you may want to use the -s flag to limit the test to your tutorial_1 test only. Normally we want to re-test everything for every introduced change, but it's pretty safe to say tutorial_1 hasn't broken other parts of Aurora)
-
-18. After local Docker tests are complete, you can optionally run the EC2 triggered locally as well by following the steps here: [Testing with molecule_ec2](#testing-with-molecule_ec2) (However, you need to contact the System Administrator for credentials as explained here: [Credentials](#credentials))
-
-19. When all tests are passing (initiated locally), create a PR of your branch and see the AWS automatic build activate as well as the AWS ECR tests (building aurora Docker images). All tests must pass before even thinking about merging to master (and in this exercise, please DO NOT MERGE to master!). More information available here: [Automatic tests](#automatic-tests)
-
-20. Once your PR is passing (all green), you are ready to test your branch on real hardware. For this tutorial, you will test your branch on your own local machine by opening a terminal window by pressing Ctrl+Alt+T and run this:
-```bash
-bash <(curl -Ls bit.ly/run-aurora) tutorial_icon_deploy --branch NameOfYourBranch --inventory local/docker_deploy username=YourName
-```
-Rememeber to substitute in NameOfYourBranch and YourName
-
-You will have to enter the sudo password for your computer twice (once for the bash script and once for ansible)
-
-21. The desktop icon should be created and when you double-click on it, a window should pop up and greet you using the username you passed in. You have now completed Tutorial 1
-
- 
-
- 
-
-# Troubleshooting #
-
-1. **SSH warning** when using the same laptops for multiple different NUCs (in server_and_nuc_deploy and teleop_deploy): for a given server laptop, only 1 NUC is supposed to be used. If the NUC is changed, the SSH keys stored on the laptop don't match the NUC, so aurora has to be re-run. In this case, it's required that the user manually deletes the .ssh folder on the server laptop to clear ssh keys.
-
-2. **Unable to connect to a new NUC with SSH** (not cloned from Clonezilla image) (in server_and_nuc_deploy and teleop_deploy): the NUC with Ubuntu Server 18.04 needs manual netplan configuration as below in order to recognize and connect the ethernet-USB adapters: edit the file /etc/netplan/50-cloud-init.yaml in the NUC host so it has the following:
-
-```bash
-network:
- version: 2
- ethernets:
- enx-usb-ethernet:
- match:
- name: enx*
- dhcp4: true
- optional: true
-```
-
-3. **Unable to launch RQT on NUC** (or other graphical programs running on the NUC), due to Xauthority issues (in server_and_nuc_deploy and teleop_deploy): Before running aurora, execute ssh -X user@nuc-control to create a proper .Xauthority file in the NUC host (user home folder). This is required before aurora runs and creates the container.
diff --git a/ansible/data/ansible/requirements.txt b/ansible/data/ansible/requirements.txt
index 04e34b13b..1d9a70df6 100644
--- a/ansible/data/ansible/requirements.txt
+++ b/ansible/data/ansible/requirements.txt
@@ -1,12 +1,13 @@
ansible==4.2.0
ansible-core==2.11.11
+boto3==1.24.88
jinja2==3.1.1
packaging==21.3
resolvelib==0.5.4
MarkupSafe==2.0.1
asn1crypto==1.5.1
cffi==1.15.0
-cryptography==3.3.2
+pyOpenSSL==22.1.0
lxml==4.8.0
requests==2.27.1
pycparser==2.21
@@ -14,4 +15,4 @@ pyparsing==2.4.7
PyYAML==5.4.1
six==1.15.0
setuptools==51.1.1
-testresources==2.0.1
\ No newline at end of file
+testresources==2.0.1
diff --git a/ansible/data/molecule/requirements.txt b/ansible/data/molecule/requirements.txt
index f2528d0ec..b6889eab6 100644
--- a/ansible/data/molecule/requirements.txt
+++ b/ansible/data/molecule/requirements.txt
@@ -5,7 +5,7 @@ ansible-lint==5.4.0
asn1crypto==1.5.1
arrow==1.2.2
bcrypt==3.2.0
-boto3==1.23.0
+boto3==1.24.88
boto==2.49.0
binaryornot==0.4.4
Cerberus==1.3.2
diff --git a/ansible/inventory/local/dhcp b/ansible/inventory/local/dhcp
index fc34148a4..f2a04e0c9 100644
--- a/ansible/inventory/local/dhcp
+++ b/ansible/inventory/local/dhcp
@@ -1,2 +1,2 @@
[dhcp]
-10.9.11.1 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
+10.9.11.1 ansible_connection=local is_ansible_control_node=true ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/local/group_vars/configure_software.yml b/ansible/inventory/local/group_vars/configure_software.yml
index eba798e69..9e5b0b965 100644
--- a/ansible/inventory/local/group_vars/configure_software.yml
+++ b/ansible/inventory/local/group_vars/configure_software.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
new_docker_user: user
new_docker_user_password: "{{ new_docker_user }}"
diff --git a/ansible/inventory/local/group_vars/dhcp.yml b/ansible/inventory/local/group_vars/dhcp.yml
index b51425679..1d0099b2f 100644
--- a/ansible/inventory/local/group_vars/dhcp.yml
+++ b/ansible/inventory/local/group_vars/dhcp.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
internet_interface_name: "eth0" # Specify which interface the server laptop gets internet from
dhcp_interface_name: "eth0" # Specify the USB-ethernet adapter name connected to server going to the NUC
diff --git a/ansible/inventory/local/group_vars/docker_deploy.yml b/ansible/inventory/local/group_vars/docker_deploy.yml
index 63b92e521..14be7c25a 100644
--- a/ansible/inventory/local/group_vars/docker_deploy.yml
+++ b/ansible/inventory/local/group_vars/docker_deploy.yml
@@ -1,48 +1,38 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
-image: "shadowrobot/dexterous-hand" # Docker image name
-tag: "noetic-release" # Tag of the exact Docker hub image to pull
+image: "public.ecr.aws/shadowrobot/dexterous-hand" # Docker image name
+tag: "noetic-v1.0.21" # Tag of the exact Docker hub image to pull
product: '' # Name of the product (hand_e, arm_hand_e, hand_lite, arm_hand_lite, hand_extra_lite, arm_hand_extra_lite)
reinstall: false # Flag to know if the docker container should be fully reinstalled
container_name: "dexterous_hand" # Name of the docker container
nvidia_docker: false # Define if nvidia-container-toolkit is used (default is false)
-desktop_icon: true # Generates a desktop icon to launch the hand
use_aws: false # Flag to prompt for customer key for uploading files to AWS
shortcut_name: "Shadow_Hand_Launcher" # Specify the name for the desktop icon (default: Shadow_Hand_Launcher)
-optoforce: false # Specify if optoforce sensors are going to be used with a branch name (Only for Flexible Hand)
-launch_hand: false # Specify if hand driver should start when double clicking desktop icon
demo_icons: true # Generates desktop icons to run demos
setup_directory: "/usr/local/bin" # Where setup scripts should be installed that are launched when Docker starts
terminator: true # Launch terminator when the Docker starts
upgrade_check: false # If set to true will pull latest docker image and prompt to upgrade the container
-sim_hand: false # if set to true it will autolaunch the hand in simulation
+sim_icon: false # If set to true it will create simulation icons
hand_side: "right" # Specify if the hand is right or left (ignored if bimanual=true)
bimanual: false # Specify if both hands are used or not
-arm_ip_left: "" # Specify the IP address of left arm
-arm_ip_right: "" # Specify the IP address of right arm
-ur_robot_type: "ur10e" # Specify ur robot type: ur10, ur10e, ur5, ur5e
remote_bag_user: "shadowop"
remote_bag_storage_IP: "10.5.10.59"
remote_bag_storage_location: "/volume1/ros_bags"
bag_all_data_from: ["shadowrobot_210312", "shadowrobot_210311", "shadowrobot_210311_210312"]
pr_branches: "" # Space-separated list in double quotes of PRs and branches like this "https://github.com/shadow-robot/repo/pull/266 https://github.com/shadow-robot/repo/tree/custom_branch" to check out on server and catkin_make
local_image: false # This boolean dictates if you want to use a local image or not. Skips all authentication checks and stops the image from being pulled.
-arm_hand_readthedocs_token: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 66353963666432383265393835616638613636366135663330383339323666636139653535386338
- 3862393133333033323961633735643131306134366135300a393435356162343863326530333131
- 39646636663333653732643033353838343237623834383434373533653465366463623165386565
- 6135376565363933620a386561666563666431343931626239613761663537366239643063626236
- 66626266333436366434376536636537626262343161633535663935666561383136
-arm_hand_readthedocs_link: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 36666266326536386336316166626631333738613730666165326435353063646535363163353432
- 3965623466306161623433333538363938666331376661630a373663626237303463353636323330
- 33336531653431663438376531653734306330346335646161626262643965363030373837346135
- 3361356664303739390a363731643964643830363966313963356364386232656530666634383866
- 33386263323131663836626565383431656164363763363862333235333862623334666461363336
- 66633735326261373334353134313331636663303638633664333237626461316130653362353763
- 32616439626536373862646339623065643063313764353835633039376333643466366234396465
- 35316232643932633138373330366536613061366335386532346332353461363965663533333132
- 33666434393533396132643533356461656339366465323333653366353663386538656436353733
- 38626635363932626431326661666633643732363665646566353162623862663938393838356237
- 316632643837373336333761303336616661
+
+skip_molecule_task: false # Used for automated tests - should not be used by users
\ No newline at end of file
diff --git a/ansible/inventory/local/group_vars/install_software.yml b/ansible/inventory/local/group_vars/install_software.yml
index 24edd7dd9..f0b05a855 100644
--- a/ansible/inventory/local/group_vars/install_software.yml
+++ b/ansible/inventory/local/group_vars/install_software.yml
@@ -1,2 +1,16 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
diff --git a/ansible/inventory/server_and_nuc/bristol b/ansible/inventory/server_and_nuc/bristol
deleted file mode 100644
index 46b0fc279..000000000
--- a/ansible/inventory/server_and_nuc/bristol
+++ /dev/null
@@ -1,5 +0,0 @@
-[server]
-10.6.10.3 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
-
-[control_machine]
-10.6.10.2 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/server_and_nuc/bristol2 b/ansible/inventory/server_and_nuc/bristol2
deleted file mode 100644
index f9c23c394..000000000
--- a/ansible/inventory/server_and_nuc/bristol2
+++ /dev/null
@@ -1,5 +0,0 @@
-[server]
-10.17.1.36 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
-
-[control_machine]
-10.17.1.35 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/teleop/staging_b b/ansible/inventory/server_and_nuc/development
similarity index 65%
rename from ansible/inventory/teleop/staging_b
rename to ansible/inventory/server_and_nuc/development
index 6f6ac3c9e..e08af7d37 100644
--- a/ansible/inventory/teleop/staging_b
+++ b/ansible/inventory/server_and_nuc/development
@@ -1,5 +1,5 @@
[server]
-10.9.9.1 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
+10.9.9.1 ansible_connection=local is_ansible_control_node=true ansible_ssh_common_args='-o StrictHostKeyChecking=no'
[control_machine]
10.9.9.2 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/server_and_nuc/group_vars/control_machine.yml b/ansible/inventory/server_and_nuc/group_vars/control_machine.yml
index 933dfd3f7..7651a4024 100644
--- a/ansible/inventory/server_and_nuc/group_vars/control_machine.yml
+++ b/ansible/inventory/server_and_nuc/group_vars/control_machine.yml
@@ -1,6 +1,20 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
image: "public.ecr.aws/shadowrobot/dexterous-hand" # Docker image name
-tag: "noetic-release" # Tag of the exact Docker hub image to pull
+tag: "noetic-v1.0.21" # Tag of the exact Docker hub image to pull
product: '' # Name of the product (hand_e, arm_hand_e, hand_lite, arm_hand_lite, hand_extra_lite, arm_hand_extra_lite)
reinstall: false # Flag to know if the docker container should be fully reinstalled
container_name: "dexterous_hand" # Name of the docker container
@@ -9,16 +23,14 @@ use_aws: false # Flag to prompt for customer key for uploading files to AWS
setup_directory: "/usr/local/bin" # Where setup scripts should be installed that are launched when Docker starts
terminator: false # Launch terminator when the Docker starts
nvidia_docker: false # Define if nvidia-container-toolkit is used (defaul is false)
-optoforce: false # Specify if optoforce sensors are going to be used with a branch name (Only for Flexible Hand)
upgrade_check: false # If set to true will pull latest docker image and prompt to upgrade the container
hand_side: "right" # Specify if the hand is right or left (ignored if bimanual=true)
bimanual: false # Specify if both left and right hands are used or not
arm_ip_left: "" # Specify the IP address of left arm
arm_ip_right: "" # Specify the IP address of right arm
ur_robot_type: "ur10e" # Specify ur robot type: ur10, ur10e, ur5, ur5e
-glove: "shadow_glove" # Determines which glove is installed (haptx or shadow_glove)
-real_glove: true # Whether a real physical glove is being used for hand control or not
-biotacs: true # Whether the hands will have biotac fingertips
+glove: "" # Determines which glove is installed (shadow_glove)
+real_glove: false # Whether a real physical glove is being used for hand control or not
polhemus_type: "viper" # Allows the user to specify the polhemus type used (liberty or viper)
remote_bag_user: "shadowop"
remote_bag_storage_IP: "10.5.10.59"
@@ -26,6 +38,7 @@ remote_bag_storage_location: "/volume1/ros_bags"
record_data: false
pr_branches: "" # Space-separated list in double quotes of PRs and branches like this "https://github.com/shadow-robot/repo/pull/266 https://github.com/shadow-robot/repo/tree/custom_branch" to check out on server and catkin_make
local_image: false # This boolean dictates if you want to use a local image or not. Skips all authentication checks and stops the image from being pulled.
+delivery: true # This variable is used to determine whether we are using this for product delivery, or for development purposes. (should be used internally by Shadow Engineers)
ansible_become_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
37666530346662303365643738316338633231613365666339383135616237666336646133326435
@@ -40,3 +53,5 @@ ansible_ssh_pass: !vault |
31613934306166313637326339313136393537393664663664353862613762646333646437646630
3331323561646639620a363162363661363834616465393132383664363038666532323162393934
3239
+
+skip_molecule_task: false # Used for automated tests
\ No newline at end of file
diff --git a/ansible/inventory/server_and_nuc/group_vars/server.yml b/ansible/inventory/server_and_nuc/group_vars/server.yml
index a0a671b4d..157874296 100644
--- a/ansible/inventory/server_and_nuc/group_vars/server.yml
+++ b/ansible/inventory/server_and_nuc/group_vars/server.yml
@@ -1,13 +1,25 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
image: "public.ecr.aws/shadowrobot/dexterous-hand" # Docker image name
-tag: "noetic-release" # Tag of the exact Docker hub image to pull
+tag: "noetic-v1.0.21" # Tag of the exact Docker hub image to pull
product: '' # Name of the product (hand_e, arm_hand_e, hand_lite, arm_hand_lite, hand_extra_lite, arm_hand_extra_lite)
reinstall: false # Flag to know if the docker container should be fully reinstalled
container_name: "dexterous_hand" # Name of the docker container
nvidia_docker: true # Define if nvidia-container-toolkit is used (defaul is false)
-desktop_icon: true # Generates a desktop icon to launch the hand
shortcut_name: "Shadow_Hand_Launcher" # Specify the name for the desktop icon (default: Shadow_Hand_Launcher)
-optoforce: false # Specify if optoforce sensors are going to be used with a branch name (Only for Flexible Hand)
use_aws: false # Flag to prompt for customer key for uploading files to AWS
setup_directory: "/usr/local/bin" # Where setup scripts should be installed that are launched when Docker starts
terminator: true # Launch terminator when the Docker starts
@@ -21,51 +33,13 @@ ansible_become_password: "{{ sudo_password }}" # Specify the sudo password for t
arm_ip_left: "" # Specify the IP address of left arm
arm_ip_right: "" # Specify the IP address of right arm
ur_robot_type: "ur10e" # Specify ur robot type: ur10, ur10e, ur5, ur5e
-glove: "shadow_glove" # Determines which glove is installed (haptx or shadow_glove)
-real_glove: true # Whether a real physical glove is being used for hand control or not
-biotacs: true # Whether the hands will have biotac fingertips
+glove: "" # Determines which glove is installed (shadow_glove)
+real_glove: false # Whether a real physical glove is being used for hand control or not
polhemus_type: "viper" # Allows the user to specify the polhemus type used (liberty or viper)
pr_branches: "" # Space-separated list in double quotes of PRs and branches like this "https://github.com/shadow-robot/repo/pull/266 https://github.com/shadow-robot/repo/tree/custom_branch" to check out on server and catkin_make
router: false # Specify if a router is used between server and NUC
-scene_file: "" # Allows the user to override the scene_file used in GUI launch (only for arm+hand product) e.g. scene_file="\$(find sr_description_common)/scenes/custom.scene" (if empty, default in Github will be used)
+scene_file: "" # Allows the user to override the scene_file used in GUI launch (only for arm+hand product) e.g. scene_file="new_scene" (we do not add .scene to the variable as it assumes:$(find sr_description_common)/scenes/{scene_file}.scene and $(find sr_description_common)/worlds/{scene_file}.world)
+delivery: true # This variable is used to determine whether we are using this for product delivery, or for development purposes. (should be used internally by Shadow Engineers)
local_image: false # This boolean dictates if you want to use a local image or not. Skips all authentication checks and stops the image from being pulled.
-arm_hand_readthedocs_token: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 66353963666432383265393835616638613636366135663330383339323666636139653535386338
- 3862393133333033323961633735643131306134366135300a393435356162343863326530333131
- 39646636663333653732643033353838343237623834383434373533653465366463623165386565
- 6135376565363933620a386561666563666431343931626239613761663537366239643063626236
- 66626266333436366434376536636537626262343161633535663935666561383136
-arm_hand_readthedocs_link: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 36666266326536386336316166626631333738613730666165326435353063646535363163353432
- 3965623466306161623433333538363938666331376661630a373663626237303463353636323330
- 33336531653431663438376531653734306330346335646161626262643965363030373837346135
- 3361356664303739390a363731643964643830363966313963356364386232656530666634383866
- 33386263323131663836626565383431656164363763363862333235333862623334666461363336
- 66633735326261373334353134313331636663303638633664333237626461316130653362353763
- 32616439626536373862646339623065643063313764353835633039376333643466366234396465
- 35316232643932633138373330366536613061366335386532346332353461363965663533333132
- 33666434393533396132643533356461656339366465323333653366353663386538656436353733
- 38626635363932626431326661666633643732363665646566353162623862663938393838356237
- 316632643837373336333761303336616661
-glove_hand_readthedocs_token: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 33386366643631653639623762636466346264363263343138386363643537346436653038626339
- 6566316437373566633833633934306636646663333532350a636365633737373233383238663035
- 38616162656665376238353437353563323161666331663566646136666639626566376462386233
- 6136306164316563340a346666313266653761636664623262393638393930366363633666633763
- 65643735323235363962623238663237633662373132353166323231373365363461
-glove_hand_readthedocs_link: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 66616130383864383038643362336232643739356666623635313130653631373430653861613630
- 3666653764666338666361623139313130353836306664390a636434366166643930623163623764
- 32646130616233613562653633636331313766323966393039643864633065373535333465643339
- 3133663535643237320a373165343162313036373566376533633164613337343666643432643036
- 36336437393965336262356339363530613738616561363361383938363135663761313962643039
- 66633437613232373931636131653031393236343034363163346162636166613332316133386438
- 66303635373064633732383832373864326136663962633236363165313264666238626162393663
- 64666264663938336161313834366130366138393664633231303864313061356535356462623532
- 39343334313330613632333838613833386564343862623439656333346331383433313535346564
- 36343461306464643930653039386237393964353633323031636162343766303566383338326532
- 323636663438386636613038663061653465
\ No newline at end of file
+
+skip_molecule_task: false # Used for automated tests - should not be used by users
\ No newline at end of file
diff --git a/ansible/inventory/server_and_nuc/phantom_hands b/ansible/inventory/server_and_nuc/phantom_hands
index 54e0527a0..42817ef76 100644
--- a/ansible/inventory/server_and_nuc/phantom_hands
+++ b/ansible/inventory/server_and_nuc/phantom_hands
@@ -1,5 +1,5 @@
[server]
-10.5.10.146 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
+10.5.10.146 ansible_connection=local is_ansible_control_node=true ansible_ssh_common_args='-o StrictHostKeyChecking=no'
[control_machine]
10.5.10.147 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/server_and_nuc/production b/ansible/inventory/server_and_nuc/production
index a65b125d9..e9f57b8a6 100644
--- a/ansible/inventory/server_and_nuc/production
+++ b/ansible/inventory/server_and_nuc/production
@@ -1,5 +1,5 @@
[server]
-10.9.11.1 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
+10.9.11.1 ansible_connection=local is_ansible_control_node=true ansible_ssh_common_args='-o StrictHostKeyChecking=no'
[control_machine]
10.9.11.2 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/server_and_nuc/staging_a b/ansible/inventory/server_and_nuc/staging_a
deleted file mode 100644
index d4c91c41a..000000000
--- a/ansible/inventory/server_and_nuc/staging_a
+++ /dev/null
@@ -1,5 +0,0 @@
-[server]
-10.9.10.1 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
-
-[control_machine]
-10.9.10.2 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/teleop/bristol b/ansible/inventory/teleop/bristol
deleted file mode 100644
index 46b0fc279..000000000
--- a/ansible/inventory/teleop/bristol
+++ /dev/null
@@ -1,5 +0,0 @@
-[server]
-10.6.10.3 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
-
-[control_machine]
-10.6.10.2 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/teleop/bristol2 b/ansible/inventory/teleop/bristol2
deleted file mode 100644
index f9c23c394..000000000
--- a/ansible/inventory/teleop/bristol2
+++ /dev/null
@@ -1,5 +0,0 @@
-[server]
-10.17.1.36 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
-
-[control_machine]
-10.17.1.35 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/server_and_nuc/staging_b b/ansible/inventory/teleop/development
similarity index 65%
rename from ansible/inventory/server_and_nuc/staging_b
rename to ansible/inventory/teleop/development
index 6f6ac3c9e..e08af7d37 100644
--- a/ansible/inventory/server_and_nuc/staging_b
+++ b/ansible/inventory/teleop/development
@@ -1,5 +1,5 @@
[server]
-10.9.9.1 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
+10.9.9.1 ansible_connection=local is_ansible_control_node=true ansible_ssh_common_args='-o StrictHostKeyChecking=no'
[control_machine]
10.9.9.2 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/teleop/staging_b_remote b/ansible/inventory/teleop/development_remote
similarity index 78%
rename from ansible/inventory/teleop/staging_b_remote
rename to ansible/inventory/teleop/development_remote
index 14f74b07a..c2f28cf0d 100644
--- a/ansible/inventory/teleop/staging_b_remote
+++ b/ansible/inventory/teleop/development_remote
@@ -1,5 +1,5 @@
[server]
-10.9.9.1 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
+10.9.9.1 ansible_connection=local is_ansible_control_node=true ansible_ssh_common_args='-o StrictHostKeyChecking=no'
[control_machine]
10.9.9.2 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/teleop/events_1 b/ansible/inventory/teleop/events_1
deleted file mode 100644
index d6896c8a8..000000000
--- a/ansible/inventory/teleop/events_1
+++ /dev/null
@@ -1,5 +0,0 @@
-[server]
-10.9.13.1 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
-
-[control_machine]
-10.9.13.2 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/teleop/group_vars/control_machine.yml b/ansible/inventory/teleop/group_vars/control_machine.yml
index 375b2c11a..d559a3dff 100644
--- a/ansible/inventory/teleop/group_vars/control_machine.yml
+++ b/ansible/inventory/teleop/group_vars/control_machine.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
image: "080653068785.dkr.ecr.eu-west-2.amazonaws.com/shadow-teleop-polhemus" # Docker image name
tag: "noetic-night-build" # Tag of the exact Docker hub image to pull
@@ -8,7 +22,7 @@ ethercat_right_arm: "eth1" # Ethercat interface of the right arm
allow_auto_reboot: true # Allow Ansible to reboot the control_machine automatically during software installation
use_aws: false # Boolean to indicate whether ROS logs will be uploaded to AWS S3
glove: "shadow_glove" # Determines which glove is installed (haptx or shadow_glove)
-container_name: "teleop_{{ glove }}" # Name of the docker container
+container_name: "shadow_teleop" # Name of the docker container
setup_directory: "/usr/local/bin" # Where setup scripts should be installed that are launched when Docker starts
terminator: false # Launch terminator when the Docker starts
nvidia_docker: false # Define if nvidia-container-toolkit is used (defaul is false)
@@ -17,14 +31,13 @@ hand_side: "right" # Specify if the hand is right or left (ignored if bimanual=t
arm_ip_left: "" # Specify the IP address of left arm
arm_ip_right: "" # Specify the IP address of right arm
ur_robot_type: "ur10e" # Specify ur robot type: ur10, ur10e, ur5, ur5e
-biotacs: true # Whether the hands will have biotac fingertips
remote_bag_user: "shadowop"
remote_bag_storage_IP: "10.5.10.59"
remote_bag_storage_location: "/volume1/ros_bags"
pr_branches: "" # Space-separated list of PRs (https://github.com/shadow-robot/repo/pull/266) or branches (https://github.com/shadow-robot/repo/tree/custom_branch) to check out on NUC and catkin_make
record_data: false
-arm_servo: true # This boolean dictates which method of arm controller to use. True for arm_servo or false for jog_arm.
local_image: false # This boolean dictates if you want to use a local image or not. Skips all authentication checks and stops the image from being pulled.
+delivery: true # This variable is used to determine whether we are using this for product delivery, or for development purposes. (should be used internally by Shadow Engineers)
ansible_become_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
37666530346662303365643738316338633231613365666339383135616237666336646133326435
@@ -40,3 +53,4 @@ ansible_ssh_pass: !vault |
3331323561646639620a363162363661363834616465393132383664363038666532323162393934
3239
+skip_molecule_task: false # Used for automated tests - should not be used by users
\ No newline at end of file
diff --git a/ansible/inventory/teleop/group_vars/server.yml b/ansible/inventory/teleop/group_vars/server.yml
index c94157add..f5064ef19 100644
--- a/ansible/inventory/teleop/group_vars/server.yml
+++ b/ansible/inventory/teleop/group_vars/server.yml
@@ -1,10 +1,24 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
image: "080653068785.dkr.ecr.eu-west-2.amazonaws.com/shadow-teleop-polhemus" # Docker image name
tag: "noetic-night-build" # Tag of the exact Docker hub image to pull
reinstall: false # Flag to know if the docker container should be fully reinstalled
nvidia_docker: true # Define if nvidia-container-toolkit is used (defaul is false)
glove: "shadow_glove" # Determines which glove is installed (haptx or shadow_glove)
-container_name: "teleop_{{ glove }}" # Name of the docker container
+container_name: "shadow_teleop" # Name of the docker container
real_glove: true # Whether a real physical glove is being used for hand control or not
real_vive: true # Whether a real Vive system is being used for arm control
use_aws: false # Flag to prompt for customer key for uploading files to AWS
@@ -23,49 +37,14 @@ demohand_icons: false # Specify if all the teleop icons for Demohands A,B,C,D sh
arm_ip_left: "" # Specify the IP address of left arm
arm_ip_right: "" # Specify the IP address of right arm
ur_robot_type: "ur10e" # Specify ur robot type: ur10, ur10e, ur5, ur5e
-biotacs: true # Whether the hands will have biotac fingertips
rh_biotac_mapping: "" # Allows the user to override the rh_biotac_mapping_script_type (if empty, default in Github will be used)
lh_biotac_mapping: "" # Allows the user to override the lh_biotac_mapping_script_type (if empty, default in Github will be used)
pr_branches: "" # Space-separated list in double quotes of PRs and branches like this "https://github.com/shadow-robot/repo/pull/266 https://github.com/shadow-robot/repo/tree/custom_branch" to check out on server and catkin_make
polhemus_type: "viper" # Allows the user to specify the polhemus type used (liberty or viper)
-scene_file: "" # Allows the user to override the scene_file used in GUI launch e.g. scene_file="\$(find sr_description_common)/scenes/custom.scene" (if empty, default in Github will be used)
+scene_file: "" # Allows the user to override the scene_file used in GUI launch e.g. scene_file="new_scene" (we do not add .scene to the variable as it assumes:$(find sr_description_common)/scenes/{scene_file}.scene and $(find sr_description_common)/worlds/{scene_file}.world)
ra_tracker_id: 0 # Right tracker ID specified for haptx gloves (lowest tracker serial number seen in SteamVR)
la_tracker_id: 1 # Left tracker ID specified for haptx gloves (highest tracker serial number seen in SteamVR)
-arm_servo: true # This boolean dictates which method of arm controller to use. True for arm_servo or false for jog_arm.
local_image: false # This boolean dictates if you want to use a local image or not. Skips all authentication checks and stops the image from being pulled.
-haptx_teleop_readthedocs_token: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 36316332326334323634393864353132323038333837636264356466353263353038313930383932
- 6666316239376263656534343065383131363836636630650a366662353765636538633063636564
- 61333536653638643538343036613137313239653762613436636630643231643564393937353639
- 3865383631323434650a396130656362383731316233366339656535353333633033356533376439
- 32333564633363623433393564633437623436316536656235356432643637666465
-shadow_glove_teleop_readthedocs_token: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 35656336316532343065633663663930653531363566666663386531323339663564363038373539
- 3765633939666133613464663735636536326162613437360a356239633930303031333533383634
- 35663237303361363361303937633436376534663337373636323837313532326565633234663838
- 3232376336373161360a366530383864383834646662363933666161386335386165353564313366
- 39346137646463343536396636613136656262383133376334306536303263363937
-haptx_teleop_readthedocs_link: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 32303139313863323166323930313631353663306139383532306336363434366331346364333764
- 3538623033623833303135316364396438383634643162650a646462653039653834626331656461
- 39333535396134376236333836323038303336626335363030306531613462383639303035383233
- 6266613631313430310a343461373335626665376662383932393937383435663937363638643363
- 31643334643962333563646265363334373538386134616136306364326261363536356166353664
- 63623261393662363065616539386137636463373330373166343561363163383066663634633238
- 63306265323864666562356461303864316437393837643531326539666464653332613938353964
- 33333535633137636334656635313737303864376562663632386437346163653337653238303963
- 64336661353966323231313666383537633963383137636339393833376664326439
-shadow_glove_teleop_readthedocs_link: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 30396330353636336161386534656537383236353631616662386164313464633765613331313032
- 3639623738383864363765373034633533646663366433370a373133306331366436376164316139
- 61303061653331663461346433643264353330613031383834373130643231623965663830643734
- 6134353962306435370a616462626237666438353332616236316334613438373433306163376539
- 35666533396139333862393830616461363639396365383834393961373738666363393239346332
- 32633038346561383432633036636166636334363663656539663239323566373036353632633863
- 62656361323237623836356431626139633538636138303033333939343733653931633739623831
- 34623562333737653636333132306365363236653136333234383363623562626463373765303336
- 30636135333261313237303138373963373561653233636565363338663232366466
+delivery: true # This variable is used to determine whether we are using this for product delivery, or for development purposes. (should be used internally by Shadow Engineers)
+
+skip_molecule_task: false # Used for automated tests - should not be used by users
\ No newline at end of file
diff --git a/ansible/inventory/teleop/group_vars/simulation.yml b/ansible/inventory/teleop/group_vars/simulation.yml
index da3caa973..cd210c09b 100644
--- a/ansible/inventory/teleop/group_vars/simulation.yml
+++ b/ansible/inventory/teleop/group_vars/simulation.yml
@@ -1,14 +1,27 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
image: "080653068785.dkr.ecr.eu-west-2.amazonaws.com/shadow-teleop-polhemus" # Docker image name
tag: "noetic-night-build" # Tag of the exact Docker hub image to pull
reinstall: false # Flag to know if the docker container should be fully reinstalled
nvidia_docker: true # Define if nvidia-container-toolkit is used (defaul is false)
glove: "shadow_glove" # Determines which glove is installed (haptx or shadow_glove)
-container_name: "teleop_{{ glove }}" # Name of the docker container
+container_name: "shadow_teleop" # Name of the docker container
bimanual: true # when doing sim we should always have it bimanual.
real_glove: false # Whether a real physical glove is being used for hand control or not
real_vive: false # Whether a real Vive system is being used for arm control
-biotacs: true # Whether the hands will have biotac fingertips
use_aws: false # Flag to prompt for customer key for uploading files to AWS
setup_directory: "/usr/local/bin" # Where setup scripts should be installed that are launched when Docker starts
terminator: true # Launch terminator when the Docker starts
@@ -20,42 +33,8 @@ ur_robot_type: "ur10e" # Specify ur robot type: ur10, ur10e, ur5, ur5e
arm_ip_left: "" # Specify the IP address of left arm
arm_ip_right: "" # Specify the IP address of right arm
pr_branches: "" # Space-separated list in double quotes of PRs and branches like this "https://github.com/shadow-robot/repo/pull/266 https://github.com/shadow-robot/repo/tree/custom_branch" to check out on server and catkin_make
-scene_file: "" # Allows the user to override the scene_file used in GUI launch e.g. scene_file="\$(find sr_description_common)/scenes/custom.scene" (if empty, default in Github will be used)
-arm_servo: true # This boolean dictates which method of arm controller to use. True for arm_servo or false for jog_arm.
+scene_file: "" # Allows the user to override the scene_file used in GUI launch e.g. scene_file="new_scene" (we do not add .scene to the variable as it assumes:$(find sr_description_common)/scenes/{scene_file}.scene and $(find sr_description_common)/worlds/{scene_file}.world)
local_image: false # This boolean dictates if you want to use a local image or not. Skips all authentication checks and stops the image from being pulled.
-haptx_teleop_readthedocs_token: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 36316332326334323634393864353132323038333837636264356466353263353038313930383932
- 6666316239376263656534343065383131363836636630650a366662353765636538633063636564
- 61333536653638643538343036613137313239653762613436636630643231643564393937353639
- 3865383631323434650a396130656362383731316233366339656535353333633033356533376439
- 32333564633363623433393564633437623436316536656235356432643637666465
-shadow_glove_teleop_readthedocs_token: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 35656336316532343065633663663930653531363566666663386531323339663564363038373539
- 3765633939666133613464663735636536326162613437360a356239633930303031333533383634
- 35663237303361363361303937633436376534663337373636323837313532326565633234663838
- 3232376336373161360a366530383864383834646662363933666161386335386165353564313366
- 39346137646463343536396636613136656262383133376334306536303263363937
-haptx_teleop_readthedocs_link: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 32303139313863323166323930313631353663306139383532306336363434366331346364333764
- 3538623033623833303135316364396438383634643162650a646462653039653834626331656461
- 39333535396134376236333836323038303336626335363030306531613462383639303035383233
- 6266613631313430310a343461373335626665376662383932393937383435663937363638643363
- 31643334643962333563646265363334373538386134616136306364326261363536356166353664
- 63623261393662363065616539386137636463373330373166343561363163383066663634633238
- 63306265323864666562356461303864316437393837643531326539666464653332613938353964
- 33333535633137636334656635313737303864376562663632386437346163653337653238303963
- 64336661353966323231313666383537633963383137636339393833376664326439
-shadow_glove_teleop_readthedocs_link: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 30396330353636336161386534656537383236353631616662386164313464633765613331313032
- 3639623738383864363765373034633533646663366433370a373133306331366436376164316139
- 61303061653331663461346433643264353330613031383834373130643231623965663830643734
- 6134353962306435370a616462626237666438353332616236316334613438373433306163376539
- 35666533396139333862393830616461363639396365383834393961373738666363393239346332
- 32633038346561383432633036636166636334363663656539663239323566373036353632633863
- 62656361323237623836356431626139633538636138303033333939343733653931633739623831
- 34623562333737653636333132306365363236653136333234383363623562626463373765303336
- 30636135333261313237303138373963373561653233636565363338663232366466
+delivery: true # This variable is used to determine whether we are using this for product delivery, or for development purposes. (should be used internally by Shadow Engineers)
+
+skip_molecule_task: false # Used for automated tests - should not be used by users
\ No newline at end of file
diff --git a/ansible/inventory/teleop/phantom_hands b/ansible/inventory/teleop/phantom_hands
index 54e0527a0..42817ef76 100644
--- a/ansible/inventory/teleop/phantom_hands
+++ b/ansible/inventory/teleop/phantom_hands
@@ -1,5 +1,5 @@
[server]
-10.5.10.146 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
+10.5.10.146 ansible_connection=local is_ansible_control_node=true ansible_ssh_common_args='-o StrictHostKeyChecking=no'
[control_machine]
10.5.10.147 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/teleop/production b/ansible/inventory/teleop/production
index a65b125d9..db6125ee0 100644
--- a/ansible/inventory/teleop/production
+++ b/ansible/inventory/teleop/production
@@ -1,5 +1,5 @@
[server]
-10.9.11.1 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
+10.9.11.1 ansible_connection=local is_ansible_control_node=true ansible_ssh_common_args='-o StrictHostKeyChecking=no'
[control_machine]
-10.9.11.2 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
+10.9.11.2 ansible_host=nuc-control is_ansible_control_node=false ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/teleop/production_remote b/ansible/inventory/teleop/production_remote
index f8e55e073..39e76f0d6 100644
--- a/ansible/inventory/teleop/production_remote
+++ b/ansible/inventory/teleop/production_remote
@@ -1,5 +1,5 @@
[server]
-10.9.11.1 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
+10.9.11.1 ansible_connection=local is_ansible_control_node=true ansible_ssh_common_args='-o StrictHostKeyChecking=no'
[control_machine]
10.9.11.2 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/teleop/simulation b/ansible/inventory/teleop/simulation
index 7985e6863..12f06f1b6 100644
--- a/ansible/inventory/teleop/simulation
+++ b/ansible/inventory/teleop/simulation
@@ -1,2 +1,2 @@
[simulation]
-127.0.0.1 ansible_connection=local
+127.0.0.1 ansible_connection=local is_ansible_control_node=true
diff --git a/ansible/inventory/teleop/staging_a b/ansible/inventory/teleop/staging_a
deleted file mode 100644
index d4c91c41a..000000000
--- a/ansible/inventory/teleop/staging_a
+++ /dev/null
@@ -1,5 +0,0 @@
-[server]
-10.9.10.1 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
-
-[control_machine]
-10.9.10.2 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/inventory/teleop/staging_a_remote b/ansible/inventory/teleop/staging_a_remote
deleted file mode 100644
index ad33d1cb9..000000000
--- a/ansible/inventory/teleop/staging_a_remote
+++ /dev/null
@@ -1,8 +0,0 @@
-[server]
-10.9.10.1 ansible_connection=local ansible_ssh_common_args='-o StrictHostKeyChecking=no'
-
-[control_machine]
-10.9.10.2 ansible_host=nuc-control ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=user ansible_user=user remote_user=user ansible_ssh_common_args='-o StrictHostKeyChecking=no'
-
-[client]
-10.9.10.3 ansible_host=teleop-client ansible_ssh_pipelining=true ansible_connection=ssh ansible_ssh_user=shadowop ansible_user=shadowop ansible_ssh_common_args='-o StrictHostKeyChecking=no'
diff --git a/ansible/playbooks/callback_plugins/custom_retry_runner.py b/ansible/playbooks/callback_plugins/custom_retry_runner.py
index f6c495738..ad4723e3f 100755
--- a/ansible/playbooks/callback_plugins/custom_retry_runner.py
+++ b/ansible/playbooks/callback_plugins/custom_retry_runner.py
@@ -1,3 +1,18 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+# pylint: disable=C0103,W0212,E1101
__metaclass__ = type
from ansible import constants as C
@@ -28,17 +43,22 @@ def v2_runner_retry(self, result):
task_name = result.task_name or result._task
if "pull" in result.task_name.lower() and "docker" in result.task_name.lower():
msg = "Docker image pulling in progress... Message count: "+str(result._result['attempts'])
- if (self._display.verbosity > 2 or '_ansible_verbose_always' in result._result) and '_ansible_verbose_override' not in result._result:
+ if (self._display.verbosity > 2 or '_ansible_verbose_always' in result._result) \
+ and '_ansible_verbose_override' not in result._result:
msg += "Result was: %s" % self._dump_results(result._result)
self._display.display(msg, color=C.COLOR_DEBUG)
elif "arp" in result.task_name.lower() and "mac" in result.task_name.lower():
- msg = "Waiting for the MAC address of a connected adapter to appear in arp... Message count: "+str(result._result['attempts'])
- if (self._display.verbosity > 2 or '_ansible_verbose_always' in result._result) and '_ansible_verbose_override' not in result._result:
+ msg = "Waiting for the MAC address of a connected adapter to appear in arp..."
+ msg += f"Message count: {result._result['attempts']}"
+ if (self._display.verbosity > 2 or '_ansible_verbose_always' in result._result) \
+ and '_ansible_verbose_override' not in result._result:
msg += "Result was: %s" % self._dump_results(result._result)
self._display.display(msg, color=C.COLOR_DEBUG)
else:
- msg = "FAILED - RETRYING: %s (%d retries left)." % (task_name, result._result['retries'] - result._result['attempts'])
- if (self._display.verbosity > 2 or '_ansible_verbose_always' in result._result) and '_ansible_verbose_override' not in result._result:
+ retries = result._result['retries'] - result._result['attempts']
+ msg = f"FAILED - RETRYING: {task_name} ({retries} retries left)."
+ if (self._display.verbosity > 2 or '_ansible_verbose_always' in result._result) \
+ and '_ansible_verbose_override' not in result._result:
msg += "Result was: %s" % self._dump_results(result._result)
self._display.display(msg, color=C.COLOR_DEBUG)
diff --git a/ansible/playbooks/configure_software.yml b/ansible/playbooks/configure_software.yml
index cf6be3c6e..551922d84 100644
--- a/ansible/playbooks/configure_software.yml
+++ b/ansible/playbooks/configure_software.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Install Python 3
import_playbook: ./install_python3.yml
diff --git a/ansible/playbooks/dhcp.yml b/ansible/playbooks/dhcp.yml
index 95fd1f787..3d8023fbd 100644
--- a/ansible/playbooks/dhcp.yml
+++ b/ansible/playbooks/dhcp.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Install Python 3
import_playbook: ./install_python3.yml
diff --git a/ansible/playbooks/docker_deploy.yml b/ansible/playbooks/docker_deploy.yml
index e5a5446f8..f217fcddb 100644
--- a/ansible/playbooks/docker_deploy.yml
+++ b/ansible/playbooks/docker_deploy.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Install Python 3
@@ -13,10 +27,10 @@
vars:
playbook: "docker_deploy"
- - name: Install common tools
+ - name: Running playbook setup role
include_role:
- name: installation/install_common_tools
- when: skip_molecule_task is not defined
+ name: installation/playbook_setup
+ when: not skip_molecule_task|bool
- name: check if customer_key is provided and not false
when: customer_key is defined and customer_key | length > 0
@@ -25,8 +39,5 @@
roles:
- { role: products/common/get-system-variables }
- - { role: installation/docker }
- - { role: installation/nvidia-docker, when: nvidia_docker | bool }
- - { role: products/hand-e/deploy, when: product == 'hand_e' }
- - { role: docker/aws, when: use_aws|bool }
- - { role: products/common/dolphin-icons, when: ansible_distribution_release|string == 'focal' or ansible_distribution_release|string == 'jammy'}
+ - { role: products/hand-e/docker-deploy/deploy }
+ - { role: products/common/dolphin-icons, when: ansible_distribution_release|string == 'focal' or ansible_distribution_release|string == 'jammy' }
diff --git a/ansible/playbooks/install_python3.yml b/ansible/playbooks/install_python3.yml
index 8bc12011a..8ba5754dd 100644
--- a/ansible/playbooks/install_python3.yml
+++ b/ansible/playbooks/install_python3.yml
@@ -1,26 +1,112 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
-- name: Install Python 3
+- name: Install Python 3 and pip3
hosts: all
become: yes
gather_facts: no
pre_tasks:
+ - name: Install Python 3 and pip3
+ when: (is_ansible_control_node is undefined) or (not (is_ansible_control_node | bool))
+ block:
+ - name: Set user home from env var
+ set_fact:
+ sr_user_home: "{{ lookup('env','HOME') }}"
+
+ - name: Check if Python 3 is installed
+ raw: 'python3 --version'
+ register: output
+ ignore_errors: yes
+ changed_when: output.rc != 0
+
+ - name: Install Python 3 in case if it is not installed
+ raw: 'apt-get -y update && apt-get install -y python3'
+ when: output.rc != 0
+
+ - name: Check pip3 installed (will prevent reinstallation in case if pip3 was installed without Apt)
+ command: pip3 --version
+ register: pip_status
+ ignore_errors: yes
+ changed_when: pip_status.rc != 0
+
+ - name: Make sure python3-pip is present (if run-ansible.sh was not run locally)
+ apt:
+ name: 'python3-pip'
+ state: 'present'
+ update_cache: yes
+ when:
+ - pip_status.rc != 0
+ - not pip_status.stderr | regex_search("module 'lib' has no attribute 'X509_V_FLAG_.*")
+ become: yes
- - name: Check if Python 3 is installed
- raw: 'python3 --version'
- register: output
- ignore_errors: yes
- changed_when: output.rc != 0
+ # This checks for a condition where pip3 is installed but not working due to an issue with a criptography library
+ - name: Check for pip3 cryptography issue
+ command: pip3 --version
+ register: pip_status
+ ignore_errors: yes
+ # This is to avoid a failure of the idempotency tests
+ changed_when: false
- - name: Install Python 3 in case if it is not installed
- raw: 'apt-get -y update && apt-get install -y python3'
- when: output.rc != 0
+ # Package python3-openssl comes preinstalled in ubuntu server (together with two packages that depend on it landscape-common and python3-twisted).
+ # It depends on the cryptography package, and the problem is that the cryptography package is installed with both pip3 and apt.
+ # But the version installed with pip is found first in the python path. And the pip version of cryptography is incompatible with the openssl version installed with apt,
+ # which oddly enough throws this error just by trying to do anything with pip. So we're removing the conflicting package.
+ # And we do it with a raw command because the apt module doesn't work because it tries to use the openssl library from the host.
+ - name: Fix pip3 cryptography issue
+ raw: 'apt-get -y update && apt-get purge -y python3-openssl'
+ register: output
+ when:
+ - pip_status.rc != 0
+ - pip_status.stderr | regex_search("module 'lib' has no attribute 'X509_V_FLAG_.*")
+ become: yes
- name: Set Python 3 variable
hosts: all
gather_facts: no
pre_tasks:
- - name: Set Python 3 interpreter
+ - name: Set user home from env var
set_fact:
- ansible_python_interpreter: /usr/bin/python3
+ sr_user_home: "{{ lookup('env','HOME') }}"
+
+ - name: Set Python 3 conda
+ when:
+ - '"root" not in sr_user_home'
+ - is_ansible_control_node is defined
+ - is_ansible_control_node | bool
+ block:
+ - name: Set python3/pip path
+ set_fact:
+ sr_python_and_pip_path: "{{ sr_user_home }}/.shadow_miniconda/miniconda/envs/aurora_conda_ws/bin"
+
+ - name: Set Python 3 interpreter
+ set_fact:
+ ansible_python_interpreter: "{{ sr_python_and_pip_path }}/python3"
+
+ - name: Set Python3 pip executable
+ set_fact:
+ ansible_pip3_executable: "{{ sr_python_and_pip_path }}/pip3"
+
+ - name: Set Python 3 non-conda
+ when: ("root" in sr_user_home) or (is_ansible_control_node is undefined) or (not (is_ansible_control_node | bool))
+ block:
+ - name: Set Python 3 interpreter
+ set_fact:
+ ansible_python_interpreter: "/usr/bin/python3"
+
+ - name: Set Python3 pip executable
+ set_fact:
+ ansible_pip3_executable: "/usr/bin/pip3"
diff --git a/ansible/playbooks/install_software.yml b/ansible/playbooks/install_software.yml
index 6695b0ce4..8e6c369b9 100644
--- a/ansible/playbooks/install_software.yml
+++ b/ansible/playbooks/install_software.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Install Python 3
import_playbook: ./install_python3.yml
@@ -32,3 +46,4 @@
- {role: installation/mongodb, when: "'mongodb' in software_list"}
- {role: installation/warehouse_ros, when: "'warehouse_ros' in software_list"}
- {role: installation/production_tools, when: "'production_tools' in software_list"}
+ - {role: installation/teamviewer, when: "'teamviewer' in software_list"}
diff --git a/ansible/playbooks/molecule_docker/molecule/default/converge.yml b/ansible/playbooks/molecule_docker/molecule/default/converge.yml
index 2ba9e8a7b..afa78df65 100644
--- a/ansible/playbooks/molecule_docker/molecule/default/converge.yml
+++ b/ansible/playbooks/molecule_docker/molecule/default/converge.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Docker deploy playbook for non existing product
import_playbook: ../../../docker_deploy.yml
diff --git a/ansible/playbooks/molecule_docker/molecule/default/molecule.yml b/ansible/playbooks/molecule_docker/molecule/default/molecule.yml
index 823b51ae7..24fc08244 100644
--- a/ansible/playbooks/molecule_docker/molecule/default/molecule.yml
+++ b/ansible/playbooks/molecule_docker/molecule/default/molecule.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
driver:
name: docker
diff --git a/ansible/playbooks/molecule_docker/molecule/default/tests/test_default.py b/ansible/playbooks/molecule_docker/molecule/default/tests/test_default.py
index eedd64a1d..aeba688be 100644
--- a/ansible/playbooks/molecule_docker/molecule/default/tests/test_default.py
+++ b/ansible/playbooks/molecule_docker/molecule/default/tests/test_default.py
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
import os
import testinfra.utils.ansible_runner
@@ -7,8 +21,8 @@
def test_hosts_file(host):
- f = host.file('/etc/hosts')
+ host_file = host.file('/etc/hosts')
- assert f.exists
- assert f.user == 'root'
- assert f.group == 'root'
+ assert host_file.exists
+ assert host_file.user == 'root'
+ assert host_file.group == 'root'
diff --git a/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/cleanup.yml b/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/cleanup.yml
index dc25bb2cd..4f42db219 100644
--- a/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/cleanup.yml
+++ b/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/cleanup.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Cleanup
hosts: localhost
diff --git a/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/converge.yml b/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/converge.yml
index 02f32e92e..5400ce9ed 100644
--- a/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/converge.yml
+++ b/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/converge.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Docker deploy playbook for Hand E
import_playbook: ../../../docker_deploy.yml
diff --git a/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/molecule.yml b/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/molecule.yml
index 6792d0b85..b2db4bfc3 100644
--- a/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/molecule.yml
+++ b/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/molecule.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
driver:
name: docker
diff --git a/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/tests/test_default.py b/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/tests/test_default.py
index eedd64a1d..cac915832 100644
--- a/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/tests/test_default.py
+++ b/ansible/playbooks/molecule_docker/molecule/hand_e_empty_machine_docker/tests/test_default.py
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
import os
import testinfra.utils.ansible_runner
@@ -7,8 +21,8 @@
def test_hosts_file(host):
- f = host.file('/etc/hosts')
+ hosts_file = host.file('/etc/hosts')
- assert f.exists
- assert f.user == 'root'
- assert f.group == 'root'
+ assert hosts_file.exists
+ assert hosts_file.user == 'root'
+ assert hosts_file.group == 'root'
diff --git a/ansible/playbooks/molecule_docker/molecule/server_and_nuc_desktop_icons_docker/converge.yml b/ansible/playbooks/molecule_docker/molecule/server_and_nuc_desktop_icons_docker/converge.yml
index c57ff8935..d8d48931d 100644
--- a/ansible/playbooks/molecule_docker/molecule/server_and_nuc_desktop_icons_docker/converge.yml
+++ b/ansible/playbooks/molecule_docker/molecule/server_and_nuc_desktop_icons_docker/converge.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Server_and_nuc playbook server desktop icons
import_playbook: ../../../server_and_nuc_deploy.yml
diff --git a/ansible/playbooks/molecule_docker/molecule/server_and_nuc_desktop_icons_docker/molecule.yml b/ansible/playbooks/molecule_docker/molecule/server_and_nuc_desktop_icons_docker/molecule.yml
index 2698fe88b..56aa6acf7 100644
--- a/ansible/playbooks/molecule_docker/molecule/server_and_nuc_desktop_icons_docker/molecule.yml
+++ b/ansible/playbooks/molecule_docker/molecule/server_and_nuc_desktop_icons_docker/molecule.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
driver:
name: docker
diff --git a/ansible/playbooks/molecule_docker/molecule/server_and_nuc_desktop_icons_docker/tests/test_server.py b/ansible/playbooks/molecule_docker/molecule/server_and_nuc_desktop_icons_docker/tests/test_server.py
index 530a149bc..1b671b04c 100644
--- a/ansible/playbooks/molecule_docker/molecule/server_and_nuc_desktop_icons_docker/tests/test_server.py
+++ b/ansible/playbooks/molecule_docker/molecule/server_and_nuc_desktop_icons_docker/tests/test_server.py
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
import os
import testinfra.utils.ansible_runner
@@ -86,7 +100,7 @@ def test_icons_in_docker(host):
'shadow_zero_force_mode_right',
'shadow_zero_force_mode_left',
'close_everything'
- )
+ )
for icon in icons:
assert host.file(f"{desktop_path}{icon}.desktop").exists
@@ -94,5 +108,3 @@ def test_icons_in_docker(host):
assert host.file(f"{script_path}{script}.sh").exists
save_logs_file = f"{save_logs_script_path}save-latest-ros-logs.sh"
assert host.file(save_logs_file).exists
- hand_manual_file = f"{desktop_path}Palm_EDC_User_Manual_1.7.pdf"
- assert host.file(hand_manual_file).exists
diff --git a/ansible/playbooks/molecule_docker/molecule/teleop_control_machine_check_config_docker/converge.yml b/ansible/playbooks/molecule_docker/molecule/teleop_control_machine_check_config_docker/converge.yml
index 55ab19669..8baea0564 100644
--- a/ansible/playbooks/molecule_docker/molecule/teleop_control_machine_check_config_docker/converge.yml
+++ b/ansible/playbooks/molecule_docker/molecule/teleop_control_machine_check_config_docker/converge.yml
@@ -1,9 +1,23 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Teleop Nuc machine playbook for config check
import_playbook: ../../../teleop_deploy.yml
vars:
image: public.ecr.aws/shadowrobot/dexterous-hand
- tag: noetic-release
+ tag: noetic-v1.0.21
reinstall: true
use_openvpn: false
nvidia_docker: false
diff --git a/ansible/playbooks/molecule_docker/molecule/teleop_control_machine_check_config_docker/molecule.yml b/ansible/playbooks/molecule_docker/molecule/teleop_control_machine_check_config_docker/molecule.yml
index 630fa0a59..a7058b138 100644
--- a/ansible/playbooks/molecule_docker/molecule/teleop_control_machine_check_config_docker/molecule.yml
+++ b/ansible/playbooks/molecule_docker/molecule/teleop_control_machine_check_config_docker/molecule.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
driver:
name: docker
diff --git a/ansible/playbooks/molecule_docker/molecule/teleop_control_machine_check_config_docker/tests/test_default.py b/ansible/playbooks/molecule_docker/molecule/teleop_control_machine_check_config_docker/tests/test_default.py
index 2f06c675e..0419271a1 100644
--- a/ansible/playbooks/molecule_docker/molecule/teleop_control_machine_check_config_docker/tests/test_default.py
+++ b/ansible/playbooks/molecule_docker/molecule/teleop_control_machine_check_config_docker/tests/test_default.py
@@ -1,18 +1,31 @@
-import os
-import docker
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+import os
import testinfra.utils.ansible_runner
+import docker
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_hosts_file(host):
- f = host.file('/etc/hosts')
+ host_file = host.file('/etc/hosts')
- assert f.exists
- assert f.user == 'root'
- assert f.group == 'root'
+ assert host_file.exists
+ assert host_file.user == 'root'
+ assert host_file.group == 'root'
def test_docker_installed(host):
diff --git a/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/converge.yml b/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/converge.yml
index 0c412a28a..9886e4f07 100644
--- a/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/converge.yml
+++ b/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/converge.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Teleop deploy playbook for teleop server
import_playbook: ../../../teleop_deploy.yml
@@ -5,7 +19,7 @@
reinstall: true
use_openvpn: false
image: public.ecr.aws/shadowrobot/dexterous-hand
- tag: noetic-release
+ tag: noetic-v1.0.21
nvidia_docker: false
skip_molecule_task: true
allow_auto_reboot: true
@@ -19,4 +33,3 @@
demohand_icons: true
haptx_teleop_readthedocs_link: ""
shadow_glove_teleop_readthedocs_link: ""
- arm_servo: true
diff --git a/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/molecule.yml b/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/molecule.yml
index a3363a82d..ade83fd9e 100644
--- a/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/molecule.yml
+++ b/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/molecule.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
driver:
name: docker
diff --git a/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/tests/test_teleop_server.py b/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/tests/test_teleop_server.py
index 4f2858227..29ed69032 100644
--- a/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/tests/test_teleop_server.py
+++ b/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/tests/test_teleop_server.py
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
import os
import testinfra.utils.ansible_runner
@@ -6,11 +20,11 @@
def test_hosts_file(host):
- f = host.file('/etc/hosts')
+ host_file = host.file('/etc/hosts')
- assert f.exists
- assert f.user == 'root'
- assert f.group == 'root'
+ assert host_file.exists
+ assert host_file.user == 'root'
+ assert host_file.group == 'root'
def test_docker_installed(host):
@@ -21,10 +35,10 @@ def test_docker_installed(host):
def test_icons_in_docker(host):
hostuser = str(host.user().name)
desktop_path = f'/home/{hostuser}/Desktop/'
- script_path = f'/home/{hostuser}/.shadow_launcher_app_teleop_shadow_glove/shadow_hand_launcher/'
+ script_path = f'/home/{hostuser}/.shadow_launcher_app_shadow_teleoperation_system/shadow_hand_launcher/'
save_logs_script_path = f'/home/{hostuser}/.shadow_save_log_app/save_latest_ros_logs/'
icons = (
- 'Launch Shadow Right Teleop 8DOF',
+ 'Launch Shadow Right Teleop',
'Shadow NUC RQT',
'Shadow Advanced Launchers/1 - Launch Server Container',
'Shadow Advanced Launchers/2 - Launch Server ROSCORE',
@@ -33,14 +47,12 @@ def test_icons_in_docker(host):
'Shadow Advanced Launchers/3 - Demohand B Launch NUC Right Side Teleop Hardware Control Loop',
'Shadow Advanced Launchers/3 - Demohand C Launch NUC Right Side Teleop Hardware Control Loop',
'Shadow Advanced Launchers/3 - Demohand D Launch NUC Left Side Teleop Hardware Control Loop',
- 'Shadow Advanced Launchers/4 - Launch Right Teleop GUI 8DOF',
- 'Shadow Advanced Launchers/5 - Launch Right Shadow Glove Driver',
- 'Shadow Advanced Launchers/6 - Launch Right Shadow Glove Mapping',
+ 'Shadow Advanced Launchers/4 - Launch Right Teleop GUI',
'Shadow Advanced Launchers/Launch NUC Container',
'Shadow Demos/Close Right Hand',
'Shadow Demos/Open Right Hand',
'Shadow ROS Logs Saver and Uploader',
- 'Teleop Documentation',
+ 'Shadow Teleop Documentation',
'Local Launch/Launch Local Shadow Right Hand',
'Local Launch/Local Zero Force Mode - Right Hand',
'Shadow Advanced Launchers/3 - Zero Force Mode - Right Hand',
@@ -49,7 +61,7 @@ def test_icons_in_docker(host):
'Shadow Close Everything'
)
scripts = (
- 'shadow_launch_right_teleop_8dof',
+ 'shadow_launch_right_teleop',
'nuc_rqt',
'shadow_server_container',
'shadow_roscore',
@@ -58,9 +70,7 @@ def test_icons_in_docker(host):
'teleop_exec_B',
'teleop_exec_C',
'teleop_exec_D',
- 'shadow_GUI_right_8DOF',
- 'shadow_glove_mapping_launch_right',
- 'shadow_glove_driver_right',
+ 'shadow_GUI_right',
'shadow_nuc_container',
'close_right_hand',
'open_right_hand',
@@ -80,5 +90,3 @@ def test_icons_in_docker(host):
assert host.file(f"{script_path}{script}.sh").exists
save_logs_file = f"{save_logs_script_path}save-latest-ros-logs.sh"
assert host.file(save_logs_file).exists
- hand_manual_file = f"{desktop_path}Palm_EDC_User_Manual_1.7.pdf"
- assert host.file(hand_manual_file).exists
diff --git a/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_haptx_bimanual_docker/converge.yml b/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_haptx_bimanual_docker/converge.yml
index cada2dbae..710a85059 100644
--- a/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_haptx_bimanual_docker/converge.yml
+++ b/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_haptx_bimanual_docker/converge.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Teleop deploy playbook for teleop server with haptx bimanual
import_playbook: ../../../teleop_deploy.yml
@@ -5,7 +19,7 @@
reinstall: true
use_openvpn: false
image: public.ecr.aws/shadowrobot/dexterous-hand
- tag: noetic-release
+ tag: noetic-v1.0.21
nvidia_docker: false
skip_molecule_task: true
allow_auto_reboot: true
diff --git a/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_haptx_bimanual_docker/molecule.yml b/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_haptx_bimanual_docker/molecule.yml
index 2e5166f9f..098333538 100644
--- a/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_haptx_bimanual_docker/molecule.yml
+++ b/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_haptx_bimanual_docker/molecule.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
driver:
name: docker
diff --git a/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_haptx_bimanual_docker/tests/test_teleop_server.py b/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_haptx_bimanual_docker/tests/test_teleop_server.py
index c01d5c2d4..7c106108b 100644
--- a/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_haptx_bimanual_docker/tests/test_teleop_server.py
+++ b/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_haptx_bimanual_docker/tests/test_teleop_server.py
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
import os
import testinfra.utils.ansible_runner
@@ -26,12 +40,12 @@ def test_udev_files(host):
def test_icons_in_docker(host):
hostuser = str(host.user().name)
desktop_path = f'/home/{hostuser}/Desktop/'
- script_path = f'/home/{hostuser}/.shadow_launcher_app_teleop_haptx/shadow_hand_launcher/'
+ script_path = f'/home/{hostuser}/.shadow_launcher_app_tactile_telerobot_system/shadow_hand_launcher/'
save_logs_script_path = f'/home/{hostuser}/.shadow_save_log_app/save_latest_ros_logs/'
icons = (
- 'Launch Shadow Right Teleop 8DOF',
- 'Launch Shadow Left Teleop 8DOF',
- 'Launch Shadow Bimanual Teleop 8DOF',
+ 'Launch Shadow Right Teleop',
+ 'Launch Shadow Left Teleop',
+ 'Launch Shadow Bimanual Teleop',
'Shadow NUC RQT',
'Shadow Advanced Launchers/Launch Server Container',
'Right Side/1 - Launch Server Container',
@@ -47,9 +61,9 @@ def test_icons_in_docker(host):
'Shadow Advanced Launchers/3 - Demohand B Launch NUC Right Side Teleop Hardware Control Loop',
'Shadow Advanced Launchers/3 - Demohand C Launch NUC Right Side Teleop Hardware Control Loop',
'Shadow Advanced Launchers/3 - Demohand D Launch NUC Left Side Teleop Hardware Control Loop',
- 'Right Side/4 - Launch Right Teleop GUI 8DOF',
- 'Left Side/4 - Launch Left Teleop GUI 8DOF',
- 'Bimanual/4 - Launch Bimanual Teleop GUI 8DOF',
+ 'Right Side/4 - Launch Right Teleop GUI',
+ 'Left Side/4 - Launch Left Teleop GUI',
+ 'Bimanual/4 - Launch Bimanual Teleop GUI',
'Right Side/5 - Launch Right HaptX Mapping',
'Left Side/5 - Launch Left HaptX Mapping',
'Bimanual/5 - Launch Bimanual HaptX Mapping',
@@ -61,7 +75,7 @@ def test_icons_in_docker(host):
'Shadow Demos/Close Bimanual Hands',
'Shadow Demos/Open Bimanual Hands',
'Shadow ROS Logs Saver and Uploader',
- 'Teleop Documentation',
+ 'Shadow Teleop Documentation',
'Shadow System Monitor',
'Local Launch/Launch Local Shadow Right Hand',
'Local Launch/Launch Local Shadow Left Hand',
@@ -74,9 +88,9 @@ def test_icons_in_docker(host):
'Shadow Close Everything'
)
scripts = (
- 'shadow_launch_right_teleop_8dof',
- 'shadow_launch_left_teleop_8dof',
- 'shadow_launch_bimanual_teleop_8dof',
+ 'shadow_launch_right_teleop',
+ 'shadow_launch_left_teleop',
+ 'shadow_launch_bimanual_teleop',
'nuc_rqt',
'shadow_server_container',
'shadow_roscore',
@@ -87,9 +101,9 @@ def test_icons_in_docker(host):
'teleop_exec_B',
'teleop_exec_C',
'teleop_exec_D',
- 'shadow_GUI_left_8DOF',
- 'shadow_GUI_right_8DOF',
- 'shadow_GUI_bimanual_8DOF',
+ 'shadow_GUI_left',
+ 'shadow_GUI_right',
+ 'shadow_GUI_bimanual',
'shadow_haptx_mapping_launch_right',
'shadow_haptx_mapping_launch_left',
'shadow_haptx_mapping_launch_bimanual',
@@ -121,5 +135,3 @@ def test_icons_in_docker(host):
assert host.file(f"{script_path}{script}.sh").exists
save_logs_file = f"{save_logs_script_path}save-latest-ros-logs.sh"
assert host.file(save_logs_file).exists
- hand_manual_file = f"{desktop_path}Palm_EDC_User_Manual_1.7.pdf"
- assert host.file(hand_manual_file).exists
\ No newline at end of file
diff --git a/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_simulation_haptx_docker/converge.yml b/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_simulation_haptx_docker/converge.yml
index fb9a0db05..fa27ad991 100644
--- a/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_simulation_haptx_docker/converge.yml
+++ b/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_simulation_haptx_docker/converge.yml
@@ -1,10 +1,24 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Teleop deploy playbook for teleop server with simulation only
import_playbook: ../../../teleop_deploy.yml
vars:
reinstall: true
image: public.ecr.aws/shadowrobot/dexterous-hand
- tag: noetic-release
+ tag: noetic-v1.0.21
nvidia_docker: false
skip_molecule_task: true
allow_auto_reboot: true
@@ -14,7 +28,5 @@
customer_key: invalidkey
real_glove: true
real_vive: false
- biotacs: true
haptx_teleop_readthedocs_link: ""
shadow_glove_teleop_readthedocs_link: ""
- arm_servo: true
diff --git a/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_simulation_haptx_docker/molecule.yml b/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_simulation_haptx_docker/molecule.yml
index c2268ebd9..152378e7e 100644
--- a/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_simulation_haptx_docker/molecule.yml
+++ b/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_simulation_haptx_docker/molecule.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
driver:
name: docker
diff --git a/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_simulation_haptx_docker/tests/test_teleop_server.py b/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_simulation_haptx_docker/tests/test_teleop_server.py
index 39087db54..dafc20785 100644
--- a/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_simulation_haptx_docker/tests/test_teleop_server.py
+++ b/ansible/playbooks/molecule_docker/molecule/teleop_server_desktop_icons_simulation_haptx_docker/tests/test_teleop_server.py
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
import os
import testinfra.utils.ansible_runner
@@ -8,12 +22,12 @@
def test_icons_in_docker(host):
hostuser = str(host.user().name)
desktop_path = f'/home/{hostuser}/Desktop/'
- script_path = f'/home/{hostuser}/.shadow_launcher_app_teleop_haptx/shadow_hand_launcher/'
+ script_path = f'/home/{hostuser}/.shadow_launcher_app_tactile_telerobot_system/shadow_hand_launcher/'
save_logs_script_path = f'/home/{hostuser}/.shadow_save_log_app/save_latest_ros_logs/'
icons = (
- 'Launch Shadow Right Teleop 8DOF Simulation',
- 'Launch Shadow Left Teleop 8DOF Simulation',
- 'Launch Shadow Bimanual Teleop 8DOF Simulation',
+ 'Launch Shadow Right Teleop Simulation',
+ 'Launch Shadow Left Teleop Simulation',
+ 'Launch Shadow Bimanual Teleop Simulation',
'Shadow Advanced Launchers/Launch Server Container',
'Right Side/1 - Launch Server Container',
'Right Side/2 - Launch Server ROSCORE',
@@ -21,9 +35,9 @@ def test_icons_in_docker(host):
'Left Side/2 - Launch Server ROSCORE',
'Bimanual/1 - Launch Server Container',
'Bimanual/2 - Launch Server ROSCORE',
- 'Right Side/3 - Launch Right Teleop Simulation 8DOF',
- 'Left Side/3 - Launch Left Teleop Simulation 8DOF',
- 'Bimanual/3 - Launch Bimanual Teleop Simulation 8DOF',
+ 'Right Side/3 - Launch Right Teleop Simulation',
+ 'Left Side/3 - Launch Left Teleop Simulation',
+ 'Bimanual/3 - Launch Bimanual Teleop Simulation',
'Right Side/4 - Launch Right HaptX Mapping',
'Left Side/4 - Launch Left HaptX Mapping',
'Bimanual/4 - Launch Bimanual HaptX Mapping',
@@ -35,19 +49,19 @@ def test_icons_in_docker(host):
'Shadow Demos/Close Left Hand',
'Shadow Demos/Open Left Hand',
'Shadow ROS Logs Saver and Uploader',
- 'Teleop Documentation',
+ 'Shadow Teleop Documentation',
'Shadow System Monitor',
'Shadow Close Everything'
)
scripts = (
- 'shadow_launch_right_teleop_8dof_sim',
- 'shadow_launch_left_teleop_8dof_sim',
- 'shadow_launch_bimanual_teleop_8dof_sim',
+ 'shadow_launch_right_teleop_sim',
+ 'shadow_launch_left_teleop_sim',
+ 'shadow_launch_bimanual_teleop_sim',
'shadow_server_container',
'shadow_roscore',
- 'shadow_sim_right_8DOF',
- 'shadow_sim_left_8DOF',
- 'shadow_sim_bimanual_8DOF',
+ 'shadow_sim_right',
+ 'shadow_sim_left',
+ 'shadow_sim_bimanual',
'shadow_haptx_mapping_launch_right',
'shadow_haptx_mapping_launch_left',
'shadow_haptx_mapping_launch_bimanual',
@@ -69,5 +83,3 @@ def test_icons_in_docker(host):
assert host.file(f"{script_path}{script}.sh").exists
save_logs_file = f"{save_logs_script_path}save-latest-ros-logs.sh"
assert host.file(save_logs_file).exists
- hand_manual_file = f"{desktop_path}Palm_EDC_User_Manual_1.7.pdf"
- assert host.file(hand_manual_file).exists
diff --git a/ansible/playbooks/molecule_ec2_local_inventories/molecule/default_ec2/molecule.yml b/ansible/playbooks/molecule_ec2_local_inventories/molecule/default_ec2/molecule.yml
index a228374c9..d7a842bde 100644
--- a/ansible/playbooks/molecule_ec2_local_inventories/molecule/default_ec2/molecule.yml
+++ b/ansible/playbooks/molecule_ec2_local_inventories/molecule/default_ec2/molecule.yml
@@ -1,7 +1,21 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
dependency:
name: shell
- command: bash -c "ansible-galaxy collection install amazon.aws ansible.netcommon:1.5.0 --force"
+ command: bash -c "wget -O /tmp/amazon-aws-6.5.0.tar.gz http://shadowrobot.aurora-host-packages.s3.eu-west-2.amazonaws.com/ansible_collections/amazon-aws-6.5.0.tar.gz && ansible-galaxy collection install /tmp/amazon-aws-6.5.0.tar.gz --force && ANSIBLE_GALAXY_SERVER=https://old-galaxy.ansible.com/ ansible-galaxy collection install ansible.netcommon:1.5.0 --force"
driver:
name: ec2
lint: |
diff --git a/ansible/playbooks/molecule_ec2_local_inventories/molecule/hand_e_empty_machine_docker_ec2/molecule.yml b/ansible/playbooks/molecule_ec2_local_inventories/molecule/hand_e_empty_machine_docker_ec2/molecule.yml
index bf561b66c..33969e226 100644
--- a/ansible/playbooks/molecule_ec2_local_inventories/molecule/hand_e_empty_machine_docker_ec2/molecule.yml
+++ b/ansible/playbooks/molecule_ec2_local_inventories/molecule/hand_e_empty_machine_docker_ec2/molecule.yml
@@ -1,7 +1,21 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
dependency:
name: shell
- command: bash -c "ansible-galaxy collection install amazon.aws ansible.netcommon:1.5.0 --force"
+ command: bash -c "wget -O /tmp/amazon-aws-6.5.0.tar.gz http://shadowrobot.aurora-host-packages.s3.eu-west-2.amazonaws.com/ansible_collections/amazon-aws-6.5.0.tar.gz && ansible-galaxy collection install /tmp/amazon-aws-6.5.0.tar.gz --force && ANSIBLE_GALAXY_SERVER=https://old-galaxy.ansible.com/ ansible-galaxy collection install ansible.netcommon:1.5.0 --force"
driver:
name: ec2
lint: |
diff --git a/ansible/playbooks/molecule_ec2_local_inventories/molecule/resources/ec2/create.yml b/ansible/playbooks/molecule_ec2_local_inventories/molecule/resources/ec2/create.yml
index deb08bf6b..aea4eb195 100644
--- a/ansible/playbooks/molecule_ec2_local_inventories/molecule/resources/ec2/create.yml
+++ b/ansible/playbooks/molecule_ec2_local_inventories/molecule/resources/ec2/create.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Create
hosts: localhost
diff --git a/ansible/playbooks/molecule_ec2_local_inventories/molecule/resources/ec2/destroy.yml b/ansible/playbooks/molecule_ec2_local_inventories/molecule/resources/ec2/destroy.yml
index b733c92a6..03f976e84 100644
--- a/ansible/playbooks/molecule_ec2_local_inventories/molecule/resources/ec2/destroy.yml
+++ b/ansible/playbooks/molecule_ec2_local_inventories/molecule/resources/ec2/destroy.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Destroy
hosts: localhost
diff --git a/ansible/playbooks/molecule_ec2_server_and_nuc/molecule/resources/ec2/create.yml b/ansible/playbooks/molecule_ec2_server_and_nuc/molecule/resources/ec2/create.yml
index deb08bf6b..aea4eb195 100644
--- a/ansible/playbooks/molecule_ec2_server_and_nuc/molecule/resources/ec2/create.yml
+++ b/ansible/playbooks/molecule_ec2_server_and_nuc/molecule/resources/ec2/create.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Create
hosts: localhost
diff --git a/ansible/playbooks/molecule_ec2_server_and_nuc/molecule/resources/ec2/destroy.yml b/ansible/playbooks/molecule_ec2_server_and_nuc/molecule/resources/ec2/destroy.yml
index b733c92a6..03f976e84 100644
--- a/ansible/playbooks/molecule_ec2_server_and_nuc/molecule/resources/ec2/destroy.yml
+++ b/ansible/playbooks/molecule_ec2_server_and_nuc/molecule/resources/ec2/destroy.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Destroy
hosts: localhost
diff --git a/ansible/playbooks/molecule_ec2_server_and_nuc/molecule/server_and_nuc_desktop_icons_docker_ec2/molecule.yml b/ansible/playbooks/molecule_ec2_server_and_nuc/molecule/server_and_nuc_desktop_icons_docker_ec2/molecule.yml
index 7e9bcd211..dc8fe77b6 100644
--- a/ansible/playbooks/molecule_ec2_server_and_nuc/molecule/server_and_nuc_desktop_icons_docker_ec2/molecule.yml
+++ b/ansible/playbooks/molecule_ec2_server_and_nuc/molecule/server_and_nuc_desktop_icons_docker_ec2/molecule.yml
@@ -1,7 +1,21 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
dependency:
name: shell
- command: bash -c "ansible-galaxy collection install amazon.aws ansible.netcommon:1.5.0 --force"
+ command: bash -c "wget -O /tmp/amazon-aws-6.5.0.tar.gz http://shadowrobot.aurora-host-packages.s3.eu-west-2.amazonaws.com/ansible_collections/amazon-aws-6.5.0.tar.gz && ansible-galaxy collection install /tmp/amazon-aws-6.5.0.tar.gz --force && ANSIBLE_GALAXY_SERVER=https://old-galaxy.ansible.com/ ansible-galaxy collection install ansible.netcommon:1.5.0 --force"
driver:
name: ec2
lint: |
diff --git a/ansible/playbooks/molecule_ec2_simulation/molecule/resources/ec2/create.yml b/ansible/playbooks/molecule_ec2_simulation/molecule/resources/ec2/create.yml
index deb08bf6b..aea4eb195 100644
--- a/ansible/playbooks/molecule_ec2_simulation/molecule/resources/ec2/create.yml
+++ b/ansible/playbooks/molecule_ec2_simulation/molecule/resources/ec2/create.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Create
hosts: localhost
diff --git a/ansible/playbooks/molecule_ec2_simulation/molecule/resources/ec2/destroy.yml b/ansible/playbooks/molecule_ec2_simulation/molecule/resources/ec2/destroy.yml
index b733c92a6..03f976e84 100644
--- a/ansible/playbooks/molecule_ec2_simulation/molecule/resources/ec2/destroy.yml
+++ b/ansible/playbooks/molecule_ec2_simulation/molecule/resources/ec2/destroy.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Destroy
hosts: localhost
diff --git a/ansible/playbooks/molecule_ec2_simulation/molecule/teleop_server_desktop_icons_simulation_haptx_ec2/molecule.yml b/ansible/playbooks/molecule_ec2_simulation/molecule/teleop_server_desktop_icons_simulation_haptx_ec2/molecule.yml
index 02395d994..b5e7a8abd 100644
--- a/ansible/playbooks/molecule_ec2_simulation/molecule/teleop_server_desktop_icons_simulation_haptx_ec2/molecule.yml
+++ b/ansible/playbooks/molecule_ec2_simulation/molecule/teleop_server_desktop_icons_simulation_haptx_ec2/molecule.yml
@@ -1,7 +1,21 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
dependency:
name: shell
- command: bash -c "ansible-galaxy collection install amazon.aws ansible.netcommon:1.5.0 --force"
+ command: bash -c "wget -O /tmp/amazon-aws-6.5.0.tar.gz http://shadowrobot.aurora-host-packages.s3.eu-west-2.amazonaws.com/ansible_collections/amazon-aws-6.5.0.tar.gz && ansible-galaxy collection install /tmp/amazon-aws-6.5.0.tar.gz --force && ANSIBLE_GALAXY_SERVER=https://old-galaxy.ansible.com/ ansible-galaxy collection install ansible.netcommon:1.5.0 --force"
driver:
name: ec2
lint: |
diff --git a/ansible/playbooks/molecule_ec2_teleop/molecule/resources/ec2/create.yml b/ansible/playbooks/molecule_ec2_teleop/molecule/resources/ec2/create.yml
index deb08bf6b..aea4eb195 100644
--- a/ansible/playbooks/molecule_ec2_teleop/molecule/resources/ec2/create.yml
+++ b/ansible/playbooks/molecule_ec2_teleop/molecule/resources/ec2/create.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Create
hosts: localhost
diff --git a/ansible/playbooks/molecule_ec2_teleop/molecule/resources/ec2/destroy.yml b/ansible/playbooks/molecule_ec2_teleop/molecule/resources/ec2/destroy.yml
index b733c92a6..03f976e84 100644
--- a/ansible/playbooks/molecule_ec2_teleop/molecule/resources/ec2/destroy.yml
+++ b/ansible/playbooks/molecule_ec2_teleop/molecule/resources/ec2/destroy.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Destroy
hosts: localhost
diff --git a/ansible/playbooks/molecule_ec2_teleop/molecule/teleop_server_check_desktop_icons_docker_ec2/molecule.yml b/ansible/playbooks/molecule_ec2_teleop/molecule/teleop_server_check_desktop_icons_docker_ec2/molecule.yml
index 6bf38b141..b36e397b6 100644
--- a/ansible/playbooks/molecule_ec2_teleop/molecule/teleop_server_check_desktop_icons_docker_ec2/molecule.yml
+++ b/ansible/playbooks/molecule_ec2_teleop/molecule/teleop_server_check_desktop_icons_docker_ec2/molecule.yml
@@ -1,7 +1,21 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
dependency:
name: shell
- command: bash -c "ansible-galaxy collection install amazon.aws ansible.netcommon:1.5.0 --force"
+ command: bash -c "wget -O /tmp/amazon-aws-6.5.0.tar.gz http://shadowrobot.aurora-host-packages.s3.eu-west-2.amazonaws.com/ansible_collections/amazon-aws-6.5.0.tar.gz && ansible-galaxy collection install /tmp/amazon-aws-6.5.0.tar.gz --force && ANSIBLE_GALAXY_SERVER=https://old-galaxy.ansible.com/ ansible-galaxy collection install ansible.netcommon:1.5.0 --force"
driver:
name: ec2
lint: |
diff --git a/ansible/playbooks/molecule_ec2_teleop/molecule/teleop_server_desktop_icons_haptx_bimanual_ec2/molecule.yml b/ansible/playbooks/molecule_ec2_teleop/molecule/teleop_server_desktop_icons_haptx_bimanual_ec2/molecule.yml
index ef56f82c4..8d5d37a5b 100644
--- a/ansible/playbooks/molecule_ec2_teleop/molecule/teleop_server_desktop_icons_haptx_bimanual_ec2/molecule.yml
+++ b/ansible/playbooks/molecule_ec2_teleop/molecule/teleop_server_desktop_icons_haptx_bimanual_ec2/molecule.yml
@@ -1,7 +1,21 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
dependency:
name: shell
- command: bash -c "ansible-galaxy collection install amazon.aws ansible.netcommon:1.5.0 --force"
+ command: bash -c "wget -O /tmp/amazon-aws-6.5.0.tar.gz http://shadowrobot.aurora-host-packages.s3.eu-west-2.amazonaws.com/ansible_collections/amazon-aws-6.5.0.tar.gz && ansible-galaxy collection install /tmp/amazon-aws-6.5.0.tar.gz --force && ANSIBLE_GALAXY_SERVER=https://old-galaxy.ansible.com/ ansible-galaxy collection install ansible.netcommon:1.5.0 --force"
driver:
name: ec2
lint: |
diff --git a/ansible/playbooks/server_and_nuc_deploy.yml b/ansible/playbooks/server_and_nuc_deploy.yml
index 5b4675d20..625bca1ae 100644
--- a/ansible/playbooks/server_and_nuc_deploy.yml
+++ b/ansible/playbooks/server_and_nuc_deploy.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Set server hostname variable and validate input variables
hosts: server
@@ -10,30 +24,25 @@
vars:
playbook: "server_and_nuc_deploy"
- - name: Install common tools
+ - name: Running playbook setup role
include_role:
- name: installation/install_common_tools
- when: skip_molecule_task is not defined
-
- - name: Install licence tools
- include_role:
- name: installation/install_licence_tools
- when: '"binary" in image'
+ name: installation/playbook_setup
+ when: not skip_molecule_task|bool
tasks:
- name: Extract hostname from server
set_fact:
ansible_host: "{{ ansible_hostname }}"
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
- name: Add IP address of all hosts to computer that is running Ansible
hosts: server
connection: local
gather_facts: yes
tasks:
- - name: Install common tools
+ - name: Running playbook setup role
include_role:
- name: installation/install_common_tools
- when: skip_molecule_task is not defined
+ name: installation/playbook_setup
+ when: not skip_molecule_task|bool
- name: Add lines in /etc/hosts in computer that is running Ansible
blockinfile:
@@ -68,9 +77,22 @@
ping:
become: yes
+- name: Doing Control Machine pre-checks
+ hosts: control_machine
+ pre_tasks:
+ - name: Running nuc-pre-check role
+ include_role:
+ name: installation/nuc-pre-check
+ when: not skip_molecule_task|bool
+
- name: Install Hand software on Ubuntu server laptop
hosts: server
pre_tasks:
+ - name: Install licence tools
+ include_role:
+ name: installation/install_licence_tools
+ when: '"binary" in image'
+
- name: check if customer_key is provided and not false
when: customer_key is defined and customer_key | length > 0
set_fact:
@@ -108,6 +130,11 @@
when: customer_key is defined and customer_key | length > 0
set_fact:
use_aws: true
+
+ - name: Running playbook setup role
+ include_role:
+ name: installation/playbook_setup
+ when: not skip_molecule_task|bool
- name: Set container name for hand and arm
when: "'arm_' in product"
@@ -132,14 +159,3 @@
roles:
- { role: products/common/get-system-variables }
- { role: products/hand-e/control_machine/deploy }
-
-- name: Inform user for reboot
- hosts: 127.0.0.1
- gather_facts: no
- tasks:
- - name: Reboot message
- debug:
- msg:
- - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
- - "!!! Please restart the server laptop and re-run this script to finalize the installation. Ignore if you have already done this !!!"
- - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
diff --git a/ansible/playbooks/teleop_deploy.yml b/ansible/playbooks/teleop_deploy.yml
index 5c686aa77..b15c4ac1c 100644
--- a/ansible/playbooks/teleop_deploy.yml
+++ b/ansible/playbooks/teleop_deploy.yml
@@ -1,34 +1,41 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
+- name: Install Python 3
+ import_playbook: ./install_python3.yml
+
- name: Set server hostname variable and validate input variables
hosts: server
connection: local
gather_facts: yes
pre_tasks:
- - name: Unset arm_servo if haptx
- when: "'haptx' in image"
- set_fact:
- arm_servo: false
-
- name: include products/common/validation role
include_role:
name: products/common/validation
vars:
playbook: "teleop_deploy"
- - name: Install common tools
+ - name: Running playbook setup role
include_role:
- name: installation/install_common_tools
- when: skip_molecule_task is not defined
-
- - name: Install licence tools
- include_role:
- name: installation/install_licence_tools
- when: '"binary" in image'
+ name: installation/playbook_setup
+ when: not skip_molecule_task|bool
tasks:
- name: Extract hostname from server
set_fact:
ansible_host: "{{ ansible_hostname }}"
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
- name: Add IP address of all hosts to computer that is running Ansible
hosts: server
@@ -57,9 +64,6 @@
when: hostvars[item].ansible_host is defined
with_items: "{{ groups.all | difference([inventory_hostname]) }}"
-- name: Install Python 3
- import_playbook: ./install_python3.yml
-
- name: Check which hosts are available for teleop system Install
hosts: all
gather_facts: no
@@ -68,13 +72,40 @@
ping:
become: yes
+- name: Doing Control Machine pre-checks
+ hosts: control_machine
+ pre_tasks:
+ - name: Running nuc-pre-check role
+ include_role:
+ name: installation/nuc-pre-check
+ when: not skip_molecule_task|bool
+
- name: Install Teleop software on Ubuntu teleop server laptop
hosts: server
pre_tasks:
+ - name: Install licence tools
+ include_role:
+ name: installation/install_licence_tools
+ when: '"binary" in image'
+
- name: check if customer_key is provided
when: customer_key is defined and customer_key | length > 0
set_fact:
use_aws: true
+
+ - name: Set container name (Shadow Teleop System)
+ set_fact:
+ container_name: "shadow_teleoperation_system"
+ when:
+ - container_name == "shadow_teleop"
+ - glove == "shadow_glove"
+
+ - name: Set container name (Tactile Telerobot System)
+ set_fact:
+ container_name: "tactile_telerobot_system"
+ when:
+ - container_name == "shadow_teleop"
+ - glove == "haptx"
- name: Add IP address of all hosts to all hosts
lineinfile:
@@ -94,16 +125,25 @@
- name: Install Teleop simulation software on Ubuntu teleop server laptop
hosts: simulation
pre_tasks:
- - name: Unset arm_servo if haptx
- when: "'haptx' in image"
- set_fact:
- arm_servo: false
-
- - name: Install common tools
+ - name: Running playbook setup role
include_role:
- name: installation/install_common_tools
- when: skip_molecule_task is not defined
+ name: installation/playbook_setup
+ when: not skip_molecule_task|bool
+ - name: Set container name (Shadow Teleop System)
+ set_fact:
+ container_name: "shadow_teleoperation_system"
+ when:
+ - container_name == "shadow_teleop"
+ - glove == "shadow_glove"
+
+ - name: Set container name (Tactile Telerobot System)
+ set_fact:
+ container_name: "tactile_telerobot_system"
+ when:
+ - container_name == "shadow_teleop"
+ - glove == "haptx"
+
- name: Install licence tools
include_role:
name: installation/install_licence_tools
@@ -122,10 +162,24 @@
- name: Install Teleop software on control machine
hosts: control_machine
pre_tasks:
- - name: Install common tools
+ - name: Running playbook setup role
include_role:
- name: installation/install_common_tools
- when: skip_molecule_task is not defined
+ name: installation/playbook_setup
+ when: not skip_molecule_task|bool
+
+ - name: Set container name (Shadow Teleop System)
+ set_fact:
+ container_name: "shadow_teleoperation_system"
+ when:
+ - container_name == "shadow_teleop"
+ - glove == "shadow_glove"
+
+ - name: Set container name (Tactile Telerobot System)
+ set_fact:
+ container_name: "tactile_telerobot_system"
+ when:
+ - container_name == "shadow_teleop"
+ - glove == "haptx"
- name: Add IP address of all hosts to all hosts
lineinfile:
@@ -140,14 +194,3 @@
roles:
- { role: products/common/get-system-variables }
- { role: products/teleop/control_machine/deploy }
-
-- name: Inform user for reboot
- hosts: 127.0.0.1
- gather_facts: no
- tasks:
- - name: Reboot message
- debug:
- msg:
- - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
- - "!!! Please restart the server laptop and re-run this script to finalize the installation. Ignore if you have already done this !!!"
- - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
diff --git a/ansible/roles/docker/aws/defaults/main.yml b/ansible/roles/docker/aws/defaults/main.yml
index 1174244f0..1ba4f151f 100644
--- a/ansible/roles/docker/aws/defaults/main.yml
+++ b/ansible/roles/docker/aws/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
use_aws: false
user: "{{ ansible_user_id }}"
diff --git a/ansible/roles/docker/aws/files/shadow-upload.sh b/ansible/roles/docker/aws/files/shadow-upload.sh
index 233c81cd5..362203fa8 100644
--- a/ansible/roles/docker/aws/files/shadow-upload.sh
+++ b/ansible/roles/docker/aws/files/shadow-upload.sh
@@ -1,5 +1,19 @@
#!/bin/bash
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
# set -o xtrace
#this zips the contents of the given folder and uploads it to AWS, using the customer_key installed by oneliner inside the docker container
diff --git a/ansible/roles/docker/aws/meta/main.yml b/ansible/roles/docker/aws/meta/main.yml
deleted file mode 100644
index e3998e400..000000000
--- a/ansible/roles/docker/aws/meta/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-dependencies:
- - role: "{{'installation/aws-cli-v2' if skip_molecule_task is not defined }}"
diff --git a/ansible/roles/docker/aws/tasks/main.yml b/ansible/roles/docker/aws/tasks/main.yml
index fa26c5438..fcdde29b0 100644
--- a/ansible/roles/docker/aws/tasks/main.yml
+++ b/ansible/roles/docker/aws/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Make sure shadow-upload.sh exists locally
copy:
diff --git a/ansible/roles/docker/docker-image/defaults/main.yml b/ansible/roles/docker/docker-image/defaults/main.yml
index 8a5c55a39..a17683022 100644
--- a/ansible/roles/docker/docker-image/defaults/main.yml
+++ b/ansible/roles/docker/docker-image/defaults/main.yml
@@ -1,6 +1,20 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
container_name: "dexterous_hand"
image: "public.ecr.aws/shadowrobot/dexterous-hand"
-tag: "noetic-release"
+tag: "noetic-v1.0.21"
skip_nvidia: false
local_image: false
diff --git a/ansible/roles/docker/docker-image/meta/requirements.yml b/ansible/roles/docker/docker-image/meta/requirements.yml
index d1a468553..8f6a92c0a 100644
--- a/ansible/roles/docker/docker-image/meta/requirements.yml
+++ b/ansible/roles/docker/docker-image/meta/requirements.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
collections:
- community.docker
diff --git a/ansible/roles/docker/docker-image/tasks/main.yml b/ansible/roles/docker/docker-image/tasks/main.yml
index 539b8f38a..defa7bfc5 100644
--- a/ansible/roles/docker/docker-image/tasks/main.yml
+++ b/ansible/roles/docker/docker-image/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Set docker full image name
@@ -16,7 +30,7 @@
when:
- '"dkr.ecr" in image or "public.ecr" in image'
- customer_key is defined
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
- name: Login to AWS for ECR
include_role:
diff --git a/ansible/roles/docker/ecr/files/decode.py b/ansible/roles/docker/ecr/files/decode.py
index 555327097..807563cef 100755
--- a/ansible/roles/docker/ecr/files/decode.py
+++ b/ansible/roles/docker/ecr/files/decode.py
@@ -14,29 +14,29 @@
# You should have received a copy of the GNU General Public License along
# with this program. If not, see .
+import argparse
from base64 import b64encode
from cryptography.fernet import Fernet
-import argparse
def gather_args():
description = 'Decode AWS Login for Docker Login.'
parser = argparse.ArgumentParser(description=description)
- help = "This is the access key which needs to be decoded."
- parser.add_argument('--access_key', '-a', type=str, required=True, help=help)
- help = "This is the secret key which needs to be decoded."
- parser.add_argument('--secret_key', '-s', type=str, required=True, help=help)
- help = "This is the Customer Key."
- parser.add_argument('--customer_key', '-c', type=str, required=True, help=help)
+ help_str = "This is the access key which needs to be decoded."
+ parser.add_argument('--access_key', '-a', type=str, required=True, help=help_str)
+ help_str = "This is the secret key which needs to be decoded."
+ parser.add_argument('--secret_key', '-s', type=str, required=True, help=help_str)
+ help_str = "This is the Customer Key."
+ parser.add_argument('--customer_key', '-c', type=str, required=True, help=help_str)
args = parser.parse_args()
return args.access_key, args.secret_key, args.customer_key
def main():
- ak, sk, ck = gather_args()
- ck_encode = b64encode(ck.encode(encoding='UTF-8')[:32])
+ access_key, secret_key, customer_key = gather_args()
+ ck_encode = b64encode(customer_key.encode(encoding='UTF-8')[:32])
cipher_suite = Fernet(ck_encode)
- decrypt_ak = cipher_suite.decrypt(ak.encode(encoding='UTF-8'))
- decrypt_sk = cipher_suite.decrypt(sk.encode(encoding='UTF-8'))
+ decrypt_ak = cipher_suite.decrypt(access_key.encode(encoding='UTF-8'))
+ decrypt_sk = cipher_suite.decrypt(secret_key.encode(encoding='UTF-8'))
decode_ak = decrypt_ak.decode(encoding="UTF-8")
decode_sk = decrypt_sk.decode(encoding="UTF-8")
details = {"access_key": decode_ak, "secret_key": decode_sk}
diff --git a/ansible/roles/docker/ecr/files/requirements.txt b/ansible/roles/docker/ecr/files/requirements.txt
new file mode 100755
index 000000000..13ce87896
--- /dev/null
+++ b/ansible/roles/docker/ecr/files/requirements.txt
@@ -0,0 +1,2 @@
+argparse>=1.4.0
+cryptography>=3.4.8
diff --git a/ansible/roles/docker/ecr/tasks/main.yml b/ansible/roles/docker/ecr/tasks/main.yml
index 0e605c6c2..e90454213 100644
--- a/ansible/roles/docker/ecr/tasks/main.yml
+++ b/ansible/roles/docker/ecr/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Does .aws folder exist
stat: path={{ user_folder }}/.aws
@@ -62,35 +76,118 @@
x-api-key: "{{ customer_key }}"
no_log: True
register: request_result
+ retries: 3
+ delay: 3
+ until: request_result.json.body is defined
- name: Local Decryption
block:
+ - name: Install Python dependencies (in conda)
+ pip:
+ executable: "{{ ansible_pip3_executable }}"
+ requirements: "{{ role_path }}/files/requirements.txt"
+ when:
+ - '"conda" in ansible_pip3_executable'
+ - inventory_hostname not in groups['control_machine'] | default([])
+
+ # If we are not installing in a conda environment, we need sudo privileges
+ - name: Install Python dependencies (not in conda)
+ pip:
+ executable: "{{ ansible_pip3_executable }}"
+ requirements: "{{ role_path }}/files/requirements.txt"
+ when:
+ - '"conda" not in ansible_pip3_executable'
+ - inventory_hostname not in groups['control_machine'] | default([])
+ become: true
+
- name: Decrypt results
- command: "python3 {{ role_path }}/files/decode.py -a {{ request_result.json.body.access_key }} -s {{ request_result.json.body.secret_key }} -c {{ customer_key }}"
+ command: "{{ ansible_python_interpreter }} {{ role_path }}/files/decode.py -a {{ request_result.json.body.access_key }} -s {{ request_result.json.body.secret_key }} -c {{ customer_key }}"
no_log: True
register: decrypt_results
+ when: inventory_hostname not in groups['control_machine'] | default([])
- name: Convert stdout to json
set_fact: json_results={{ decrypt_results.stdout | to_json | from_json }}
no_log: True
-
- when: inventory_hostname not in groups['control_machine'] | default([])
+ when: inventory_hostname not in groups['control_machine'] | default([])
- name: Decode message on NUC
block:
- name: Gather decrypt script
command: "wget https://raw.githubusercontent.com/shadow-robot/aurora/master/ansible/roles/docker/ecr/files/decode.py -O /tmp/decode.py"
+ when: groups['control_machine'] is defined and inventory_hostname in groups['control_machine'] | default([])
+
+ - name: Gather requirments script
+ command: "wget https://raw.githubusercontent.com/shadow-robot/aurora/master/ansible/roles/docker/ecr/files/requirements.txt -O /tmp/requirements.txt"
+ when: groups['control_machine'] is defined and inventory_hostname in groups['control_machine'] | default([])
+
+ - name: Install Python dependencies (in conda)
+ pip:
+ executable: "{{ ansible_pip3_executable }}"
+ requirements: "/tmp/requirements.txt"
+ when:
+ - '"conda" in ansible_pip3_executable'
+ - groups['control_machine'] is defined and inventory_hostname in groups['control_machine'] | default([])
+
+ # If we are not installing in a conda environment, we need sudo privileges
+ - name: Install Python dependencies (not in conda)
+ block:
+ - name: Install Python dependencies (not in conda)
+ pip:
+ executable: "{{ ansible_pip3_executable }}"
+ requirements: "/tmp/requirements.txt"
+ when:
+ - '"conda" not in ansible_pip3_executable'
+ - groups['control_machine'] is defined and inventory_hostname in groups['control_machine'] | default([])
+ become: true
+ rescue:
+ # Package python3-openssl comes preinstalled in ubuntu server (together with two packages that depend on it landscape-common and python3-twisted).
+ # It depends on the cryptography package, and the problem is that the cryptography package is installed with both pip3 and apt.
+ # But the version installed with pip is found first in the python path. And the pip version of cryptography is incompatible with the openssl version installed with apt,
+ # which oddly enough throws this error just by trying to do anything with pip. So we're removing the conflicting package.
+ # And we do it with a raw command because the apt module doesn't work because it tries to use the openssl library from the host.
+ - name: Fix pip3 cryptography issue
+ raw: 'apt-get -y update && apt-get purge -y python3-openssl'
+ register: output
+ when:
+ - ansible_failed_result.msg | regex_search("module 'lib' has no attribute 'X509_V_FLAG_.*")
+ become: yes
+
+ - name: Re-try install Python dependencies (not in conda)
+ pip:
+ executable: "{{ ansible_pip3_executable }}"
+ requirements: "/tmp/requirements.txt"
+ when:
+ - '"conda" not in ansible_pip3_executable'
+ - groups['control_machine'] is defined and inventory_hostname in groups['control_machine'] | default([])
+ become: true
- name: Run decrypt script
command: "python3 /tmp/decode.py -a {{ request_result.json.body.access_key }} -s {{ request_result.json.body.secret_key }} -c {{ customer_key }}"
no_log: True
register: decrypt_results_nuc
+ when: groups['control_machine'] is defined and inventory_hostname in groups['control_machine'] | default([])
- name: Convert stdout to json
set_fact: json_results={{ decrypt_results_nuc.stdout | to_json | from_json }}
no_log: True
-
- when: groups['control_machine'] is defined and inventory_hostname in groups['control_machine'] | default([])
+ when: groups['control_machine'] is defined and inventory_hostname in groups['control_machine'] | default([])
+
+ - name: Install pexpect (in conda)
+ pip:
+ executable: "{{ ansible_pip3_executable }}"
+ name: [ "pexpect" ]
+ state: present
+ when: '"conda" in ansible_pip3_executable'
+
+ # If we are not installing in a conda environment, we need sudo privileges
+ - name: Install pexpect (not in conda)
+ pip:
+ executable: "{{ ansible_pip3_executable }}"
+ name: [ "pexpect" ]
+ state: present
+ when: '"conda" not in ansible_pip3_executable'
+ become: true
- name: Configure AWS CLI
expect:
@@ -127,12 +224,9 @@
path: "{{ user_folder }}/.aws_copy"
when: aws_folder.stat.isdir is defined and aws_folder.stat.isdir
- - name: Failure message
- debug:
- msg: Playbook ended because of an error when connecting to AWS.
-
- - name: End Playbook
- meta: end_play
+ - name: Error connecting to AWS
+ fail:
+ msg: "Playbook ended because of an error when connecting to AWS. Please check your customer key is correct and rerun the oneliner. If the oneliner is correct and you are still getting errors please contact support@shadowrobot.com"
- name: Remove .aws folder
file:
diff --git a/ansible/roles/docker/setup-ui/defaults/main.yml b/ansible/roles/docker/setup-ui/defaults/main.yml
index e77d4b1f7..ada160ae7 100644
--- a/ansible/roles/docker/setup-ui/defaults/main.yml
+++ b/ansible/roles/docker/setup-ui/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
# Defaults fpr user and UI setup for docker container
diff --git a/ansible/roles/docker/setup-ui/files/git_completion.sh b/ansible/roles/docker/setup-ui/files/git_completion.sh
index 72bb9d21f..3c4f16df2 100644
--- a/ansible/roles/docker/setup-ui/files/git_completion.sh
+++ b/ansible/roles/docker/setup-ui/files/git_completion.sh
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
# Print nickname for git/hg/bzr/svn version control in CWD
# Optional $1 of format string for printf, default "(%s) "
if [ -f /etc/bash_completion.d/git ]; then
diff --git a/ansible/roles/docker/setup-ui/tasks/main.yml b/ansible/roles/docker/setup-ui/tasks/main.yml
index c5644c0b6..2e70dc863 100644
--- a/ansible/roles/docker/setup-ui/tasks/main.yml
+++ b/ansible/roles/docker/setup-ui/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Update package lists
apt:
diff --git a/ansible/roles/installation/aws-cli-v2/tasks/main.yml b/ansible/roles/installation/aws-cli-v2/tasks/main.yml
index 1566af6f2..cf4fed81f 100644
--- a/ansible/roles/installation/aws-cli-v2/tasks/main.yml
+++ b/ansible/roles/installation/aws-cli-v2/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Check for AWS CLI v1
shell: "$(which aws)"
diff --git a/ansible/roles/installation/chrome/tasks/main.yml b/ansible/roles/installation/chrome/tasks/main.yml
index b8ab1045c..297647bfb 100644
--- a/ansible/roles/installation/chrome/tasks/main.yml
+++ b/ansible/roles/installation/chrome/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Download google-chrome-stable latest version
become: yes
diff --git a/ansible/roles/installation/chrony-client/defaults/main.yml b/ansible/roles/installation/chrony-client/defaults/main.yml
index 55743c36f..b4162fbf5 100644
--- a/ansible/roles/installation/chrony-client/defaults/main.yml
+++ b/ansible/roles/installation/chrony-client/defaults/main.yml
@@ -1,2 +1,16 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
chrony_server_ip: "10.9.10.1"
diff --git a/ansible/roles/installation/chrony-client/tasks/main.yml b/ansible/roles/installation/chrony-client/tasks/main.yml
index 70a925b7c..73e5211b0 100644
--- a/ansible/roles/installation/chrony-client/tasks/main.yml
+++ b/ansible/roles/installation/chrony-client/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Install chrony
apt:
diff --git a/ansible/roles/installation/chrony-server/defaults/main.yml b/ansible/roles/installation/chrony-server/defaults/main.yml
index e65fafbeb..f07440f7d 100644
--- a/ansible/roles/installation/chrony-server/defaults/main.yml
+++ b/ansible/roles/installation/chrony-server/defaults/main.yml
@@ -1,2 +1,16 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
chrony_allowed_network: "0/0"
diff --git a/ansible/roles/installation/chrony-server/tasks/main.yml b/ansible/roles/installation/chrony-server/tasks/main.yml
index 160f367e6..ea3ee0cdc 100644
--- a/ansible/roles/installation/chrony-server/tasks/main.yml
+++ b/ansible/roles/installation/chrony-server/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Install chrony
apt:
diff --git a/ansible/roles/installation/dhcp/defaults/main.yml b/ansible/roles/installation/dhcp/defaults/main.yml
index f484ffb52..ecd734b88 100644
--- a/ansible/roles/installation/dhcp/defaults/main.yml
+++ b/ansible/roles/installation/dhcp/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
dhcp_interface_name: "eth0"
server_ip: "10.9.11.1"
diff --git a/ansible/roles/installation/dhcp/tasks/main.yml b/ansible/roles/installation/dhcp/tasks/main.yml
index 64a29a07a..1bcd7a9fc 100644
--- a/ansible/roles/installation/dhcp/tasks/main.yml
+++ b/ansible/roles/installation/dhcp/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Include installation/net-tools role
include_role:
diff --git a/ansible/roles/installation/docker/defaults/main.yml b/ansible/roles/installation/docker/defaults/main.yml
index 534ec9dcd..05900f21e 100644
--- a/ansible/roles/installation/docker/defaults/main.yml
+++ b/ansible/roles/installation/docker/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
docker_apt_repository: 'deb [arch=amd64] https://download.docker.com/linux/ubuntu/ {{ ansible_distribution_release }} stable'
allow_auto_reboot: false
diff --git a/ansible/roles/installation/docker/tasks/install.yml b/ansible/roles/installation/docker/tasks/install.yml
index bb344a99d..0016f75e9 100644
--- a/ansible/roles/installation/docker/tasks/install.yml
+++ b/ansible/roles/installation/docker/tasks/install.yml
@@ -1,5 +1,18 @@
----
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+---
- name: Install Docker dependencies
apt:
name: "{{ packages }}"
@@ -32,6 +45,12 @@
- docker-ce-cli
- containerd.io
+- name: Add users to docker group
+ user:
+ name: "{{ user }}"
+ groups: 'docker'
+ append: 'yes'
+
- name: Enable Docker systemd service
service:
name: 'docker'
@@ -39,15 +58,13 @@
enabled: 'yes'
ignore_errors: yes
-- name: Add users to docker group
- user:
- name: "{{ user }}"
- groups: 'docker'
- append: 'yes'
-
-- name: Docker installation finished
- debug:
- msg: "Installation of Docker is finished. Please restart you computer and run the same installation tool again"
+- name: Set permissions for docker.sock
+ file:
+ path: /var/run/docker.sock
+ owner: root
+ group: docker
+ mode: '0660'
+ ignore_errors: yes
- name: Rebooting computer to finish Docker installation
when: allow_auto_reboot|bool
@@ -61,6 +78,9 @@
delay: '10'
timeout: '300'
-- name: Finishing Docker installation
- when: not allow_auto_reboot|bool
- meta: end_play
+- name: End playbook so user can reboot
+ fail:
+ msg: "Docker has been installed. Please reboot your device and run the same oneliner to complete installation"
+ when:
+ - not allow_auto_reboot|bool
+ - not skip_molecule_task|bool
diff --git a/ansible/roles/installation/docker/tasks/main.yml b/ansible/roles/installation/docker/tasks/main.yml
index 5bfd23323..67a2ed528 100644
--- a/ansible/roles/installation/docker/tasks/main.yml
+++ b/ansible/roles/installation/docker/tasks/main.yml
@@ -1,23 +1,50 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Check pip3 installed (will prevent reinstallation in case if pip3 was installed without Apt)
- command: pip3 --version
+ command: "{{ ansible_pip3_executable }} --version"
register: pip_status
ignore_errors: yes
changed_when: pip_status.rc != 0
-- name: Make sure python3-pip is present (if run-ansible.sh was not run locally)
- apt:
- name: 'python3-pip'
- state: 'present'
- update_cache: yes
- when: pip_status.rc != 0
- become: yes
+# - name: Make sure python3-pip is present (if run-ansible.sh was not run locally)
+# apt:
+# name: 'python3-pip'
+# state: 'present'
+# update_cache: yes
+# when: pip_status.rc != 0
+# become: yes
-- name: Install Docker pip module (and up to date versions of chardet and urllib3)
+- name: Install Docker pip module (and up to date versions of chardet and urllib3) (in conda)
pip:
+ executable: "{{ ansible_pip3_executable }}"
name: [ "docker >=4.4.1" ]
state: present
- become: yes
+ when: '"conda" in ansible_pip3_executable'
+ changed_when: pip_status.rc != 0
+ # Hack because of not idempotent behavior of pip module
+ # Check this issue for details https://github.com/ansible/ansible/issues/28952
+
+# If we are not installing in a conda environment, we need sudo privileges
+- name: Install Docker pip module (and up to date versions of chardet and urllib3) (not in conda)
+ pip:
+ executable: "{{ ansible_pip3_executable }}"
+ name: [ "docker >=4.4.1" ]
+ state: present
+ when: '"conda" not in ansible_pip3_executable'
+ become: true
changed_when: pip_status.rc != 0
# Hack because of not idempotent behavior of pip module
# Check this issue for details https://github.com/ansible/ansible/issues/28952
diff --git a/ansible/roles/installation/install_common_tools/tasks/main.yml b/ansible/roles/installation/install_common_tools/tasks/main.yml
deleted file mode 100644
index 01b75a62c..000000000
--- a/ansible/roles/installation/install_common_tools/tasks/main.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-- name: Install common tools
- apt:
- name: "{{ packages }}"
- state: present
- force_apt_get: yes
- become: yes
- vars:
- packages:
- - htop
- - nano
- - net-tools
diff --git a/ansible/roles/installation/install_licence_tools/tasks/main.yml b/ansible/roles/installation/install_licence_tools/tasks/main.yml
index 6ee3298cc..8bd23d35d 100644
--- a/ansible/roles/installation/install_licence_tools/tasks/main.yml
+++ b/ansible/roles/installation/install_licence_tools/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
- name: Add Yubico apt repositroy
apt_repository:
repo: ppa:yubico/stable
@@ -14,8 +28,18 @@
packages:
- yubikey-personalization
-- name: Install common python packages
+- name: Install common python packages (in conda)
pip:
+ executable: "{{ ansible_pip3_executable }}"
name: python-yubico==1.3.3
state: present
- become: yes
+ when: '"conda" in ansible_pip3_executable'
+
+# If we are not installing in a conda environment, we need sudo privileges
+- name: Install common python packages (not in conda)
+ pip:
+ executable: "{{ ansible_pip3_executable }}"
+ name: python-yubico==1.3.3
+ state: present
+ when: '"conda" not in ansible_pip3_executable'
+ become: true
diff --git a/ansible/roles/installation/libglvnd/defaults/main.yml b/ansible/roles/installation/libglvnd/defaults/main.yml
index bba6dc668..541c935af 100644
--- a/ansible/roles/installation/libglvnd/defaults/main.yml
+++ b/ansible/roles/installation/libglvnd/defaults/main.yml
@@ -1,2 +1,16 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
libglvnd_version: v1.2.0
diff --git a/ansible/roles/installation/libglvnd/tasks/main.yml b/ansible/roles/installation/libglvnd/tasks/main.yml
index 382a8e909..65791b8c3 100644
--- a/ansible/roles/installation/libglvnd/tasks/main.yml
+++ b/ansible/roles/installation/libglvnd/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Update package lists
apt:
diff --git a/ansible/roles/installation/lxml/tasks/main.yml b/ansible/roles/installation/lxml/tasks/main.yml
index 2863d0d00..701ce6def 100644
--- a/ansible/roles/installation/lxml/tasks/main.yml
+++ b/ansible/roles/installation/lxml/tasks/main.yml
@@ -1,23 +1,52 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Check pip3 installed (will prevent reinstallation in case if pip3 was installed without Apt)
- command: pip3 --version
+ command: "{{ ansible_pip3_executable }} --version"
register: pip_status
ignore_errors: yes
changed_when: pip_status.rc != 0
-- name: Make sure python3-pip is present (if run-ansible.sh was not run locally)
- apt:
- name: 'python3-pip'
- state: 'present'
- update_cache: yes
- when: pip_status.rc != 0
- become: yes
+# - name: Make sure python3-pip is present (if run-ansible.sh was not run locally)
+# apt:
+# name: 'python3-pip'
+# state: 'present'
+# update_cache: yes
+# when: pip_status.rc != 0
+# become: yes
+
+- name: Install lxml pip module (in conda)
+ pip:
+ executable: "{{ ansible_pip3_executable }}"
+ name: lxml
+ state: present
+ version: 4.8.0
+ when: '"conda" in ansible_pip3_executable'
+ changed_when: pip_status.rc != 0
+ # Hack because of not idempotent behavior of pip module
+ # Check this issue for details https://github.com/ansible/ansible/issues/28952
-- name: Install lxml pip module
+# If we are not installing in a conda environment, we need sudo privileges
+- name: Install lxml pip module (not in conda)
pip:
+ executable: "{{ ansible_pip3_executable }}"
name: lxml
state: present
- become: yes
+ version: 4.8.0
+ when: '"conda" not in ansible_pip3_executable'
+ become: true
changed_when: pip_status.rc != 0
# Hack because of not idempotent behavior of pip module
# Check this issue for details https://github.com/ansible/ansible/issues/28952
diff --git a/ansible/roles/installation/mongodb/tasks/main.yml b/ansible/roles/installation/mongodb/tasks/main.yml
index 18fdae581..403f0df98 100644
--- a/ansible/roles/installation/mongodb/tasks/main.yml
+++ b/ansible/roles/installation/mongodb/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
# mongodb installation (noetic)
diff --git a/ansible/roles/installation/mplabx/tasks/main.yml b/ansible/roles/installation/mplabx/tasks/main.yml
index 857ae71e6..a5b2c63f0 100644
--- a/ansible/roles/installation/mplabx/tasks/main.yml
+++ b/ansible/roles/installation/mplabx/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Download MPLabX installer
become: yes
diff --git a/ansible/roles/installation/net-tools/tasks/main.yml b/ansible/roles/installation/net-tools/tasks/main.yml
index 0e1e37925..e4628f288 100644
--- a/ansible/roles/installation/net-tools/tasks/main.yml
+++ b/ansible/roles/installation/net-tools/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Make sure net-tools are available (arp, ifconfig, netstat, rarp, nameif, route)
apt:
diff --git a/ansible/roles/installation/nuc-pre-check/tasks/main.yml b/ansible/roles/installation/nuc-pre-check/tasks/main.yml
new file mode 100644
index 000000000..a81757784
--- /dev/null
+++ b/ansible/roles/installation/nuc-pre-check/tasks/main.yml
@@ -0,0 +1,23 @@
+# Copyright 2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+---
+- name: Check if Intel Turbo Boost is enabled
+ set_fact:
+ boost_check: "{{ lookup('file', '/sys/devices/system/cpu/intel_pstate/no_turbo') | int }}"
+
+- name: Fail if Intel Turbo Boost is disabled on control_machine
+ fail:
+ msg: "Intel Turbo Boost is not enabled on this machine. Please go into the BIOS and enable it."
+ when: "{{ boost_check }} != 0"
diff --git a/ansible/roles/installation/nvidia-docker/defaults/main.yml b/ansible/roles/installation/nvidia-docker/defaults/main.yml
index 98992626d..9f3b616e7 100644
--- a/ansible/roles/installation/nvidia-docker/defaults/main.yml
+++ b/ansible/roles/installation/nvidia-docker/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
ubuntu_version: "18.04"
skip_nvidia: false
diff --git a/ansible/roles/installation/nvidia-docker/tasks/main.yml b/ansible/roles/installation/nvidia-docker/tasks/main.yml
index 3051a5407..e9959df87 100644
--- a/ansible/roles/installation/nvidia-docker/tasks/main.yml
+++ b/ansible/roles/installation/nvidia-docker/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: remove nvidia-docker1 and nvidia-docker2 before installing nvidia-container-toolkit
apt:
@@ -14,3 +28,58 @@
when: nvidia_docker | bool and not skip_nvidia|bool
become: yes
changed_when: false
+
+- name: Check what graphic drivers are used
+ block:
+ - name: install nvidia-prime apt
+ apt:
+ name: nvidia-prime
+ state: present
+ become: yes
+
+ - name: Query and set prime-select
+ block:
+ - name: query prime-select
+ command: prime-select query
+ become: yes
+ register: prime_select_results
+
+ - name: switch driver to nvidia
+ command: prime-select nvidia
+ become: yes
+ when: "prime_select_results.stdout != 'nvidia'"
+
+ - name: query prime-select again, check it's been set
+ command: prime-select query
+ become: yes
+ register: prime_select_results
+
+ - name: Check if nvidia-smi is installed
+ stat:
+ path: /usr/bin/nvidia-smi
+ register: nvidia_smi_installed
+
+ - name: Graphics Error Message
+ fail:
+ msg: "Nvidia Graphics card error: If the machine you are running the oneliner on doesn't have a Nvidia graphics card please add `nvidia_docker=false` to the oneliner and rerun."
+ ignore_errors: True
+ when: "not nvidia_smi_installed.stat.exists or prime_select_results.stdout != 'nvidia'"
+
+ - name: Prime select error message
+ fail:
+ msg: "Your prime-select graphic driver has been switched to Nvidia from {{ prime_select_results.stdout }}."
+ ignore_errors: True
+ when: "prime_select_results.stdout != 'nvidia'"
+
+ - name: No Nvidia driver detected error message
+ fail:
+ msg: "Your computer is not using a Nvidia driver, please change it in the application Additional Drivers."
+ ignore_errors: True
+ when: not nvidia_smi_installed.stat.exists
+
+ - name: Error message to alert of problems
+ fail:
+ msg: "The error conditions were met. See the debug output above for more details."
+ when: "not nvidia_smi_installed.stat.exists or prime_select_results.stdout != 'nvidia'"
+
+ when: nvidia_docker | bool and not skip_nvidia|bool
diff --git a/ansible/roles/installation/nvidia-docker/tasks/nvidia-container-toolkit.yml b/ansible/roles/installation/nvidia-docker/tasks/nvidia-container-toolkit.yml
index b0384aa21..c74fb4f4d 100644
--- a/ansible/roles/installation/nvidia-docker/tasks/nvidia-container-toolkit.yml
+++ b/ansible/roles/installation/nvidia-docker/tasks/nvidia-container-toolkit.yml
@@ -1,49 +1,45 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Installing nvidia-modprobe
apt:
name: nvidia-modprobe
state: present
-- name: Install nvidia-docker gpg key
- apt_key:
- url: https://nvidia.github.io/nvidia-docker/gpgkey
- state: present
-
-- name: Set ubuntu_version to 18.04 for nvidia-container-toolkit install
- set_fact:
- ubuntu_version: "18.04"
- when:
- - ansible_distribution|string == 'Ubuntu'
- - ansible_distribution_release|string == 'bionic'
-
-- name: Set ubuntu_version to 20.04 for nvidia-container-toolkit install
- set_fact:
- ubuntu_version: "20.04"
- when:
- - ansible_distribution|string == 'Ubuntu'
- - ansible_distribution_release|string == 'focal'
-
-- name: Set ubuntu_version to 22.04 for nvidia-container-toolkit install
- set_fact:
- ubuntu_version: "22.04"
- when:
- - ansible_distribution|string == 'Ubuntu'
- - ansible_distribution_release|string == 'jammy'
-
-- name: Add nvidia-docker repository
- apt_repository:
- repo: deb https://nvidia.github.io/{{ item }}/ubuntu{{ ubuntu_version }}/amd64 /
- state: present
- with_items:
- - nvidia-docker
-
-- name: Add libnvidia-container repository
- apt_repository:
- repo: deb https://nvidia.github.io/{{ item }}/stable/ubuntu{{ ubuntu_version }}/amd64 /
- state: present
- with_items:
- - libnvidia-container
- - nvidia-container-runtime
+- name: Check nvidia-container-toolkit repository key exists
+ stat:
+ path: /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
+ register: nvidia_container_toolkit_repo_key_exists
+
+# Inspired by: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#setting-up-nvidia-container-toolkit
+- name: Get and de-armour gpg key, add repository
+ block:
+ - name: Get armoured gpg key
+ ansible.builtin.get_url:
+ url: https://nvidia.github.io/libnvidia-container/gpgkey
+ dest: /tmp/nvidia-container-toolkit-keyring.asc
+
+ - name: Dearmour gpg key
+ shell: cat /tmp/nvidia-container-toolkit-keyring.asc | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
+ become: true
+
+ - name: Add nvidia-container-toolkit repository, pointing to the dearmored gpg key (backwards compatable, 18.04 should work with up to at least 22.04)
+ ansible.builtin.apt_repository:
+ repo: "deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/$(ARCH) /"
+ state: present
+ when: nvidia_container_toolkit_repo_key_exists.stat.exists == false
- name: Install nvidia-container-toolkit
apt:
@@ -55,7 +51,7 @@
- name: Reload daemon
systemd:
daemon_reload: yes
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
- name: Restart docker after installing nvidia-container-toolkit
service:
diff --git a/ansible/roles/installation/passwordless-command/defaults/main.yml b/ansible/roles/installation/passwordless-command/defaults/main.yml
index e07c8869c..50be907ca 100644
--- a/ansible/roles/installation/passwordless-command/defaults/main.yml
+++ b/ansible/roles/installation/passwordless-command/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
passwordless_command: "/bin/systemctl restart chrony.service"
diff --git a/ansible/roles/installation/passwordless-command/tasks/main.yml b/ansible/roles/installation/passwordless-command/tasks/main.yml
index 80a76a282..96640f479 100644
--- a/ansible/roles/installation/passwordless-command/tasks/main.yml
+++ b/ansible/roles/installation/passwordless-command/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Allow {{ user }} to run {{ passwordless_command }} without a password
lineinfile:
diff --git a/ansible/roles/installation/playbook_setup/defaults/main.yml b/ansible/roles/installation/playbook_setup/defaults/main.yml
new file mode 100644
index 000000000..e07a49076
--- /dev/null
+++ b/ansible/roles/installation/playbook_setup/defaults/main.yml
@@ -0,0 +1,17 @@
+# Copyright 2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+---
+scene_file: ""
+delivery: true
+bimanual: false
\ No newline at end of file
diff --git a/ansible/roles/installation/playbook_setup/tasks/main.yml b/ansible/roles/installation/playbook_setup/tasks/main.yml
new file mode 100644
index 000000000..8dc633523
--- /dev/null
+++ b/ansible/roles/installation/playbook_setup/tasks/main.yml
@@ -0,0 +1,30 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+- name: Install common tools
+ apt:
+ name: "{{ packages }}"
+ state: present
+ force_apt_get: yes
+ become: yes
+ vars:
+ packages:
+ - htop
+ - nano
+ - net-tools
+
+- name: Set default customer_key
+ set_fact:
+ customer_key: ROGkPp4U6C1pdLN1c1zwa88sqlajSOEImTDty3ie
+ when: customer_key is not defined
diff --git a/ansible/roles/installation/prepareshadowvpn/tasks/main.yml b/ansible/roles/installation/prepareshadowvpn/tasks/main.yml
index 3edaae56e..2885ce305 100644
--- a/ansible/roles/installation/prepareshadowvpn/tasks/main.yml
+++ b/ansible/roles/installation/prepareshadowvpn/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Add Repository for Network-Manager-l2tp
become: yes
diff --git a/ansible/roles/installation/production_tools/tasks/main.yml b/ansible/roles/installation/production_tools/tasks/main.yml
index b5a822007..6863e845f 100644
--- a/ansible/roles/installation/production_tools/tasks/main.yml
+++ b/ansible/roles/installation/production_tools/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
# Production tools
diff --git a/ansible/roles/installation/pycharm/defaults/main.yml b/ansible/roles/installation/pycharm/defaults/main.yml
index dbff59359..ff3fee355 100644
--- a/ansible/roles/installation/pycharm/defaults/main.yml
+++ b/ansible/roles/installation/pycharm/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
# Defaults for PyCharm IDE installation
diff --git a/ansible/roles/installation/pycharm/tasks/main.yml b/ansible/roles/installation/pycharm/tasks/main.yml
index 3918071c2..1849cb3cb 100644
--- a/ansible/roles/installation/pycharm/tasks/main.yml
+++ b/ansible/roles/installation/pycharm/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
# PyCharm IDE installation
diff --git a/ansible/roles/installation/qtcreator/tasks/main.yml b/ansible/roles/installation/qtcreator/tasks/main.yml
index 72c59ee1c..dfe647a7f 100644
--- a/ansible/roles/installation/qtcreator/tasks/main.yml
+++ b/ansible/roles/installation/qtcreator/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
# QtCreator IDE installation
diff --git a/ansible/roles/installation/rabbitvcs/tasks/main.yml b/ansible/roles/installation/rabbitvcs/tasks/main.yml
index 77ea47677..4a8563fa1 100644
--- a/ansible/roles/installation/rabbitvcs/tasks/main.yml
+++ b/ansible/roles/installation/rabbitvcs/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Install rabbitvcs
apt:
diff --git a/ansible/roles/installation/resolvconf/tasks/main.yml b/ansible/roles/installation/resolvconf/tasks/main.yml
index 5be4d2c48..04f1202c7 100644
--- a/ansible/roles/installation/resolvconf/tasks/main.yml
+++ b/ansible/roles/installation/resolvconf/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Install Resolvconf to fix network connectivity issue in Ubuntu 18.04.5 LTS
become: yes
diff --git a/ansible/roles/installation/shadow_glove_driver/defaults/main.yml b/ansible/roles/installation/shadow_glove_driver/defaults/main.yml
index 9e1bf7605..1e9652908 100644
--- a/ansible/roles/installation/shadow_glove_driver/defaults/main.yml
+++ b/ansible/roles/installation/shadow_glove_driver/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
shadow_glove_driver_repo: "https://github.com/shadow-robot/polhemus_ros_driver"
shadow_glove_driver_folder: "polhemus_ros_driver"
diff --git a/ansible/roles/installation/shadow_glove_driver/tasks/main.yml b/ansible/roles/installation/shadow_glove_driver/tasks/main.yml
index f22216666..520660c0e 100644
--- a/ansible/roles/installation/shadow_glove_driver/tasks/main.yml
+++ b/ansible/roles/installation/shadow_glove_driver/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Install shadow glove driver dependencies
apt:
diff --git a/ansible/roles/installation/steamvr/defaults/main.yml b/ansible/roles/installation/steamvr/defaults/main.yml
index d8500e424..18672b0c5 100644
--- a/ansible/roles/installation/steamvr/defaults/main.yml
+++ b/ansible/roles/installation/steamvr/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
user_home_dir: "/home/{{ user }}"
diff --git a/ansible/roles/installation/steamvr/meta/requirements.yml b/ansible/roles/installation/steamvr/meta/requirements.yml
index f1a2e5fdf..63812af98 100644
--- a/ansible/roles/installation/steamvr/meta/requirements.yml
+++ b/ansible/roles/installation/steamvr/meta/requirements.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
collections:
- amazon.aws
diff --git a/ansible/roles/installation/steamvr/tasks/main.yml b/ansible/roles/installation/steamvr/tasks/main.yml
index da5b63165..ae071839b 100644
--- a/ansible/roles/installation/steamvr/tasks/main.yml
+++ b/ansible/roles/installation/steamvr/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Update package lists
apt:
@@ -94,17 +108,27 @@
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'jammy'
-- name: Ensure botocore and boto3 modules are installed
+# We need to specify versions that are compatible with the amazon.was.s3_object module
+# otherwise the pip module finds the package installed via apt (due to this ROS package dependency
+# https://github.com/shadow-robot/common_resources/blob/noetic-devel/sr_utilities_common/package.xml#L44)
+# and doesn't install these packages via pip, resulting in the following s3_object task failing.
+# This wasn't an issue before we moved to the conda environment, as a more recent version of boto3 was in the requirements.txt for ansible.
+# When we moved to conda, the installation of the requirements.txt was removed from the run_ansible.sh script, triggering this issue.
+# The versions below are the ones required from https://docs.ansible.com/ansible/latest/collections/amazon/aws/s3_object_module.html
+- name: Ensure botocore and boto3 modules are installed and have a recent enough version
pip:
- name: [ "boto3", "botocore"]
+ executable: "{{ ansible_pip3_executable }}"
+ name:
+ - boto3>=1.22.0
+ - botocore>=1.25.0
extra_args: "--user"
- name: Downloading steamvr 1.21
- amazon.aws.aws_s3:
+ amazon.aws.s3_object:
aws_access_key: "{{ lookup('env','aws_key') }}"
aws_secret_key: "{{ lookup('env','aws_secret') }}"
bucket: shadowrobot.aurora.files
- object: /server/steamvr/steamNew.tar.gz
+ object: server/steamvr/steamNew.tar.gz
dest: "{{ user_home_dir }}/steam.tar.gz"
mode: get
diff --git a/ansible/roles/installation/teamviewer/defaults/main.yml b/ansible/roles/installation/teamviewer/defaults/main.yml
new file mode 100644
index 000000000..7dc4c91c5
--- /dev/null
+++ b/ansible/roles/installation/teamviewer/defaults/main.yml
@@ -0,0 +1,17 @@
+# Copyright 2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+---
+teamviewer_package_url: "https://download.teamviewer.com/download/linux/teamviewer_amd64.deb"
+teamviewer_package_dest: "/tmp/teamviewer_amd64.deb"
diff --git a/ansible/roles/installation/teamviewer/tasks/main.yml b/ansible/roles/installation/teamviewer/tasks/main.yml
new file mode 100644
index 000000000..0b1302e48
--- /dev/null
+++ b/ansible/roles/installation/teamviewer/tasks/main.yml
@@ -0,0 +1,32 @@
+# Copyright 2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+---
+- name: Install libminizip1 package (Dependency for TeamViewer)
+ become: true
+ apt:
+ name: libminizip1
+ state: present
+
+- name: Download TeamViewer package
+ get_url:
+ url: "{{ teamviewer_package_url }}"
+ dest: "{{ teamviewer_package_dest }}"
+
+- name: Install TeamViewer package
+ become: true
+ apt:
+ deb: "{{ teamviewer_package_dest }}"
+ state: present
+
diff --git a/ansible/roles/installation/terminator/defaults/main.yml b/ansible/roles/installation/terminator/defaults/main.yml
index dd236f97b..74ad8a32f 100644
--- a/ansible/roles/installation/terminator/defaults/main.yml
+++ b/ansible/roles/installation/terminator/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ ansible_user_id }}"
diff --git a/ansible/roles/installation/terminator/tasks/main.yml b/ansible/roles/installation/terminator/tasks/main.yml
index 9a1d4d6ab..cbb9fc612 100644
--- a/ansible/roles/installation/terminator/tasks/main.yml
+++ b/ansible/roles/installation/terminator/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Install terminator
apt:
diff --git a/ansible/roles/installation/vscode/tasks/main.yml b/ansible/roles/installation/vscode/tasks/main.yml
index ed548ad40..2ba6c6026 100644
--- a/ansible/roles/installation/vscode/tasks/main.yml
+++ b/ansible/roles/installation/vscode/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
# VSCode IDE installation
diff --git a/ansible/roles/installation/warehouse_ros/tasks/main.yml b/ansible/roles/installation/warehouse_ros/tasks/main.yml
index 979c3c546..0196d0c5c 100644
--- a/ansible/roles/installation/warehouse_ros/tasks/main.yml
+++ b/ansible/roles/installation/warehouse_ros/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
# Warehouse_ros installation
diff --git a/ansible/roles/products/common/arm-interfaces/defaults/main.yml b/ansible/roles/products/common/arm-interfaces/defaults/main.yml
index b21df72b1..bd3ccff66 100644
--- a/ansible/roles/products/common/arm-interfaces/defaults/main.yml
+++ b/ansible/roles/products/common/arm-interfaces/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
ethercat_left_arm: "enx2"
netplan_file: "/etc/netplan/50-cloud-init.yaml"
diff --git a/ansible/roles/products/common/arm-interfaces/tasks/bionic.yml b/ansible/roles/products/common/arm-interfaces/tasks/bionic.yml
index 59eebee72..8121f1754 100644
--- a/ansible/roles/products/common/arm-interfaces/tasks/bionic.yml
+++ b/ansible/roles/products/common/arm-interfaces/tasks/bionic.yml
@@ -1,7 +1,21 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Set current right arm interface name and mac if the right arm interface hasn't been renamed
set_fact:
- current_right_arm_interface: "{{ ethercat_right_arm }}"
+ current_right_arm_interface: "{{ ethercat_right_arm|lower }}"
ethercat_right_arm_mac: "{{ hostvars[groups['control_machine'][0]]['ansible_'+ethercat_right_arm]['macaddress'] }}"
when:
- "ethercat_right_arm in ansible_interfaces"
@@ -22,7 +36,7 @@
- name: Set current left arm interface name and mac if the left arm interface hasn't been renamed
set_fact:
- current_left_arm_interface: "{{ ethercat_left_arm }}"
+ current_left_arm_interface: "{{ ethercat_left_arm|lower }}"
ethercat_left_arm_mac: "{{ hostvars[groups['control_machine'][0]]['ansible_'+ethercat_left_arm]['macaddress'] }}"
when:
- "ethercat_left_arm in ansible_interfaces"
diff --git a/ansible/roles/products/common/arm-interfaces/tasks/main.yml b/ansible/roles/products/common/arm-interfaces/tasks/main.yml
index 9e666cfcb..f2e7ac3cd 100644
--- a/ansible/roles/products/common/arm-interfaces/tasks/main.yml
+++ b/ansible/roles/products/common/arm-interfaces/tasks/main.yml
@@ -1,24 +1,38 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- import_tasks: bionic.yml
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'jammy'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
- import_tasks: bionic.yml
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'focal'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
- import_tasks: bionic.yml
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
- import_tasks: xenial.yml
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'xenial'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
diff --git a/ansible/roles/products/common/arm-interfaces/tasks/xenial.yml b/ansible/roles/products/common/arm-interfaces/tasks/xenial.yml
index fa33c4405..09ca4666f 100644
--- a/ansible/roles/products/common/arm-interfaces/tasks/xenial.yml
+++ b/ansible/roles/products/common/arm-interfaces/tasks/xenial.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Check if there is an interface file
stat:
diff --git a/ansible/roles/products/common/bimanual-icons/defaults/main.yml b/ansible/roles/products/common/bimanual-icons/defaults/main.yml
index 774756b66..bbfc1ef4a 100644
--- a/ansible/roles/products/common/bimanual-icons/defaults/main.yml
+++ b/ansible/roles/products/common/bimanual-icons/defaults/main.yml
@@ -1,4 +1,21 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
left_advanced_launcher: "Left Side"
right_advanced_launcher: "Right Side"
-bimanual_advanced_launcher: "Bimanual"
\ No newline at end of file
+bimanual_advanced_launcher: "Bimanual"
+warning_title: "Example Warning"
+warning_text: "Example Text"
+extra_vars: ""
diff --git a/ansible/roles/products/common/bimanual-icons/tasks/main.yml b/ansible/roles/products/common/bimanual-icons/tasks/main.yml
index a23e5abe7..a7f62eed0 100644
--- a/ansible/roles/products/common/bimanual-icons/tasks/main.yml
+++ b/ansible/roles/products/common/bimanual-icons/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Install desktop icon for server container
include_role:
diff --git a/ansible/roles/products/common/clear-icons/defaults/main.yml b/ansible/roles/products/common/clear-icons/defaults/main.yml
index bc8f6fac0..e1c2ccb8d 100644
--- a/ansible/roles/products/common/clear-icons/defaults/main.yml
+++ b/ansible/roles/products/common/clear-icons/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ user }}"
diff --git a/ansible/roles/products/common/clear-icons/tasks/main.yml b/ansible/roles/products/common/clear-icons/tasks/main.yml
index 6d858eed2..dd13409cf 100644
--- a/ansible/roles/products/common/clear-icons/tasks/main.yml
+++ b/ansible/roles/products/common/clear-icons/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Ensure Shadow Demos folder and contents are deleted
file:
diff --git a/ansible/roles/products/common/close-everything-icon/defaults/main.yml b/ansible/roles/products/common/close-everything-icon/defaults/main.yml
index 473224d49..e7b9b2e30 100644
--- a/ansible/roles/products/common/close-everything-icon/defaults/main.yml
+++ b/ansible/roles/products/common/close-everything-icon/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ user }}"
diff --git a/ansible/roles/products/common/close-everything-icon/tasks/main.yml b/ansible/roles/products/common/close-everything-icon/tasks/main.yml
index 7d851ef3d..0ae92aca6 100644
--- a/ansible/roles/products/common/close-everything-icon/tasks/main.yml
+++ b/ansible/roles/products/common/close-everything-icon/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Copy Close Everything desktop icon
copy:
@@ -34,4 +48,4 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
diff --git a/ansible/roles/products/common/default-icon-no-terminator/defaults/main.yml b/ansible/roles/products/common/default-icon-no-terminator/defaults/main.yml
index c57d0ae42..24daea032 100644
--- a/ansible/roles/products/common/default-icon-no-terminator/defaults/main.yml
+++ b/ansible/roles/products/common/default-icon-no-terminator/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ user }}"
diff --git a/ansible/roles/products/common/default-icon-no-terminator/tasks/main.yml b/ansible/roles/products/common/default-icon-no-terminator/tasks/main.yml
index b47bcdaf4..990f3adaf 100644
--- a/ansible/roles/products/common/default-icon-no-terminator/tasks/main.yml
+++ b/ansible/roles/products/common/default-icon-no-terminator/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Copy desktop icon
copy:
@@ -29,4 +43,4 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
\ No newline at end of file
+ - not skip_molecule_task|bool
\ No newline at end of file
diff --git a/ansible/roles/products/common/default-icon/defaults/main.yml b/ansible/roles/products/common/default-icon/defaults/main.yml
index bc7874e53..539cad9aa 100644
--- a/ansible/roles/products/common/default-icon/defaults/main.yml
+++ b/ansible/roles/products/common/default-icon/defaults/main.yml
@@ -1,5 +1,23 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ user }}"
shadow_hand_launcher_folder: "{{ user_folder }}/.shadow_launcher_app_{{ container_name }}/shadow_hand_launcher"
-haptx_mapping_script: ""
\ No newline at end of file
+haptx_mapping_script: ""
+enable_warning: false
+warning_title: "Example Warning"
+warning_text: "Example Text"
+extra_vars: ""
diff --git a/ansible/roles/products/common/default-icon/tasks/main.yml b/ansible/roles/products/common/default-icon/tasks/main.yml
index 8495c8f8f..cb5803117 100644
--- a/ansible/roles/products/common/default-icon/tasks/main.yml
+++ b/ansible/roles/products/common/default-icon/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Copy desktop icon
copy:
@@ -25,7 +39,7 @@
desktop_shortcut_name: "{{ desktop_icon_name }}"
comment: "{{ desktop_icon_name }}"
folder: "{{ shadow_hand_launcher_folder }}"
- shell_script_file_name: "{{ launch_script }}"
+ shell_script_file_name: "'{{ launch_script }}{{ extra_vars }}'"
icon_file_name: "{{ desktop_icon_png }}"
start_terminal: "{{ launch_terminal }}"
@@ -34,4 +48,4 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
diff --git a/ansible/roles/products/common/demo-icons/defaults/main.yml b/ansible/roles/products/common/demo-icons/defaults/main.yml
index 64628b050..c44178ae5 100644
--- a/ansible/roles/products/common/demo-icons/defaults/main.yml
+++ b/ansible/roles/products/common/demo-icons/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ user }}"
@@ -7,7 +21,6 @@ use_aws: false
bimanual: true
hand_side: "right"
hand_type: "hand_e"
-biotacs: false
product: ''
demo_icon_folder: "{{ desktop_path }}"
start_terminal: "true"
diff --git a/ansible/roles/products/common/demo-icons/tasks/main.yml b/ansible/roles/products/common/demo-icons/tasks/main.yml
index b0c44d93a..dff7a3743 100644
--- a/ansible/roles/products/common/demo-icons/tasks/main.yml
+++ b/ansible/roles/products/common/demo-icons/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Ensures that Desktop folder exists
file:
@@ -60,7 +74,7 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
when: bimanual|bool or hand_side=="right"
@@ -99,7 +113,7 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
when: bimanual|bool or hand_side=="left"
@@ -138,7 +152,7 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
when: bimanual|bool
@@ -177,7 +191,7 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
when: bimanual|bool or hand_side=="right"
@@ -216,7 +230,7 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
when: bimanual|bool or hand_side=="left"
@@ -255,7 +269,7 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
when: bimanual|bool == true
@@ -295,7 +309,7 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
when:
- bimanual|bool == true or hand_side=="right"
@@ -336,7 +350,7 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
when:
- bimanual|bool == true or hand_side=="left"
@@ -377,133 +391,7 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
when:
- bimanual|bool == true
-
-- name: Install right arm and hand joint position example if arm and hand_side="right"
- block:
- - name: Copy right Arm and Hand desktop icon
- copy:
- src: ../../../common/resources/files/arm_hand_right.jpeg
- dest: "{{ shadow_hand_launcher_folder }}/arm_hand_right.jpeg"
- mode: '664'
-
- - name: Create Right Hand and Arm Joint Positions executable launch script
- template:
- src: ../resources/templates/scripts/rosrun-script.j2
- dest: "{{ shadow_hand_launcher_folder }}/right_arm_hand_joint_pos.sh"
- mode: '755'
- vars:
- project_name: sr_example
- script_name: sr_right_hand_arm_joint_pos.py
-
- - name: Create Right Hand and Arm Joint Positions desktop icon
- template:
- src: ../resources/templates/desktop-icons/standard-icon.j2
- dest: "{{ demo_icon_folder }}/Right Hand and Arm Joint Positions Example.desktop"
- mode: '755'
- vars:
- desktop_shortcut_name: Right Hand and Arm Joint Positions Example
- comment: "This runs arm and hand plan and move to joint positions example"
- folder: "{{ shadow_hand_launcher_folder }}"
- shell_script_file_name: right_arm_hand_joint_pos.sh
- icon_file_name: arm_hand_right.jpeg
- start_terminal: "false"
-
- - name: Make Right Hand and Arm Joint Positions Example desktop icon Trusted
- shell: gio set "{{ demo_icon_folder }}/Right Hand and Arm Joint Positions Example.desktop" "metadata::trusted" yes
- when:
- - ansible_distribution|string == 'Ubuntu'
- - ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
-
- when:
- - product is defined
- - "'arm_' in product"
- - hand_side=="right"
-
-- name: Install right arm and hand waypoints example if arm and hand_side="right"
- block:
- - name: Copy right Arm and Hand desktop icon
- copy:
- src: ../../../common/resources/files/arm_hand_right.jpeg
- dest: "{{ shadow_hand_launcher_folder }}/arm_hand_right.jpeg"
- mode: '664'
-
- - name: Create Right Hand and Arm Waypoints executable launch script
- template:
- src: ../resources/templates/scripts/rosrun-script.j2
- dest: "{{ shadow_hand_launcher_folder }}/right_arm_hand_waypoints.sh"
- mode: '755'
- vars:
- project_name: sr_example
- script_name: sr_right_hand_arm_waypoints.py
-
- - name: Create Right Hand and Arm Waypoints desktop icon
- template:
- src: ../resources/templates/desktop-icons/standard-icon.j2
- dest: "{{ demo_icon_folder }}/Right Hand and Arm Waypoints Example.desktop"
- mode: '755'
- vars:
- desktop_shortcut_name: Right Hand and Arm Waypoints Example
- comment: "This runs arm and hand plan and move to Waypoints example"
- folder: "{{ shadow_hand_launcher_folder }}"
- shell_script_file_name: right_arm_hand_waypoints.sh
- icon_file_name: arm_hand_right.jpeg
- start_terminal: "false"
-
- - name: Make Right Hand and Arm Waypoints Example desktop icon Trusted
- shell: gio set "{{ demo_icon_folder }}/Right Hand and Arm Waypoints Example.desktop" "metadata::trusted" yes
- when:
- - ansible_distribution|string == 'Ubuntu'
- - ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
-
- when:
- - product is defined
- - "'arm_' in product"
- - hand_side=="right"
-
-- name: Install right arm and hand End Effector example if arm and hand_side="right"
- block:
- - name: Copy right Arm and Hand desktop icon
- copy:
- src: ../../../common/resources/files/arm_hand_right.jpeg
- dest: "{{ shadow_hand_launcher_folder }}/arm_hand_right.jpeg"
- mode: '664'
-
- - name: Create Right Hand and Arm End Effector executable launch script
- template:
- src: ../resources/templates/scripts/rosrun-script.j2
- dest: "{{ shadow_hand_launcher_folder }}/right_arm_hand_end_effector.sh"
- mode: '755'
- vars:
- project_name: sr_example
- script_name: sr_right_hand_arm_ef_pos.py
-
- - name: Create Right Hand and Arm End Effector desktop icon
- template:
- src: ../resources/templates/desktop-icons/standard-icon.j2
- dest: "{{ demo_icon_folder }}/Right Hand and Arm End Effector Example.desktop"
- mode: '755'
- vars:
- desktop_shortcut_name: Right Hand and Arm End Effector Example
- comment: "This runs arm and hand plan and move to End Effector example"
- folder: "{{ shadow_hand_launcher_folder }}"
- shell_script_file_name: right_arm_hand_end_effector.sh
- icon_file_name: arm_hand_right.jpeg
- start_terminal: "false"
-
- - name: Make Right Hand and Arm End Effector Example desktop icon Trusted
- shell: gio set "{{ demo_icon_folder }}/Right Hand and Arm End Effector Example.desktop" "metadata::trusted" yes
- when:
- - ansible_distribution|string == 'Ubuntu'
- - ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
-
- when:
- - product is defined
- - "'arm_' in product"
- - hand_side=="right"
diff --git a/ansible/roles/products/common/docker-container/defaults/main.yml b/ansible/roles/products/common/docker-container/defaults/main.yml
index d6096c10b..17e572fd6 100644
--- a/ansible/roles/products/common/docker-container/defaults/main.yml
+++ b/ansible/roles/products/common/docker-container/defaults/main.yml
@@ -1,9 +1,21 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
container_name: "dexterous_hand"
image: "public.ecr.aws/shadowrobot/dexterous-hand"
-tag: "noetic-release"
-full_image_name: "shadowrobot/dexterous-hand:noetic-release"
-launch_hand: false
+tag: "noetic-v1.0.21"
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ user }}"
shadow_hand_launcher_folder: "{{ user_folder }}/.shadow_launcher_app_{{ container_name }}/shadow_hand_launcher"
diff --git a/ansible/roles/products/common/docker-container/meta/requirements.yml b/ansible/roles/products/common/docker-container/meta/requirements.yml
index d1a468553..8f6a92c0a 100644
--- a/ansible/roles/products/common/docker-container/meta/requirements.yml
+++ b/ansible/roles/products/common/docker-container/meta/requirements.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
collections:
- community.docker
diff --git a/ansible/roles/products/common/docker-container/tasks/check-container-state.yml b/ansible/roles/products/common/docker-container/tasks/check-container-state.yml
index 5a566045e..896a9ff1e 100644
--- a/ansible/roles/products/common/docker-container/tasks/check-container-state.yml
+++ b/ansible/roles/products/common/docker-container/tasks/check-container-state.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Checking if container exists
become: yes
@@ -10,18 +24,6 @@
set_fact:
container_exists: true
-- name: Checking if container already running
- shell: "docker inspect -f '{{ '{{' }}.State.Running }}' {{ container_name }}"
- register: container_running_output
- when: container_exists | bool
- become: yes
- changed_when: container_running_output.rc != 0
-
-- name: Set container_running to true
- set_fact:
- container_running: "{{ container_running_output.stdout | bool }}"
- when: container_exists | bool
-
- name: Reinstalling docker container because it doesn't exist
import_tasks: reinstall.yml
when: not container_exists | bool
diff --git a/ansible/roles/products/common/docker-container/tasks/create-container/no-setup-no-terminator.yml b/ansible/roles/products/common/docker-container/tasks/create-container/no-setup-no-terminator.yml
index b993e3125..0b15eaf12 100644
--- a/ansible/roles/products/common/docker-container/tasks/create-container/no-setup-no-terminator.yml
+++ b/ansible/roles/products/common/docker-container/tasks/create-container/no-setup-no-terminator.yml
@@ -1,3 +1,17 @@
+# Copyright 2022, 2024 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Set container_type_shared_volumes
set_fact:
@@ -34,8 +48,12 @@
arm_ips: "{{ arm_ip_right }}_{{ arm_ip_left }}"
XDG_RUNTIME_DIR: "/run/user/1000"
SR_RECORD_HAND_DATA: "{{ record_hand_data }}"
+ CONTAINER_NAME: "{{ container_name }}"
+ SERVER_USERNAME: "{{ lookup('ansible.builtin.env', 'USER') }}"
+ SERVER_IP: "{{ groups['server'][0] }}"
network_mode: "host"
pid_mode: "host"
+ ipc_mode: "host"
privileged: yes
interactive: yes
security_opts:
diff --git a/ansible/roles/products/common/docker-container/tasks/create-container/no-setup-with-terminator.yml b/ansible/roles/products/common/docker-container/tasks/create-container/no-setup-with-terminator.yml
index 6562bfd6a..eca0b993e 100644
--- a/ansible/roles/products/common/docker-container/tasks/create-container/no-setup-with-terminator.yml
+++ b/ansible/roles/products/common/docker-container/tasks/create-container/no-setup-with-terminator.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Set shared volumes
set_fact:
@@ -31,6 +45,7 @@
SR_RECORD_HAND_DATA: "{{ record_hand_data }}"
network_mode: "host"
pid_mode: "host"
+ ipc_mode: "host"
privileged: yes
interactive: yes
security_opts:
diff --git a/ansible/roles/products/common/docker-container/tasks/create-container/nvidia-with-setup-with-terminator.yml b/ansible/roles/products/common/docker-container/tasks/create-container/nvidia-with-setup-with-terminator.yml
index 9fee2b7ad..ea858119a 100644
--- a/ansible/roles/products/common/docker-container/tasks/create-container/nvidia-with-setup-with-terminator.yml
+++ b/ansible/roles/products/common/docker-container/tasks/create-container/nvidia-with-setup-with-terminator.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Set shared volumes
set_fact:
@@ -33,6 +47,7 @@
SR_RECORD_HAND_DATA: "{{ record_hand_data }}"
network_mode: "host"
pid_mode: "host"
+ ipc_mode: "host"
privileged: yes
interactive: yes
security_opts:
diff --git a/ansible/roles/products/common/docker-container/tasks/create-container/with-setup-no-terminator.yml b/ansible/roles/products/common/docker-container/tasks/create-container/with-setup-no-terminator.yml
index d95fcaf72..09295a7aa 100644
--- a/ansible/roles/products/common/docker-container/tasks/create-container/with-setup-no-terminator.yml
+++ b/ansible/roles/products/common/docker-container/tasks/create-container/with-setup-no-terminator.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Set container_type_shared_volumes
set_fact:
@@ -36,6 +50,7 @@
SR_RECORD_HAND_DATA: "{{ record_hand_data }}"
network_mode: "host"
pid_mode: "host"
+ ipc_mode: "host"
privileged: yes
interactive: yes
security_opts:
diff --git a/ansible/roles/products/common/docker-container/tasks/create-container/with-setup-with-terminator.yml b/ansible/roles/products/common/docker-container/tasks/create-container/with-setup-with-terminator.yml
index dd56cf2cb..683a480af 100644
--- a/ansible/roles/products/common/docker-container/tasks/create-container/with-setup-with-terminator.yml
+++ b/ansible/roles/products/common/docker-container/tasks/create-container/with-setup-with-terminator.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Set shared volumes
set_fact:
@@ -31,6 +45,7 @@
SR_RECORD_HAND_DATA: "{{ record_hand_data }}"
network_mode: "host"
pid_mode: "host"
+ ipc_mode: "host"
privileged: yes
interactive: yes
security_opts:
diff --git a/ansible/roles/products/common/docker-container/tasks/main.yml b/ansible/roles/products/common/docker-container/tasks/main.yml
index 688f367c6..a26c74cea 100644
--- a/ansible/roles/products/common/docker-container/tasks/main.yml
+++ b/ansible/roles/products/common/docker-container/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Getting UID
shell: id -u
diff --git a/ansible/roles/products/common/docker-container/tasks/modify-container.yml b/ansible/roles/products/common/docker-container/tasks/modify-container.yml
index 7b755b514..0bb71c91a 100644
--- a/ansible/roles/products/common/docker-container/tasks/modify-container.yml
+++ b/ansible/roles/products/common/docker-container/tasks/modify-container.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Creating the modify container script
template:
@@ -13,5 +27,5 @@
shell: "/tmp/{{ modify_script_name }}"
become: yes
changed_when: false
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
diff --git a/ansible/roles/products/common/docker-container/tasks/reinstall.yml b/ansible/roles/products/common/docker-container/tasks/reinstall.yml
index 299d7a997..7044b55a4 100644
--- a/ansible/roles/products/common/docker-container/tasks/reinstall.yml
+++ b/ansible/roles/products/common/docker-container/tasks/reinstall.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Create the shadow_hand_launcher_folder
file:
@@ -25,23 +39,23 @@
changed_when: false
- name: Creating the container which will execute setup script in terminator when started
- when: "not nvidia_docker|bool and terminator and setup_script | length > 0"
+ when: "not nvidia_docker|bool and terminator|bool and setup_script | length > 0"
include_tasks: create-container/with-setup-with-terminator.yml
- name: Creating the container which will execute setup script when started without terminator
- when: "not nvidia_docker|bool and not terminator and setup_script | length > 0"
+ when: "not nvidia_docker|bool and not terminator|bool and setup_script | length > 0"
include_tasks: create-container/with-setup-no-terminator.yml
- name: Creating the container which will just start a terminator (no setup script)
- when: "not nvidia_docker|bool and terminator and setup_script | length == 0"
+ when: "not nvidia_docker|bool and terminator|bool and setup_script | length == 0"
include_tasks: create-container/no-setup-with-terminator.yml
- name: Creating the container which will not even start terminator (no setup script)
- when: "not nvidia_docker|bool and not terminator and setup_script | length == 0"
+ when: "not nvidia_docker|bool and not terminator|bool and setup_script | length == 0"
include_tasks: create-container/no-setup-no-terminator.yml
- name: Creating the container which will execute setup script in terminator when started (NVIDIA)
- when: "nvidia_docker|bool and terminator and setup_script | length > 0"
+ when: "nvidia_docker|bool and terminator|bool and setup_script | length > 0"
include_tasks: create-container/nvidia-with-setup-with-terminator.yml
- name: Move response back to container
@@ -61,7 +75,7 @@
import_tasks: modify-container.yml
vars:
modify_script_name: "create_ssh_folder.sh"
- modify_script_commands: "sudo mkdir -p /home/user/.ssh"
+ modify_script_commands: "mkdir -p /home/user/.ssh"
when: "'arm_' in product"
- name: Checking out PRs and branches if pr_branches list has been specified
@@ -91,129 +105,6 @@
modify_script_commands: "/tmp/pull_pr_branches_and_catkin_make.sh"
when: pr_branches is defined and pr_branches | length > 0
-- name: Installing private repositories for arm and hand product
- block:
- - name: Ensure botocore and boto3 modules are installed
- pip:
- name: [ "boto3", "botocore"]
- extra_args: "--user"
- changed_when: false
-
- - name: Connect to Shadow AWS API
- uri:
- url: https://5vv2z6j3a7.execute-api.eu-west-2.amazonaws.com/prod
- method: GET
- return_content: yes
- headers:
- x-api-key: "{{ customer_key }}"
- register: response_private
-
- - name: Get private github ssh key
- set_fact:
- private_github_ssh_key_base64: "{{ response_private.content | regex_search('(?<=GITHUB_KEY=)(.*)(?=\\nCUSTOMER_NAME)', multiline=True) }}"
-
- - name: Customer_key is not authorized to use product={{ product }}
- fail:
- msg: "Invalid customer_key for product={{ product }}. Please contact Shadow Robot Company with your customer_key and check that you have been authorized to use product={{ product }}"
- when: private_github_ssh_key_base64==""
-
- - name: Write private github ssh key to file
- copy:
- content: "{{ private_github_ssh_key_base64 | b64decode }}"
- dest: "{{ private_ssh_keys_path }}"
- mode: '600'
- changed_when: false
-
- - name: Creating the clone_private_repos bash script
- template:
- src: ../../../common/resources/templates/scripts/clone-private-repos.j2
- dest: "{{ shadow_hand_launcher_folder }}/clone_private_repos.sh"
- mode: '755'
- vars:
- private_repos_value: "sr_dexterous_hand_and_arm_documentation"
-
- - name: Copying the pull clone_private_repos bash script into docker container
- changed_when: false
- shell: "docker cp {{ shadow_hand_launcher_folder }}/clone_private_repos.sh {{ container_name }}:/tmp/clone_private_repos.sh"
- become: yes
-
- - name: Copying the private_ssh_keys into docker container
- changed_when: false
- shell: "docker cp {{ private_ssh_keys_path }} {{ container_name }}:/home/user/.ssh/id_rsa"
- become: yes
-
- - name: Set up known_hosts
- import_tasks: modify-container.yml
- vars:
- modify_script_name: "setup_known_hosts.sh"
- modify_script_commands: "ssh-keyscan github.com >> /home/user/known_hosts; sudo mv /home/user/known_hosts /home/user/.ssh/"
-
- - name: Install private repos
- import_tasks: modify-container.yml
- vars:
- modify_script_name: "clone_private_repos.sh"
- modify_script_commands: "/tmp/clone_private_repos.sh"
- when:
- - "'arm_' in product"
- - skip_molecule_task is not defined
- - customer_key is defined and customer_key | length > 0
-
-- name: Set documentation variables for shadow_glove teleop
- set_fact:
- documentation_repo: sr_teleop_polhemus_documentation
- readthedocs_token: "{{ shadow_glove_teleop_readthedocs_token }}"
- documentation_product: teleop-polhemus
- when: glove == "shadow_glove" and skip_molecule_task is not defined
-
-- name: Set documentation variables for haptx teleop
- set_fact:
- documentation_repo: sr_teleop_haptx_documentation
- readthedocs_token: "{{ haptx_teleop_readthedocs_token }}"
- documentation_product: teleop-haptx
- when: glove == "haptx" and skip_molecule_task is not defined
-
-- name: Set documentation variables for arm and hand
- set_fact:
- documentation_repo: sr_dexterous_hand_and_arm_documentation
- readthedocs_token: "{{ arm_hand_readthedocs_token }}"
- documentation_product: dexterous-hand-and-arm
- when:
- - "'arm_' in product"
- - skip_molecule_task is not defined
-
-- name: Set documentation variables for arm and glove
- set_fact:
- documentation_repo: sr_dexterous_hand_glove_documentation
- readthedocs_token: "{{ glove_hand_readthedocs_token }}"
- documentation_product: dexterous-hand-and-glove
- when:
- - "'arm_' in product"
- - skip_molecule_task is not defined
-
-- name: Update documentation inside the docker container for teleop or arm+hand
- import_tasks: modify-container.yml
- vars:
- modify_script_name: "update_documentation.sh"
- modify_script_commands: "roscd {{ documentation_repo }};curl -H 'Authorization: Token {{ readthedocs_token }}' https://shadow-robot-company-{{ documentation_product }}.readthedocs-hosted.com/_/downloads/en/latest/htmlzip/ -o temp.zip;unzip temp.zip;mv shadow-robot-company-{{ documentation_product }}-latest/ html/"
- when:
- - "glove == 'haptx' or glove == 'shadow_glove' or 'arm_' in product or 'glove_' in product"
- - "product != 'hand_e' or product != 'hand_lite' or product != 'hand_extra_lite'"
- - skip_molecule_task is not defined
- - groups['server'] is defined and inventory_hostname==hostvars[groups['server'][0]]['inventory_hostname']
- ignore_errors: yes
-
-- name: Update documentation inside the docker container for hand only
- import_tasks: modify-container.yml
- vars:
- modify_script_name: "update_documentation.sh"
- modify_script_commands: "cd /home/user/projects/shadow_robot/base/src;git clone https://github.com/shadow-robot/sr_dexterous_hand_documentation;cd /home/user/projects/shadow_robot/base;catkin_make --only-pkg-with-deps sr_dexterous_hand_documentation;cd /home/user/projects/shadow_robot/base/src/sr_dexterous_hand_documentation;curl https://dexterous-hand.readthedocs.io/_/downloads/en/latest/htmlzip/ -o temp.zip;unzip temp.zip;mv dexterous-hand-latest html/"
- when:
- - "'arm_' not in product"
- - "'hand' in product"
- - skip_molecule_task is not defined
- - groups['server'] is defined and inventory_hostname==hostvars[groups['server'][0]]['inventory_hostname']
- ignore_errors: yes
-
- name: Pulling latest hand_configurations
import_tasks: modify-container.yml
vars:
diff --git a/ansible/roles/products/common/documentation/defaults/main.yml b/ansible/roles/products/common/documentation/defaults/main.yml
new file mode 100644
index 000000000..4bedd9e49
--- /dev/null
+++ b/ansible/roles/products/common/documentation/defaults/main.yml
@@ -0,0 +1,86 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+---
+user: "{{ ansible_user_id }}"
+user_folder: "/home/{{ user }}"
+desktop_path: "{{ user_folder }}/Desktop"
+manual_folder: "{{ user_folder }}/.shadow_launcher_app_{{ container_name }}"
+manual_filename: "shadow_documentation.pdf"
+bucket_name: "shadowrobot.aurora.files"
+# Release Variables
+# AWS File Names
+hand_lite_version: "test"
+hand_e_version: "2.2.5"
+hand_arm_version: "2.2.5"
+hand_glove_version: "2.2.1"
+teleop_polhemus_version: "2.2.5"
+teleop_haptx_version: "2.2.5"
+# ReadTheDocs links
+dexterous_hand_lite_readthedocs_link: "https://shadow-robot-company-dexterous-hand-lite.readthedocs-hosted.com/en/latest/"
+dexterous_hand_readthedocs_link: "https://shadow-robot-company-dexterous-hand.readthedocs-hosted.com/en/2.2.5/"
+
+arm_hand_readthedocs_link: !vault |
+ $ANSIBLE_VAULT;1.1;AES256
+ 63383233336534653437343739656235366135616538376562613465323765663631393932333334
+ 3761393136336435643165353639373339663630393635360a653263336264613838366635623266
+ 32323638393937383930326130386539633366636434373264663532313433613365613639303064
+ 3338623330633933640a356537636161333932363862323330343933356462623532663435653565
+ 32643066616161316130643863656530323237343436376136613138353662353935386262633436
+ 30363839343635623938653439653565306631323731633330623166623265623837336566666430
+ 34323335396566613031636264626535663036386132383864653931613137653639613032356330
+ 63623066353462336266363935636165613463383262303764313163383239313663386437623334
+ 32323362393233366431643266626663646263623037333033383863356336333533653035636137
+ 39326331303664333637306239623930366664383962303137363830323139326232316666396563
+ 333039646230323435306461363564353461
+
+glove_hand_readthedocs_link: !vault |
+ $ANSIBLE_VAULT;1.1;AES256
+ 66333137313832363734383765353331663334383535613164313834383863623639313263323464
+ 6562363639643464326138353537656133316235613461640a356332663037396564396539633364
+ 35306237313336636531633033356237346261386135616166303630653763333935303937623735
+ 6637356335323339360a626139623865336133613336363564646139623139336533626136656666
+ 65663530623832316363306638316636366331353439336339366463636164303665333033376465
+ 34343832343365643633303231636666653831356565643161643731363163323737346137663330
+ 34313436636430613638623833623733663763616639396433383464323966626635396237643364
+ 31353033613633626339613033613964343736623461363538666564303764363861633631383236
+ 62383964373066653830366335353066373565333337633933356166623935633937653066363736
+ 39396135333765313339616463656466386362346264393761323664346238363835376536646361
+ 653834303364656330663563373462326466
+
+haptx_teleop_readthedocs_link: !vault |
+ $ANSIBLE_VAULT;1.1;AES256
+ 63623036326264383766363566326639633162653236636365326534393839623330393632303431
+ 3664303133663038646561356461323864663834313464340a363166623032623534323838346433
+ 39353937356237653731623830333232633539343138316539316330376238653464333437646235
+ 6336613534633865360a653130376365363165346331353039333633623266626331313339363861
+ 34363465303764613138396633626530363033323963313538643034613330366432306639333565
+ 32646136396430343566313036623732613839623663306230653066663230343566376464393937
+ 30313036333431336635353034613661303734343666633236353264666232386331643030303738
+ 35316235356536373934393264613239333663323537643036336362373938626230613361643834
+ 31356431656139396339326536373463333364613561636139633962363137323330613533646362
+ 6466346235633266356365343938303839633763323262613636
+
+shadow_glove_teleop_readthedocs_link: !vault |
+ $ANSIBLE_VAULT;1.1;AES256
+ 66333862383562386261666665393738396438313330663664346566633463616161666233663361
+ 3438653037386230383239333538633630623534323436610a363962313065373763346433333962
+ 37313334313665343934636465353732626562356433393233366262303065343036626233303063
+ 3135623730303632330a316465316338353136653839386637306363303936346235306432613265
+ 39663432363263633663633838326230663139623833383938633066633835366336366662616362
+ 62623734623438363165396336376236656262663030343833383563633762356263396337663866
+ 64646465623837393435366238346363393365613762353561613637316639363838616562653266
+ 38643734313633383131323735623536343135326139613866653737636433313233663962336634
+ 63663439363630346138396161386332393732623835376165396162613736666661353766326163
+ 3332303235613837383864623338383230663961616539343333
diff --git a/ansible/roles/products/common/documentation/meta/requirements.yml b/ansible/roles/products/common/documentation/meta/requirements.yml
new file mode 100644
index 000000000..63812af98
--- /dev/null
+++ b/ansible/roles/products/common/documentation/meta/requirements.yml
@@ -0,0 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+---
+collections:
+ - amazon.aws
diff --git a/ansible/roles/products/common/documentation/tasks/create-icon.yml b/ansible/roles/products/common/documentation/tasks/create-icon.yml
new file mode 100644
index 000000000..220bb1c4e
--- /dev/null
+++ b/ansible/roles/products/common/documentation/tasks/create-icon.yml
@@ -0,0 +1,50 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+---
+- name: Copy desktop icon
+ copy:
+ src: ../../../common/resources/files/{{ desktop_icon_png }}
+ dest: "{{ shadow_hand_launcher_folder }}/{{ desktop_icon_png }}"
+ mode: '664'
+
+- name: Create executable launch script
+ template:
+ src: ../../../common/resources/templates/scripts/documentation.j2
+ dest: "{{ shadow_hand_launcher_folder }}/{{ launch_script }}"
+ mode: '755'
+ vars:
+ local_website_name: "{{ desktop_icon_name }}"
+ live_website_url: "{{ live_website_url_var }}"
+ file_path: "{{ file_path_var }}"
+
+- name: Create desktop icon
+ template:
+ src: ../../../common/resources/templates/desktop-icons/standard-icon-no-terminator.j2
+ dest: "{{ desktop_path }}/{{ desktop_icon_path }}.desktop"
+ mode: '755'
+ vars:
+ desktop_shortcut_name: "{{ desktop_icon_name }}"
+ comment: "{{ desktop_icon_name }}"
+ folder: "{{ shadow_hand_launcher_folder }}"
+ shell_script_file_name: "{{ launch_script }}"
+ icon_file_name: "{{ desktop_icon_png }}"
+ start_terminal: "{{ launch_terminal }}"
+
+- name: Make Desktop icon trusted
+ shell: gio set "{{ desktop_path }}/{{ desktop_icon_path }}.desktop" "metadata::trusted" yes
+ when:
+ - ansible_distribution|string == 'Ubuntu'
+ - ansible_distribution_release|string == 'bionic'
+ - not skip_molecule_task|bool
diff --git a/ansible/roles/products/common/documentation/tasks/main.yml b/ansible/roles/products/common/documentation/tasks/main.yml
new file mode 100644
index 000000000..6f285d24c
--- /dev/null
+++ b/ansible/roles/products/common/documentation/tasks/main.yml
@@ -0,0 +1,155 @@
+# Copyright 2022-2024 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+---
+- name: Ensure botocore and boto3 modules are installed
+ pip:
+ executable: "{{ ansible_pip3_executable }}"
+ name: [ "boto3", "botocore"]
+ extra_args: "--user"
+ changed_when: false
+
+- name: Connect to Shadow AWS API
+ uri:
+ url: https://5vv2z6j3a7.execute-api.eu-west-2.amazonaws.com/prod
+ method: GET
+ return_content: yes
+ headers:
+ x-api-key: "{{ customer_key }}"
+ register: response
+ until: response.status == 200
+ retries: 5
+ delay: 3
+ when: not skip_molecule_task|bool
+
+- name: Set temporary AWS credentials for accessing necessary files
+ set_fact:
+ aws_key: "{{ response.content | regex_search('(?<=ACCESS_KEY_ID=)(.*)(?=\\nSECRET_ACCESS_KEY)', multiline=True) }}"
+ aws_secret: "{{ response.content | regex_search('(?<=SECRET_ACCESS_KEY=)(.*)(?=\\nSESSION_TOKEN)', multiline=True) }}"
+ aws_security_token: "{{ response.content | regex_search('(?<=SESSION_TOKEN=)(.*)(?=\\nEXPIRATION)', multiline=True) }}"
+ when: not skip_molecule_task|bool
+
+- name: Set AWS credentials for accessing necessary files (for Molecule in AWS)
+ set_fact:
+ aws_key: "{{ lookup('env','AWS_ACCESS_KEY') }}"
+ aws_secret: "{{ lookup('env','AWS_SECRET_KEY') }}"
+ when: skip_molecule_task|bool
+
+- name: Choose documentation version (not teleop)
+ block:
+ - name: Choose Dexterous Hand Lite
+ set_fact:
+ documentation_folder: "documentation/dexterous_hand_lite"
+ documentation_file: "dexterous-hand-lite-{{ hand_lite_version }}.pdf"
+ readthedocs_link: "{{ dexterous_hand_lite_readthedocs_link }}"
+ doc_icon_name: Dexterous Hand-Lite Documentation
+ when:
+ - "'arm_' not in product"
+ - "'glove_' not in product"
+ - "product == 'hand_lite' or product == 'hand_extra_lite'"
+ - product is defined
+
+ - name: Choose Dexterous Hand
+ set_fact:
+ documentation_folder: "documentation/dexterous_hand"
+ documentation_file: "dexterous-hand-{{ hand_e_version }}.pdf"
+ readthedocs_link: "{{ dexterous_hand_readthedocs_link }}"
+ doc_icon_name: Dexterous Hand Documentation
+ when:
+ - "'arm_' not in product"
+ - "'glove_' not in product"
+ - product == 'hand_e'
+ - product is defined
+
+ - name: Choose Dexterous Hand and Arm
+ set_fact:
+ documentation_folder: "documentation/dexterous_hand_arm"
+ documentation_file: "dexterous-hand-arm-{{ hand_arm_version }}.pdf"
+ readthedocs_link: "{{ arm_hand_readthedocs_link }}"
+ doc_icon_name: Dexterous Hand and Arm Documentation
+ when:
+ - "'arm_' in product"
+ - "'glove_' not in product"
+ - product is defined
+
+ - name: Choose Dexterous Hand and Glove
+ set_fact:
+ documentation_folder: "documentation/dexterous_hand_glove"
+ documentation_file: "dexterous-hand-glove-{{ hand_glove_version }}.pdf"
+ readthedocs_link: "{{ glove_hand_readthedocs_link }}"
+ doc_icon_name: Dexterous Hand and Glove Documentation
+ when:
+ - "'arm_' not in product"
+ - "'glove_' in product"
+ - product is defined
+ when:
+ - product is defined
+
+- name: Choose documentation version (teleop)
+ block:
+ - name: Choose Teleop Polhemus
+ set_fact:
+ documentation_folder: "documentation/teleop_polhemus"
+ documentation_file: "teleop-polhemus-{{ teleop_polhemus_version }}.pdf"
+ readthedocs_link: "{{ shadow_glove_teleop_readthedocs_link }}"
+ doc_icon_name: Shadow Teleop Documentation
+ when:
+ - glove == "shadow_glove"
+ - product is not defined
+
+ - name: Choose Teleop Haptx
+ set_fact:
+ documentation_folder: "documentation/teleop_haptx"
+ documentation_file: "teleop-haptx-{{ teleop_haptx_version }}.pdf"
+ readthedocs_link: "{{ haptx_teleop_readthedocs_link }}"
+ doc_icon_name: Shadow Teleop Documentation
+ when:
+ - glove == "haptx"
+ when:
+ - product is not defined
+
+
+- name: Downloading the Documentation from AWS to Desktop
+ amazon.aws.s3_object:
+ aws_access_key: "{{ aws_key }}"
+ aws_secret_key: "{{ aws_secret }}"
+ security_token: "{{ aws_security_token }}"
+ bucket: "{{ bucket_name }}"
+ object: "{{ documentation_folder }}/{{ documentation_file }}"
+ dest: "{{ manual_folder }}/{{ manual_filename }}"
+ mode: get
+ when: not skip_molecule_task|bool
+ changed_when: false
+
+- name: Downloading the Documentation from AWS to Desktop (for Molecule in AWS)
+ amazon.aws.s3_object:
+ aws_access_key: "{{ aws_key }}"
+ aws_secret_key: "{{ aws_secret }}"
+ bucket: "{{ bucket_name }}"
+ object: "{{ documentation_folder }}/{{ documentation_file }}"
+ dest: "{{ manual_folder }}/{{ manual_filename }}"
+ mode: get
+ when: skip_molecule_task|bool
+ changed_when: false
+
+- name: Create the Documentation desktop icon
+ import_tasks: create-icon.yml
+ vars:
+ desktop_icon_png: "documentation_icon.png"
+ launch_script: "shadow_launcher_doc_exec.sh"
+ desktop_icon_name: "{{ doc_icon_name }}"
+ desktop_icon_path: "{{ doc_icon_name }}"
+ launch_terminal: "false"
+ live_website_url_var: "{{ readthedocs_link }}"
+ file_path_var: "{{ manual_folder }}/{{ manual_filename }}"
diff --git a/ansible/roles/products/common/dolphin-icons/defaults/main.yml b/ansible/roles/products/common/dolphin-icons/defaults/main.yml
index f2c5f929d..cb6551d57 100644
--- a/ansible/roles/products/common/dolphin-icons/defaults/main.yml
+++ b/ansible/roles/products/common/dolphin-icons/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ user }}"
diff --git a/ansible/roles/products/common/dolphin-icons/tasks/main.yml b/ansible/roles/products/common/dolphin-icons/tasks/main.yml
index bf89b518c..4784d4ef4 100644
--- a/ansible/roles/products/common/dolphin-icons/tasks/main.yml
+++ b/ansible/roles/products/common/dolphin-icons/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Dolphin file manager installation for Icons handling
apt:
@@ -261,15 +275,25 @@
dest: "{{ shadow_hand_launcher_folder }}/shadow_hand_launcher/shadowlogo.png"
mode: '664'
-- name: Create desktop icon for Dolphin file manager
+- name: Create main {{ container_name | replace('_', ' ') | title }} desktop icon for Dolphin file manager
template:
src: ../../../common/resources/templates/desktop-icons/standard-icon-command.j2
- dest: "{{ desktop_path }}/Shadow Launcher {{ container_name | replace('_', ' ') | title }}.desktop"
+ dest: "{{ desktop_path }}/{{ container_name | replace('_', ' ') | title }}.desktop"
mode: '755'
vars:
- desktop_shortcut_name: "Shadow Launcher {{ container_name | replace('_', ' ') | title }}"
- comment: "Shadow Launcher {{ container_name | replace('_', ' ') | title }}"
+ desktop_shortcut_name: "{{ container_name | replace('_', ' ') | title }}"
+ comment: "{{ container_name | replace('_', ' ') | title }}"
exec_command: "dolphin '{{ shadow_hand_launcher_folder }}/Shadow Icons'"
icon_file_name: "shadowlogo.png"
folder: "{{ shadow_hand_launcher_folder }}/shadow_hand_launcher"
start_terminal: "false"
+
+- name: Make main {{ container_name | replace('_', ' ') | title }} desktop icon Trusted
+ shell: gio set "{{ desktop_path }}/{{ container_name | replace('_', ' ') | title }}.desktop" "metadata::trusted" true
+
+- name: Make all desktop icons auto_execute
+ shell: kwriteconfig5 --file kiorc --group 'Executable scripts' --key 'behaviourOnLaunch' 'execute'
+ changed_when: false
+
+- name: Restart GNOME Display Manager (Desktop refresh)
+ shell: killall -SIGQUIT gnome-shell
diff --git a/ansible/roles/products/common/get-system-variables/tasks/main.yml b/ansible/roles/products/common/get-system-variables/tasks/main.yml
index ab03f4022..282ca7221 100644
--- a/ansible/roles/products/common/get-system-variables/tasks/main.yml
+++ b/ansible/roles/products/common/get-system-variables/tasks/main.yml
@@ -1,13 +1,32 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- - name: get dekstop path
- shell: xdg-user-dir DESKTOP
- register: desktop_path_shell
- when: skip_molecule_task is not defined
-
- - name:
- set_fact: desktop_path="{{ desktop_path_shell.stdout }}"
- when: skip_molecule_task is not defined
-
- - name:
- set_fact: desktop_path="/home/{{ user }}/Desktop"
- when: skip_molecule_task is defined
+- name: get dekstop path
+ shell: xdg-user-dir DESKTOP
+ register: desktop_path_shell
+ when: not skip_molecule_task|bool
+
+- name: set desktop path
+ set_fact: desktop_path="{{ desktop_path_shell.stdout }}"
+ when: not skip_molecule_task|bool
+
+- name: set desktop path (for molecule tests)
+ set_fact: desktop_path="/home/{{ user }}/Desktop"
+ when: skip_molecule_task|bool
+
+- name: Ensure desktop folder exists
+ file:
+ path: "{{ desktop_path }}"
+ state: directory
\ No newline at end of file
diff --git a/ansible/roles/products/common/hand-manual/defaults/main.yml b/ansible/roles/products/common/hand-manual/defaults/main.yml
deleted file mode 100644
index accbc3f7e..000000000
--- a/ansible/roles/products/common/hand-manual/defaults/main.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-user: "{{ ansible_user_id }}"
-user_folder: "/home/{{ user }}"
-manual_folder: "{{ desktop_path }}"
-manual_filename: "Palm_EDC_User_Manual_1.7.pdf"
diff --git a/ansible/roles/products/common/hand-manual/meta/requirements.yml b/ansible/roles/products/common/hand-manual/meta/requirements.yml
deleted file mode 100644
index f1a2e5fdf..000000000
--- a/ansible/roles/products/common/hand-manual/meta/requirements.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-collections:
- - amazon.aws
diff --git a/ansible/roles/products/common/hand-manual/tasks/main.yml b/ansible/roles/products/common/hand-manual/tasks/main.yml
deleted file mode 100644
index b83b45586..000000000
--- a/ansible/roles/products/common/hand-manual/tasks/main.yml
+++ /dev/null
@@ -1,52 +0,0 @@
----
-- name: Ensure botocore and boto3 modules are installed
- pip:
- name: [ "boto3", "botocore"]
- extra_args: "--user"
- changed_when: false
-
-- name: Connect to Shadow AWS API
- uri:
- url: https://5vv2z6j3a7.execute-api.eu-west-2.amazonaws.com/prod
- method: GET
- return_content: yes
- headers:
- x-api-key: "{{ customer_key }}"
- register: response
- when: skip_molecule_task is not defined
-
-- name: Set temporary AWS credentials for accessing necessary files
- set_fact:
- aws_key: "{{ response.content | regex_search('(?<=ACCESS_KEY_ID=)(.*)(?=\\nSECRET_ACCESS_KEY)', multiline=True) }}"
- aws_secret: "{{ response.content | regex_search('(?<=SECRET_ACCESS_KEY=)(.*)(?=\\nSESSION_TOKEN)', multiline=True) }}"
- aws_security_token: "{{ response.content | regex_search('(?<=SESSION_TOKEN=)(.*)(?=\\nEXPIRATION)', multiline=True) }}"
- when: skip_molecule_task is not defined
-
-- name: Set AWS credentials for accessing necessary files (for Molecule in AWS)
- set_fact:
- aws_key: "{{ lookup('env','AWS_ACCESS_KEY') }}"
- aws_secret: "{{ lookup('env','AWS_SECRET_KEY') }}"
- when: skip_molecule_task is defined
-
-- name: Downloading the hand manual from AWS to Desktop
- amazon.aws.aws_s3:
- aws_access_key: "{{ aws_key }}"
- aws_secret_key: "{{ aws_secret }}"
- security_token: "{{ aws_security_token }}"
- bucket: shadowrobot.aurora.files
- object: "/server/{{ manual_filename }}"
- dest: "{{ manual_folder }}/{{ manual_filename }}"
- mode: get
- when: skip_molecule_task is not defined
- changed_when: false
-
-- name: Downloading the hand manual from AWS to Desktop (for Molecule in AWS)
- amazon.aws.aws_s3:
- aws_access_key: "{{ aws_key }}"
- aws_secret_key: "{{ aws_secret }}"
- bucket: shadowrobot.aurora.files
- object: "/server/{{ manual_filename }}"
- dest: "{{ manual_folder }}/{{ manual_filename }}"
- mode: get
- when: skip_molecule_task is defined
- changed_when: false
diff --git a/ansible/roles/products/common/hand_config/tasks/main.yml b/ansible/roles/products/common/hand_config/tasks/main.yml
index e8efd9de5..0ed2a7f83 100644
--- a/ansible/roles/products/common/hand_config/tasks/main.yml
+++ b/ansible/roles/products/common/hand_config/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Create temporary script file
file:
@@ -9,29 +23,36 @@
copy:
dest: /tmp/update_hand_config.sh
content: |
- #!/usr/bin/env bash
- # Used to update hand config.
- cd ~/projects/shadow_robot/base_deps/src/sr_hand_config
- git_branch=$(git rev-parse --abbrev-ref HEAD | xargs)
- if [[ `git status --porcelain` ]]; then
- file_changed=true
- else
- file_changed=false
- fi
-
- git remote set-url origin https://github.com/shadow-robot/sr_hand_config
- if [[ $git_branch == "master" && $file_changed == false ]]; then
- echo "Pulling the latest sr_hand_config changes."
- git pull
- elif [[ $git_branch != "master" && $file_changed == false ]]; then
- echo "Pulling the latest sr_hand_config changes to master branch then switching back to branch $git_branch"
- git checkout master --quiet 1> /dev/null
- git pull
- git checkout $git_branch --quiet 1> /dev/null
- else
- echo "You have un-commited changes in sr_hand_config, not pulling any changes automatically."
- fi
- cd ~
+ #!/usr/bin/env bash
+ # Check if there is internet connection
+ if ! wget -q --spider https://www.google.com/; then
+ echo "There is no internet connection. Nothing will be pulled."
+ exit 1
+ fi
+
+ # Used to update hand config.
+ cd ~/projects/shadow_robot/base_deps/src/sr_hand_config
+ git_branch=$(git rev-parse --abbrev-ref HEAD | xargs)
+
+ if [[ `git status --porcelain` ]]; then
+ file_changed=true
+ else
+ file_changed=false
+ fi
+
+ git remote set-url origin https://github.com/shadow-robot/sr_hand_config
+ if [[ $git_branch == "master" && $file_changed == false ]]; then
+ echo "Pulling the latest sr_hand_config changes."
+ timeout 5s git pull
+ elif [[ $git_branch != "master" && $file_changed == false ]]; then
+ echo "Pulling the latest sr_hand_config changes to master branch then switching back to branch $git_branch"
+ git checkout master --quiet 1> /dev/null
+ timeout 5s git pull
+ git checkout $git_branch --quiet 1> /dev/null
+ else
+ echo "You have un-commited changes in sr_hand_config, not pulling any changes automatically."
+ fi
+ cd ~
- name: Move script folder over
shell: "docker cp /tmp/update_hand_config.sh {{ container_name }}:/bin/update_hand_config.sh"
diff --git a/ansible/roles/products/common/local-hand-launch/defaults/main.yml b/ansible/roles/products/common/local-hand-launch/defaults/main.yml
index cf7a2ca43..6a2c5ddac 100644
--- a/ansible/roles/products/common/local-hand-launch/defaults/main.yml
+++ b/ansible/roles/products/common/local-hand-launch/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ user }}"
@@ -9,12 +23,11 @@ bimanual_hands_picture: hand-e-bimanual.png
product: hand_e
setup_directory: "/usr/local/bin"
icon_folder: "{{ desktop_path }}/Local Launch"
-launch_hand: false
override_launch_hand: false
-sim_hand: false
use_steamvr: false
launch_package_name: "sr_robot_launch"
launch_file_name: "srhand.launch"
override_launch_hand_var: false
uses_autodetect: false
hand_side_ad: ""
+simulate_icons: false
diff --git a/ansible/roles/products/common/local-hand-launch/tasks/main.yml b/ansible/roles/products/common/local-hand-launch/tasks/main.yml
index da2623954..e55068259 100644
--- a/ansible/roles/products/common/local-hand-launch/tasks/main.yml
+++ b/ansible/roles/products/common/local-hand-launch/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Setup script names
set_fact:
@@ -10,14 +24,14 @@
right_hand_picture: hand_lite.jpg
left_hand_picture: hand_lite_left.jpg
bimanual_hands_picture: hand_lite_bimanual.jpg
- when: product=='hand_lite'
+ when: '"hand_lite" in product'
- name: Set icon picture filenames for hand_extra_lite
set_fact:
right_hand_picture: hand_extra_lite.jpg
left_hand_picture: hand_extra_lite_left.jpg
bimanual_hands_picture: hand_extra_lite_bimanual.jpg
- when: product=='hand_extra_lite'
+ when: '"hand_extra_lite" in product'
- name: Creating server setup script for local right hand launch
template:
@@ -25,7 +39,7 @@
dest: "{{ shadow_hand_launcher_folder }}/{{ local_right_setup_script }}"
mode: '755'
vars:
- launch_file_name: "srhand.launch sim:={{ sim_hand }} hand_side_ad:=-r"
+ launch_file_name: "srhand.launch sim:={{ simulate_icons }} hand_id:=rh hand_side_ad:=-r"
launch_package_name: "sr_robot_launch"
override_launch_hand: "{{ override_launch_hand_var }}"
when: bimanual|bool or hand_side=="right"
@@ -36,7 +50,7 @@
dest: "{{ shadow_hand_launcher_folder }}/{{ local_left_setup_script }}"
mode: '755'
vars:
- launch_file_name: "srhand.launch sim:={{ sim_hand }} hand_side_ad:=-l"
+ launch_file_name: "srhand.launch sim:={{ simulate_icons }} hand_id:=lh hand_side_ad:=-l"
launch_package_name: "sr_robot_launch"
override_launch_hand: "{{ override_launch_hand_var }}"
when: bimanual|bool or hand_side=="left"
@@ -47,7 +61,7 @@
dest: "{{ shadow_hand_launcher_folder }}/{{ local_bm_setup_script }}"
mode: '755'
vars:
- launch_file_name: "sr_bimanual.launch sim:={{ sim_hand }}"
+ launch_file_name: "sr_bimanual.launch sim:={{ simulate_icons }}"
launch_package_name: "sr_robot_launch"
override_launch_hand: "{{ override_launch_hand_var }}"
when: bimanual|bool
@@ -104,7 +118,7 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
when: bimanual|bool or hand_side=="right"
@@ -142,7 +156,7 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
when: bimanual|bool or hand_side=="left"
@@ -180,8 +194,6 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
when: bimanual|bool
-
-
diff --git a/ansible/roles/products/common/local-zero-force-mode-launch/defaults/main.yml b/ansible/roles/products/common/local-zero-force-mode-launch/defaults/main.yml
index 27937d9c1..63a943931 100644
--- a/ansible/roles/products/common/local-zero-force-mode-launch/defaults/main.yml
+++ b/ansible/roles/products/common/local-zero-force-mode-launch/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ user }}"
@@ -9,10 +23,8 @@ bimanual_hands_picture: hand-e-bimanual.png
product: hand_e
setup_directory: "/usr/local/bin"
icon_folder: "{{ desktop_path }}/Local Launch"
-launch_hand: false
override_launch_hand: false
use_steamvr: false
-sim_hand: false
launch_package_name: "sr_robot_launch"
launch_file_name: "sr_hardware_control_loop.launch pwm_control:=false hand_ctrl:=false arm:=false"
uses_autodetect: False
diff --git a/ansible/roles/products/common/local-zero-force-mode-launch/tasks/main.yml b/ansible/roles/products/common/local-zero-force-mode-launch/tasks/main.yml
index 7ff74c7d7..5aa9e70a4 100644
--- a/ansible/roles/products/common/local-zero-force-mode-launch/tasks/main.yml
+++ b/ansible/roles/products/common/local-zero-force-mode-launch/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Setup script names
set_fact:
@@ -20,13 +34,23 @@
bimanual_hands_picture: hand_extra_lite_bimanual.jpg
when: product=='hand_extra_lite'
+- name: set product variable
+ set_fact:
+ hand_type_value: "hand_type:=hand_g"
+ when: '"hand_extra_lite" in product or "hand_lite" in product'
+
+- name: set product variable
+ set_fact:
+ hand_type_value: "hand_type:=hand_e"
+ when: 'product is not defined or "hand_e" in product'
+
- name: Creating the setup script for Local Zero Force Mode - Right Hand
template:
src: ../../../common/resources/templates/scripts/setup-hand.j2
dest: "{{ shadow_hand_launcher_folder }}/{{ local_zero_force_mode_right_hand_script }}"
mode: '755'
vars:
- launch_file_name: "sr_hardware_control_loop.launch pwm_control:=false hand_ctrl:=false arm:=false"
+ launch_file_name: "sr_hardware_control_loop.launch pwm_control:=false hand_ctrl:=false arm:=false {{ hand_type_value }}"
launch_package_name: "sr_robot_launch"
uses_autodetect: True
override_launch_hand: True
@@ -45,7 +69,7 @@
dest: "{{ shadow_hand_launcher_folder }}/{{ local_zero_force_mode_left_hand_script }}"
mode: '755'
vars:
- launch_file_name: "sr_hardware_control_loop.launch pwm_control:=false hand_ctrl:=false arm:=false"
+ launch_file_name: "sr_hardware_control_loop.launch pwm_control:=false hand_ctrl:=false arm:=false {{ hand_type_value }}"
launch_package_name: "sr_robot_launch"
uses_autodetect: True
override_launch_hand: True
@@ -92,7 +116,7 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
when: bimanual|bool or hand_side=="right"
@@ -130,6 +154,6 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
when: bimanual|bool or hand_side=="left"
diff --git a/ansible/roles/products/common/record-hand-data/defaults/main.yml b/ansible/roles/products/common/record-hand-data/defaults/main.yml
index 8795ceb79..586373b1f 100644
--- a/ansible/roles/products/common/record-hand-data/defaults/main.yml
+++ b/ansible/roles/products/common/record-hand-data/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
record_all_data_from: []
diff --git a/ansible/roles/products/common/record-hand-data/tasks/main.yml b/ansible/roles/products/common/record-hand-data/tasks/main.yml
index 5c7ddb5a1..538e46b0d 100644
--- a/ansible/roles/products/common/record-hand-data/tasks/main.yml
+++ b/ansible/roles/products/common/record-hand-data/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Custom shared volume for bag storage
block:
diff --git a/ansible/roles/products/common/resources/files/arm_hand_bimanual.jpg b/ansible/roles/products/common/resources/files/arm_hand_bimanual.jpg
deleted file mode 100644
index 806d4ec2c..000000000
Binary files a/ansible/roles/products/common/resources/files/arm_hand_bimanual.jpg and /dev/null differ
diff --git a/ansible/roles/products/common/resources/files/arm_hand_bimanual.png b/ansible/roles/products/common/resources/files/arm_hand_bimanual.png
new file mode 100644
index 000000000..10672df84
Binary files /dev/null and b/ansible/roles/products/common/resources/files/arm_hand_bimanual.png differ
diff --git a/ansible/roles/products/common/resources/files/arm_hand_left.jpg b/ansible/roles/products/common/resources/files/arm_hand_left.jpg
deleted file mode 100644
index e7eb7562e..000000000
Binary files a/ansible/roles/products/common/resources/files/arm_hand_left.jpg and /dev/null differ
diff --git a/ansible/roles/products/common/resources/files/arm_hand_left.png b/ansible/roles/products/common/resources/files/arm_hand_left.png
new file mode 100644
index 000000000..56f83c780
Binary files /dev/null and b/ansible/roles/products/common/resources/files/arm_hand_left.png differ
diff --git a/ansible/roles/products/common/resources/files/arm_hand_right.jpeg b/ansible/roles/products/common/resources/files/arm_hand_right.jpeg
deleted file mode 100644
index 5ccb873e9..000000000
Binary files a/ansible/roles/products/common/resources/files/arm_hand_right.jpeg and /dev/null differ
diff --git a/ansible/roles/products/common/resources/files/arm_hand_right.png b/ansible/roles/products/common/resources/files/arm_hand_right.png
new file mode 100644
index 000000000..f89d149b5
Binary files /dev/null and b/ansible/roles/products/common/resources/files/arm_hand_right.png differ
diff --git a/ansible/roles/products/common/resources/files/system-check.png b/ansible/roles/products/common/resources/files/system-check.png
new file mode 100644
index 000000000..726416a0a
Binary files /dev/null and b/ansible/roles/products/common/resources/files/system-check.png differ
diff --git a/ansible/roles/products/common/resources/templates/desktop-icons/standard-icon-command.j2 b/ansible/roles/products/common/resources/templates/desktop-icons/standard-icon-command.j2
index d8968589c..8c20a9569 100644
--- a/ansible/roles/products/common/resources/templates/desktop-icons/standard-icon-command.j2
+++ b/ansible/roles/products/common/resources/templates/desktop-icons/standard-icon-command.j2
@@ -9,4 +9,3 @@ Terminal={{ start_terminal }}
Type=Application
Categories=Utility;Application;
GenericName[en_GB]={{ comment }}
-
diff --git a/ansible/roles/products/common/resources/templates/scripts/close-everything.j2 b/ansible/roles/products/common/resources/templates/scripts/close-everything.j2
index e37cb5de3..860574340 100644
--- a/ansible/roles/products/common/resources/templates/scripts/close-everything.j2
+++ b/ansible/roles/products/common/resources/templates/scripts/close-everything.j2
@@ -8,6 +8,12 @@ NUC_RECORD="/control_box/record"
SERVER_RECORD="/server_record"
COMMON_ROSNODE_KILL_COMMAND="rosnode list | grep /bag_rotate | xargs -I{} rosnode kill {}; rosnode kill -all"
(
+ docker exec $CONTAINER_NAME bash -c "source /home/user/projects/shadow_robot/base/devel/setup.bash;rosparam get /diagnostic_aggregator/load_diagnostic_analyzer/hand_serials_list"
+ returncode=$?
+ if [ $returncode -eq 0 ]; then
+ echo "# Calibrating hand before closing everything"
+ docker exec $CONTAINER_NAME bash -c "source /home/user/projects/shadow_robot/base/devel/setup.bash;roslaunch sr_utilities calibrate_hand_finder.launch node_shutdown:=true node_timeout:=10"
+ fi
if $CLOSE_NUC_PROCESSES;
then
echo "# Stopping Shadow Robot processes in the NUC container"
@@ -17,16 +23,16 @@ COMMON_ROSNODE_KILL_COMMAND="rosnode list | grep /bag_rotate | xargs -I{} rosnod
fi
echo 10
echo "# Stopping Shadow Robot processes in the server container"
- docker exec $CONTAINER_NAME bash -c "rosnode kill $SERVER_RECORD; $COMMON_ROSNODE_KILL_COMMAND" || true &
- sleep 2
+ timeout 10 docker exec $CONTAINER_NAME bash -c "rosnode kill $SERVER_RECORD; $COMMON_ROSNODE_KILL_COMMAND" || true
+ sleep 0.2
echo 20
- sleep 2
+ sleep 0.2
echo 30
- sleep 2
+ sleep 0.2
echo 40
- sleep 2
+ sleep 0.2
echo 50
- sleep 2
+ sleep 0.2
echo 60
if $CLOSE_NUC_PROCESSES;
then
@@ -45,4 +51,5 @@ COMMON_ROSNODE_KILL_COMMAND="rosnode list | grep /bag_rotate | xargs -I{} rosnod
echo "# All Shadow Robot processes closed!"
echo 100
echo $pids | xargs kill -15
-) | zenity --title "Closing all Shadow Robot processes" --progress --auto-kill
+ sleep 5
+) | zenity --title "Closing all Shadow Robot processes" --progress --auto-kill --auto-close
diff --git a/ansible/roles/products/common/resources/templates/scripts/documentation.j2 b/ansible/roles/products/common/resources/templates/scripts/documentation.j2
new file mode 100644
index 000000000..e2b557b25
--- /dev/null
+++ b/ansible/roles/products/common/resources/templates/scripts/documentation.j2
@@ -0,0 +1,19 @@
+#jinja2: trim_blocks:False
+#! /bin/bash
+LIVE_URL={{ live_website_url }}
+live_url_available=false
+
+if [[ -n ${LIVE_URL} ]];
+then
+ check=$(curl -s -w "%{http_code}\n" -L "${LIVE_URL}" -o /dev/null)
+ if [[ $check == 200 ]]; then
+ live_url_available=true
+ echo "{{ local_website_name }}'s live url is available on the internet! Opening it now in a browser..."
+ xdg-open {{ live_website_url }}
+ sleep 3
+ fi
+fi
+if ! $live_url_available;
+then
+ xdg-open {{ file_path }}
+fi
diff --git a/ansible/roles/products/common/resources/templates/scripts/roslaunch-script.j2 b/ansible/roles/products/common/resources/templates/scripts/roslaunch-script.j2
index 38fa1b4cc..ac6fe6fca 100644
--- a/ansible/roles/products/common/resources/templates/scripts/roslaunch-script.j2
+++ b/ansible/roles/products/common/resources/templates/scripts/roslaunch-script.j2
@@ -1,2 +1,2 @@
#jinja2: trim_blocks:False
-docker exec -it --user user {{ container_name }} bash -c "xhost +local:{{ ansible_host }};export DISPLAY={{ lookup('env','DISPLAY') }};source /home/user/projects/shadow_robot/base/devel/setup.bash;roslaunch {{ project_name }} {{ launch_file | regex_replace('\$', '\\\$') }}"
+docker exec -it --user user {{ container_name }} bash -c "xhost +local:{{ ansible_host }};export DISPLAY={{ lookup('env','DISPLAY') }};export ROSCONSOLE_FORMAT='"'[${severity}](${node}): [${time}] ${message}'"';export ROSCONSOLE_STDOUT_LINE_BUFFERED=1;source /home/user/projects/shadow_robot/base/devel/setup.bash;roslaunch {{ project_name }} {{ launch_file | regex_replace('\$', '\\\$') }}"
diff --git a/ansible/roles/products/common/resources/templates/scripts/rosrun-script.j2 b/ansible/roles/products/common/resources/templates/scripts/rosrun-script.j2
index c7ae2666d..ed6d8eac1 100644
--- a/ansible/roles/products/common/resources/templates/scripts/rosrun-script.j2
+++ b/ansible/roles/products/common/resources/templates/scripts/rosrun-script.j2
@@ -1,2 +1,2 @@
#jinja2: trim_blocks:False
-docker exec -it --user user {{ container_name }} bash -c 'source /home/user/projects/shadow_robot/base/devel/setup.bash;rosrun {{ project_name }} {{ script_name }}'
+docker exec -it --user user {{ container_name }} bash -c "export ROSCONSOLE_FORMAT='"'[${severity}](${node}): [${time}] ${message}'"';export ROSCONSOLE_STDOUT_LINE_BUFFERED=1;source /home/user/projects/shadow_robot/base/devel/setup.bash;rosrun {{ project_name }} {{ script_name }}"
diff --git a/ansible/roles/products/common/resources/templates/scripts/setup-hand.j2 b/ansible/roles/products/common/resources/templates/scripts/setup-hand.j2
index e0e11f871..84186b685 100644
--- a/ansible/roles/products/common/resources/templates/scripts/setup-hand.j2
+++ b/ansible/roles/products/common/resources/templates/scripts/setup-hand.j2
@@ -8,24 +8,16 @@ fi
# move ssh key to ssh folder
if [ -f /tmp/id_rsa ]; then
+ if [ ! -d /home/user/.ssh ]; then
+ mkdir -p /home/user/.ssh
+ fi
mv /tmp/id_rsa /home/user/.ssh/id_rsa
fi
-if {{ launch_hand | lower }}; then
- if {{ sim_hand | lower }}; then
- roslaunch sr_robot_launch srhand.launch sim:=true
+
+if {{ override_launch_hand | lower }}; then
+ if {{ uses_autodetect | lower }}; then
+ sr_hand_autodetect {{ hand_side_ad }} roslaunch {{ launch_package_name }} {{ launch_file_name }} 2> >(tee -a /home/user/.ros/log/stderr.log >&2)
else
- if {{ uses_autodetect | lower }}; then
- sr_hand_autodetect {{ hand_side_ad }} roslaunch {{ launch_package_name }} {{ launch_file_name }} 2> >(tee -a /home/user/.ros/log/stderr.log >&2)
- else
- roslaunch {{ launch_package_name }} {{ launch_file_name }} 2> >(tee -a /home/user/.ros/log/stderr.log >&2)
- fi
- fi
-else
- if {{ override_launch_hand | lower }}; then
- if {{ uses_autodetect | lower }}; then
- sr_hand_autodetect {{ hand_side_ad }} roslaunch {{ launch_package_name }} {{ launch_file_name }} 2> >(tee -a /home/user/.ros/log/stderr.log >&2)
- else
- roslaunch {{ launch_package_name }} {{ launch_file_name }} 2> >(tee -a /home/user/.ros/log/stderr.log >&2)
- fi
+ roslaunch {{ launch_package_name }} {{ launch_file_name }} 2> >(tee -a /home/user/.ros/log/stderr.log >&2)
fi
fi
diff --git a/ansible/roles/products/common/resources/templates/scripts/system-check.j2 b/ansible/roles/products/common/resources/templates/scripts/system-check.j2
new file mode 100644
index 000000000..94f15b35d
--- /dev/null
+++ b/ansible/roles/products/common/resources/templates/scripts/system-check.j2
@@ -0,0 +1,128 @@
+#jinja2: trim_blocks:False
+#!/bin/bash
+
+NUC_USERNAME={{ nuc_username }}
+NUC_ADDRESS={{ nuc_address }}
+LOCAL_IP={{ server_ip }}
+USER={{ user }}
+HOSTNAME=$(hostname)
+CLOSE_NUC_PROCESSES={{ close_nuc_processes | lower }}
+NVIDIA_DOCKER={{ nvidia_docker | lower }}
+RED='\033[0;31m'
+NC='\033[0m' # No Color
+
+
+function check_storage_available {
+ # Get available storage space on main drive in GB
+ disk_free=$(df -h / | awk 'NR==2{print $4}')
+
+ # Remove "G" from the disk_free value and convert it to a number
+ disk_free=$(echo "$disk_free" | tr -d "G")
+ disk_free=$(bc <<< "$disk_free * 1")
+
+ # Check if available storage space is less than 50GB
+ if [[ $disk_free -lt 50 ]]; then
+ printf "${RED}Error: Available storage space on main drive is less than 50GB.${NC}\n"
+ fi
+}
+
+function check_cpu_and_mem_usage {
+ # Get the current CPU and memory usage
+ CPU=$(top -b -n 1 | grep "Cpu(s)" | awk '{print $2 + $4}')
+ MEM=$(free | awk '/Mem/{printf("%d"), $4/$2*100}')
+ CPU_THRESHOLD=80
+ MEM_THRESHOLD=80
+
+ # Check if usage exceeds the thresholds
+ if (( $(echo "$CPU > $CPU_THRESHOLD" | bc -l) )) || (( $(echo "$MEM > $MEM_THRESHOLD" | bc -l) )); then
+ # If usage is high, print a warning message
+ printf "${RED}Warning: High CPU or memory usage detected!${NC}\n"
+ fi
+ printf "CPU usage: $CPU%%\n"
+ printf "Memory usage: $MEM%%\n\n"
+}
+
+function check_hosts_file {
+ ip_address="$1"
+ hostname="$2"
+ grep -q -E "^$ip_address\s+$hostname\s*$" /etc/hosts
+ if [[ $? != 0 ]]; then
+ printf "\n${RED}Error: The IP address $ip_address and hostname $hostname do not exist in /etc/hosts.${NC}\n"
+ return 1
+ fi
+ return 0
+}
+
+function check_nuc_connection {
+ if ! ping -c 1 $NUC_ADDRESS &> /dev/null; then
+ printf "\n${RED}Error: Cannot ping the NUC at $NUC_ADDRESS. ${NC}\n"
+ return 1
+ fi
+
+ if ! ssh -q -o ConnectTimeout=5 -o BatchMode=yes $NUC_USERNAME@$NUC_ADDRESS "echo 2>&1" >/dev/null; then
+ printf "\n${RED}Error: $NUC_USERNAME@$NUC_ADDRESS is not reachable via SSH.${NC}\n"
+ return 1
+ fi
+
+ check_hosts_file $NUC_ADDRESS nuc-control
+ check_host_result=$?
+ if [ ! "$check_host_result" -eq "0" ]; then
+ return 1
+ fi
+
+ return 0
+}
+
+function check_nvidia_settings {
+ return_val=0
+ if ! command -v nvidia-smi &> /dev/null; then
+ echo "\n${RED}Error: NVIDIA driver not found. Please install it first.${NC}\n"
+ return_val=1
+ fi
+
+ if ! nvidia-smi &> /dev/null; then
+ echo "\n${RED}Error: NVIDIA driver is installed, but not working properly.${NC}\n"
+ return_val=1
+ fi
+
+ if [[ "$(prime-select query)" != *"nvidia"* ]]; then
+ printf "\n${RED}Error: NVIDIA driver is not set as the current GPU using \`prime-select nvidia\`.${NC}\n"
+ return_val=1
+ fi
+ return $return_val
+}
+
+function run_system_test {
+ user=$1
+ address=$2
+ printf "Running system test on $user:$address\n"
+ check_storage_available
+ check_cpu_and_mem_usage
+}
+
+function run_nuc_test {
+ ssh -X $NUC_USERNAME@$NUC_ADDRESS 'bash -s' <.
+
---
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ user }}"
diff --git a/ansible/roles/products/common/roslaunch-icon/tasks/main.yml b/ansible/roles/products/common/roslaunch-icon/tasks/main.yml
index bdd3c402e..173b4241a 100644
--- a/ansible/roles/products/common/roslaunch-icon/tasks/main.yml
+++ b/ansible/roles/products/common/roslaunch-icon/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Copy desktop icon
copy:
@@ -32,4 +46,4 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
diff --git a/ansible/roles/products/common/save-logs-icons/defaults/main.yml b/ansible/roles/products/common/save-logs-icons/defaults/main.yml
index 3463acf02..339f4e787 100644
--- a/ansible/roles/products/common/save-logs-icons/defaults/main.yml
+++ b/ansible/roles/products/common/save-logs-icons/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ user }}"
diff --git a/ansible/roles/products/common/save-logs-icons/tasks/main.yml b/ansible/roles/products/common/save-logs-icons/tasks/main.yml
index 71d06d0c5..d85a2d33f 100644
--- a/ansible/roles/products/common/save-logs-icons/tasks/main.yml
+++ b/ansible/roles/products/common/save-logs-icons/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Ensures that Desktop folder exists
file:
@@ -42,7 +56,7 @@
- not use_aws|bool
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
- name: Create ROS Logs Saver and Uploader desktop icon
when: use_aws|bool
@@ -64,4 +78,4 @@
- use_aws|bool
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
diff --git a/ansible/roles/products/common/save-logs-icons/templates/scripts/save-latest-ros-logs.j2 b/ansible/roles/products/common/save-logs-icons/templates/scripts/save-latest-ros-logs.j2
index a3db517d0..588758748 100644
--- a/ansible/roles/products/common/save-logs-icons/templates/scripts/save-latest-ros-logs.j2
+++ b/ansible/roles/products/common/save-logs-icons/templates/scripts/save-latest-ros-logs.j2
@@ -52,8 +52,8 @@ function copy_logs
docker exec $container_name bash -c "rosnode kill $record_node" || true
docker exec $container_name bash -c "rosnode list | grep /bag_rotate | xargs -I{} rosnode kill {}" || true
sleep 1
- latestbag=$(docker exec $container_name bash -c "ls -dtr $docker_ros_logs_folder/*.bag | tail -1") || true
- latestbag_tmp=$(docker exec $container_name bash -c "ls -dtr $docker_user_home/*.bag | tail -1") || true
+ latestbag=$(docker exec $container_name bash -c "ls -dtr $docker_ros_logs_folder/*.bag* | tail -1") || true
+ latestbag_tmp=$(docker exec $container_name bash -c "ls -dtr $docker_user_home/*.bag* | tail -1") || true
docker exec $container_name bash -c "mkdir -p $docker_logs_temp" || true
docker exec $container_name bash -c "cp $docker_ros_logs_folder/stderr.log $docker_logs_temp" || true
docker exec $container_name bash -c "rm $docker_ros_logs_folder/std*.log" || true
diff --git a/ansible/roles/products/common/scene-files/defaults/main.yml b/ansible/roles/products/common/scene-files/defaults/main.yml
new file mode 100644
index 000000000..f0ee84d4b
--- /dev/null
+++ b/ansible/roles/products/common/scene-files/defaults/main.yml
@@ -0,0 +1,20 @@
+# Copyright 2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+---
+scene_file: ""
+scene_file_left: ""
+scene_file_right: ""
+scene_file_bimanual: ""
+initial_z: 0.8221
diff --git a/ansible/roles/products/common/scene-files/tasks/main.yml b/ansible/roles/products/common/scene-files/tasks/main.yml
new file mode 100644
index 000000000..bf2f12eb4
--- /dev/null
+++ b/ansible/roles/products/common/scene-files/tasks/main.yml
@@ -0,0 +1,70 @@
+# Copyright 2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+---
+- name: Set scene file when set
+ set_fact:
+ scene_file_left: "{{ scene_file }}"
+ scene_file_right: "{{ scene_file }}"
+ scene_file_bimanual: "{{ scene_file }}"
+ initial_z: 0.8221
+ when: scene_file
+
+- name: Block to set scene file and initial_z
+ block:
+ - name: Set scene and initial_z for production (Bimanual)
+ set_fact:
+ scene_file: "customer_stand_bimanual"
+ scene_file_left: "customer_stand_bimanual_left_only"
+ scene_file_right: "customer_stand_bimanual_right_only"
+ scene_file_bimanual: "customer_stand_bimanual"
+ initial_z: 0.8221
+ when:
+ - bimanual|bool
+ - delivery|bool
+
+ - name: Set scene and initial_z for production (Unimanual)
+ set_fact:
+ scene_file: "customer_stand_unimanual"
+ scene_file_left: "customer_stand_unimanual"
+ scene_file_right: "customer_stand_unimanual"
+ scene_file_bimanual: "customer_stand_unimanual"
+ initial_z: 0.8221
+ when:
+ - not bimanual|bool
+ - delivery|bool
+
+ - name: Set scene and initial_z for developers (Bimanual)
+ set_fact:
+ scene_file: "demo_space_large_bimanual"
+ scene_file_left: "demo_space_large_bimanual"
+ scene_file_right: "demo_space_large_bimanual"
+ scene_file_bimanual: "demo_space_large_bimanual"
+ initial_z: 0.7521
+ when:
+ - bimanual|bool
+ - not delivery|bool
+
+ - name: Set scene and initial_z for developers (Unimanual)
+ set_fact:
+ scene_file: "demo_space_large_unimanual"
+ scene_file_left: "demo_space_large_unimanual"
+ scene_file_right: "demo_space_large_unimanual"
+ scene_file_bimanual: "demo_space_large_unimanual"
+ initial_z: 0.7521
+ when:
+ - not bimanual|bool
+ - not delivery|bool
+ when:
+ - not scene_file
diff --git a/ansible/roles/products/common/setup_nuc_ssh_key/defaults/main.yml b/ansible/roles/products/common/setup_nuc_ssh_key/defaults/main.yml
new file mode 100644
index 000000000..fb7cbe997
--- /dev/null
+++ b/ansible/roles/products/common/setup_nuc_ssh_key/defaults/main.yml
@@ -0,0 +1,19 @@
+# Copyright 2024 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+---
+ssh_keys_path: "{{ user_folder }}/.ssh/id_rsa"
+temp_ssh_keys_path: "/tmp/id_ssh_rsa"
+reverse_ssh_keys_user_path: "{{ user_folder }}/.ssh/reverse_ssh_id_rsa"
+reverse_ssh_keys_temp_path: "/tmp/reverse_ssh_id_rsa"
diff --git a/ansible/roles/products/common/setup_nuc_ssh_key/tasks/main.yml b/ansible/roles/products/common/setup_nuc_ssh_key/tasks/main.yml
new file mode 100644
index 000000000..debfefcd6
--- /dev/null
+++ b/ansible/roles/products/common/setup_nuc_ssh_key/tasks/main.yml
@@ -0,0 +1,81 @@
+# Copyright 2024 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+---
+- name: Check if the ssh public key has been generated and copied to temp_ssh_keys_path folder on machine running Ansible (server laptop)
+ stat:
+ path: "{{ temp_ssh_keys_path }}.pub"
+ register: ssh_result
+ delegate_to: 127.0.0.1
+
+- name: Check if the ssh private key has been generated and copied to temp_ssh_keys_path folder on machine running Ansible (server laptop)
+ stat:
+ path: "{{ temp_ssh_keys_path }}"
+ register: ssh_result_private
+ delegate_to: 127.0.0.1
+
+- name: Ensure the private file doesn't exist on the nuc (before we generate it)
+ file:
+ path: "{{ reverse_ssh_keys_temp_path }}"
+ state: absent
+
+- name: Ensure the public ssh file doesn't exist on the nuc (before we generate it)
+ file:
+ path: "{{ reverse_ssh_keys_temp_path }}.pub"
+ state: absent
+
+- name: Generate an OpenSSH keypair with the default values (4096 bits, rsa)
+ openssh_keypair:
+ path: "{{ reverse_ssh_keys_temp_path }}"
+
+- name: Copying ssh key pair into nuc docker container
+ changed_when: false
+ shell: "docker cp {{ reverse_ssh_keys_temp_path }} {{ container_name }}:{{ reverse_ssh_keys_temp_path }}"
+ become: yes
+
+- name: Make ssh folder in container and copy tmp key to the ssh folder
+ import_tasks: ../roles/products/common/docker-container/tasks/modify-container.yml
+ vars:
+ modify_script_name: "make_ssh_folder_and_copy_key.sh"
+ modify_script_commands: "mkdir -p /home/user/.ssh && sudo chown user:user /home/user/.ssh && sudo mv {{ reverse_ssh_keys_temp_path }} {{ reverse_ssh_keys_user_path }}"
+
+- name: Fix ssh key permissions and folder ownership
+ import_tasks: ../roles/products/common/docker-container/tasks/modify-container.yml
+ vars:
+ modify_script_name: "ssh_key_permissions.sh"
+ modify_script_commands: "sudo chmod 600 {{ reverse_ssh_keys_user_path }} && sudo chown user:user {{ reverse_ssh_keys_user_path }}"
+
+- name: Ensure the .ssh file doesn't exist on the server (before we copy it over)
+ file:
+ path: "{{ reverse_ssh_keys_temp_path }}.pub"
+ state: absent
+ delegate_to: 127.0.0.1
+
+- name: Make a copy of SSH public key from the nuc (src) to the server (dest)
+ fetch:
+ src: "{{ reverse_ssh_keys_temp_path }}.pub"
+ dest: "{{ reverse_ssh_keys_temp_path }}.pub"
+ flat: true
+ when: ssh_result.stat.exists
+ changed_when: false
+
+- name: Register SSH public key with current user on the server machine
+ authorized_key:
+ user: "{{ ssh_result.stat.gr_name }}"
+ key: "{{ lookup('file', '{{ reverse_ssh_keys_temp_path }}.pub') }}"
+ state: present
+ when: ssh_result.stat.exists
+ changed_when: false
+ become: yes
+ delegate_to: 127.0.0.1
diff --git a/ansible/roles/products/common/system-check-icon/defaults/main.yml b/ansible/roles/products/common/system-check-icon/defaults/main.yml
new file mode 100644
index 000000000..e0a25417b
--- /dev/null
+++ b/ansible/roles/products/common/system-check-icon/defaults/main.yml
@@ -0,0 +1,22 @@
+# Copyright 2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+---
+user: "{{ ansible_user_id }}"
+user_folder: "/home/{{ user }}"
+container_name: "dexterous_hand"
+shadow_hand_launcher_folder: "{{ user_folder }}/.shadow_launcher_app_{{ container_name }}/shadow_hand_launcher"
+nuc_username: "user"
+nuc_address: "10.9.11.2"
+close_nuc_processes: false
diff --git a/ansible/roles/products/common/system-check-icon/tasks/main.yml b/ansible/roles/products/common/system-check-icon/tasks/main.yml
new file mode 100644
index 000000000..52fb133cf
--- /dev/null
+++ b/ansible/roles/products/common/system-check-icon/tasks/main.yml
@@ -0,0 +1,51 @@
+# Copyright 2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+---
+- name: Copy System Check desktop icon
+ copy:
+ src: ../resources/files/system-check.png
+ dest: "{{ shadow_hand_launcher_folder }}/system-check.png"
+ mode: '664'
+
+- name: Set close_nuc_processes variable
+ set_fact:
+ close_nuc_processes: true
+ when: groups['control_machine'] is defined
+
+- name: Create System Check executable launch script
+ template:
+ src: ../resources/templates/scripts/system-check.j2
+ dest: "{{ shadow_hand_launcher_folder }}/system-check.sh"
+ mode: '755'
+
+- name: Create System Check icon
+ template:
+ src: ../resources/templates/desktop-icons/standard-icon.j2
+ dest: "{{ desktop_path }}/System Check.desktop"
+ mode: '755'
+ vars:
+ desktop_shortcut_name: System Check
+ comment: "Checks the overall status of the system (and nuc if connected)"
+ folder: "{{ shadow_hand_launcher_folder }}"
+ shell_script_file_name: system-check.sh
+ icon_file_name: system-check.png
+ start_terminal: "false"
+
+- name: Make System Check icon Trusted
+ shell: gio set "{{ desktop_path }}/System Check.desktop" "metadata::trusted" yes
+ when:
+ - ansible_distribution|string == 'Ubuntu'
+ - ansible_distribution_release|string == 'bionic'
+ - not skip_molecule_task|bool
\ No newline at end of file
diff --git a/ansible/roles/products/common/validation/defaults/main.yml b/ansible/roles/products/common/validation/defaults/main.yml
index 0adccf8c9..ff133d12c 100644
--- a/ansible/roles/products/common/validation/defaults/main.yml
+++ b/ansible/roles/products/common/validation/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
playbook: ""
boolean_variables:
@@ -8,20 +22,15 @@ boolean_variables:
- use_aws
- use_openvpn
- terminator
- - launch_hand
- use_steamvr
- sim_icon
- - sim_hand
- save_nuc_logs
- demo_icons
- upgrade_check
- bimanual
- demohand_icons
- - biotacs
- allow_auto_reboot
- client_use_steamvr
- - desktop_icon
- - optoforce
- router
boolean_allowed_values:
- true
diff --git a/ansible/roles/products/common/validation/tasks/main.yml b/ansible/roles/products/common/validation/tasks/main.yml
index 5660a60a4..1261f6ceb 100644
--- a/ansible/roles/products/common/validation/tasks/main.yml
+++ b/ansible/roles/products/common/validation/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Check product is defined (for server_and_nuc_deploy and docker_deploy)
assert:
@@ -16,6 +30,14 @@
quiet: yes
when: playbook=="teleop_deploy"
+- name: Make sure arm not used in docker_deploy
+ assert:
+ that:
+ - "'arm_' not in product"
+ fail_msg: "You cannot use the docker_deploy playbook with an arm. This playbook is not suited for arm-related products."
+ quiet: yes
+ when: playbook=="docker_deploy"
+
- name: Make sure arm_ip_right is specified if using teleop or server_and_nuc_deploy with arm, non-sim inventory
assert:
that:
diff --git a/ansible/roles/products/common/web-gui-icon/defaults/main.yml b/ansible/roles/products/common/web-gui-icon/defaults/main.yml
index 572c40cc2..c58e21f80 100644
--- a/ansible/roles/products/common/web-gui-icon/defaults/main.yml
+++ b/ansible/roles/products/common/web-gui-icon/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ user }}"
diff --git a/ansible/roles/products/common/web-gui-icon/tasks/main.yml b/ansible/roles/products/common/web-gui-icon/tasks/main.yml
index ee9823fe9..e0047ee66 100644
--- a/ansible/roles/products/common/web-gui-icon/tasks/main.yml
+++ b/ansible/roles/products/common/web-gui-icon/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Copy desktop icon
copy:
@@ -36,4 +50,4 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
diff --git a/ansible/roles/products/hand-e/control_machine/deploy/defaults/main.yml b/ansible/roles/products/hand-e/control_machine/deploy/defaults/main.yml
index dd2299b61..45b2021e2 100644
--- a/ansible/roles/products/hand-e/control_machine/deploy/defaults/main.yml
+++ b/ansible/roles/products/hand-e/control_machine/deploy/defaults/main.yml
@@ -1,6 +1,20 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
image: "public.ecr.aws/shadowrobot/dexterous-hand"
-tag: "noetic-release"
+tag: "noetic-v1.0.21"
reinstall: false
container_name: "dexterous_hand"
ethercat_left_arm: "enx2"
@@ -11,18 +25,16 @@ user_folder: "/home/{{ user }}"
shadow_hand_launcher_folder: "{{ user_folder }}/.shadow_launcher_app_{{ container_name }}/shadow_hand_launcher"
setup_directory: "/usr/local/bin"
use_aws: false
-launch_hand: false
server_hostname: "SERVER"
ssh_keys_path: "{{ user_folder }}/.ssh/id_rsa"
temp_ssh_keys_path: "/tmp/id_ssh_rsa"
terminator: false
use_steamvr: false
nvidia_docker: false
-sim_hand: false
bimanual: false
hand_side: "right"
ur_robot_type: "ur10e"
arm_ip_left: ""
arm_ip_right: ""
pr_branches: ""
-record_data: false
\ No newline at end of file
+record_data: false
diff --git a/ansible/roles/products/hand-e/control_machine/deploy/tasks/main.yml b/ansible/roles/products/hand-e/control_machine/deploy/tasks/main.yml
index b221ce57c..08cb56a7b 100644
--- a/ansible/roles/products/hand-e/control_machine/deploy/tasks/main.yml
+++ b/ansible/roles/products/hand-e/control_machine/deploy/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Include installation/docker role
include_role:
@@ -13,7 +27,7 @@
- name: Include installation/aws-cli role
include_role:
name: installation/aws-cli-v2
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
- name: Include installation/chrony-client role
include_role:
@@ -107,10 +121,14 @@
- name: Include products/common/hand_config role
include_role:
name: products/common/hand_config
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
- name: Copying NUC arm ip setup script into docker container
changed_when: false
shell: "docker cp {{ user_folder }}/{{ setup_script }} {{ container_name }}:{{ setup_directory }}/{{ setup_script }}"
become: yes
when: arm_ip_left!="" or arm_ip_right!=""
+
+- name: Include products/common/setup_nuc_ssh_key role
+ include_role:
+ name: products/common/setup_nuc_ssh_key
diff --git a/ansible/roles/products/hand-e/deploy/defaults/main.yml b/ansible/roles/products/hand-e/docker-deploy/deploy/defaults/main.yml
similarity index 53%
rename from ansible/roles/products/hand-e/deploy/defaults/main.yml
rename to ansible/roles/products/hand-e/docker-deploy/deploy/defaults/main.yml
index f486eed57..b01bfbd1d 100644
--- a/ansible/roles/products/hand-e/deploy/defaults/main.yml
+++ b/ansible/roles/products/hand-e/docker-deploy/deploy/defaults/main.yml
@@ -1,18 +1,30 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
container_name: "dexterous_hand"
image: "public.ecr.aws/shadowrobot/dexterous-hand"
-tag: "noetic-release"
+tag: "noetic-v1.0.21"
demo_icons: false
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ user }}"
shadow_hand_launcher_folder: "{{ user_folder }}/.shadow_launcher_app_{{ container_name }}/shadow_hand_launcher"
setup_directory: "/usr/local/bin"
upgrade_check: false
-sim_hand: false
reinstall: false
nvidia_docker: false
use_aws: false
-launch_hand: false
hand_side: "right"
bimanual: false
right_hand_picture: hand-e.png
diff --git a/ansible/roles/products/hand-e/docker-deploy/deploy/tasks/main.yml b/ansible/roles/products/hand-e/docker-deploy/deploy/tasks/main.yml
new file mode 100644
index 000000000..52877df88
--- /dev/null
+++ b/ansible/roles/products/hand-e/docker-deploy/deploy/tasks/main.yml
@@ -0,0 +1,69 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+---
+- name: Setup script name
+ set_fact:
+ setup_script: server-setup.sh
+ upgrade_script: "upgrade_image.sh"
+
+- name: Include products/common/clear-icons role
+ include_role:
+ name: products/common/clear-icons
+ when: not skip_molecule_task|bool
+
+- name: Include installation/aws-cli role
+ include_role:
+ name: installation/aws-cli-v2
+ when: not skip_molecule_task|bool
+
+- name: Include installation/docker role
+ include_role:
+ name: installation/docker
+
+- name: Include installation/lxml role
+ include_role:
+ name: installation/lxml
+
+- name: Include installation/terminator role
+ include_role:
+ name: installation/terminator
+
+- name: Include installation/nvidia-docker role
+ include_role:
+ name: installation/nvidia-docker
+ when: nvidia_docker|bool
+
+- name: Include docker/docker-image role
+ include_role:
+ name: docker/docker-image
+
+- name: Include products/common/docker-container role
+ include_role:
+ name: products/common/docker-container
+ vars:
+ container_terminal_title: "{{ product }} container"
+
+- name: Include docker/aws role
+ include_role:
+ name: docker/aws
+ when: use_aws|bool
+
+- name: Include installation/teamviewer role
+ include_role:
+ name: installation/teamviewer
+
+- name: Include docker-deploy/desktop-icons role
+ include_role:
+ name: products/hand-e/docker-deploy/desktop-icons
diff --git a/ansible/roles/products/hand-e/docker-deploy/desktop-icons/defaults/main.yml b/ansible/roles/products/hand-e/docker-deploy/desktop-icons/defaults/main.yml
new file mode 100644
index 000000000..7b516e22b
--- /dev/null
+++ b/ansible/roles/products/hand-e/docker-deploy/desktop-icons/defaults/main.yml
@@ -0,0 +1,33 @@
+# Copyright 2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
+---
+user: "{{ ansible_user_id }}"
+user_folder: "/home/{{ user }}"
+container_name: "dexterous_hand"
+shadow_hand_launcher_folder: "{{ user_folder }}/.shadow_launcher_app_{{ container_name }}/shadow_hand_launcher"
+setup_directory: ""
+sim_icon: false
+upgrade_script: false
+server_ip: "10.9.11.1"
+right_hand_picture: hand-e.png
+left_hand_picture: hand-e-left.png
+bimanual_hands_picture: hand-e-bimanual.png
+initial_z: 0.8221
+arm_x_separation: 0.0
+arm_y_separation: 0.0
+arm_hand_readthedocs_link: ""
+scene_file: ""
+arm_mass_payload: 5.0
+hand_side_ad: ""
\ No newline at end of file
diff --git a/ansible/roles/products/hand-e/deploy/tasks/main.yml b/ansible/roles/products/hand-e/docker-deploy/desktop-icons/tasks/main.yml
similarity index 62%
rename from ansible/roles/products/hand-e/deploy/tasks/main.yml
rename to ansible/roles/products/hand-e/docker-deploy/desktop-icons/tasks/main.yml
index 6a4c72254..b5d960944 100644
--- a/ansible/roles/products/hand-e/deploy/tasks/main.yml
+++ b/ansible/roles/products/hand-e/docker-deploy/desktop-icons/tasks/main.yml
@@ -1,42 +1,35 @@
----
-- name: Include products/common/clear-icons role
- include_role:
- name: products/common/clear-icons
- when: skip_molecule_task is not defined
-
-- name: Setup script name
- set_fact:
- setup_script: server-setup.sh
- upgrade_script: "upgrade_image.sh"
-
-- name: Include installation/aws-cli role
- include_role:
- name: installation/aws-cli-v2
- when: skip_molecule_task is not defined
+# Copyright 2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
-- name: Include installation/terminator role
+---
+- name: Install desktop icon for server container
include_role:
- name: installation/terminator
+ name: products/common/default-icon
+ vars:
+ template: ../../../common/resources/templates/scripts/start-docker-container.j2
+ desktop_icon_png: "laptop.png"
+ launch_script: "shadow_server_container.sh"
+ desktop_icon_name: "Launch Server Container"
+ desktop_icon_path: "Launch Server Container"
+ launch_terminal: "false"
+ hand_side_ad: ""
- name: Include products/common/record-hand-data role
include_role:
name: products/common/record-hand-data
when: record_data
-- name: Include docker/docker-image role
- include_role:
- name: docker/docker-image
-
-- name: Include products/common/docker-container role
- include_role:
- name: products/common/docker-container
- vars:
- container_terminal_title: "{{ product }} container"
-
-- name: Include installation/lxml role
- include_role:
- name: installation/lxml
-
- name: Include products/common/save-logs-icons role
include_role:
name: products/common/save-logs-icons
@@ -54,16 +47,6 @@
demo_icon_folder: "{{ desktop_path }}/Shadow Demos"
when: demo_icons|bool
-- name: Include docker/aws role
- include_role:
- name: docker/aws
- when: use_aws|bool
-
-- name: Include products/common/arm-interfaces role
- include_role:
- name: products/common/arm-interfaces
- when: "'arm_' in product"
-
- name: Creating upgrade script
template:
src: ../../../common/resources/templates/scripts/upgrade_image.j2
@@ -87,9 +70,9 @@
shell: "docker cp {{ shadow_hand_launcher_folder }}/{{ setup_script }} {{ container_name }}:{{ setup_directory }}/{{ setup_script }}"
become: yes
-- name: Include hand-manual role
+- name: Include documentation role
include_role:
- name: products/common/hand-manual
+ name: products/common/documentation
when: customer_key is defined and customer_key | length > 0
- name: Include products/common/local-hand-launch role
@@ -97,20 +80,21 @@
name: products/common/local-hand-launch
vars:
icon_folder: "{{ desktop_path }}"
- override_launch_hand_var: False
+ override_launch_hand_var: True
+ simulate_icons: "{{ sim_icon }}"
- name: Include products/common/local-zero-force-mode-launch role
include_role:
name: products/common/local-zero-force-mode-launch
vars:
icon_folder: "{{ desktop_path }}"
+ when: not sim_icon|bool
- name: Include products/common/hand_config role
include_role:
name: products/common/hand_config
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
- name: Include products/common/close-everything-icon role
include_role:
name: products/common/close-everything-icon
-
diff --git a/ansible/roles/products/hand-e/server/deploy/defaults/main.yml b/ansible/roles/products/hand-e/server/deploy/defaults/main.yml
index 8cc9afe0d..ce2674d1d 100644
--- a/ansible/roles/products/hand-e/server/deploy/defaults/main.yml
+++ b/ansible/roles/products/hand-e/server/deploy/defaults/main.yml
@@ -1,6 +1,20 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
image: "public.ecr.aws/shadowrobot/dexterous-hand"
-tag: "noetic-release"
+tag: "noetic-v1.0.21"
reinstall: false
container_name: "dexterous_hand"
nvidia_docker: true
@@ -11,7 +25,6 @@ user_folder: "/home/{{ user }}"
shadow_hand_launcher_folder: "{{ user_folder }}/.shadow_launcher_app_{{ container_name }}/shadow_hand_launcher"
nuc_username: "user"
setup_directory: "/usr/local/bin"
-launch_hand: false
ssh_keys_path: "{{ user_folder }}/.ssh/id_rsa"
temp_ssh_keys_path: "/tmp/id_ssh_rsa"
save_nuc_logs: true
@@ -21,7 +34,6 @@ terminator: true
use_steamvr: false
sim_icon: false
demo_icons: true
-sim_hand: false
encryption_password: ""
server_ip: "10.9.11.1"
hand_side: "right"
diff --git a/ansible/roles/products/hand-e/server/deploy/tasks/main.yml b/ansible/roles/products/hand-e/server/deploy/tasks/main.yml
index 9c9158bd2..b5d7c1887 100644
--- a/ansible/roles/products/hand-e/server/deploy/tasks/main.yml
+++ b/ansible/roles/products/hand-e/server/deploy/tasks/main.yml
@@ -1,8 +1,22 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Include products/common/clear-icons role
include_role:
name: products/common/clear-icons
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
- name: Set NUC IP address and username for SSH
set_fact:
@@ -23,7 +37,7 @@
- name: Include installation/aws-cli role
include_role:
name: installation/aws-cli-v2
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
- name: Include installation/docker role
include_role:
@@ -54,7 +68,21 @@
- name: Include installation/shadow_glove_driver role
include_role:
name: installation/shadow_glove_driver
- when: glove == "shadow_glove" and real_glove|bool and skip_molecule_task is not defined
+ when: "'glove' in product and not skip_molecule_task|bool"
+
+- name: Udev rules for pedal
+ get_url:
+ url: https://raw.githubusercontent.com/shadow-robot/sr_teleop_devices/noetic-devel/sr_pedal/90-VEC-USB-Footpedal.rules
+ dest: /etc/udev/rules.d/90-VEC-USB-Footpedal.rules
+ mode: '0644'
+ become: yes
+ when: "'glove' in product"
+
+- name: Reload udev rules
+ shell: udevadm control --reload-rules && udevadm trigger
+ changed_when: false
+ become: yes
+ when: "'glove' in product and not skip_molecule_task|bool"
- name: Include docker/docker-image role
include_role:
@@ -84,139 +112,6 @@
term_5: "{{ term_width }}x{{ term_height }}+{{ term_x|int + 2*term_width|int }}+{{ term_y }}"
term_6: "{{ term_width }}x{{ term_height }}+{{ term_x|int + 2*term_width|int }}+{{ term_y|int + term_height|int +term_y_correction|int }}"
-- name: Custom shared volume for user Shadow Glove calibration and move calibration files.
- block:
- - name: Set shadow_glove_calibration_folder folder names
- set_fact:
- shadow_glove_calibration_folder: "{{ desktop_path }}/shadow_glove_calibration"
- shadow_glove_calibration_inside_docker: "/home/user/shadow_glove_calibration"
-
- - name: Set shadow glove user calibration and boresight calibration folder names
- set_fact:
- user_shadow_glove_calibration_folder: "{{ shadow_glove_calibration_folder }}/user_calibration"
- user_shadow_glove_calibration_inside_docker: "{{ shadow_glove_calibration_inside_docker }}/user_calibration"
- user_shadow_glove_calibration_defaults_inside_docker: "/home/user/projects/shadow_robot/base/src/sr_hand_glove_internal/sr_hand_glove/shadow_glove_user_calibration_defaults/."
- user_shadow_glove_calibration_defaults_inside_docker_binary: "/opt/ros/shadow/share/sr_hand_glove/shadow_glove_user_calibration_defaults/."
- boresight_calibration_folder: "{{ shadow_glove_calibration_folder }}/glove_boresight_calibration"
- boresight_calibration_inside_docker: "{{ shadow_glove_calibration_inside_docker }}/glove_boresight_calibration"
- boresight_calibration_default_file_inside_docker: "/home/user/projects/shadow_robot/base/src/polhemus_ros_driver/config/{{ polhemus_type }}_calibration.yaml"
-
- - name: Ensure {{ shadow_glove_calibration_folder }} folder exists
- file:
- path: "{{ shadow_glove_calibration_folder }}"
- mode: '755'
- state: directory
-
- - name: Ensure {{ user_shadow_glove_calibration_folder }} folder exists
- file:
- path: "{{ user_shadow_glove_calibration_folder }}"
- mode: '755'
- state: directory
-
- - name: Ensure {{ boresight_calibration_folder }} folder exists
- file:
- path: "{{ boresight_calibration_folder }}"
- mode: '755'
- state: directory
-
- - name: Set custom shared volumes for docker container
- set_fact:
- custom_shared_volumes:
- - "{{ shadow_glove_calibration_folder }}:{{ shadow_glove_calibration_inside_docker }}"
-
- - name: Copying default files from non-binary docker container path {{ user_shadow_glove_calibration_defaults_inside_docker }} to the host folder {{ user_shadow_glove_calibration_folder }}
- changed_when: false
- shell: "docker cp {{ container_name }}:{{ user_shadow_glove_calibration_defaults_inside_docker }} {{ user_shadow_glove_calibration_folder }}"
- become: yes
- ignore_errors: yes
- when: "'binary' not in image"
-
- - name: Copying default files from binary docker container path {{ user_shadow_glove_calibration_defaults_inside_docker_binary }} to the host folder {{ user_shadow_glove_calibration_folder }}
- changed_when: false
- shell: "docker cp {{ container_name }}:{{ user_shadow_glove_calibration_defaults_inside_docker_binary }} {{ user_shadow_glove_calibration_folder }}"
- become: yes
- ignore_errors: yes
- when: "'binary' in image"
-
- - name: Check if the {{ polhemus_type }}_calibration.yaml exists on the host shared volume
- stat:
- path: "{{ boresight_calibration_folder }}/{{ polhemus_type }}_calibration.yaml"
- register: boresight_calibration_file
- ignore_errors: yes
-
- - name: If the default calibration doesn't exist, copy the default boresight calibration file from docker container path {{ boresight_calibration_default_file_inside_docker }} to the host folder {{ boresight_calibration_folder }}
- changed_when: false
- shell: "docker cp {{ container_name }}:{{ boresight_calibration_default_file_inside_docker }} {{ boresight_calibration_folder }}"
- become: yes
- ignore_errors: yes
- when: not boresight_calibration_file.stat.exists
-
- - name: Ensure {{ boresight_calibration_folder }}/{{ polhemus_type }}_calibration.yaml has the right permissions
- file:
- path: "{{ boresight_calibration_folder }}/{{ polhemus_type }}_calibration.yaml"
- mode: '666'
- state: file
- become: true
- ignore_errors: yes
-
- - name: Ensure {{ user_shadow_glove_calibration_folder }}/default_calibration_right.yaml has the right permissions
- file:
- path: "{{ user_shadow_glove_calibration_folder }}/default_calibration_right.yaml"
- mode: '666'
- state: file
- become: true
- ignore_errors: yes
-
- - name: Ensure {{ user_shadow_glove_calibration_folder }}/default_calibration_left.yaml has the right permissions
- file:
- path: "{{ user_shadow_glove_calibration_folder }}/default_calibration_left.yaml"
- mode: '666'
- state: file
- become: true
- ignore_errors: yes
-
- - name: Check if the current_calibration_right.yaml exists on the host shared volume
- stat:
- path: "{{ user_shadow_glove_calibration_folder }}/current_calibration_right.yaml"
- register: current_calibration_file_right
- ignore_errors: yes
-
- - name: Check if the current_calibration_left.yaml exists on the host shared volume
- stat:
- path: "{{ user_shadow_glove_calibration_folder }}/current_calibration_left.yaml"
- register: current_calibration_file_left
- ignore_errors: yes
-
- - name: Check if the default_calibration_right.yaml exists on the host shared volume
- stat:
- path: "{{ user_shadow_glove_calibration_folder }}/default_calibration_right.yaml"
- register: default_calibration_file_right
- ignore_errors: yes
-
- - name: Check if the default_calibration_left.yaml exists on the host shared volume
- stat:
- path: "{{ user_shadow_glove_calibration_folder }}/default_calibration_left.yaml"
- register: default_calibration_file_left
- ignore_errors: yes
-
- - name: if current_calibration_right.yaml doesn't exist but default does, copy default into it
- copy:
- src: "{{ user_shadow_glove_calibration_folder }}/default_calibration_right.yaml"
- dest: "{{ user_shadow_glove_calibration_folder }}/current_calibration_right.yaml"
- mode: '666'
- when: not current_calibration_file_right.stat.exists and default_calibration_file_right.stat.exists
- ignore_errors: yes
-
- - name: if current_calibration_left.yaml doesn't exist but default does, copy default into it
- copy:
- src: "{{ user_shadow_glove_calibration_folder }}/default_calibration_left.yaml"
- dest: "{{ user_shadow_glove_calibration_folder }}/current_calibration_left.yaml"
- mode: '666'
- when: not current_calibration_file_left.stat.exists and default_calibration_file_left.stat.exists
- ignore_errors: yes
-
- when: glove == "shadow_glove" and "'glove_' in product"
-
- name: Include products/common/docker-container role
include_role:
name: products/common/docker-container
@@ -254,26 +149,32 @@
- name: Adding the ssh identity
shell: "ssh-add {{ ssh_keys_path }}"
changed_when: false
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
- name: Make a copy of SSH public key to a /tmp/ folder for copying to other machines
copy:
src: "{{ ssh_keys_path }}.pub"
dest: "{{ temp_ssh_keys_path }}.pub"
changed_when: false
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
- name: Make a copy of SSH private key to a /tmp/ folder for copying to other machines
copy:
src: "{{ ssh_keys_path }}"
dest: "{{ temp_ssh_keys_path }}"
changed_when: false
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
+
+- name: Copying ssh key pair into docker container
+ changed_when: false
+ shell: "docker cp {{ ssh_keys_path }} {{ container_name }}:/tmp/."
+ become: yes
+ when: groups['server'] is defined
- name: Include products/common/hand_config role
include_role:
name: products/common/hand_config
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
- name: Creating server setup script
template:
@@ -293,3 +194,6 @@
mode: '755'
when: upgrade_check|bool
+- name: Include installation/teamviewer role
+ include_role:
+ name: installation/teamviewer
diff --git a/ansible/roles/products/hand-e/server/desktop-icons/defaults/main.yml b/ansible/roles/products/hand-e/server/desktop-icons/defaults/main.yml
index a131c8fd3..f39d56191 100644
--- a/ansible/roles/products/hand-e/server/desktop-icons/defaults/main.yml
+++ b/ansible/roles/products/hand-e/server/desktop-icons/defaults/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ user }}"
@@ -11,10 +25,22 @@ server_ip: "10.9.11.1"
right_hand_picture: hand-e.png
left_hand_picture: hand-e-left.png
bimanual_hands_picture: hand-e-bimanual.png
-initial_z_value: 0.7551
-arm_x_separation_value: 0.0
-arm_y_separation_value: 0.0
+initial_z: 0.8221
+initial_y_left_arm: 0.0
+initial_y_right_arm: 0.0
+initial_y_var: 0.0
+initial_z_var: 0.0
+arm_x_separation: 0.0
+arm_y_separation: 0.0
arm_hand_readthedocs_link: ""
scene_file: ""
arm_mass_payload: 5.0
hand_side_ad: ""
+bimanual_warning_title: "Unimanual Launch Warning"
+bimanual_warning_text: "It is potentially unsafe to run a bimanual robot in unimanual mode; the pose of the unused arm is unknown, which may result in collisions.\nTo safely launch in unimanual mode, please first launch in bimanual mode, and use Rviz MotionPlanning to move the arm and hand you do not intend to use into the 'safe_store' state.\nBy clicking 'I accept the risks', you acknowledge that you understand the risks involved by running the unimanual system without moving the other robot arm and take full responsibility for any consequences that may arise."
+enable_warning_var: false
+skip_warning: false
+warning_title: "Example Warning"
+warning_text: "Example Text"
+extra_vars: ""
+extra_vars_value: ""
\ No newline at end of file
diff --git a/ansible/roles/products/hand-e/server/desktop-icons/tasks/default-icon-server.yml b/ansible/roles/products/hand-e/server/desktop-icons/tasks/default-icon-server.yml
index 80ceef8ba..c8abb2597 100644
--- a/ansible/roles/products/hand-e/server/desktop-icons/tasks/default-icon-server.yml
+++ b/ansible/roles/products/hand-e/server/desktop-icons/tasks/default-icon-server.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Copy desktop icon
copy:
@@ -32,4 +46,4 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
diff --git a/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-and-arm.yml b/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-and-arm.yml
index b616fbd10..217a7f06d 100644
--- a/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-and-arm.yml
+++ b/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-and-arm.yml
@@ -1,13 +1,48 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
+- name: Include products/common/scene-files
+ include_role:
+ name: products/common/scene-files
+ when: scene_file or "arm_" in product
+
+- name: Set enable warning vars
+ set_fact:
+ enable_warning_var: true
+ extra_vars_value: " 0" # Used to enable the bimanual warning for control loop advanced launcher icon
+ when: bimanual|bool and not skip_warning|bool
+
- name: Set Shadow Arm+Hand icon pictures
set_fact:
- right_arm_hand_picture: arm_hand_right.jpeg
- left_arm_hand_picture: arm_hand_left.jpg
- bimanual_arm_hand_picture: arm_hand_bimanual.jpg
+ right_arm_hand_picture: arm_hand_right.png
+ left_arm_hand_picture: arm_hand_left.png
+ bimanual_arm_hand_picture: arm_hand_bimanual.png
+ bimanual_warning_title: "Unimanual Launch Warning"
+ bimanual_warning_text: "It is potentially unsafe to run a bimanual robot in unimanual mode; the pose of the unused arm is unknown, which may result in collisions.\nTo safely launch in unimanual mode, please first launch in bimanual mode, and use Rviz MotionPlanning to move the arm and hand you do not intend to use into the 'safe_store' state.\nBy clicking 'I accept the risks', you acknowledge that you understand the risks involved by running the unimanual system without moving the other robot arm and take full responsibility for any consequences that may arise."
+
+- name: Set inital_y when bimanual is true
+ set_fact:
+ initial_y_left_arm: 1.5
+ initial_y_right_arm: 0.0
+ arm_y_separation: 1.5
+ when:
+ - bimanual|bool
- name: Set arm+hand GUI launch file names for UR10/UR10e
set_fact:
- project_name_input: "sr_robot_launch"
+ project_name_var: "sr_robot_launch"
launch_file_input_arm_hand_right: "sr_right_ur10arm_hand.launch"
launch_file_input_arm_hand_left: "sr_left_ur10arm_hand.launch"
launch_file_input_arm_hand_bimanual: "sr_bimanual_ur10arms_hands.launch"
@@ -16,7 +51,7 @@
- name: Set arm+hand GUI launch file names for UR5/UR5e
set_fact:
- project_name_input: "sr_robot_launch"
+ project_name_var: "sr_robot_launch"
launch_file_input_arm_hand_right: "sr_right_ur5arm_hand.launch"
launch_file_input_arm_hand_left: "sr_left_ur5arm_hand.launch"
launch_file_input_arm_hand_bimanual: "sr_bimanual_ur5arms_hands.launch"
@@ -25,24 +60,24 @@
- name: Set arm+hand GUI launch file content for sim
set_fact:
- launch_file_content_arm_hand_right_sim: "{{ launch_file_input_arm_hand_right }} external_control_loop:=false sim:=true arm_speed_scale:=0.7 scene:=true"
- launch_file_content_arm_hand_left_sim: "{{ launch_file_input_arm_hand_left }} external_control_loop:=false sim:=true arm_speed_scale:=0.7 scene:=true"
- launch_file_content_arm_hand_bimanual_sim: "{{ launch_file_input_arm_hand_bimanual }} external_control_loop:=false sim:=true arm_speed_scale:=0.7 scene:=true"
+ launch_file_content_arm_hand_right_sim: "{{ launch_file_input_arm_hand_right }} external_control_loop:=false sim:=true arm_speed_scale:=0.7 initial_y:={{ initial_y_right_arm }} initial_z:={{ initial_z }}"
+ launch_file_content_arm_hand_left_sim: "{{ launch_file_input_arm_hand_left }} external_control_loop:=false sim:=true arm_speed_scale:=0.7 initial_y:={{ initial_y_left_arm }} initial_z:={{ initial_z }}"
+ launch_file_content_arm_hand_bimanual_sim: "{{ launch_file_input_arm_hand_bimanual }} external_control_loop:=false sim:=true arm_speed_scale:=0.7 arm_1_z:={{ initial_z }} arm_2_z:={{ initial_z }} arm_y_separation:={{ arm_y_separation }}"
- name: Set arm+hand GUI launch file content
set_fact:
- launch_file_content_arm_hand_right: "{{ launch_file_input_arm_hand_right }} external_control_loop:=true sim:=false arm_speed_scale:=0.7 scene:=true"
- launch_file_content_arm_hand_left: "{{ launch_file_input_arm_hand_left }} external_control_loop:=true sim:=false arm_speed_scale:=0.7 scene:=true"
+ launch_file_content_arm_hand_right: "{{ launch_file_input_arm_hand_right }} external_control_loop:=true sim:=false arm_speed_scale:=0.7"
+ launch_file_content_arm_hand_left: "{{ launch_file_input_arm_hand_left }} external_control_loop:=true sim:=false arm_speed_scale:=0.7"
launch_file_content_arm_hand_bimanual: "{{ launch_file_input_arm_hand_bimanual }} external_control_loop:=true sim:=false arm_speed_scale:=0.7"
- name: Set arm+hand GUI launch file content for custom scene
set_fact:
- launch_file_content_arm_hand_right: "{{ launch_file_content_arm_hand_right }} scene_file:='{{ scene_file }}'"
- launch_file_content_arm_hand_left: "{{ launch_file_content_arm_hand_left }} scene_file:='{{ scene_file }}'"
- launch_file_content_arm_hand_bimanual: "{{ launch_file_content_arm_hand_bimanual }} scene_file:='{{ scene_file }}'"
- launch_file_content_arm_hand_right_sim: "{{ launch_file_content_arm_hand_right_sim }} scene_file:='{{ scene_file }}'"
- launch_file_content_arm_hand_left_sim: "{{ launch_file_content_arm_hand_left_sim }} scene_file:='{{ scene_file }}'"
- launch_file_content_arm_hand_bimanual_sim: "{{ launch_file_content_arm_hand_bimanual_sim }} scene_file:='{{ scene_file }}'"
+ launch_file_content_arm_hand_right: "{{ launch_file_content_arm_hand_right }} initial_y:={{ initial_y_right_arm }} initial_z:={{ initial_z }} scene:=true scene_file:='$(find sr_description_common)/scenes/{{ scene_file_right }}.scene' world:='$(find sr_description_common)/worlds/{{ scene_file_right }}.world'"
+ launch_file_content_arm_hand_left: "{{ launch_file_content_arm_hand_left }} initial_y:={{ initial_y_right_arm }} initial_z:={{ initial_z }} scene:=true scene_file:='$(find sr_description_common)/scenes/{{ scene_file_left }}.scene' world:='$(find sr_description_common)/worlds/{{ scene_file_left }}.world'"
+ launch_file_content_arm_hand_bimanual: "{{ launch_file_content_arm_hand_bimanual }} arm_1_z:={{ initial_z }} arm_2_z:={{ initial_z }} arm_y_separation:={{ arm_y_separation }} scene:=true scene_file:='$(find sr_description_common)/scenes/{{ scene_file_bimanual }}.scene' world:='$(find sr_description_common)/worlds/{{ scene_file_bimanual }}.world'"
+ launch_file_content_arm_hand_right_sim: "{{ launch_file_content_arm_hand_right_sim }} scene:=true scene_file:='$(find sr_description_common)/scenes/{{ scene_file_right }}.scene' world:='$(find sr_description_common)/worlds/{{ scene_file_right }}.world'"
+ launch_file_content_arm_hand_left_sim: "{{ launch_file_content_arm_hand_left_sim }} scene:=true scene_file:='$(find sr_description_common)/scenes/{{ scene_file_left }}.scene' world:='$(find sr_description_common)/worlds/{{ scene_file_left }}.world'"
+ launch_file_content_arm_hand_bimanual_sim: "{{ launch_file_content_arm_hand_bimanual_sim }} scene:=true scene_file:='$(find sr_description_common)/scenes/{{ scene_file_bimanual }}.scene' world:='$(find sr_description_common)/worlds/{{ scene_file_bimanual }}.world'"
when:
- scene_file|length > 0
@@ -59,6 +94,9 @@
control_loop_script_name: "shadow_nuc_right_arm_hand_hardware_control_loop.sh"
gui_script_name: "shadow_GUI_right_arm_hand.sh"
launch_terminal: "false"
+ enable_warning: "{{ enable_warning_var|bool }}"
+ warning_title: "{{ bimanual_warning_title }}"
+ warning_text: "{{ bimanual_warning_text }}"
when:
- bimanual|bool or hand_side=="right"
@@ -75,6 +113,9 @@
hand_side_label: "Left Arm and Hand"
control_loop_script_name: "shadow_nuc_left_arm_hand_hardware_control_loop.sh"
gui_script_name: "shadow_GUI_left_arm_hand.sh"
+ enable_warning: "{{ enable_warning_var|bool }}"
+ warning_title: "{{ bimanual_warning_title }}"
+ warning_text: "{{ bimanual_warning_text }}"
when:
- bimanual|bool or hand_side=="left"
@@ -91,6 +132,9 @@
hand_side_label: "Bimanual Arm and Hand"
control_loop_script_name: "shadow_nuc_bimanual_arm_hand_hardware_control_loop.sh"
gui_script_name: "shadow_GUI_bimanual_arm_hand.sh"
+ enable_warning: "false"
+ warning_title: "{{ bimanual_warning_title }}"
+ warning_text: "{{ bimanual_warning_text }}"
when:
- bimanual|bool
@@ -105,6 +149,11 @@
hand_ctrl_value: "true"
arm_ctrl_value: "true"
hand_side_ad: "-r"
+ initial_z_var: "{{ initial_z }}"
+ initial_y_var: "{{ initial_y_right_arm }}"
+ warning_title: "{{ bimanual_warning_title }}"
+ warning_text: "{{ bimanual_warning_text }}"
+ extra_vars: "{{ extra_vars_value }}"
when:
- bimanual|bool or hand_side=="right"
@@ -119,6 +168,11 @@
hand_ctrl_value: "true"
arm_ctrl_value: "true"
hand_side_ad: "-l"
+ initial_z_var: "{{ initial_z }}"
+ initial_y_var: "{{ initial_y_left_arm }}"
+ warning_title: "{{ bimanual_warning_title }}"
+ warning_text: "{{ bimanual_warning_text }}"
+ extra_vars: "{{ extra_vars_value }}"
when:
- bimanual|bool or hand_side=="left"
@@ -131,6 +185,8 @@
desktop_icon_path: "{{ bimanual_advanced_launcher }}/3 - Launch NUC Container and Bimanual Hand+Arm Hardware Control Loop"
arm_payload_mass: "{{ arm_mass_payload }}"
arm_ctrl_value: "true"
+ warning_title: "{{ bimanual_warning_title }}"
+ warning_text: "{{ bimanual_warning_text }}"
when:
- bimanual|bool
@@ -142,12 +198,13 @@
vars:
pwm_control_var: "true"
hand_ctrl_var: "true"
- initial_z_var: "{{ initial_z_value }}"
- arm_x_separation_var: "{{ arm_x_separation_value }}"
- arm_y_separation_var: "{{ arm_y_separation_value }}"
+ initial_z_var: "{{ initial_z }}"
+ initial_y_var: "{{ initial_y_right_arm }}"
arm_ctrl_var: "true"
arm_payload_mass: "{{ arm_mass_payload }}"
ad_hand_side: "-r"
+ warning_title: "{{ bimanual_warning_title }}"
+ warning_text: "{{ bimanual_warning_text }}"
when:
- not bimanual|bool and hand_side=="right"
@@ -159,12 +216,13 @@
vars:
pwm_control_var: "true"
hand_ctrl_var: "true"
- initial_z_var: "{{ initial_z_value }}"
- arm_x_separation_var: "{{ arm_x_separation_value }}"
- arm_y_separation_var: "{{ arm_y_separation_value }}"
+ initial_z_var: "{{ initial_z }}"
+ initial_y_var: "{{ initial_y_left_arm }}"
arm_ctrl_var: "true"
arm_payload_mass: "{{ arm_mass_payload }}"
ad_hand_side: "-l"
+ warning_title: "{{ bimanual_warning_title }}"
+ warning_text: "{{ bimanual_warning_text }}"
when:
- not bimanual|bool and hand_side=="left"
@@ -173,6 +231,14 @@
src: templates/scripts/start-docker-container-nuc-bimanual-arm-hand.j2
dest: "{{ shadow_hand_launcher_folder }}/shadow_nuc_bimanual_arm_hand_hardware_control_loop.sh"
mode: '755'
+ vars:
+ pwm_control_var: "true"
+ hand_ctrl_var: "true"
+ initial_z_var: "{{ initial_z }}"
+ arm_x_separation_var: "{{ arm_x_separation }}"
+ arm_y_separation_var: "{{ arm_y_separation }}"
+ arm_ctrl_var: "true"
+ arm_payload_mass: "{{ arm_mass_payload }}"
when:
- bimanual|bool
@@ -182,8 +248,8 @@
vars:
desktop_icon_png: "rviz.png"
launch_script: "shadow_GUI_right_arm_hand.sh"
- project_name_input: "sr_robot_launch"
- launch_file_input: "srhand.launch external_control_loop:=true sim:=false hand_side_ad:=-r"
+ project_name_input: "{{ project_name_var }}"
+ launch_file_input: "{{ launch_file_content_arm_hand_right }}"
desktop_icon_name: "4 - Launch Server Right Hand+Arm GUI"
desktop_icon_path: "{{ right_advanced_launcher }}/4 - Launch Server Right Hand+Arm GUI"
when:
@@ -195,8 +261,8 @@
vars:
desktop_icon_png: "rviz.png"
launch_script: "shadow_GUI_left_arm_hand.sh"
- project_name_input: "sr_robot_launch"
- launch_file_input: "srhand.launch external_control_loop:=true sim:=false hand_side_ad:=-l"
+ project_name_input: "{{ project_name_var }}"
+ launch_file_input: "{{ launch_file_content_arm_hand_left }}"
desktop_icon_name: "4 - Launch Server Left Hand+Arm GUI"
desktop_icon_path: "{{ left_advanced_launcher }}/4 - Launch Server Left Hand+Arm GUI"
when:
@@ -208,46 +274,13 @@
vars:
desktop_icon_png: "rviz.png"
launch_script: "shadow_GUI_bimanual_arm_hand.sh"
- project_name_input: "sr_robot_launch"
- launch_file_input: "sr_bimanual.launch external_control_loop:=true sim:=false"
+ project_name_input: "{{ project_name_var }}"
+ launch_file_input: "{{ launch_file_content_arm_hand_bimanual }}"
desktop_icon_name: "4 - Launch Server Bimanual Hand+Arm GUI"
desktop_icon_path: "{{ bimanual_advanced_launcher }}/4 - Launch Server Bimanual Hand+Arm GUI"
when:
- bimanual|bool
-- name: Create executable launch script for hand+arm (Right) GUI
- template:
- src: ../../../common/resources/templates/scripts/roslaunch-script.j2
- dest: "{{ shadow_hand_launcher_folder }}/shadow_GUI_right_arm_hand.sh"
- mode: '755'
- vars:
- project_name: "{{ project_name_input }}"
- launch_file: "{{ launch_file_content_arm_hand_right }}"
- when:
- - not bimanual|bool and hand_side=="right"
-
-- name: Create executable launch script for hand+arm (Left) GUI
- template:
- src: ../../../common/resources/templates/scripts/roslaunch-script.j2
- dest: "{{ shadow_hand_launcher_folder }}/shadow_GUI_left_arm_hand.sh"
- mode: '755'
- vars:
- project_name: "{{ project_name_input }}"
- launch_file: "{{ launch_file_content_arm_hand_left }}"
- when:
- - not bimanual|bool and hand_side=="left"
-
-- name: Create executable launch script for hand+arm (Bimanual) GUI
- template:
- src: ../../../common/resources/templates/scripts/roslaunch-script.j2
- dest: "{{ shadow_hand_launcher_folder }}/shadow_GUI_bimanual_arm_hand.sh"
- mode: '755'
- vars:
- project_name: "{{ project_name_input }}"
- launch_file: "{{ launch_file_content_arm_hand_bimanual }}"
- when:
- - bimanual|bool
-
- name: Simulation icons
block:
- name: Right arm+hand sim icon
@@ -258,7 +291,7 @@
dest: "{{ shadow_hand_launcher_folder }}/shadow_launch_right_arm_hand_sim.sh"
mode: '755'
vars:
- project_name: "{{ project_name_input }}"
+ project_name: "{{ project_name_var }}"
launch_file: "{{ launch_file_content_arm_hand_right_sim }}"
- name: Install desktop icon for launching everything for Shadow Arm+Hand Simulation
@@ -282,7 +315,7 @@
dest: "{{ shadow_hand_launcher_folder }}/shadow_launch_left_arm_hand_sim.sh"
mode: '755'
vars:
- project_name: "{{ project_name_input }}"
+ project_name: "{{ project_name_var }}"
launch_file: "{{ launch_file_content_arm_hand_left_sim }}"
- name: Install desktop icon for launching everything for Shadow Left Arm+Hand Simulation
@@ -306,7 +339,7 @@
dest: "{{ shadow_hand_launcher_folder }}/shadow_launch_bimanual_arm_hand_sim.sh"
mode: '755'
vars:
- project_name: "{{ project_name_input }}"
+ project_name: "{{ project_name_var }}"
launch_file: "{{ launch_file_content_arm_hand_bimanual_sim }}"
- name: Install desktop icon for launching everything for Shadow Bimanual Arm+Hand Simulation
diff --git a/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-and-glove.yml b/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-and-glove.yml
index c6218f35b..6eea79504 100644
--- a/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-and-glove.yml
+++ b/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-and-glove.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Install desktop icon for right Hand and Glove GUI
include_role:
@@ -6,7 +20,7 @@
desktop_icon_png: "rviz.png"
launch_script: "shadow_GUI_right_hand_glove.sh"
project_name_input: "sr_hand_glove"
- launch_file_input: "sr_hand_glove.launch polhemus_product_type:={{ polhemus_type }} pedal:=true biotacs:={{ biotacs | lower }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' user_calibration_file_name:=current_calibration_right.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration' side:=right external_control_loop:=true"
+ launch_file_input: "sr_hand_glove.launch polhemus_product_type:={{ polhemus_type }} pedal:=true side:=right user_calibration_file_name:=default_calibration_right.yaml external_control_loop:=true"
desktop_icon_name: "4 - Launch Server Right Hand and Glove GUI"
desktop_icon_path: "{{ right_advanced_launcher }}/4 - Launch Server Right Hand and Glove GUI"
when:
@@ -19,7 +33,7 @@
desktop_icon_png: "rviz.png"
launch_script: "shadow_GUI_left_hand_glove.sh"
project_name_input: "sr_hand_glove"
- launch_file_input: "sr_hand_glove.launch polhemus_product_type:={{ polhemus_type }} pedal:=true biotacs:={{ biotacs | lower }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' user_calibration_file_name:=current_calibration_left.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration' side:=left external_control_loop:=true"
+ launch_file_input: "sr_hand_glove.launch polhemus_product_type:={{ polhemus_type }} pedal:=true side:=left user_calibration_file_name:=default_calibration_left.yaml external_control_loop:=true"
desktop_icon_name: "4 - Launch Server Left Hand and Glove GUI"
desktop_icon_path: "{{ left_advanced_launcher }}/4 - Launch Server Left Hand and Glove GUI"
when:
@@ -32,7 +46,7 @@
desktop_icon_png: "rviz.png"
launch_script: "shadow_GUI_bimanual_hand_glove.sh"
project_name_input: "sr_hand_glove"
- launch_file_input: "sr_hand_glove_bimanual.launch polhemus_product_type:={{ polhemus_type }} pedal:=true biotacs:={{ biotacs | lower }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' right_user_calibration_file_name:=current_calibration_right.yaml left_user_calibration_file_name:=current_calibration_left.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration' external_control_loop:=true"
+ launch_file_input: "sr_hand_glove_bimanual.launch polhemus_product_type:={{ polhemus_type }} pedal:=true right_user_calibration_file_name:=default_calibration_right.yaml left_user_calibration_file_name:=default_calibration_left.yaml external_control_loop:=true"
desktop_icon_name: "4 - Launch Server Bimanual Hand and Glove GUI"
desktop_icon_path: "{{ bimanual_advanced_launcher }}/4 - Launch Server Bimanual Hand and Glove GUI"
when:
@@ -92,7 +106,7 @@
dest: "{{ shadow_hand_launcher_folder }}/shadow_glove_calibration_rqt.sh"
mode: '755'
vars:
- command: "rqt -s sr_gui_shadow_glove_calibration.shadow_glove_calibration.SrGuiShadowGloveCalibration"
+ command: "rqt -s sr_glove_calibration_gui.sr_glove_calibration_gui.SrGloveCalibrationGui"
when: glove=="shadow_glove"
- name: Set Shadow Glove driver name (if right)
@@ -116,9 +130,9 @@
vars:
desktop_icon_png: "shadow_glove_{{ glove_driver_type }}.png"
launch_script: "shadow_glove_calibration.sh"
- desktop_icon_name: "Launch Shadow {{ glove_driver_type }} Glove Calibration"
+ desktop_icon_name: "Launch Shadow {{ glove_driver_type | title }} Glove Calibration"
template: templates/scripts/launch-shadow-glove-calibration.j2
- desktop_icon_path: "Shadow Advanced Launchers/Launch Shadow {{ glove_driver_type }} Glove Calibration"
+ desktop_icon_path: "Shadow Advanced Launchers/Launch Shadow {{ glove_driver_type | title }} Glove Calibration"
launch_terminal: "false"
glove_driver_value: "{{ glove_driver_type }}"
when: glove=="shadow_glove"
@@ -142,9 +156,9 @@
block:
- name: Set Sim variables
set_fact:
- launch_file_content_glove_hand_right_sim: "sr_hand_glove.launch side:=right external_control_loop:=false sim:=true polhemus_product_type:={{ polhemus_type }} pedal:=true biotacs:={{ biotacs | lower }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' user_calibration_file_name:=current_calibration_right.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration'"
- launch_file_content_glove_hand_left_sim: "sr_hand_glove.launch side:=left external_control_loop:=false sim:=true polhemus_product_type:={{ polhemus_type }} pedal:=true biotacs:={{ biotacs | lower }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' user_calibration_file_name:=current_calibration_left.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration'"
- launch_file_content_glove_hand_bimanual_sim: "sr_hand_glove_bimanual.launch external_control_loop:=false sim:=true polhemus_product_type:={{ polhemus_type }} pedal:=true biotacs:={{ biotacs | lower }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' right_user_calibration_file_name:=current_calibration_right.yaml left_user_calibration_file_name:=current_calibration_left.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration'"
+ launch_file_content_glove_hand_right_sim: "sr_hand_glove.launch side:=right external_control_loop:=false sim:=true polhemus_product_type:={{ polhemus_type }} pedal:=true user_calibration_file_name:=default_calibration_right.yaml"
+ launch_file_content_glove_hand_left_sim: "sr_hand_glove.launch side:=left external_control_loop:=false sim:=true polhemus_product_type:={{ polhemus_type }} pedal:=true user_calibration_file_name:=default_calibration_left.yaml"
+ launch_file_content_glove_hand_bimanual_sim: "sr_hand_glove_bimanual.launch external_control_loop:=false sim:=true polhemus_product_type:={{ polhemus_type }} pedal:=true right_user_calibration_file_name:=default_calibration_right.yaml left_user_calibration_file_name:=default_calibration_left.yaml"
- name: Right Hand and Glove sim icon
block:
diff --git a/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-icon-bimanual.yml b/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-icon-bimanual.yml
index 850fa9927..2470481fd 100644
--- a/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-icon-bimanual.yml
+++ b/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-icon-bimanual.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Copy desktop icon
copy:
@@ -29,4 +43,4 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
diff --git a/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-icon.yml b/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-icon.yml
index ceb7106c8..3d0ea4799 100644
--- a/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-icon.yml
+++ b/ansible/roles/products/hand-e/server/desktop-icons/tasks/hand-icon.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Copy desktop icon
copy:
@@ -13,9 +27,6 @@
vars:
pwm_control_var: "{{ pwm_control_value }}"
hand_ctrl_var: "{{ hand_ctrl_value }}"
- initial_z_var: "{{ initial_z_value }}"
- arm_x_separation_var: "{{ arm_x_separation_value }}"
- arm_y_separation_var: "{{ arm_y_separation_value }}"
arm_ctrl_var: "{{ arm_ctrl_value }}"
arm_payload_mass: "{{ arm_mass_payload }}"
ad_hand_side: "{{ hand_side_ad }}"
@@ -29,7 +40,7 @@
desktop_shortcut_name: "{{ desktop_icon_name }}"
comment: "{{ desktop_icon_name }}"
folder: "{{ shadow_hand_launcher_folder }}"
- shell_script_file_name: "{{ launch_script }}"
+ shell_script_file_name: "'{{ launch_script }} {{ extra_vars }}'"
icon_file_name: "{{ desktop_icon_png }}"
start_terminal: "false"
@@ -38,4 +49,4 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
diff --git a/ansible/roles/products/hand-e/server/desktop-icons/tasks/main.yml b/ansible/roles/products/hand-e/server/desktop-icons/tasks/main.yml
index 24219dbb0..b055d114c 100644
--- a/ansible/roles/products/hand-e/server/desktop-icons/tasks/main.yml
+++ b/ansible/roles/products/hand-e/server/desktop-icons/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Ensures that Desktop folder exists
file:
@@ -88,11 +102,6 @@
- "'glove_' not in product"
- "'arm' not in product"
-- name: Include hand-manual role
- include_role:
- name: products/common/hand-manual
- when: customer_key is defined and customer_key | length > 0
-
- name: Install desktop icon for RQT on NUC
include_role:
name: products/common/default-icon-no-terminator
@@ -105,55 +114,10 @@
command_to_run: "rqt"
launch_terminal: "false"
-- name: Install the Documentation desktop icon for Dexterous Hand
- include_role:
- name: products/common/web-gui-icon
- vars:
- desktop_icon_png: "documentation_icon.png"
- launch_script: "shadow_launcher_doc_exec.sh"
- local_website_port_var: '7070'
- desktop_icon_name: "Dexterous Hand Documentation"
- desktop_icon_path: "Dexterous Hand Documentation"
- launch_terminal: "false"
- start_container_var: "true"
- start_server_command_var: "roscd sr_dexterous_hand_documentation/html; python3 -m http.server {{ local_website_port_var }}"
- preconditions_var: ""
- live_website_url_var: "https://dexterous-hand.readthedocs.io/en/2.1.6/"
- when:
- - "'arm_' not in product"
- - "'glove_' not in product"
-
-- name: Install the Documentation desktop icon for Dexterous Hand and Arm
- include_role:
- name: products/common/web-gui-icon
- vars:
- desktop_icon_png: "documentation_icon.png"
- launch_script: "shadow_launcher_doc_exec.sh"
- local_website_port_var: '7070'
- desktop_icon_name: "Dexterous Hand and Arm Documentation"
- desktop_icon_path: "Dexterous Hand and Arm Documentation"
- launch_terminal: "false"
- start_container_var: "true"
- start_server_command_var: "roscd sr_dexterous_hand_and_arm_documentation/html; python3 -m http.server {{ local_website_port_var }}"
- preconditions_var: ""
- live_website_url_var: "{{ arm_hand_readthedocs_link }}"
- when: "'arm_' in product"
-
-- name: Install the Documentation desktop icon for Dexterous Hand and Glove
+- name: Include documentation role
include_role:
- name: products/common/web-gui-icon
- vars:
- desktop_icon_png: "documentation_icon.png"
- launch_script: "shadow_launcher_doc_exec.sh"
- local_website_port_var: '7070'
- desktop_icon_name: "Dexterous Hand and Glove Documentation"
- desktop_icon_path: "Dexterous Hand and Glove Documentation"
- launch_terminal: "false"
- start_container_var: "true"
- start_server_command_var: "roscd sr_dexterous_hand_glove_documentation/html; python3 -m http.server {{ local_website_port_var }}"
- preconditions_var: ""
- live_website_url_var: "{{ glove_hand_readthedocs_link }}"
- when: "'glove_' in product"
+ name: products/common/documentation
+ when: customer_key is defined and customer_key | length > 0
- name: Create Shadow Demos folder
file:
@@ -446,6 +410,7 @@
name: products/common/local-hand-launch
vars:
override_launch_hand_var: True
+ simulate_icons: False
- name: Include products/common/local-zero-force-mode-launch role
include_role:
@@ -454,11 +419,3 @@
- name: Include products/common/close-everything-icon role
include_role:
name: products/common/close-everything-icon
-
-- name: Udev rules for pedal
- get_url:
- url: https://raw.githubusercontent.com/shadow-robot/sr_teleop_devices/noetic-devel/sr_pedal/90-VEC-USB-Footpedal.rules
- dest: /etc/udev/rules.d/90-VEC-USB-Footpedal.rules
- mode: '0644'
- become: yes
- when: "'glove' in product"
diff --git a/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/launch-everything.j2 b/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/launch-everything.j2
index c883812d7..2b3da6e45 100644
--- a/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/launch-everything.j2
+++ b/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/launch-everything.j2
@@ -3,6 +3,15 @@
CONST_TIMEOUT=20
+if {{ enable_warning | lower }}; then
+ zenity --warning --title="{{ warning_title }}" --text="{{ warning_text }}" --ok-label="I accept the risks" --extra-button="I decline the risks" --no-wrap --width=400 --height=120
+ response=$?
+ if [ $response -ne 0 ]; then
+ echo "User has declined the risks. Aborting script."
+ exit 1
+ fi
+fi
+
terminator --geometry "{{ term_1 }}" -T 'Launching server container...' -e "{{ shadow_hand_launcher_folder}}/shadow_server_container.sh"
elapsed_time=0
@@ -41,6 +50,6 @@ if [ "$proceed" == false ]; then
exit 1
fi
-terminator --geometry "{{ term_3 }}" -T 'NUC {{ arm_side }} hardware control loop' -e "{{ shadow_hand_launcher_folder}}/{{ control_loop_script }}"
+terminator --geometry "{{ term_3 }}" -T 'NUC {{ arm_side }} hardware control loop' -e "{{ shadow_hand_launcher_folder}}/{{ control_loop_script }} 1"
sleep 30 # temporary workaround until arm controllers starting on time is fixed
terminator --geometry "{{ term_4 }}" -T 'Server {{ arm_side }} GUI' -e "{{ shadow_hand_launcher_folder}}/{{ gui_script }}"
diff --git a/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc-bimanual-arm-hand.j2 b/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc-bimanual-arm-hand.j2
index 6e40b8e98..ffa7c2ae7 100644
--- a/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc-bimanual-arm-hand.j2
+++ b/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc-bimanual-arm-hand.j2
@@ -13,20 +13,13 @@ if [ $chrony_status -eq 0 ]; then
sleep 3
fi
-ssh -X $NUC_NAME@$NUC_ADDRESS CONTAINER={{ container_name }} HOST_IP=$LOCAL_IP NUC_ADDRESS=$NUC_ADDRESS UR_TYPE={{ ur_robot_type }} ARM_PAYLOAD_MASS={{ arm_mass_payload }} 'bash -s' <<'ENDSSH'
+ssh -X $NUC_NAME@$NUC_ADDRESS CONTAINER={{ container_name }} HOST_IP=$LOCAL_IP NUC_ADDRESS=$NUC_ADDRESS UR_TYPE={{ ur_robot_type }} ARM_PAYLOAD_MASS={{ arm_mass_payload }} ARM_X_SEPARATION={{ arm_x_separation_var }} ARM_Y_SEPARATION={{ arm_y_separation_var }} INITIAL_Z={{ initial_z_var }} 'bash -s' <<'ENDSSH'
bash $(while [[ $(ss | grep $HOST_IP | grep $NUC_ADDRESS | grep ssh | grep ESTAB | wc -l) -gt 0 ]]; do sleep 1; done ; pkill -INT -f roslaunch) &
-<<<<<<< HEAD
-XACRO='{{ xacro_system }}'
-MAPPING_RIGHT='{{ mapping_path_right }}'
-MAPPING_LEFT='{{ mapping_path_left }}'
-ROBOT_CONFIG='{{ robot_config_system }}'
-=======
->>>>>>> master
docker stop ${CONTAINER}
sleep 2
docker start ${CONTAINER}
echo "Starting the container..."
sleep 3
-docker exec --user user ${CONTAINER} bash -c "export ROSCONSOLE_FORMAT='"'[${severity}](${node}): [${time}] ${message}'"';export ROSCONSOLE_STDOUT_LINE_BUFFERED=1;source /home/user/projects/shadow_robot/base/devel/setup.bash;ulimit -c unlimited;/bin/update_hand_config.sh;sr_hand_autodetect roslaunch sr_robot_launch sr_bimanual_hardware_control_loop.launch arms:=true robot_model:=${UR_TYPE} arm_payload_mass:=${ARM_PAYLOAD_MASS} 2> >(tee -a /home/user/.ros/log/stderr.log)"
+docker exec --user user ${CONTAINER} bash -c "export ROSCONSOLE_FORMAT='"'[${severity}](${node}): [${time}] ${message}'"';export ROSCONSOLE_STDOUT_LINE_BUFFERED=1;source /home/user/projects/shadow_robot/base/devel/setup.bash;ulimit -c unlimited;/bin/update_hand_config.sh;sr_hand_autodetect roslaunch sr_robot_launch sr_bimanual_hardware_control_loop.launch arms:=true robot_model:=${UR_TYPE} arm_payload_mass:=${ARM_PAYLOAD_MASS} arm_x_separation:=${ARM_X_SEPARATION} arm_y_separation:=${ARM_Y_SEPARATION} arm_1_z:=${INITIAL_Z} arm_2_z:=${INITIAL_Z} 2> >(tee -a /home/user/.ros/log/stderr.log)"
ENDSSH
sleep infinity
diff --git a/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc-command.j2 b/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc-command.j2
index e7e216e9b..1be444a88 100644
--- a/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc-command.j2
+++ b/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc-command.j2
@@ -3,4 +3,4 @@
NUC_NAME={{ nuc_username }}
NUC_ADDRESS={{ nuc_address }}
CONTAINER={{ container_name }}
-ssh -X $NUC_NAME@$NUC_ADDRESS "docker exec -i --user user $CONTAINER bash -c 'cat > ~/.Xauthority' < ~/.Xauthority; docker exec --user user $CONTAINER bash -c $'source /home/user/projects/shadow_robot/base/devel/setup.bash;xauth list | tail -1 | awk \'{print \$1}\' | cut -d ':' -f2 > ~/.display_number;export DISPLAY=localhost:\$(<~/.display_number).0;/bin/update_hand_config.sh;{{ command_to_run }} 2> >(tee -a /home/user/.ros/log/stderr.log)'"
+ssh -X $NUC_NAME@$NUC_ADDRESS "docker exec -i --user user $CONTAINER bash -c 'cat > ~/.Xauthority' < ~/.Xauthority; docker exec --user user $CONTAINER bash -c $'export ROSCONSOLE_FORMAT=\'"'[${severity}](${node}): [${time}] ${message}'"\';export ROSCONSOLE_STDOUT_LINE_BUFFERED=1;source /home/user/projects/shadow_robot/base/devel/setup.bash;xauth list | tail -1 | awk \'{print \$1}\' | cut -d ':' -f2 > ~/.display_number;export DISPLAY=localhost:\$(<~/.display_number).0;/bin/update_hand_config.sh;{{ command_to_run }} 2> >(tee -a /home/user/.ros/log/stderr.log)'"
\ No newline at end of file
diff --git a/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc-interactive-terminal.j2 b/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc-interactive-terminal.j2
index e565c6166..eb498f482 100644
--- a/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc-interactive-terminal.j2
+++ b/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc-interactive-terminal.j2
@@ -3,4 +3,4 @@
NUC_NAME={{ nuc_username }}
NUC_ADDRESS={{ nuc_address }}
CONTAINER={{ container_name }}
-ssh -Xt $NUC_NAME@$NUC_ADDRESS "docker start ${CONTAINER};docker exec -i --user user $CONTAINER bash -c 'cat > ~/.Xauthority' < ~/.Xauthority;docker exec -it --user user $CONTAINER /bin/bash -c $'source /home/user/projects/shadow_robot/base/devel/setup.bash;xauth list | tail -1 | awk \'{print \$1}\' | cut -d ':' -f2 > ~/.display_number;export DISPLAY=localhost:\$(<~/.display_number).0;/bin/update_hand_config.sh;bash'"
+ssh -Xt $NUC_NAME@$NUC_ADDRESS "docker start ${CONTAINER};docker exec -i --user user $CONTAINER bash -c 'cat > ~/.Xauthority' < ~/.Xauthority;docker exec -it --user user $CONTAINER /bin/bash -c $'export ROSCONSOLE_FORMAT=\'[${severity}](${node}): [${time}] ${message}\';export ROSCONSOLE_STDOUT_LINE_BUFFERED=1;source /home/user/projects/shadow_robot/base/devel/setup.bash;xauth list | tail -1 | awk \'{print \$1}\' | cut -d ':' -f2 > ~/.display_number;export DISPLAY=localhost:\$(<~/.display_number).0;/bin/update_hand_config.sh;bash'"
diff --git a/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc.j2 b/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc.j2
index 217894f86..6da43bdc0 100644
--- a/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc.j2
+++ b/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc.j2
@@ -4,6 +4,23 @@ NUC_NAME={{ nuc_username }}
NUC_ADDRESS={{ nuc_address }}
LOCAL_IP={{ server_ip }}
+default_value=1
+if [ $# -eq 1 ]; then
+ enable_warning=$1
+else
+ enable_warning=$default_value
+fi
+
+if [ $enable_warning -eq 0 ]; then
+ zenity --warning --title="{{ warning_title }}" --text="{{ warning_text }}" --ok-label="I accept the risks" --extra-button="I decline the risks" --no-wrap --width=400 --height=120
+ response=$?
+ if [ $response -ne 0 ]; then
+ echo "User has declined the risks. Aborting script."
+ {{ shadow_hand_launcher_folder}}/close_everything.sh
+ exit 1
+ fi
+fi
+
chrony_status=$(ssh {{ nuc_username }}@{{ nuc_address }} chronyc -n tracking | grep {{ server_ip }} | wc -l)
if [ $chrony_status -eq 0 ]; then
echo "NUC lost chrony tracking. Restarting chrony on server and NUC..."
@@ -13,13 +30,13 @@ if [ $chrony_status -eq 0 ]; then
sleep 3
fi
-ssh -X $NUC_NAME@$NUC_ADDRESS CONTAINER={{ container_name }} PWM_CONTROL={{ pwm_control_var }} HAND_CTRL={{ hand_ctrl_var }} HOST_IP=$LOCAL_IP NUC_ADDRESS=$NUC_ADDRESS UR_TYPE={{ ur_robot_type }} ARM={{ arm_ctrl_var }} ARM_PAYLOAD_MASS={{ arm_payload_mass }} HAND_SIDE_AD={{ ad_hand_side }} 'bash -s' <<'ENDSSH'
+ssh -X $NUC_NAME@$NUC_ADDRESS CONTAINER={{ container_name }} PWM_CONTROL={{ pwm_control_var }} HAND_CTRL={{ hand_ctrl_var }} HOST_IP=$LOCAL_IP NUC_ADDRESS=$NUC_ADDRESS UR_TYPE={{ ur_robot_type }} ARM={{ arm_ctrl_var }} ARM_PAYLOAD_MASS={{ arm_payload_mass }} HAND_SIDE_AD={{ ad_hand_side }} INITIAL_Z={{ initial_z_var }} INITIAL_Y={{ initial_y_var }} 'bash -s' <<'ENDSSH'
bash $(while [[ $(ss | grep $HOST_IP | grep $NUC_ADDRESS | grep ssh | grep ESTAB | wc -l) -gt 0 ]]; do sleep 1; done ; pkill -INT -f roslaunch) &
docker stop ${CONTAINER}
sleep 2
docker start ${CONTAINER}
echo "Starting the container..."
sleep 3
-docker exec --user user ${CONTAINER} bash -c "export ROSCONSOLE_FORMAT='"'[${severity}](${node}): [${time}] ${message}'"';export ROSCONSOLE_STDOUT_LINE_BUFFERED=1;source /home/user/projects/shadow_robot/base/devel/setup.bash;ulimit -c unlimited;/bin/update_hand_config.sh;sr_hand_autodetect ${HAND_SIDE_AD} roslaunch sr_robot_launch sr_hardware_control_loop.launch arm:=${ARM} pwm_control:=${PWM_CONTROL} hand_ctrl:=${HAND_CTRL} robot_model:=${UR_TYPE} arm_payload_mass:=${ARM_PAYLOAD_MASS} 2> >(tee -a /home/user/.ros/log/stderr.log)"
+docker exec --user user ${CONTAINER} bash -c "export ROSCONSOLE_FORMAT='"'[${severity}](${node}): [${time}] ${message}'"';export ROSCONSOLE_STDOUT_LINE_BUFFERED=1;source /home/user/projects/shadow_robot/base/devel/setup.bash;ulimit -c unlimited;/bin/update_hand_config.sh;sr_hand_autodetect ${HAND_SIDE_AD} roslaunch sr_robot_launch sr_hardware_control_loop.launch arm:=${ARM} pwm_control:=${PWM_CONTROL} hand_ctrl:=${HAND_CTRL} robot_model:=${UR_TYPE} arm_payload_mass:=${ARM_PAYLOAD_MASS} initial_z:=${INITIAL_Z} initial_y:=${INITIAL_Y} 2> >(tee -a /home/user/.ros/log/stderr.log)"
ENDSSH
sleep infinity
diff --git a/ansible/roles/products/teleop/control_machine/deploy/defaults/main.yml b/ansible/roles/products/teleop/control_machine/deploy/defaults/main.yml
index 766b49580..6230346ce 100644
--- a/ansible/roles/products/teleop/control_machine/deploy/defaults/main.yml
+++ b/ansible/roles/products/teleop/control_machine/deploy/defaults/main.yml
@@ -1,9 +1,23 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
image: "080653068785.dkr.ecr.eu-west-2.amazonaws.com/shadow-teleop-polhemus"
tag: "noetic-night-build"
reinstall: false
glove: "shadow_glove"
-container_name: "teleop_{{ glove }}"
+container_name: "shadow_teleop"
bimanual: false
ethercat_left_arm: "enx2"
ethercat_right_arm: "eth1"
@@ -13,7 +27,6 @@ user_folder: "/home/{{ user }}"
shadow_hand_launcher_folder: "{{ user_folder }}/.shadow_launcher_app_{{ container_name }}/shadow_hand_launcher"
setup_directory: "/usr/local/bin"
use_aws: false
-launch_hand: false
server_hostname: "SERVER"
ssh_keys_path: "{{ user_folder }}/.ssh/id_rsa"
temp_ssh_keys_path: "/tmp/id_ssh_rsa"
@@ -21,7 +34,6 @@ terminator: false
use_steamvr: false
nvidia_docker: false
ur_interface: "eth0"
-sim_hand: false
hand_side: "right"
arm_ip_left: ""
arm_ip_right: ""
diff --git a/ansible/roles/products/teleop/control_machine/deploy/tasks/main.yml b/ansible/roles/products/teleop/control_machine/deploy/tasks/main.yml
index 76c57daf0..9c257ce55 100644
--- a/ansible/roles/products/teleop/control_machine/deploy/tasks/main.yml
+++ b/ansible/roles/products/teleop/control_machine/deploy/tasks/main.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Include installation/docker role
include_role:
@@ -13,7 +27,7 @@
- name: Include installation/aws-cli role
include_role:
name: installation/aws-cli-v2
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
- name: Include installation/chrony-client role
include_role:
@@ -118,4 +132,8 @@
- name: Include products/common/hand_config role
include_role:
name: products/common/hand_config
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
+
+- name: Include products/common/setup_nuc_ssh_key role
+ include_role:
+ name: products/common/setup_nuc_ssh_key
diff --git a/ansible/roles/products/teleop/server/deploy/defaults/main.yml b/ansible/roles/products/teleop/server/deploy/defaults/main.yml
index 675ec0e38..f622cc43e 100644
--- a/ansible/roles/products/teleop/server/deploy/defaults/main.yml
+++ b/ansible/roles/products/teleop/server/deploy/defaults/main.yml
@@ -1,10 +1,24 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
image: "080653068785.dkr.ecr.eu-west-2.amazonaws.com/shadow-teleop-polhemus"
tag: "noetic-night-build"
reinstall: false
nvidia_docker: true
glove: "shadow_glove"
-container_name: "teleop_{{ glove }}"
+container_name: "shadow_teleop"
use_aws: false
use_openvpn: false
ethercat_left_arm: "enx2"
@@ -13,7 +27,6 @@ user_folder: "/home/{{ user }}"
shadow_hand_launcher_folder: "{{ user_folder }}/.shadow_launcher_app_{{ container_name }}/shadow_hand_launcher"
nuc_username: "user"
setup_directory: "/usr/local/bin"
-launch_hand: false
ssh_keys_path: "{{ user_folder }}/.ssh/id_rsa"
temp_ssh_keys_path: "/tmp/id_ssh_rsa"
save_nuc_logs: true
@@ -25,7 +38,6 @@ use_steamvr: true
sim_icon: false
demo_icons: true
bimanual: false
-sim_hand: false
encryption_password: ""
hand_side: "right"
term_width: 500
diff --git a/ansible/roles/products/teleop/server/deploy/tasks/main.yml b/ansible/roles/products/teleop/server/deploy/tasks/main.yml
index 48996c83b..57a5ccd07 100644
--- a/ansible/roles/products/teleop/server/deploy/tasks/main.yml
+++ b/ansible/roles/products/teleop/server/deploy/tasks/main.yml
@@ -1,8 +1,22 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Include products/common/clear-icons role
include_role:
name: products/common/clear-icons
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
- name: Set NUC IP address and username for SSH
set_fact:
@@ -23,7 +37,7 @@
- name: Include installation/aws-cli role
include_role:
name: installation/aws-cli-v2
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
- name: Include installation/docker role
include_role:
@@ -55,7 +69,7 @@
- name: Include installation/shadow_glove_driver role
include_role:
name: installation/shadow_glove_driver
- when: glove == "shadow_glove" and real_glove|bool and skip_molecule_task is not defined
+ when: glove == "shadow_glove" and real_glove|bool and not skip_molecule_task|bool
- name: Include docker/docker-image role
include_role:
@@ -91,48 +105,6 @@
mode: '755'
state: directory
-- name: Custom shared volume for user Shadow Glove calibration
- block:
- - name: Set shadow_glove_calibration_folder folder names
- set_fact:
- shadow_glove_calibration_folder: "{{ desktop_path }}/shadow_glove_calibration"
- shadow_glove_calibration_inside_docker: "/home/user/shadow_glove_calibration"
-
- - name: Set shadow glove user calibration and boresight calibration folder names
- set_fact:
- user_shadow_glove_calibration_folder: "{{ shadow_glove_calibration_folder }}/user_calibration"
- user_shadow_glove_calibration_inside_docker: "{{ shadow_glove_calibration_inside_docker }}/user_calibration"
- user_shadow_glove_calibration_defaults_inside_docker: "/home/user/projects/shadow_robot/base/src/sr_hand_glove_internal/sr_hand_glove/shadow_glove_user_calibration_defaults/."
- user_shadow_glove_calibration_defaults_inside_docker_binary: "/opt/ros/shadow/share/sr_hand_glove/shadow_glove_user_calibration_defaults/."
- boresight_calibration_folder: "{{ shadow_glove_calibration_folder }}/glove_boresight_calibration"
- boresight_calibration_inside_docker: "{{ shadow_glove_calibration_inside_docker }}/glove_boresight_calibration"
- boresight_calibration_default_file_inside_docker: "/home/user/projects/shadow_robot/base/src/polhemus_ros_driver/config/{{ polhemus_type }}_calibration.yaml"
-
- - name: Ensure {{ shadow_glove_calibration_folder }} folder exists
- file:
- path: "{{ shadow_glove_calibration_folder }}"
- mode: '755'
- state: directory
-
- - name: Ensure {{ user_shadow_glove_calibration_folder }} folder exists
- file:
- path: "{{ user_shadow_glove_calibration_folder }}"
- mode: '755'
- state: directory
-
- - name: Ensure {{ boresight_calibration_folder }} folder exists
- file:
- path: "{{ boresight_calibration_folder }}"
- mode: '755'
- state: directory
-
- - name: Set custom shared volumes for docker container
- set_fact:
- custom_shared_volumes:
- - "{{ shadow_glove_calibration_folder }}:{{ shadow_glove_calibration_inside_docker }}"
-
- when: glove == "shadow_glove" and real_glove|bool
-
- name: Include products/common/docker-container role
include_role:
name: products/common/docker-container
@@ -140,101 +112,6 @@
container_terminal_title: "Teleop Server Container"
term_args: "--geometry {{ term_1 }}"
-- name: Copy the default shadow glove user and boresight calibration files to the host
- block:
- - name: Copying default files from non-binary docker container path {{ user_shadow_glove_calibration_defaults_inside_docker }} to the host folder {{ user_shadow_glove_calibration_folder }}
- changed_when: false
- shell: "docker cp {{ container_name }}:{{ user_shadow_glove_calibration_defaults_inside_docker }} {{ user_shadow_glove_calibration_folder }}"
- become: yes
- ignore_errors: yes
- when: "'binary' not in image"
-
- - name: Copying default files from binary docker container path {{ user_shadow_glove_calibration_defaults_inside_docker_binary }} to the host folder {{ user_shadow_glove_calibration_folder }}
- changed_when: false
- shell: "docker cp {{ container_name }}:{{ user_shadow_glove_calibration_defaults_inside_docker_binary }} {{ user_shadow_glove_calibration_folder }}"
- become: yes
- ignore_errors: yes
- when: "'binary' in image"
-
- - name: Check if the {{ polhemus_type }}_calibration.yaml exists on the host shared volume
- stat:
- path: "{{ boresight_calibration_folder }}/{{ polhemus_type }}_calibration.yaml"
- register: boresight_calibration_file
- ignore_errors: yes
-
- - name: If the default calibration doesn't exist, copy the default boresight calibration file from docker container path {{ boresight_calibration_default_file_inside_docker }} to the host folder {{ boresight_calibration_folder }}
- changed_when: false
- shell: "docker cp {{ container_name }}:{{ boresight_calibration_default_file_inside_docker }} {{ boresight_calibration_folder }}"
- become: yes
- ignore_errors: yes
- when: not boresight_calibration_file.stat.exists
-
- - name: Ensure {{ boresight_calibration_folder }}/{{ polhemus_type }}_calibration.yaml has the right permissions
- file:
- path: "{{ boresight_calibration_folder }}/{{ polhemus_type }}_calibration.yaml"
- mode: '666'
- state: file
- become: true
- ignore_errors: yes
-
- - name: Ensure {{ user_shadow_glove_calibration_folder }}/default_calibration_right.yaml has the right permissions
- file:
- path: "{{ user_shadow_glove_calibration_folder }}/default_calibration_right.yaml"
- mode: '666'
- state: file
- become: true
- ignore_errors: yes
-
- - name: Ensure {{ user_shadow_glove_calibration_folder }}/default_calibration_left.yaml has the right permissions
- file:
- path: "{{ user_shadow_glove_calibration_folder }}/default_calibration_left.yaml"
- mode: '666'
- state: file
- become: true
- ignore_errors: yes
-
- - name: Check if the current_calibration_right.yaml exists on the host shared volume
- stat:
- path: "{{ user_shadow_glove_calibration_folder }}/current_calibration_right.yaml"
- register: current_calibration_file_right
- ignore_errors: yes
-
- - name: Check if the current_calibration_left.yaml exists on the host shared volume
- stat:
- path: "{{ user_shadow_glove_calibration_folder }}/current_calibration_left.yaml"
- register: current_calibration_file_left
- ignore_errors: yes
-
- - name: Check if the default_calibration_right.yaml exists on the host shared volume
- stat:
- path: "{{ user_shadow_glove_calibration_folder }}/default_calibration_right.yaml"
- register: default_calibration_file_right
- ignore_errors: yes
-
- - name: Check if the default_calibration_left.yaml exists on the host shared volume
- stat:
- path: "{{ user_shadow_glove_calibration_folder }}/default_calibration_left.yaml"
- register: default_calibration_file_left
- ignore_errors: yes
-
- - name: if current_calibration_right.yaml doesn't exist but default does, copy default into it
- copy:
- src: "{{ user_shadow_glove_calibration_folder }}/default_calibration_right.yaml"
- dest: "{{ user_shadow_glove_calibration_folder }}/current_calibration_right.yaml"
- mode: '666'
- when: not current_calibration_file_right.stat.exists and default_calibration_file_right.stat.exists
- ignore_errors: yes
-
- - name: if current_calibration_left.yaml doesn't exist but default does, copy default into it
- copy:
- src: "{{ user_shadow_glove_calibration_folder }}/default_calibration_left.yaml"
- dest: "{{ user_shadow_glove_calibration_folder }}/current_calibration_left.yaml"
- mode: '666'
- when: not current_calibration_file_left.stat.exists and default_calibration_file_left.stat.exists
- ignore_errors: yes
-
- when: glove == "shadow_glove" and real_glove|bool
-
- name: Include docker/aws role
include_role:
name: docker/aws
@@ -268,21 +145,21 @@
- name: Adding the ssh identity
shell: "ssh-add {{ ssh_keys_path }}"
changed_when: false
- when: skip_molecule_task is not defined and groups['server'] is defined
+ when: not skip_molecule_task|bool and groups['server'] is defined
- name: Make a copy of SSH public key to a /tmp/ folder for copying to other machines
copy:
src: "{{ ssh_keys_path }}.pub"
dest: "{{ temp_ssh_keys_path }}.pub"
changed_when: false
- when: skip_molecule_task is not defined and groups['server'] is defined
+ when: not skip_molecule_task|bool and groups['server'] is defined
- name: Make a copy of SSH private key to a /tmp/ folder for copying to other machines
copy:
src: "{{ ssh_keys_path }}"
dest: "{{ temp_ssh_keys_path }}"
changed_when: false
- when: skip_molecule_task is not defined and groups['server'] is defined
+ when: not skip_molecule_task|bool and groups['server'] is defined
- name: Copying ssh key pair into docker container
changed_when: false
@@ -343,7 +220,7 @@
shell: udevadm control --reload-rules && udevadm trigger
changed_when: false
become: yes
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
- name: Creating upgrade script
template:
@@ -351,3 +228,7 @@
dest: "{{ shadow_hand_launcher_folder }}/{{ upgrade_script }}"
mode: '755'
when: upgrade_check|bool
+
+- name: Include installation/teamviewer role
+ include_role:
+ name: installation/teamviewer
\ No newline at end of file
diff --git a/ansible/roles/products/teleop/server/desktop-icons/defaults/main.yml b/ansible/roles/products/teleop/server/desktop-icons/defaults/main.yml
index e670c1232..a0c870c42 100644
--- a/ansible/roles/products/teleop/server/desktop-icons/defaults/main.yml
+++ b/ansible/roles/products/teleop/server/desktop-icons/defaults/main.yml
@@ -1,8 +1,22 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
user: "{{ ansible_user_id }}"
user_folder: "/home/{{ user }}"
glove: "shadow_glove"
-container_name: "teleop_{{ glove }}"
+container_name: "shadow_teleop"
shadow_hand_launcher_folder: "{{ user_folder }}/.shadow_launcher_app_{{ container_name }}/shadow_hand_launcher"
setup_directory: ""
nuc_username: "user"
@@ -11,8 +25,8 @@ upgrade_script: false
server_ip: "10.9.11.1"
demohand_icons: false
teleop_control_launch: "sr_robot_launch sr_hardware_control_loop.launch"
+launch_file_params: ""
ur_robot_type: "ur10e"
-biotacs: true
teleop_glove_right: "hand-e.png"
teleop_glove_left: "hand-e-left.png"
teleop_glove_bimanual: "hand-e-bimanual.png"
@@ -20,9 +34,9 @@ steam_binding: "steam_binding.jpg"
steam_vive_binding_url: http://127.0.0.1:27062/dashboard/controllerbinding.html
shadow_glove_teleop_readthedocs_link: ""
haptx_teleop_readthedocs_link: ""
-initial_z_value: 0.7551
-arm_x_separation_value: 0.0
-arm_y_separation_value: 0.0
+initial_z: 0.8221
+initial_y: 0.0
+initial_x: 0.0
rh_biotac_mapping: ""
lh_biotac_mapping: ""
launch_file_input_haptx_mapping_left: "haptx_base.launch side:=left"
@@ -35,4 +49,14 @@ glove_driver_value: "right"
ra_tracker_id: 0
la_tracker_id: 1
remote_icons: false
-hand_side_ad: ""
+hand_side_var: "right"
+hand_side_ad: "-r"
+roslaunch_command: "roslaunch"
+bimanual_warning_title: "Unimanual Launch Warning"
+bimanual_warning_text: "It is potentially unsafe to run a bimanual robot in unimanual mode; the pose of the unused arm is unknown, which may result in collisions.\nTo safely launch in unimanual mode, please first launch in bimanual mode, and use Rviz MotionPlanning to move the arm and hand you do not intend to use into the 'safe_store' state.\nBy clicking 'I accept the risks', you acknowledge that you understand the risks involved by running the unimanual system without moving the other robot arm and take full responsibility for any consequences that may arise."
+enable_warning_var: false
+skip_warning: false
+warning_title: "Example Warning"
+warning_text: "Example Text"
+extra_vars: ""
+extra_vars_value: ""
diff --git a/ansible/roles/products/teleop/server/desktop-icons/tasks/demohands-unimanual.yml b/ansible/roles/products/teleop/server/desktop-icons/tasks/demohands-unimanual.yml
index 7aadbb870..ba4c2eabf 100644
--- a/ansible/roles/products/teleop/server/desktop-icons/tasks/demohands-unimanual.yml
+++ b/ansible/roles/products/teleop/server/desktop-icons/tasks/demohands-unimanual.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Install desktop icon for hand A
import_tasks: nuc-control-loop-icon.yml
@@ -6,6 +20,9 @@
launch_script: "teleop_exec_A.sh"
desktop_icon_name: "3 - Demohand A Launch NUC Right Side Teleop Hardware Control Loop"
desktop_icon_path: "Shadow Advanced Launchers/3 - Demohand A Launch NUC Right Side Teleop Hardware Control Loop"
+ hand_side_var: "right"
+ hand_side_ad: "-r"
+
- name: Install desktop icon for hand B
import_tasks: nuc-control-loop-icon.yml
vars:
@@ -13,6 +30,8 @@
launch_script: "teleop_exec_B.sh"
desktop_icon_name: "3 - Demohand B Launch NUC Right Side Teleop Hardware Control Loop"
desktop_icon_path: "Shadow Advanced Launchers/3 - Demohand B Launch NUC Right Side Teleop Hardware Control Loop"
+ hand_side_var: "right"
+ hand_side_ad: "-r"
- name: Install desktop icon for hand C
import_tasks: nuc-control-loop-icon.yml
@@ -21,6 +40,9 @@
launch_script: "teleop_exec_C.sh"
desktop_icon_name: "3 - Demohand C Launch NUC Right Side Teleop Hardware Control Loop"
desktop_icon_path: "Shadow Advanced Launchers/3 - Demohand C Launch NUC Right Side Teleop Hardware Control Loop"
+ hand_side_var: "right"
+ hand_side_ad: "-r"
+
- name: Install desktop icon for hand D
import_tasks: nuc-control-loop-icon.yml
vars:
@@ -28,4 +50,5 @@
launch_script: "teleop_exec_D.sh"
desktop_icon_name: "3 - Demohand D Launch NUC Left Side Teleop Hardware Control Loop"
desktop_icon_path: "Shadow Advanced Launchers/3 - Demohand D Launch NUC Left Side Teleop Hardware Control Loop"
-
+ hand_side_var: "left"
+ hand_side_ad: "-l"
diff --git a/ansible/roles/products/teleop/server/desktop-icons/tasks/hand-icon.yml b/ansible/roles/products/teleop/server/desktop-icons/tasks/hand-icon.yml
index 2ce423eb8..c88a313bb 100644
--- a/ansible/roles/products/teleop/server/desktop-icons/tasks/hand-icon.yml
+++ b/ansible/roles/products/teleop/server/desktop-icons/tasks/hand-icon.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Copy desktop icon
copy:
@@ -7,15 +21,9 @@
- name: Create executable launch script for hand
template:
- src: ../../../hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc.j2
+ src: templates/scripts/start-docker-container-nuc.j2
dest: "{{ shadow_hand_launcher_folder }}/{{ launch_script }}"
mode: '755'
- vars:
- pwm_control_var: "{{ pwm_control_value }}"
- hand_ctrl_var: "{{ hand_ctrl_value }}"
- arm_ctrl_var: "false"
- arm_payload_mass: 5.0
- ad_hand_side: "{{ hand_side_ad }}"
- name: Create desktop icon for hand
template:
@@ -35,4 +43,4 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
diff --git a/ansible/roles/products/teleop/server/desktop-icons/tasks/main.yml b/ansible/roles/products/teleop/server/desktop-icons/tasks/main.yml
index f59ef0ce4..c5221ab70 100644
--- a/ansible/roles/products/teleop/server/desktop-icons/tasks/main.yml
+++ b/ansible/roles/products/teleop/server/desktop-icons/tasks/main.yml
@@ -1,9 +1,27 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Ensures that shadow_hand_launcher directory exists
file:
path: "{{ shadow_hand_launcher_folder }}"
state: directory
+- name: Include products/common/scene-files
+ include_role:
+ name: products/common/scene-files
+
- name: Set teleop main icon picture for HaptX
set_fact:
teleop_glove_right: "haptx_right.png"
@@ -37,4 +55,4 @@
- name: Include products/common/hand_config role
include_role:
name: products/common/hand_config
- when: skip_molecule_task is not defined
+ when: not skip_molecule_task|bool
diff --git a/ansible/roles/products/teleop/server/desktop-icons/tasks/nuc-control-loop-icon-bimanual.yml b/ansible/roles/products/teleop/server/desktop-icons/tasks/nuc-control-loop-icon-bimanual.yml
index 176dd5772..cd5e6f8bc 100644
--- a/ansible/roles/products/teleop/server/desktop-icons/tasks/nuc-control-loop-icon-bimanual.yml
+++ b/ansible/roles/products/teleop/server/desktop-icons/tasks/nuc-control-loop-icon-bimanual.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Copy desktop icon
copy:
@@ -5,6 +19,10 @@
dest: "{{ shadow_hand_launcher_folder }}/{{ desktop_icon_png }}"
mode: '664'
+- name: Set arm y separation
+ set_fact:
+ initial_y: 1.5
+
- name: Create executable launch script for bimanual hand and arm control loop (with haptx)
template:
src: templates/scripts/start-docker-container-nuc-bimanual.j2
@@ -12,6 +30,7 @@
mode: '755'
vars:
teleop_control_launch: "sr_teleop_vive_haptx teleop_vive_haptx_bimanual_control.launch"
+ launch_file_params: "robot_model:={{ ur_robot_type }} arm_1_z:={{ initial_z }} arm_2_z:={{ initial_z }} arm_x_separation:={{ initial_x }} arm_y_separation:={{ initial_y }}"
when: glove=="haptx"
- name: Create executable launch script for bimanual hand and arm control loop (with shadow_glove)
@@ -21,6 +40,7 @@
mode: '755'
vars:
teleop_control_launch: "sr_teleop_vive_polhemus teleop_vive_polhemus_bimanual_control.launch"
+ launch_file_params: "robot_model:={{ ur_robot_type }} arm_1_z:={{ initial_z }} arm_2_z:={{ initial_z }} arm_x_separation:={{ initial_x }} arm_y_separation:={{ initial_y }}"
when: glove=="shadow_glove"
- name: Create desktop icon for hand
@@ -41,4 +61,4 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
diff --git a/ansible/roles/products/teleop/server/desktop-icons/tasks/nuc-control-loop-icon.yml b/ansible/roles/products/teleop/server/desktop-icons/tasks/nuc-control-loop-icon.yml
index 39b593784..ab7c58be7 100644
--- a/ansible/roles/products/teleop/server/desktop-icons/tasks/nuc-control-loop-icon.yml
+++ b/ansible/roles/products/teleop/server/desktop-icons/tasks/nuc-control-loop-icon.yml
@@ -1,3 +1,17 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Copy desktop icon
copy:
@@ -5,10 +19,15 @@
dest: "{{ shadow_hand_launcher_folder }}/{{ desktop_icon_png }}"
mode: '664'
-- name: Set arm y separation if bimanual=true
+- name: Set arm y separation for left arm if bimanual=true
+ set_fact:
+ initial_y: 1.5
+ when: bimanual|bool and hand_side_var=="left"
+
+- name: Set arm y separation for right arm if bimanual=true
set_fact:
- arm_y_separation_value: 1.5
- when: bimanual|bool and hand_side=="left"
+ initial_y: 0.0
+ when: bimanual|bool and hand_side_var=="right"
- name: Create executable launch script for hand and arm control loop (with haptx)
template:
@@ -17,10 +36,8 @@
mode: '755'
vars:
teleop_control_launch: "sr_teleop_vive_haptx teleop_vive_haptx_control.launch"
- initial_z_var: "{{ initial_z_value }}"
- arm_x_separation_var: "{{ arm_x_separation_value }}"
- arm_y_separation_var: "{{ arm_y_separation_value }}"
- ad_hand_side: "{{ hand_side_ad }}"
+ launch_file_params: "robot_model:={{ ur_robot_type }} initial_z:={{ initial_z }} arm_x_separation:={{ initial_x }} arm_y_separation:={{ initial_y }} hand_side_ad:={{ hand_side_ad }}"
+ roslaunch_command: "roslaunch"
when: glove=="haptx"
- name: Create executable launch script for hand and arm control loop (with shadow_glove)
@@ -30,10 +47,8 @@
mode: '755'
vars:
teleop_control_launch: "sr_teleop_vive_polhemus teleop_vive_polhemus_control.launch"
- initial_z_var: "{{ initial_z_value }}"
- arm_x_separation_var: "{{ arm_x_separation_value }}"
- arm_y_separation_var: "{{ arm_y_separation_value }}"
- ad_hand_side: "{{ hand_side_ad }}"
+ launch_file_params: "robot_model:={{ ur_robot_type }} initial_z:={{ initial_z }} arm_x_separation:={{ initial_x }} arm_y_separation:={{ initial_y }} hand_side_ad:={{ hand_side_ad }}"
+ roslaunch_command: "roslaunch"
when: glove=="shadow_glove"
- name: Create desktop icon for hand
@@ -45,7 +60,7 @@
desktop_shortcut_name: "{{ desktop_icon_name }}"
comment: "{{ desktop_icon_name }}"
folder: "{{ shadow_hand_launcher_folder }}"
- shell_script_file_name: "{{ launch_script }}"
+ shell_script_file_name: "'{{ launch_script }}{{ extra_vars }}'"
icon_file_name: "{{ desktop_icon_png }}"
start_terminal: "false"
@@ -54,4 +69,4 @@
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- - skip_molecule_task is not defined
+ - not skip_molecule_task|bool
diff --git a/ansible/roles/products/teleop/server/desktop-icons/tasks/only-simulation.yml b/ansible/roles/products/teleop/server/desktop-icons/tasks/only-simulation.yml
index 9db6e16f1..c58f6b10f 100644
--- a/ansible/roles/products/teleop/server/desktop-icons/tasks/only-simulation.yml
+++ b/ansible/roles/products/teleop/server/desktop-icons/tasks/only-simulation.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
- name: Install desktop icon for launching Shadow Right Teleop Simulation
include_role:
@@ -13,7 +27,6 @@
control_loop_script_name: ""
gui_script_name: "shadow_sim_right.sh"
haptx_mapping_script_name: "shadow_haptx_mapping_launch_right.sh"
- when: not arm_servo|bool
- name: Install desktop icon for launching Shadow Left Teleop Simulation
include_role:
@@ -29,7 +42,6 @@
control_loop_script_name: ""
gui_script_name: "shadow_sim_left.sh"
haptx_mapping_script_name: "shadow_haptx_mapping_launch_left.sh"
- when: not arm_servo|bool
- name: Install desktop icon for launching Shadow Bimanual Teleop Simulation
include_role:
@@ -45,99 +57,41 @@
control_loop_script_name: ""
gui_script_name: "shadow_sim_bimanual.sh"
haptx_mapping_script_name: "shadow_haptx_mapping_launch_bimanual.sh"
- when: not arm_servo|bool
-
-- name: Install desktop icon for launching Shadow Right Teleop 8DOF Simulation
- include_role:
- name: products/common/default-icon
- vars:
- desktop_icon_png: "{{ teleop_glove_right }}"
- launch_script: "shadow_launch_right_teleop_8dof_sim.sh"
- desktop_icon_name: "Launch Shadow Right Teleop 8DOF Simulation"
- template: templates/scripts/launch-teleop-sim.j2
- desktop_icon_path: "Launch Shadow Right Teleop 8DOF Simulation"
- launch_terminal: "false"
- hand_side_label: "Right Hand"
- control_loop_script_name: ""
- gui_script_name: "shadow_sim_right_8DOF.sh"
- haptx_mapping_script_name: "shadow_haptx_mapping_launch_right.sh"
- when: arm_servo|bool
-
-- name: Install desktop icon for launching Shadow Left Teleop 8DOF Simulation
- include_role:
- name: products/common/default-icon
- vars:
- desktop_icon_png: "{{ teleop_glove_left }}"
- launch_script: "shadow_launch_left_teleop_8dof_sim.sh"
- desktop_icon_name: "Launch Shadow Left Teleop 8DOF Simulation"
- template: templates/scripts/launch-teleop-sim.j2
- desktop_icon_path: "Launch Shadow Left Teleop 8DOF Simulation"
- launch_terminal: "false"
- hand_side_label: "Left Hand"
- control_loop_script_name: ""
- gui_script_name: "shadow_sim_left_8DOF.sh"
- haptx_mapping_script_name: "shadow_haptx_mapping_launch_left.sh"
- when: arm_servo|bool
-
-- name: Install desktop icon for launching Shadow Bimanual Teleop 8DOF Simulation
- include_role:
- name: products/common/default-icon
- vars:
- desktop_icon_png: "{{ teleop_glove_bimanual }}"
- launch_script: "shadow_launch_bimanual_teleop_8dof_sim.sh"
- desktop_icon_name: "Launch Shadow Bimanual Teleop 8DOF Simulation"
- template: templates/scripts/launch-teleop-sim.j2
- desktop_icon_path: "Launch Shadow Bimanual Teleop 8DOF Simulation"
- launch_terminal: "false"
- hand_side_label: "Bimanual"
- control_loop_script_name: ""
- gui_script_name: "shadow_sim_bimanual_8DOF.sh"
- haptx_mapping_script_name: "shadow_haptx_mapping_launch_bimanual.sh"
- when: arm_servo|bool
-- name: Include hand-manual role
+- name: Include documentation role
include_role:
- name: products/common/hand-manual
+ name: products/common/documentation
when: customer_key is defined and customer_key | length > 0
-- name: Set default biotacs to false if Shadow Glove is being used (user can still override)
+- name: Set variables for sim
set_fact:
- biotacs: false
- when: glove=="shadow_glove"
+ initial_y_left_arm: 1.5
+ initial_y_right_arm: 0.0
- name: Create shared icons
include_tasks: shared-roles.yml
- name: Set GUI icon variables to standard values for haptx
set_fact:
- launch_file_input_gui_right: "teleop_vive_haptx.launch external_control_loop:=false sim:=true side:=right robot_model:={{ ur_robot_type }} require_pedal:=false biotacs:={{ biotacs | lower }} vive:={{ real_vive | lower }} jog_arm:=true arm_servo:=false"
- launch_file_input_gui_left: "teleop_vive_haptx.launch external_control_loop:=false sim:=true side:=left robot_model:={{ ur_robot_type }} require_pedal:=false biotacs:={{ biotacs | lower }} vive:={{ real_vive | lower }} jog_arm:=true arm_servo:=false"
- launch_file_input_gui_bimanual: "teleop_bimanual_vive_haptx.launch external_control_loop:=false sim:=true robot_model:={{ ur_robot_type }} require_pedal:=false biotacs:={{ biotacs | lower }} vive:={{ real_vive | lower }} jog_arm:=true arm_servo:=false"
- launch_file_input_gui_right_8DOF: "teleop_vive_haptx.launch external_control_loop:=false sim:=true side:=right robot_model:={{ ur_robot_type }} require_pedal:=false biotacs:={{ biotacs | lower }} vive:={{ real_vive | lower }} jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true"
- launch_file_input_gui_left_8DOF: "teleop_vive_haptx.launch external_control_loop:=false sim:=true side:=left robot_model:={{ ur_robot_type }} require_pedal:=false biotacs:={{ biotacs | lower }} vive:={{ real_vive | lower }} jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true"
- launch_file_input_gui_bimanual_8DOF: "teleop_bimanual_vive_haptx.launch external_control_loop:=false sim:=true robot_model:={{ ur_robot_type }} require_pedal:=false biotacs:={{ biotacs | lower }} vive:={{ real_vive | lower }} jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true"
+ launch_file_input_gui_right: "teleop_vive_haptx.launch external_control_loop:=false sim:=true side:=right robot_model:={{ ur_robot_type }} require_pedal:=false vive:={{ real_vive | lower }} jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true initial_y:={{ initial_y_right_arm }} initial_z:={{ initial_z }}"
+ launch_file_input_gui_left: "teleop_vive_haptx.launch external_control_loop:=false sim:=true side:=left robot_model:={{ ur_robot_type }} require_pedal:=false vive:={{ real_vive | lower }} jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true initial_y:={{ initial_y_left_arm }} initial_z:={{ initial_z }}"
+ launch_file_input_gui_bimanual: "teleop_bimanual_vive_haptx.launch external_control_loop:=false sim:=true robot_model:={{ ur_robot_type }} require_pedal:=false vive:={{ real_vive | lower }} jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true arm_1_z:={{ initial_z }} arm_2_z:={{ initial_z }} arm_y_separation:={{ initial_y_left_arm }}"
project_name_input_value: "sr_teleop_vive_haptx"
when: glove=="haptx"
- name: Set GUI icon variables to standard values for shadow_glove
set_fact:
- launch_file_input_gui_right: "sr_teleop_vive_polhemus.launch polhemus_product_type:={{ polhemus_type }} external_control_loop:=false sim:=true side:=right vive:={{ real_vive | lower }} biotacs:={{ biotacs | lower }} robot_model:={{ ur_robot_type }} polhemus:={{ real_glove | lower }} palm_device:=tracker require_pedal:=false jog_arm:=true arm_servo:=false"
- launch_file_input_gui_left: "sr_teleop_vive_polhemus.launch polhemus_product_type:={{ polhemus_type }} external_control_loop:=false sim:=true side:=left vive:={{ real_vive | lower }} biotacs:={{ biotacs | lower }} robot_model:={{ ur_robot_type }} polhemus:={{ real_glove | lower }} palm_device:=tracker require_pedal:=false jog_arm:=true arm_servo:=false"
- launch_file_input_gui_bimanual: "sr_teleop_vive_polhemus_bimanual.launch polhemus_product_type:={{ polhemus_type }} external_control_loop:=false sim:=true vive:={{ real_vive | lower }} biotacs:={{ biotacs | lower }} robot_model:={{ ur_robot_type }} polhemus:={{ real_glove | lower | ternary('both','none') }} rh_palm_device:=tracker lh_palm_device:=tracker require_pedal:=false jog_arm:=true arm_servo:=false"
- launch_file_input_gui_right_8DOF: "sr_teleop_vive_polhemus.launch polhemus_product_type:={{ polhemus_type }} external_control_loop:=false sim:=true side:=right vive:={{ real_vive | lower }} biotacs:={{ biotacs | lower }} robot_model:={{ ur_robot_type }} polhemus:={{ real_glove | lower }} palm_device:=tracker require_pedal:=false jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true"
- launch_file_input_gui_left_8DOF: "sr_teleop_vive_polhemus.launch polhemus_product_type:={{ polhemus_type }} external_control_loop:=false sim:=true side:=left vive:={{ real_vive | lower }} biotacs:={{ biotacs | lower }} robot_model:={{ ur_robot_type }} polhemus:={{ real_glove | lower }} palm_device:=tracker require_pedal:=false jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true"
- launch_file_input_gui_bimanual_8DOF: "sr_teleop_vive_polhemus_bimanual.launch polhemus_product_type:={{ polhemus_type }} external_control_loop:=false sim:=true vive:={{ real_vive | lower }} biotacs:={{ biotacs | lower }} robot_model:={{ ur_robot_type }} polhemus:={{ real_glove | lower | ternary('both','none') }} rh_palm_device:=tracker lh_palm_device:=tracker require_pedal:=false jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true"
+ launch_file_input_gui_right: "sr_teleop_vive_polhemus.launch polhemus_product_type:={{ polhemus_type }} external_control_loop:=false sim:=true side:=right vive:={{ real_vive | lower }} robot_model:={{ ur_robot_type }} polhemus:={{ real_glove | lower }} palm_device:=tracker require_pedal:=false jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true initial_y:={{ initial_y_right_arm }} initial_z:={{ initial_z }}"
+ launch_file_input_gui_left: "sr_teleop_vive_polhemus.launch polhemus_product_type:={{ polhemus_type }} external_control_loop:=false sim:=true side:=left vive:={{ real_vive | lower }} robot_model:={{ ur_robot_type }} polhemus:={{ real_glove | lower }} palm_device:=tracker require_pedal:=false jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true initial_y:={{ initial_y_left_arm }} initial_z:={{ initial_z }}"
+ launch_file_input_gui_bimanual: "sr_teleop_vive_polhemus_bimanual.launch polhemus_product_type:={{ polhemus_type }} external_control_loop:=false sim:=true vive:={{ real_vive | lower }} robot_model:={{ ur_robot_type }} polhemus:={{ real_glove | lower | ternary('both','none') }} rh_palm_device:=tracker lh_palm_device:=tracker require_pedal:=false jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true arm_1_z:={{ initial_z }} arm_2_z:={{ initial_z }} arm_y_separation:={{ initial_y_left_arm }}"
project_name_input_value: "sr_teleop_vive_polhemus"
when: glove=="shadow_glove"
- name: Set GUI icon variables for custom scene
set_fact:
- launch_file_input_gui_right: "{{ launch_file_input_gui_right }} scene_file:='{{ scene_file }}' world:='{{ scene_file | replace('.scene','.world') | replace('/scenes/','/worlds/') }}'"
- launch_file_input_gui_left: "{{ launch_file_input_gui_left }} scene_file:='{{ scene_file }}' world:='{{ scene_file | replace('.scene','.world') | replace('/scenes/','/worlds/') }}'"
- launch_file_input_gui_bimanual: "{{ launch_file_input_gui_bimanual }} scene_file:='{{ scene_file }}' world:='{{ scene_file | replace('.scene','.world') | replace('/scenes/','/worlds/') }}'"
- launch_file_input_gui_right_8DOF: "{{ launch_file_input_gui_right_8DOF }} scene_file:='{{ scene_file }}' world:='{{ scene_file | replace('.scene','.world') | replace('/scenes/','/worlds/') }}'"
- launch_file_input_gui_left_8DOF: "{{ launch_file_input_gui_left_8DOF }} scene_file:='{{ scene_file }}' world:='{{ scene_file | replace('.scene','.world') | replace('/scenes/','/worlds/') }}'"
- launch_file_input_gui_bimanual_8DOF: "{{ launch_file_input_gui_bimanual_8DOF }} scene_file:='{{ scene_file }}' world:='{{ scene_file | replace('.scene','.world') | replace('/scenes/','/worlds/') }}'"
+ launch_file_input_gui_right: "{{ launch_file_input_gui_right }} scene_file:='$(find sr_description_common)/scenes/{{ scene_file_right }}.scene' world:='$(find sr_description_common)/worlds/{{ scene_file_right }}.world'"
+ launch_file_input_gui_left: "{{ launch_file_input_gui_left }} scene_file:='$(find sr_description_common)/scenes/{{ scene_file_left }}.scene' world:='$(find sr_description_common)/worlds/{{ scene_file_left }}.world'"
+ launch_file_input_gui_bimanual: "{{ launch_file_input_gui_bimanual }} scene_file:='$(find sr_description_common)/scenes/{{ scene_file_bimanual }}.scene' world:='$(find sr_description_common)/worlds/{{ scene_file_bimanual }}.world'"
when: scene_file|length > 0
- name: Install desktop icon for Teleop server Simulation (Unimanual Right)
@@ -173,42 +127,6 @@
project_name_input: "{{ project_name_input_value }}"
launch_file_input: "{{ launch_file_input_gui_bimanual }}"
-- name: Install desktop icon for Teleop server Simulation 8DOF (Unimanual Right)
- include_role:
- name: products/common/roslaunch-icon
- vars:
- desktop_icon_png: "{{ glove }}_right.png"
- launch_script: "shadow_sim_right_8DOF.sh"
- desktop_icon_name: "3 - Launch Right Teleop Simulation 8DOF"
- desktop_icon_path: "{{ right_advanced_launcher }}/3 - Launch Right Teleop Simulation 8DOF"
- project_name_input: "{{ project_name_input_value }}"
- launch_file_input: "{{ launch_file_input_gui_right_8DOF }}"
- when: arm_servo|bool
-
-- name: Install desktop icon for Teleop server Simulation 8DOF (Unimanual Left)
- include_role:
- name: products/common/roslaunch-icon
- vars:
- desktop_icon_png: "{{ glove }}_left.png"
- launch_script: "shadow_sim_left_8DOF.sh"
- desktop_icon_name: "3 - Launch Left Teleop Simulation 8DOF"
- desktop_icon_path: "{{ left_advanced_launcher }}/3 - Launch Left Teleop Simulation 8DOF"
- project_name_input: "{{ project_name_input_value }}"
- launch_file_input: "{{ launch_file_input_gui_left_8DOF }}"
- when: arm_servo|bool
-
-- name: Install desktop icon for Teleop server Simulation 8DOF (Bimanual)
- include_role:
- name: products/common/roslaunch-icon
- vars:
- desktop_icon_png: "{{ glove }}_bimanual.png"
- launch_script: "shadow_sim_bimanual_8DOF.sh"
- desktop_icon_name: "3 - Launch Bimanual Teleop Simulation 8DOF"
- desktop_icon_path: "{{ bimanual_advanced_launcher }}/3 - Launch Bimanual Teleop Simulation 8DOF"
- project_name_input: "{{ project_name_input_value }}"
- launch_file_input: "{{ launch_file_input_gui_bimanual_8DOF }}"
- when: arm_servo|bool
-
- name: Set Shadow Glove Launch file inputs
set_fact:
launch_file_input_right: "polhemus.launch polhemus_product_type:={{ polhemus_type }}"
@@ -218,16 +136,16 @@
- name: Set Shadow Glove Launch file inputs if real_glove = true
set_fact:
- launch_file_input_right: "polhemus.launch polhemus_product_type:={{ polhemus_type }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' user_calibration_file_name:=current_calibration_right.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration'"
- launch_file_input_left: "polhemus.launch polhemus_product_type:={{ polhemus_type }} side:=left user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' user_calibration_file_name:=current_calibration_left.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration'"
- launch_file_input_bimanual: "polhemus.launch polhemus_product_type:={{ polhemus_type }} side:=both user_calibration_folder_path:='/home/user/shadow_glove_user_calibration_files' right_user_calibration_file_name:=current_calibration_right.yaml left_user_calibration_file_name:=current_calibration_left.yaml"
+ launch_file_input_right: "polhemus.launch polhemus_product_type:={{ polhemus_type }} user_calibration_file_name:=default_calibration_right.yaml"
+ launch_file_input_left: "polhemus.launch polhemus_product_type:={{ polhemus_type }} side:=left user_calibration_file_name:=default_calibration_left.yaml"
+ launch_file_input_bimanual: "polhemus.launch polhemus_product_type:={{ polhemus_type }} side:=both right_user_calibration_file_name:=default_calibration_right.yaml left_user_calibration_file_name:=default_calibration_left.yaml"
when: glove=="shadow_glove" and real_glove|bool
- name: Set Shadow Glove Launch file inputs if real_glove = true
set_fact:
- launch_file_input_right: "{{ launch_file_input_right }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' user_calibration_file_name:=current_calibration_right.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration'"
- launch_file_input_left: "{{ launch_file_input_right }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' user_calibration_file_name:=current_calibration_left.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration'"
- launch_file_input_bimanual: "{{ launch_file_input_gui_bimanual }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' right_user_calibration_file_name:=current_calibration_right.yaml left_user_calibration_file_name:=current_calibration_left.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration'"
+ launch_file_input_right: "{{ launch_file_input_right }} user_calibration_file_name:=default_calibration_right.yaml"
+ launch_file_input_left: "{{ launch_file_input_right }} user_calibration_file_name:=default_calibration_left.yaml"
+ launch_file_input_bimanual: "{{ launch_file_input_gui_bimanual }} right_user_calibration_file_name:=default_calibration_right.yaml left_user_calibration_file_name:=default_calibration_left.yaml"
when: glove=="shadow_glove" and real_glove|bool
- name: Install desktop icon for running right Shadow Glove driver
@@ -238,7 +156,7 @@
launch_script: "shadow_glove_driver_right.sh"
desktop_icon_name: "4 - Launch Right Shadow Glove Driver"
desktop_icon_path: "{{ right_advanced_launcher }}/4 - Launch Right Shadow Glove Driver"
- project_name_input: "sr_teleop_vive_polhemus"
+ project_name_input: "sr_hand_glove"
launch_file_input: "{{ launch_file_input_right }}"
when: glove=="shadow_glove" and real_glove|bool
@@ -250,7 +168,7 @@
launch_script: "shadow_glove_driver_left.sh"
desktop_icon_name: "4 - Launch Left Shadow Glove Driver"
desktop_icon_path: "{{ left_advanced_launcher }}/4 - Launch Left Shadow Glove Driver"
- project_name_input: "sr_teleop_vive_polhemus"
+ project_name_input: "sr_hand_glove"
launch_file_input: "{{ launch_file_input_left }}"
when: glove=="shadow_glove" and real_glove|bool
@@ -262,7 +180,7 @@
launch_script: "shadow_glove_driver_bimanual.sh"
desktop_icon_name: "4 - Launch Bimanual Shadow Glove Driver"
desktop_icon_path: "{{ bimanual_advanced_launcher }}/4 - Launch Bimanual Shadow Glove Driver"
- project_name_input: "sr_teleop_vive_polhemus"
+ project_name_input: "sr_hand_glove"
launch_file_input: "{{ launch_file_input_bimanual }}"
when: glove=="shadow_glove" and real_glove|bool
@@ -302,43 +220,6 @@
launch_file_input: "haptx_base_bimanual.launch"
when: glove=="haptx" and real_glove|bool
-- name: Install desktop icon for running Shadow Glove mapping node right
- include_role:
- name: products/common/roslaunch-icon
- vars:
- desktop_icon_png: "shadow_glove_right.png"
- launch_script: "shadow_glove_mapping_launch_right.sh"
- desktop_icon_name: "5 - Launch Right Shadow Glove Mapping"
- desktop_icon_path: "{{ right_advanced_launcher }}/5 - Launch Right Shadow Glove Mapping"
- project_name_input: "sr_fingertip_hand_teleop"
- launch_file_input: "sr_fingertip_hand_teleop.launch hand_side_prefix:=rh"
- when: glove=="shadow_glove"
-
-- name: Install desktop icon for running Shadow Glove mapping node left
- include_role:
- name: products/common/roslaunch-icon
- vars:
- desktop_icon_png: "shadow_glove_left.png"
- launch_script: "shadow_glove_mapping_launch_left.sh"
- desktop_icon_name: "5 - Launch Left Shadow Glove Mapping"
- desktop_icon_path: "{{ left_advanced_launcher }}/5 - Launch Left Shadow Glove Mapping"
- project_name_input: "sr_fingertip_hand_teleop"
- launch_file_input: "sr_fingertip_hand_teleop.launch hand_side_prefix:=lh"
- when: glove=="shadow_glove"
-
-- name: Install desktop icon for running Shadow Glove mapping node bimanual
- include_role:
- name: products/common/roslaunch-icon
- vars:
- desktop_icon_png: "shadow_glove_bimanual.png"
- launch_script: "shadow_glove_mapping_launch_bimanual.sh"
- desktop_icon_name: "6 - Launch Bimanual Shadow Glove Mapping"
- desktop_icon_path: "{{ bimanual_advanced_launcher }}/6 - Launch Bimanual Shadow Glove Mapping"
- project_name_input: "sr_fingertip_hand_teleop"
- launch_file_input: "sr_fingertip_hand_teleop_bimanual.launch"
- when:
- - glove=="shadow_glove"
-
- name: Set mock parameters based on glove=haptx
set_fact:
project_name_value: "sr_teleop_vive_haptx"
@@ -396,7 +277,7 @@
dest: "{{ shadow_hand_launcher_folder }}/shadow_glove_calibration_rqt.sh"
mode: '755'
vars:
- command: "rqt -s sr_gui_shadow_glove_calibration.shadow_glove_calibration.SrGuiShadowGloveCalibration"
+ command: "rqt -s sr_glove_calibration_gui.sr_glove_calibration_gui.SrGloveCalibrationGui"
when: glove=="shadow_glove" and real_glove|bool
- name: Set Shadow Glove driver name (if right)
@@ -410,9 +291,9 @@
vars:
desktop_icon_png: "shadow_glove_{{ glove_driver_type }}.png"
launch_script: "shadow_glove_calibration.sh"
- desktop_icon_name: "Launch Shadow {{ glove_driver_type }} Glove Calibration"
+ desktop_icon_name: "Launch Shadow {{ glove_driver_type | title }} Glove Calibration"
template: templates/scripts/launch-shadow-glove-calibration.j2
- desktop_icon_path: "Shadow Advanced Launchers/Launch Shadow {{ glove_driver_type }} Glove Calibration"
+ desktop_icon_path: "Shadow Advanced Launchers/Launch Shadow {{ glove_driver_type | title }} Glove Calibration"
launch_terminal: "false"
glove_driver_value: "{{ glove_driver_type }}"
when: glove=="shadow_glove" and real_glove|bool
@@ -428,9 +309,9 @@
vars:
desktop_icon_png: "shadow_glove_{{ glove_driver_type }}.png"
launch_script: "shadow_glove_calibration.sh"
- desktop_icon_name: "Launch Shadow {{ glove_driver_type }} Glove Calibration"
+ desktop_icon_name: "Launch Shadow {{ glove_driver_type | title }} Glove Calibration"
template: templates/scripts/launch-shadow-glove-calibration.j2
- desktop_icon_path: "Shadow Advanced Launchers/Launch Shadow {{ glove_driver_type }} Glove Calibration"
+ desktop_icon_path: "Shadow Advanced Launchers/Launch Shadow {{ glove_driver_type | title }} Glove Calibration"
launch_terminal: "false"
glove_driver_value: "{{ glove_driver_type }}"
when: glove=="shadow_glove" and real_glove|bool
@@ -446,9 +327,9 @@
vars:
desktop_icon_png: "shadow_glove_{{ glove_driver_type }}.png"
launch_script: "shadow_glove_calibration.sh"
- desktop_icon_name: "Launch Shadow {{ glove_driver_type }} Glove Calibration"
+ desktop_icon_name: "Launch Shadow {{ glove_driver_type | title }} Glove Calibration"
template: templates/scripts/launch-shadow-glove-calibration.j2
- desktop_icon_path: "Shadow Advanced Launchers/Launch Shadow {{ glove_driver_type }} Glove Calibration"
+ desktop_icon_path: "Shadow Advanced Launchers/Launch Shadow {{ glove_driver_type | title }} Glove Calibration"
launch_terminal: "false"
glove_driver_value: "{{ glove_driver_type }}"
when: glove=="shadow_glove" and real_glove|bool
diff --git a/ansible/roles/products/teleop/server/desktop-icons/tasks/real-robots.yml b/ansible/roles/products/teleop/server/desktop-icons/tasks/real-robots.yml
index 4bdb01ae3..f95158a93 100644
--- a/ansible/roles/products/teleop/server/desktop-icons/tasks/real-robots.yml
+++ b/ansible/roles/products/teleop/server/desktop-icons/tasks/real-robots.yml
@@ -1,4 +1,29 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
---
+- name: Set Shadow Bimanual Warnining
+ set_fact:
+ bimanual_warning_title: "Unimanual Launch Warning"
+ bimanual_warning_text: "It is potentially unsafe to run a bimanual robot in unimanual mode; the pose of the unused arm is unknown, which may result in collisions.\nTo safely launch in unimanual mode, please first launch in bimanual mode, and use Rviz MotionPlanning to move the arm and hand you do not intend to use into the 'safe_store' state.\nBy clicking 'I accept the risks', you acknowledge that you understand the risks involved by running the unimanual system without moving the other robot arm and take full responsibility for any consequences that may arise."
+
+- name: Set enable warning vars
+ set_fact:
+ enable_warning_var: true
+ extra_vars_value: " 0" # Used to enable the bimanual warning for control loop advanced launcher icon
+ when: bimanual|bool and not skip_warning|bool
+
- name: Install desktop icon for launching Shadow Right Teleop
include_role:
name: products/common/default-icon
@@ -13,7 +38,10 @@
control_loop_script_name: "shadow_nuc_right_hardware_control_loop.sh"
gui_script_name: "shadow_GUI_right.sh"
haptx_mapping_script_name: "shadow_haptx_mapping_launch_right.sh"
- when: (bimanual|bool or hand_side=="right") and not arm_servo|bool
+ enable_warning: "{{ enable_warning_var|bool }}"
+ warning_title: "{{ bimanual_warning_title }}"
+ warning_text: "{{ bimanual_warning_text }}"
+ when: bimanual|bool or hand_side=="right"
- name: Install desktop icon for launching Shadow Left Teleop
include_role:
@@ -29,7 +57,10 @@
control_loop_script_name: "shadow_nuc_left_hardware_control_loop.sh"
gui_script_name: "shadow_GUI_left.sh"
haptx_mapping_script_name: "shadow_haptx_mapping_launch_left.sh"
- when: (bimanual|bool or hand_side=="left") and not arm_servo|bool
+ enable_warning: "{{ enable_warning_var|bool }}"
+ warning_title: "{{ bimanual_warning_title }}"
+ warning_text: "{{ bimanual_warning_text }}"
+ when: bimanual|bool or hand_side=="left"
- name: Install desktop icon for launching Shadow Bimanual Teleop
include_role:
@@ -45,55 +76,10 @@
control_loop_script_name: "shadow_nuc_bimanual_hardware_control_loop.sh"
gui_script_name: "shadow_GUI_bimanual.sh"
haptx_mapping_script_name: "shadow_haptx_mapping_launch_bimanual.sh"
- when: bimanual|bool and not arm_servo|bool
-
-- name: Install desktop icon for launching Shadow Right Teleop 8DOF
- include_role:
- name: products/common/default-icon
- vars:
- desktop_icon_png: "{{ teleop_glove_right }}"
- launch_script: "shadow_launch_right_teleop_8dof.sh"
- desktop_icon_name: "Launch Shadow Right Teleop 8DOF"
- template: templates/scripts/launch-teleop.j2
- desktop_icon_path: "Launch Shadow Right Teleop 8DOF"
- launch_terminal: "false"
- hand_side_label: "Right Hand"
- control_loop_script_name: "shadow_nuc_right_hardware_control_loop.sh"
- gui_script_name: "shadow_GUI_right_8DOF.sh"
- haptx_mapping_script_name: "shadow_haptx_mapping_launch_right.sh"
- when: (bimanual|bool or hand_side=="right") and arm_servo|bool
-
-- name: Install desktop icon for launching Shadow Left Teleop 8DOF
- include_role:
- name: products/common/default-icon
- vars:
- desktop_icon_png: "{{ teleop_glove_left }}"
- launch_script: "shadow_launch_left_teleop_8dof.sh"
- desktop_icon_name: "Launch Shadow Left Teleop 8DOF"
- template: templates/scripts/launch-teleop.j2
- desktop_icon_path: "Launch Shadow Left Teleop 8DOF"
- launch_terminal: "false"
- hand_side_label: "Left Hand"
- control_loop_script_name: "shadow_nuc_left_hardware_control_loop.sh"
- gui_script_name: "shadow_GUI_left_8DOF.sh"
- haptx_mapping_script_name: "shadow_haptx_mapping_launch_left.sh"
- when: (bimanual|bool or hand_side=="left") and arm_servo|bool
-
-- name: Install desktop icon for launching Shadow Bimanual Teleop 8DOF
- include_role:
- name: products/common/default-icon
- vars:
- desktop_icon_png: "{{ teleop_glove_bimanual }}"
- launch_script: "shadow_launch_bimanual_teleop_8dof.sh"
- desktop_icon_name: "Launch Shadow Bimanual Teleop 8DOF"
- template: templates/scripts/launch-teleop.j2
- desktop_icon_path: "Launch Shadow Bimanual Teleop 8DOF"
- launch_terminal: "false"
- hand_side_label: "Bimanual"
- control_loop_script_name: "shadow_nuc_bimanual_hardware_control_loop.sh"
- gui_script_name: "shadow_GUI_bimanual_8DOF.sh"
- haptx_mapping_script_name: "shadow_haptx_mapping_launch_bimanual.sh"
- when: bimanual|bool and arm_servo|bool
+ enable_warning: "false"
+ warning_title: "{{ bimanual_warning_title }}"
+ warning_text: "{{ bimanual_warning_text }}"
+ when: bimanual|bool
- name: Install desktop icon for launching Shadow Remote Right Teleop
include_role:
@@ -149,9 +135,9 @@
- bimanual|bool
- remote_icons|bool
-- name: Include hand-manual role
+- name: Include documentation role
include_role:
- name: products/common/hand-manual
+ name: products/common/documentation
when: customer_key is defined and customer_key | length > 0
- name: Install desktop icon for RQT on NUC
@@ -182,7 +168,11 @@
launch_script: "shadow_nuc_right_hardware_control_loop.sh"
desktop_icon_name: "3 - Launch NUC Right Side Teleop Hardware Control Loop"
desktop_icon_path: "{{ right_advanced_launcher }}/3 - Launch NUC Right Side Teleop Hardware Control Loop"
+ hand_side_var: "right"
hand_side_ad: "-r"
+ warning_title: "{{ bimanual_warning_title }}"
+ warning_text: "{{ bimanual_warning_text }}"
+ extra_vars: "{{ extra_vars_value }}"
when: bimanual|bool or hand_side=="right"
- name: Install desktop icon for NUC left hand and arm hardware control loop
@@ -192,7 +182,11 @@
launch_script: "shadow_nuc_left_hardware_control_loop.sh"
desktop_icon_name: "3 - Launch NUC Left Side Teleop Hardware Control Loop"
desktop_icon_path: "{{ left_advanced_launcher }}/3 - Launch NUC Left Side Teleop Hardware Control Loop"
+ hand_side_var: "left"
hand_side_ad: "-l"
+ warning_title: "{{ bimanual_warning_title }}"
+ warning_text: "{{ bimanual_warning_text }}"
+ extra_vars: "{{ extra_vars_value }}"
when: bimanual|bool or hand_side=="left"
- name: Install desktop icon for NUC bimanual teleop hardware control loop
@@ -202,6 +196,8 @@
launch_script: "shadow_nuc_bimanual_hardware_control_loop.sh"
desktop_icon_name: "3 - Launch NUC Bimanual Teleop Hardware Control Loop"
desktop_icon_path: "{{ bimanual_advanced_launcher }}/3 - Launch NUC Bimanual Teleop Hardware Control Loop"
+ warning_title: "{{ bimanual_warning_title }}"
+ warning_text: "{{ bimanual_warning_text }}"
when: bimanual|bool
- name: Setting up icons for demohands A,B,C,D for unimanual teleop
@@ -210,34 +206,25 @@
- name: Set GUI icon variables to standard values for haptx
set_fact:
- launch_file_input_gui_right: "teleop_vive_haptx.launch vive:=false robot_model:={{ ur_robot_type }} require_pedal:=true biotacs:={{ biotacs | lower }} tracker_id:={{ ra_tracker_id }} hand_side_ad:=-r jog_arm:=true arm_servo:=false"
- launch_file_input_gui_left: "teleop_vive_haptx.launch side:=left vive:=false robot_model:={{ ur_robot_type }} require_pedal:=true biotacs:={{ biotacs | lower }} tracker_id:={{ la_tracker_id }} hand_side_ad:=-l jog_arm:=true arm_servo:=false"
- launch_file_input_gui_bimanual: "teleop_bimanual_vive_haptx.launch robot_model:={{ ur_robot_type }} require_pedal:=true biotacs:={{ biotacs | lower }} ra_tracker_id:={{ ra_tracker_id }} la_tracker_id:={{ la_tracker_id }} jog_arm:=true arm_servo:=false"
- launch_file_input_gui_right_8DOF: "teleop_vive_haptx.launch vive:=false robot_model:={{ ur_robot_type }} require_pedal:=true biotacs:={{ biotacs | lower }} tracker_id:={{ ra_tracker_id }} jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true hand_side_ad:=-r"
- launch_file_input_gui_left_8DOF: "teleop_vive_haptx.launch side:=left vive:=false robot_model:={{ ur_robot_type }} require_pedal:=true biotacs:={{ biotacs | lower }} tracker_id:={{ la_tracker_id }} jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true hand_side_ad:=-l"
- launch_file_input_gui_bimanual_8DOF: "teleop_bimanual_vive_haptx.launch robot_model:={{ ur_robot_type }} require_pedal:=true biotacs:={{ biotacs | lower }} ra_tracker_id:={{ ra_tracker_id }} la_tracker_id:={{ la_tracker_id }} jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true"
+ launch_file_input_gui_right: "teleop_vive_haptx.launch vive:=false robot_model:={{ ur_robot_type }} require_pedal:=true tracker_id:={{ ra_tracker_id }} jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true hand_side_ad:=-r"
+ launch_file_input_gui_left: "teleop_vive_haptx.launch side:=left vive:=false robot_model:={{ ur_robot_type }} require_pedal:=true tracker_id:={{ la_tracker_id }} jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true hand_side_ad:=-l"
+ launch_file_input_gui_bimanual: "teleop_bimanual_vive_haptx.launch robot_model:={{ ur_robot_type }} require_pedal:=true ra_tracker_id:={{ ra_tracker_id }} la_tracker_id:={{ la_tracker_id }} jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true"
project_name_input_value: "sr_teleop_vive_haptx"
when: glove=="haptx"
- name: Set GUI icon variables to standard values for shadow_glove
set_fact:
- launch_file_input_gui_right: "sr_teleop_vive_polhemus.launch polhemus_product_type:={{ polhemus_type }} vive:=true robot_model:={{ ur_robot_type }} require_pedal:=true biotacs:={{ biotacs | lower }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' user_calibration_file_name:=current_calibration_right.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration' hand_side_ad:=-r jog_arm:=true arm_servo:=false"
- launch_file_input_gui_left: "sr_teleop_vive_polhemus.launch polhemus_product_type:={{ polhemus_type }} side:=left vive:=true robot_model:={{ ur_robot_type }} require_pedal:=true biotacs:={{ biotacs | lower }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' user_calibration_file_name:=current_calibration_left.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration' hand_side_ad:=-l jog_arm:=true arm_servo:=false"
- launch_file_input_gui_bimanual: "sr_teleop_vive_polhemus_bimanual.launch polhemus_product_type:={{ polhemus_type }} vive:=true robot_model:={{ ur_robot_type }} require_pedal:=true biotacs:={{ biotacs | lower }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' right_user_calibration_file_name:=current_calibration_right.yaml left_user_calibration_file_name:=current_calibration_left.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration' jog_arm:=true arm_servo:=false"
- launch_file_input_gui_right_8DOF: "sr_teleop_vive_polhemus.launch polhemus_product_type:={{ polhemus_type }} vive:=true robot_model:={{ ur_robot_type }} require_pedal:=true biotacs:={{ biotacs | lower }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' user_calibration_file_name:=current_calibration_right.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration' jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true hand_side_ad:=-r"
- launch_file_input_gui_left_8DOF: "sr_teleop_vive_polhemus.launch polhemus_product_type:={{ polhemus_type }} side:=left vive:=true robot_model:={{ ur_robot_type }} require_pedal:=true biotacs:={{ biotacs | lower }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' user_calibration_file_name:=current_calibration_left.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration' jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true hand_side_ad:=-l"
- launch_file_input_gui_bimanual_8DOF: "sr_teleop_vive_polhemus_bimanual.launch polhemus_product_type:={{ polhemus_type }} vive:=true robot_model:={{ ur_robot_type }} require_pedal:=true biotacs:={{ biotacs | lower }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' right_user_calibration_file_name:=current_calibration_right.yaml left_user_calibration_file_name:=current_calibration_left.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration' jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true"
+ launch_file_input_gui_right: "sr_teleop_vive_polhemus.launch polhemus_product_type:={{ polhemus_type }} vive:=true robot_model:={{ ur_robot_type }} require_pedal:=true user_calibration_file_name:=default_calibration_right.yaml jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true hand_side_ad:=-r"
+ launch_file_input_gui_left: "sr_teleop_vive_polhemus.launch polhemus_product_type:={{ polhemus_type }} side:=left vive:=true robot_model:={{ ur_robot_type }} require_pedal:=true user_calibration_file_name:=default_calibration_left.yaml jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true hand_side_ad:=-l"
+ launch_file_input_gui_bimanual: "sr_teleop_vive_polhemus_bimanual.launch polhemus_product_type:={{ polhemus_type }} vive:=true robot_model:={{ ur_robot_type }} require_pedal:=true right_user_calibration_file_name:=default_calibration_right.yaml left_user_calibration_file_name:=default_calibration_left.yaml jog_arm:=false arm_servo:=true ee_link:=palm tracker_on_palm:=true"
project_name_input_value: "sr_teleop_vive_polhemus"
when: glove=="shadow_glove"
- name: Set GUI icon variables for custom scene
set_fact:
- launch_file_input_gui_right: "{{ launch_file_input_gui_right }} scene_file:='{{ scene_file }}'"
- launch_file_input_gui_left: "{{ launch_file_input_gui_left }} scene_file:='{{ scene_file }}'"
- launch_file_input_gui_bimanual: "{{ launch_file_input_gui_bimanual }} scene_file:='{{ scene_file }}'"
- launch_file_input_gui_right_8DOF: "{{ launch_file_input_gui_right_8DOF }} scene_file:='{{ scene_file }}'"
- launch_file_input_gui_left_8DOF: "{{ launch_file_input_gui_left_8DOF }} scene_file:='{{ scene_file }}'"
- launch_file_input_gui_bimanual_8DOF: "{{ launch_file_input_gui_bimanual_8DOF }} scene_file:='{{ scene_file }}'"
+ launch_file_input_gui_right: "{{ launch_file_input_gui_right }} scene_file:='$(find sr_description_common)/scenes/{{ scene_file_right }}.scene' world:='$(find sr_description_common)/worlds/{{ scene_file_right }}.world'"
+ launch_file_input_gui_left: "{{ launch_file_input_gui_left }} scene_file:='$(find sr_description_common)/scenes/{{ scene_file_left }}.scene' world:='$(find sr_description_common)/worlds/{{ scene_file_left }}.world'"
+ launch_file_input_gui_bimanual: "{{ launch_file_input_gui_bimanual }} scene_file:='$(find sr_description_common)/scenes/{{ scene_file_bimanual }}.scene' world:='$(find sr_description_common)/worlds/{{ scene_file_bimanual }}.world'"
when: scene_file|length > 0
- name: Set GUI icon variables for sim
@@ -245,27 +232,18 @@
launch_file_input_gui_right_sim: "{{ launch_file_input_gui_right }} external_control_loop:=false sim:=true"
launch_file_input_gui_left_sim: "{{ launch_file_input_gui_left }} external_control_loop:=false sim:=true"
launch_file_input_gui_bimanual_sim: "{{ launch_file_input_gui_bimanual }} external_control_loop:=false sim:=true"
- launch_file_input_gui_right_sim_8DOF: "{{ launch_file_input_gui_right_8DOF }} external_control_loop:=false sim:=true"
- launch_file_input_gui_left_sim_8DOF: "{{ launch_file_input_gui_left_8DOF }} external_control_loop:=false sim:=true"
- launch_file_input_gui_bimanual_sim_8DOF: "{{ launch_file_input_gui_bimanual_8DOF }} external_control_loop:=false sim:=true"
- name: Set GUI icon variables for sim and custom scene
set_fact:
launch_file_input_gui_right_sim: "{{ launch_file_input_gui_right_sim }} world:='{{ scene_file | replace('.scene','.world') | replace('/scenes/','/worlds/') }}'"
launch_file_input_gui_left_sim: "{{ launch_file_input_gui_left_sim }} world:='{{ scene_file | replace('.scene','.world') | replace('/scenes/','/worlds/') }}'"
launch_file_input_gui_bimanual_sim: "{{ launch_file_input_gui_bimanual_sim }} world:='{{ scene_file | replace('.scene','.world') | replace('/scenes/','/worlds/') }}'"
- launch_file_input_gui_right_sim_8DOF: "{{ launch_file_input_gui_right_sim_8DOF }} world:='{{ scene_file | replace('.scene','.world') | replace('/scenes/','/worlds/') }}'"
- launch_file_input_gui_left_sim_8DOF: "{{ launch_file_input_gui_left_sim_8DOF }} world:='{{ scene_file | replace('.scene','.world') | replace('/scenes/','/worlds/') }}'"
- launch_file_input_gui_bimanual_sim_8DOF: "{{ launch_file_input_gui_bimanual_sim_8DOF }} world:='{{ scene_file | replace('.scene','.world') | replace('/scenes/','/worlds/') }}'"
- name: Set GUI icon variables for real hardware
set_fact:
launch_file_input_gui_right_realhw: "{{ launch_file_input_gui_right }} external_control_loop:=true"
launch_file_input_gui_left_realhw: "{{ launch_file_input_gui_left }} external_control_loop:=true"
launch_file_input_gui_bimanual_realhw: "{{ launch_file_input_gui_bimanual }} external_control_loop:=true"
- launch_file_input_gui_right_realhw_8DOF: "{{ launch_file_input_gui_right_8DOF }} external_control_loop:=true"
- launch_file_input_gui_left_realhw_8DOF: "{{ launch_file_input_gui_left_8DOF }} external_control_loop:=true"
- launch_file_input_gui_bimanual_realhw_8DOF: "{{ launch_file_input_gui_bimanual_8DOF }} external_control_loop:=true"
- name: Install desktop icon for right side teleop GUI
include_role:
@@ -393,83 +371,6 @@
- remote_icons|bool
- glove=="haptx"
-- name: Install desktop icon for right side teleop GUI 8DOF
- include_role:
- name: products/common/roslaunch-icon
- vars:
- desktop_icon_png: "{{ teleop_glove_right }}"
- launch_script: "shadow_GUI_right_8DOF.sh"
- project_name_input: "{{ project_name_input_value }}"
- launch_file_input: "{{ launch_file_input_gui_right_realhw_8DOF }}"
- desktop_icon_name: "4 - Launch Right Teleop GUI 8DOF"
- desktop_icon_path: "{{ right_advanced_launcher }}/4 - Launch Right Teleop GUI 8DOF"
- when: (bimanual|bool or hand_side=="right") and (arm_servo|bool)
-
-- name: Install desktop icon for left side teleop GUI 8DOF
- include_role:
- name: products/common/roslaunch-icon
- vars:
- desktop_icon_png: "{{ teleop_glove_left }}"
- launch_script: "shadow_GUI_left_8DOF.sh"
- project_name_input: "{{ project_name_input_value }}"
- launch_file_input: "{{ launch_file_input_gui_left_realhw_8DOF }}"
- desktop_icon_name: "4 - Launch Left Teleop GUI 8DOF"
- desktop_icon_path: "{{ left_advanced_launcher }}/4 - Launch Left Teleop GUI 8DOF"
- when: (bimanual|bool or hand_side=="left") and (arm_servo|bool)
-
-- name: Install desktop icon for bimanual teleop GUI 8DOF
- include_role:
- name: products/common/roslaunch-icon
- vars:
- desktop_icon_png: "{{ teleop_glove_bimanual }}"
- launch_script: "shadow_GUI_bimanual_8DOF.sh"
- project_name_input: "{{ project_name_input_value }}"
- launch_file_input: "{{ launch_file_input_gui_bimanual_realhw_8DOF }}"
- desktop_icon_name: "4 - Launch Bimanual Teleop GUI 8DOF"
- desktop_icon_path: "{{ bimanual_advanced_launcher }}/4 - Launch Bimanual Teleop GUI 8DOF"
- when: bimanual|bool and arm_servo|bool
-
-- name: Install desktop icon for running right Shadow Glove driver
- include_role:
- name: products/common/roslaunch-icon
- vars:
- desktop_icon_png: "shadow_glove_right.png"
- launch_script: "shadow_glove_driver_right.sh"
- desktop_icon_name: "5 - Launch Right Shadow Glove Driver"
- desktop_icon_path: "{{ right_advanced_launcher }}/5 - Launch Right Shadow Glove Driver"
- project_name_input: "sr_teleop_vive_polhemus"
- launch_file_input: "polhemus.launch polhemus_product_type:={{ polhemus_type }} user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' user_calibration_file_name:=current_calibration_right.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration'"
- when:
- - bimanual|bool or hand_side=="right"
- - glove=="shadow_glove"
-
-- name: Install desktop icon for running left Shadow Glove driver
- include_role:
- name: products/common/roslaunch-icon
- vars:
- desktop_icon_png: "shadow_glove_left.png"
- launch_script: "shadow_glove_driver_left.sh"
- desktop_icon_name: "5 - Launch Left Shadow Glove Driver"
- desktop_icon_path: "{{ left_advanced_launcher }}/5 - Launch Left Shadow Glove Driver"
- project_name_input: "sr_teleop_vive_polhemus"
- launch_file_input: "polhemus.launch polhemus_product_type:={{ polhemus_type }} side:=left user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' user_calibration_file_name:=current_calibration_left.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration'"
- when:
- - bimanual|bool or hand_side=="left"
- - glove=="shadow_glove"
-
-- name: Install desktop icon for running bimanual Shadow Glove driver
- include_role:
- name: products/common/roslaunch-icon
- vars:
- desktop_icon_png: "shadow_glove_bimanual.png"
- launch_script: "shadow_glove_driver_bimanual.sh"
- desktop_icon_name: "5 - Launch Bimanual Shadow Glove Driver"
- desktop_icon_path: "{{ bimanual_advanced_launcher }}/5 - Launch Bimanual Shadow Glove Driver"
- project_name_input: "sr_teleop_vive_polhemus"
- launch_file_input: "polhemus.launch polhemus_product_type:={{ polhemus_type }} side:=both user_calibration_folder_path:='/home/user/shadow_glove_calibration/user_calibration' right_user_calibration_file_name:=current_calibration_right.yaml left_user_calibration_file_name:=current_calibration_left.yaml boresight_calibration_file_path:='/home/user/shadow_glove_calibration/glove_boresight_calibration'"
- when:
- - bimanual|bool and glove=="shadow_glove"
-
- name: Set launch file input for HaptX mapping (overriding right mapping only)
set_fact:
launch_file_input_haptx_mapping_right: "haptx_base.launch biotac_mapping_script_type:={{ rh_biotac_mapping }}"
@@ -529,48 +430,6 @@
launch_file_input: "{{ launch_file_input_haptx_mapping_bimanual }}"
when: bimanual|bool and glove=="haptx"
-- name: Install desktop icon for running Shadow Glove mapping node right
- include_role:
- name: products/common/roslaunch-icon
- vars:
- desktop_icon_png: "shadow_glove_right.png"
- launch_script: "shadow_glove_mapping_launch_right.sh"
- desktop_icon_name: "6 - Launch Right Shadow Glove Mapping"
- desktop_icon_path: "{{ right_advanced_launcher }}/6 - Launch Right Shadow Glove Mapping"
- project_name_input: "sr_fingertip_hand_teleop"
- launch_file_input: "sr_fingertip_hand_teleop.launch"
- when:
- - bimanual|bool or hand_side=="right"
- - glove=="shadow_glove"
-
-- name: Install desktop icon for running Shadow Glove mapping node left
- include_role:
- name: products/common/roslaunch-icon
- vars:
- desktop_icon_png: "shadow_glove_left.png"
- launch_script: "shadow_glove_mapping_launch_left.sh"
- desktop_icon_name: "6 - Launch Left Shadow Glove Mapping"
- desktop_icon_path: "{{ left_advanced_launcher }}/6 - Launch Left Shadow Glove Mapping"
- project_name_input: "sr_fingertip_hand_teleop"
- launch_file_input: "sr_fingertip_hand_teleop.launch hand_side_prefix:=lh"
- when:
- - bimanual|bool or hand_side=="left"
- - glove=="shadow_glove"
-
-- name: Install desktop icon for running Shadow Glove mapping node bimanual
- include_role:
- name: products/common/roslaunch-icon
- vars:
- desktop_icon_png: "shadow_glove_bimanual.png"
- launch_script: "shadow_glove_mapping_launch_bimanual.sh"
- desktop_icon_name: "6 - Launch Bimanual Shadow Glove Mapping"
- desktop_icon_path: "{{ bimanual_advanced_launcher }}/6 - Launch Bimanual Shadow Glove Mapping"
- project_name_input: "sr_fingertip_hand_teleop"
- launch_file_input: "sr_fingertip_hand_teleop_bimanual.launch"
- when:
- - bimanual|bool
- - glove=="shadow_glove"
-
- name: Install desktop icon for Teleop server Simulation (Unimanual Right)
include_role:
name: products/common/roslaunch-icon
@@ -636,29 +495,30 @@
name: products/common/local-hand-launch
vars:
override_launch_hand_var: True
+ simulate_icons: False
- name: Install desktop icon for Zero Force Mode - Right Hand for NUC
include_tasks: hand-icon.yml
vars:
+ teleop_control_launch: "sr_robot_launch sr_hardware_control_loop.launch"
+ launch_file_params: "robot_model:={{ ur_robot_type }} pwm_control:=false"
desktop_icon_png: "hand-e.png"
launch_script: "shadow_zero_force_mode_right.sh"
desktop_icon_name: "3 - Zero Force Mode - Right Hand"
desktop_icon_path: "{{ right_advanced_launcher }}/3 - Zero Force Mode - Right Hand"
- pwm_control_value: "false"
- hand_ctrl_value: "false"
- hand_side_ad: "-r"
+ roslaunch_command: "sr_hand_autodetect -r roslaunch"
when: bimanual|bool or hand_side=="right"
- name: Install desktop icon for Zero Force Mode - Left Hand for NUC
include_tasks: hand-icon.yml
vars:
+ teleop_control_launch: "sr_robot_launch sr_hardware_control_loop.launch"
+ launch_file_params: "robot_model:={{ ur_robot_type }} pwm_control:=false"
desktop_icon_png: "hand-e-left.png"
launch_script: "shadow_zero_force_mode_left.sh"
desktop_icon_name: "3 - Zero Force Mode - Left Hand"
desktop_icon_path: "{{ left_advanced_launcher }}/3 - Zero Force Mode - Left Hand"
- pwm_control_value: "false"
- hand_ctrl_value: "false"
- hand_side_ad: "-l"
+ roslaunch_command: "sr_hand_autodetect -l roslaunch"
when: bimanual|bool or hand_side=="left"
- name: Include products/common/local-zero-force-mode-launch role
@@ -671,7 +531,7 @@
dest: "{{ shadow_hand_launcher_folder }}/shadow_glove_calibration_rqt.sh"
mode: '755'
vars:
- command: "rqt -s sr_gui_shadow_glove_calibration.shadow_glove_calibration.SrGuiShadowGloveCalibration"
+ command: "rqt -s sr_glove_calibration_gui.sr_glove_calibration_gui.SrGloveCalibrationGui"
when: glove=="shadow_glove"
- name: Set Shadow Glove driver name (if right)
@@ -695,9 +555,9 @@
vars:
desktop_icon_png: "shadow_glove_{{ glove_driver_type }}.png"
launch_script: "shadow_glove_calibration.sh"
- desktop_icon_name: "Launch Shadow {{ glove_driver_type }} Glove Calibration"
+ desktop_icon_name: "Launch Shadow {{ glove_driver_type | title }} Glove Calibration"
template: templates/scripts/launch-shadow-glove-calibration.j2
- desktop_icon_path: "Shadow Advanced Launchers/Launch Shadow {{ glove_driver_type }} Glove Calibration"
+ desktop_icon_path: "Shadow Advanced Launchers/Launch Shadow {{ glove_driver_type | title }} Glove Calibration"
launch_terminal: "false"
glove_driver_value: "{{ glove_driver_type }}"
when: glove=="shadow_glove"
diff --git a/ansible/roles/products/teleop/server/desktop-icons/tasks/shared-roles.yml b/ansible/roles/products/teleop/server/desktop-icons/tasks/shared-roles.yml
index 238872aaf..9ab635831 100644
--- a/ansible/roles/products/teleop/server/desktop-icons/tasks/shared-roles.yml
+++ b/ansible/roles/products/teleop/server/desktop-icons/tasks/shared-roles.yml
@@ -1,36 +1,18 @@
----
-- name: Install the Teleop Documentation desktop icon for HaptX
- include_role:
- name: products/common/web-gui-icon
- vars:
- desktop_icon_png: "documentation_icon.png"
- launch_script: "shadow_launcher_doc_exec.sh"
- local_website_port_var: '7070'
- desktop_icon_name: "Teleop Documentation"
- desktop_icon_path: "Teleop Documentation"
- launch_terminal: "false"
- start_container_var: "true"
- start_server_command_var: "roscd sr_teleop_haptx_documentation/html; python3 -m http.server {{ local_website_port_var }}"
- preconditions_var: ""
- live_website_url_var: "{{ haptx_teleop_readthedocs_link }}"
- when: glove=="haptx"
-
-- name: Install the Teleop Documentation desktop icon for Shadow Glove Teleop
- include_role:
- name: products/common/web-gui-icon
- vars:
- desktop_icon_png: "documentation_icon.png"
- launch_script: "shadow_launcher_doc_exec.sh"
- local_website_port_var: '7070'
- desktop_icon_name: "Teleop Documentation"
- desktop_icon_path: "Teleop Documentation"
- launch_terminal: "false"
- start_container_var: "true"
- start_server_command_var: "roscd sr_teleop_polhemus_documentation/html; python3 -m http.server {{ local_website_port_var }}"
- preconditions_var: ""
- live_website_url_var: "{{ shadow_glove_teleop_readthedocs_link }}"
- when: glove=="shadow_glove"
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+---
- name: Install the Shadow System Monitor desktop icon for Teleop
include_role:
name: products/common/web-gui-icon
diff --git a/ansible/roles/products/teleop/server/desktop-icons/tasks/steam-binding-icon.yml b/ansible/roles/products/teleop/server/desktop-icons/tasks/steam-binding-icon.yml
index 7a29afc25..5348759fe 100644
--- a/ansible/roles/products/teleop/server/desktop-icons/tasks/steam-binding-icon.yml
+++ b/ansible/roles/products/teleop/server/desktop-icons/tasks/steam-binding-icon.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
- name: Copy desktop icon
copy:
src: ../../../common/resources/files/{{ steam_binding }}
@@ -15,4 +29,4 @@
folder: "{{ shadow_hand_launcher_folder }}"
exec_command: xdg-open {{ steam_vive_binding_url }}
icon_file_name: "{{ steam_binding }}"
- start_terminal: "false"
\ No newline at end of file
+ start_terminal: "false"
diff --git a/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/launch-teleop.j2 b/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/launch-teleop.j2
index 1c20f2243..be71a6594 100644
--- a/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/launch-teleop.j2
+++ b/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/launch-teleop.j2
@@ -3,6 +3,15 @@
CONST_TIMEOUT=20
+if {{ enable_warning | lower }}; then
+ zenity --warning --title="{{ warning_title }}" --text="{{ warning_text }}" --ok-label="I accept the risks" --extra-button="I decline the risks" --no-wrap --width=400 --height=120
+ response=$?
+ if [ $response -ne 0 ]; then
+ echo "User has declined the risks. Aborting script."
+ exit 1
+ fi
+fi
+
terminator --geometry "{{ term_1 }}" -T 'Launching server container...' -e "{{ shadow_hand_launcher_folder}}/shadow_server_container.sh"
elapsed_time=0
@@ -42,7 +51,11 @@ if [ "$proceed" == false ]; then
fi
terminator --geometry "{{ term_3 }}" -T 'NUC {{ arm_side }} hardware control loop' -e "{{ shadow_hand_launcher_folder}}/{{ control_loop_script }}"
-sleep 30 # temporary workaround until arm controllers starting on time is fixed
+if [[ "{{ arm_side }}" == "Bimanual" ]]; then # temporary workaround until arm controllers starting on time is fixed
+ sleep 60
+else
+ sleep 40
+fi
terminator --geometry "{{ term_4 }}" -T 'Server {{ arm_side }} GUI' -e "{{ shadow_hand_launcher_folder}}/{{ gui_script }}"
if [[ "{{ glove }}" == "haptx" ]]; then
terminator --geometry "{{ term_5 }}" -T 'Server HaptX {{ arm_side }} Mapping' -e "{{ shadow_hand_launcher_folder}}/{{ haptx_mapping_script }}"
diff --git a/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc-bimanual.j2 b/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc-bimanual.j2
index 19ca469cf..04e16cdaa 100644
--- a/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc-bimanual.j2
+++ b/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc-bimanual.j2
@@ -13,7 +13,7 @@ if [ $chrony_status -eq 0 ]; then
sleep 3
fi
-ssh -X $NUC_NAME@$NUC_ADDRESS CONTAINER={{ container_name }} HOST_IP=$LOCAL_IP NUC_ADDRESS=$NUC_ADDRESS UR_TYPE={{ ur_robot_type }} BIOTACS={{ biotacs | lower }} 'bash -s' <<'ENDSSH'
+ssh -X $NUC_NAME@$NUC_ADDRESS CONTAINER={{ container_name }} HOST_IP=$LOCAL_IP NUC_ADDRESS=$NUC_ADDRESS 'bash -s' <<'ENDSSH'
bash $(while [[ $(ss | grep $HOST_IP | grep $NUC_ADDRESS | grep ssh | grep ESTAB | wc -l) -gt 0 ]]; do sleep 1; done ; pkill -INT -f roslaunch) &
docker stop ${CONTAINER}
sleep 2
@@ -22,6 +22,6 @@ echo "Starting the container..."
sleep 2
docker exec --user user ${CONTAINER} bash -c "source /home/user/projects/shadow_robot/base/devel/setup.bash;rosrun sr_firmware_checker ur_firmware_check"
sleep 1
-docker exec --user user ${CONTAINER} bash -c "export ROSCONSOLE_FORMAT='"'[${severity}](${node}): [${time}] ${message}'"';export ROSCONSOLE_STDOUT_LINE_BUFFERED=1;source /home/user/projects/shadow_robot/base/devel/setup.bash;ulimit -c unlimited;/bin/update_hand_config.sh;roslaunch {{ teleop_control_launch }} robot_model:=${UR_TYPE} biotacs:=${BIOTACS} 2> >(tee -a /home/user/.ros/log/stderr.log)"
+docker exec --user user ${CONTAINER} bash -c "export ROSCONSOLE_FORMAT='"'[${severity}](${node}): [${time}] ${message}'"';export ROSCONSOLE_STDOUT_LINE_BUFFERED=1;source /home/user/projects/shadow_robot/base/devel/setup.bash;ulimit -c unlimited;/bin/update_hand_config.sh;roslaunch {{ teleop_control_launch }} {{ launch_file_params }} 2> >(tee -a /home/user/.ros/log/stderr.log)"
ENDSSH
sleep infinity
diff --git a/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc-command.j2 b/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc-command.j2
index e7e216e9b..e72268dce 100644
--- a/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc-command.j2
+++ b/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc-command.j2
@@ -3,4 +3,4 @@
NUC_NAME={{ nuc_username }}
NUC_ADDRESS={{ nuc_address }}
CONTAINER={{ container_name }}
-ssh -X $NUC_NAME@$NUC_ADDRESS "docker exec -i --user user $CONTAINER bash -c 'cat > ~/.Xauthority' < ~/.Xauthority; docker exec --user user $CONTAINER bash -c $'source /home/user/projects/shadow_robot/base/devel/setup.bash;xauth list | tail -1 | awk \'{print \$1}\' | cut -d ':' -f2 > ~/.display_number;export DISPLAY=localhost:\$(<~/.display_number).0;/bin/update_hand_config.sh;{{ command_to_run }} 2> >(tee -a /home/user/.ros/log/stderr.log)'"
+ssh -X $NUC_NAME@$NUC_ADDRESS "docker exec -i --user user $CONTAINER bash -c 'cat > ~/.Xauthority' < ~/.Xauthority; docker exec --user user $CONTAINER bash -c $'export ROSCONSOLE_FORMAT=\'"'[${severity}](${node}): [${time}] ${message}'"\';export ROSCONSOLE_STDOUT_LINE_BUFFERED=1;source /home/user/projects/shadow_robot/base/devel/setup.bash;xauth list | tail -1 | awk \'{print \$1}\' | cut -d ':' -f2 > ~/.display_number;export DISPLAY=localhost:\$(<~/.display_number).0;/bin/update_hand_config.sh;{{ command_to_run }} 2> >(tee -a /home/user/.ros/log/stderr.log)'"
diff --git a/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc-interactive-terminal.j2 b/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc-interactive-terminal.j2
index 0993f9b38..f2ec8ede1 100644
--- a/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc-interactive-terminal.j2
+++ b/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc-interactive-terminal.j2
@@ -3,4 +3,4 @@
NUC_NAME={{ nuc_username }}
NUC_ADDRESS={{ nuc_address }}
CONTAINER={{ container_name }}
-ssh -Xt $NUC_NAME@$NUC_ADDRESS "docker start ${CONTAINER};docker exec -i --user user $CONTAINER bash -c 'cat > ~/.Xauthority' < ~/.Xauthority;docker exec -it --user user $CONTAINER /bin/bash -c $'source /home/user/projects/shadow_robot/base/devel/setup.bash;xauth list | tail -1 | awk \'{print \$1}\' | cut -d ':' -f2 > ~/.display_number;export DISPLAY=localhost:\$(<~/.display_number).0;bash'"
+ssh -Xt $NUC_NAME@$NUC_ADDRESS "docker start ${CONTAINER};docker exec -i --user user $CONTAINER bash -c 'cat > ~/.Xauthority' < ~/.Xauthority;docker exec -it --user user $CONTAINER /bin/bash -c $'export ROSCONSOLE_FORMAT=\'[${severity}](${node}): [${time}] ${message}\';export ROSCONSOLE_STDOUT_LINE_BUFFERED=1;source /home/user/projects/shadow_robot/base/devel/setup.bash;xauth list | tail -1 | awk \'{print \$1}\' | cut -d ':' -f2 > ~/.display_number;export DISPLAY=localhost:\$(<~/.display_number).0;bash'"
diff --git a/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc.j2 b/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc.j2
index 831238a3d..ea79448b0 100644
--- a/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc.j2
+++ b/ansible/roles/products/teleop/server/desktop-icons/templates/scripts/start-docker-container-nuc.j2
@@ -4,6 +4,23 @@ NUC_NAME={{ nuc_username }}
NUC_ADDRESS={{ nuc_address }}
LOCAL_IP={{ server_ip }}
+default_value=1
+if [ $# -eq 1 ]; then
+ enable_warning=$1
+else
+ enable_warning=$default_value
+fi
+
+if [ $enable_warning -eq 0 ]; then
+ zenity --warning --title="{{ warning_title }}" --text="{{ warning_text }}" --ok-label="I accept the risks" --extra-button="I decline the risks" --no-wrap --width=400 --height=120
+ response=$?
+ if [ $response -ne 0 ]; then
+ echo "User has declined the risks. Aborting script."
+ {{ shadow_hand_launcher_folder}}/close_everything.sh
+ exit 1
+ fi
+fi
+
chrony_status=$(ssh {{ nuc_username }}@{{ nuc_address }} chronyc -n tracking | grep {{ server_ip }} | wc -l)
if [ $chrony_status -eq 0 ]; then
echo "NUC lost chrony tracking. Restarting chrony on server and NUC..."
@@ -13,7 +30,7 @@ if [ $chrony_status -eq 0 ]; then
sleep 3
fi
-ssh -X $NUC_NAME@$NUC_ADDRESS CONTAINER={{ container_name }} HOST_IP=$LOCAL_IP NUC_ADDRESS=$NUC_ADDRESS UR_TYPE={{ ur_robot_type }} BIOTACS={{ biotacs | lower }} INITIAL_Z={{ initial_z_var }} ARM_X_SEPARATION={{ arm_x_separation_var }} ARM_Y_SEPARATION={{ arm_y_separation_var }} HAND_SIDE_AD={{ ad_hand_side }} 'bash -s' <<'ENDSSH'
+ssh -X $NUC_NAME@$NUC_ADDRESS CONTAINER={{ container_name }} HOST_IP=$LOCAL_IP NUC_ADDRESS=$NUC_ADDRESS 'bash -s' <<'ENDSSH'
bash $(while [[ $(ss | grep $HOST_IP | grep $NUC_ADDRESS | grep ssh | grep ESTAB | wc -l) -gt 0 ]]; do sleep 1; done ; pkill -INT -f roslaunch) &
docker stop ${CONTAINER}
sleep 2
@@ -22,6 +39,6 @@ echo "Starting the container..."
sleep 2
docker exec --user user ${CONTAINER} bash -c "source /home/user/projects/shadow_robot/base/devel/setup.bash;rosrun sr_firmware_checker ur_firmware_check"
sleep 1
-docker exec --user user ${CONTAINER} bash -c "export ROSCONSOLE_FORMAT='"'[${severity}](${node}): [${time}] ${message}'"';export ROSCONSOLE_STDOUT_LINE_BUFFERED=1;source /home/user/projects/shadow_robot/base/devel/setup.bash;ulimit -c unlimited;/bin/update_hand_config.sh;roslaunch {{ teleop_control_launch }} robot_model:=${UR_TYPE} biotacs:=${BIOTACS} initial_z:=${INITIAL_Z} arm_x_separation:=${ARM_X_SEPARATION} arm_y_separation:=${ARM_Y_SEPARATION} hand_side_ad:=${HAND_SIDE_AD} 2> >(tee -a /home/user/.ros/log/stderr.log)"
+docker exec --user user ${CONTAINER} bash -c "export ROSCONSOLE_FORMAT='"'[${severity}](${node}): [${time}] ${message}'"';export ROSCONSOLE_STDOUT_LINE_BUFFERED=1;source /home/user/projects/shadow_robot/base/devel/setup.bash;ulimit -c unlimited;/bin/update_hand_config.sh; {{ roslaunch_command }} {{ teleop_control_launch }} {{ launch_file_params }} 2> >(tee -a /home/user/.ros/log/stderr.log)"
ENDSSH
sleep infinity
diff --git a/bin/run-ansible.sh b/bin/run-ansible.sh
index e10a6683b..ab105eb22 100755
--- a/bin/run-ansible.sh
+++ b/bin/run-ansible.sh
@@ -1,6 +1,22 @@
#!/usr/bin/env bash
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
set -e # fail on errors
+RED='\033[0;31m'
+NC='\033[0m' # No Color
#set -x # echo commands run
script_name="bash <(curl -Ls bit.ly/run-aurora)"
@@ -14,7 +30,22 @@ if [[ $# -lt 2 ]]; then
exit 1
fi
+# Some molecule tests install to `/home/...` (no user account)
+if [ -z $USER ]; then
+ if [ -z $MY_USERNAME ]; then
+ HOME='/home'
+ fi
+fi
+
aurora_home=/tmp/aurora
+conda_ws_name="aurora_conda_ws"
+miniconda_install_root="${HOME}/.shadow_miniconda"
+miniconda_install_location="${miniconda_install_root}/miniconda"
+miniconda_installer="${miniconda_install_root}/miniconda_installer.sh"
+miniconda_installer_url="https://repo.anaconda.com/miniconda/Miniconda3-py311_23.5.2-0-Linux-x86_64.sh"
+miniconda_checksum="634d76df5e489c44ade4085552b97bebc786d49245ed1a830022b0b406de5817"
+packages_download_root="${miniconda_install_root}/aurora_host_packages"
+
playbook=$1
aurora_limit=all
test_machine=false
@@ -100,7 +131,7 @@ echo "Testing setup= ${test_machine}"
export ANSIBLE_ROLES_PATH="${aurora_home}/ansible/roles"
-export ANSIBLE_CALLBACK_PLUGINS="/home/$USER/.ansible/plugins/callback:/usr/share/ansible/plugins/callback:${aurora_home}/ansible/playbooks/callback_plugins"
+export ANSIBLE_CALLBACK_PLUGINS="${HOME}/.ansible/plugins/callback:/usr/share/ansible/plugins/callback:${aurora_home}/ansible/playbooks/callback_plugins"
export ANSIBLE_STDOUT_CALLBACK="custom_retry_runner"
# check for := (ROS style) variable assignments (just = should be used)
@@ -138,8 +169,8 @@ for extra_var in $extra_vars; do
done
IFS=${old_IFS}
-github_ssh_public_key_path="/home/$USER/.ssh/id_rsa.pub"
-github_ssh_private_key_path="/home/$USER/.ssh/id_rsa"
+github_ssh_public_key_path="${HOME}/.ssh/id_rsa.pub"
+github_ssh_private_key_path="${HOME}/.ssh/id_rsa"
if [[ $extra_vars == *"pr_branches="* ]]; then
echo " -------------------------------------------------------------------------------------"
echo "Testing SSH connection to Github with ssh -oStrictHostKeyChecking=no -T git@github.com"
@@ -170,8 +201,8 @@ for i in "${inputdata[@]}"; do
read -r input_data
if [[ "${i}" = "github_email" ]]; then
if [[ ! -f "$github_ssh_public_key_path" ]]; then
- ssh-keygen -t rsa -b 4096 -q -C "$github_email" -N "" -f /home/$USER/.ssh/id_rsa
- fi
+ ssh-keygen -t rsa -b 4096 -q -C "$github_email" -N "" -f ${HOME}/.ssh/id_rsa
+ fi
eval "$(ssh-agent -s)"
ssh-add $github_ssh_private_key_path
xclip -sel clip < $github_ssh_public_key_path
@@ -225,7 +256,7 @@ echo ""
if [[ "${test_machine}" = "true" ]]; then
echo $test_password | sudo -S echo "Running on testing machine. Retrieving passwords from ENV..."
- formatted_extra_vars="$formatted_extra_vars sudo_password=$test_password docker_username=$docker_username docker_password=$docker_password"
+ formatted_extra_vars="$formatted_extra_vars sudo_password=$test_password docker_username=$docker_username docker_password=$docker_password ansible_sudo_pass=$test_password"
fi
# Wait for apt-get update lock file to be released
@@ -233,17 +264,16 @@ while (sudo fuser /var/lib/apt/lists/lock >/dev/null 2>&1) || (sudo fuser /var/l
echo "Waiting for apt-get update file lock..."
sleep 1
done
-sudo apt-get update
+# sudo apt-get update
# Wait for apt-get install lock file to be released
while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1; do
echo "Waiting for apt-get install file lock..."
sleep 1
done
-# Pip is broken at the moment and can't find base packages so a reinstall is required.
-curl https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py && python3 /tmp/get-pip.py --force-reinstall && rm /tmp/get-pip.py
-sudo apt-get install -y python3-pip git libyaml-dev libssl-dev libffi-dev sshpass lsb-release
-pip3 install --user -U pip
+
+# jq is needed for yq, which installs xq, which helps parse aws s3 http requests
+# sudo apt-get install -y git jq curl lsb-release libyaml-dev libssl-dev libffi-dev sshpass
sudo chown $USER:$USER $aurora_home || true
sudo rm -rf ${aurora_home}
@@ -257,18 +287,6 @@ echo ""
pushd $aurora_home
-ansible_version_pip3=$(pip3 freeze | grep ansible== | tr -d "ansible==")
-if [[ "${ansible_version_pip3}" != "" && "${ansible_version_pip3}" != *"4.2.0"* ]]; then
- echo "Uninstalling pre-existing pip3 Ansible version $ansible_version_pip3 which is not supported by aurora, if prompted for sudo password, please enter it"
- pip3 uninstall -y ansible-base ansible-core ansible
- sudo pip3 uninstall -y ansible-base ansible-core ansible
-fi
-ansible_version_pip2=$(pip2 freeze | grep ansible== | tr -d "ansible==")
-if [[ "${ansible_version_pip2}" != "" && "${ansible_version_pip2}" != *"4.2.0"* ]]; then
- echo "Uninstalling pre-existing pip2 Ansible version $ansible_version_pip2 which is not supported by aurora, if prompted for sudo password, please enter it"
- pip2 uninstall -y ansible-base ansible-core ansible
- sudo pip2 uninstall -y ansible-base ansible-core ansible
-fi
re="^Codename:[[:space:]]+(.*)"
while IFS= read -r line; do
@@ -277,10 +295,95 @@ while IFS= read -r line; do
fi
done < <(lsb_release -a 2>/dev/null)
-if [[ $codename == "bionic" ]]; then
- pip3 install --user -r ansible/data/ansible/bionic/requirements.txt
-else
- pip3 install --user -r ansible/data/ansible/requirements.txt
+# We use this variable to figure out which pip packages to download. Packages for focal work on jammy, but bionic needs its own packages
+if [[ $codename == *"jammy"* ]]; then
+ codename="focal"
+fi
+
+mkdir -p $miniconda_install_root
+attempts=1
+while ! $(echo "${miniconda_checksum} ${miniconda_installer}" | sha256sum --status --check); do
+ if [[ -f "$miniconda_installer" ]]; then
+ rm $miniconda_installer
+ fi
+ echo "Attempt number ${attempts}: "
+ wget -O $miniconda_installer $miniconda_installer_url
+ attempts=$(( attempts + 1 ))
+ if [[ $(echo $attempts) -gt 3 ]]; then
+ echo "Maximim attempts to fetch ${miniconda_installer} failed. Has the checksum changed?"
+ echo " Previously known good checksum: ${miniconda_checksum}"
+ echo " Current checksum: $(sha256sum $miniconda_installer)"
+ exit 0
+ fi
+done
+
+bash $miniconda_installer -u -b -p $miniconda_install_location
+
+if [[ $(echo $PATH | grep "${miniconda_install_location}/bin" | wc -l) -eq 0 ]]; then
+ PATH="${PATH}:${miniconda_install_location}/bin"
+fi
+
+shadow_conda_ws_dir="${miniconda_install_location}/envs/${conda_ws_name}"
+if [ -d "$shadow_conda_ws_dir" ]; then
+ rm -rf $shadow_conda_ws_dir
+fi
+
+${miniconda_install_location}/bin/conda create -y -n ${conda_ws_name} python=3.8 && source ${miniconda_install_location}/bin/activate ${conda_ws_name}
+python -m pip install yq xq
+fetch_new_files() {
+ aws_bucket_url=$1
+ aws_bucket_dir=$2
+ local_download_dir="${packages_download_root}/${aws_bucket_dir}"
+
+ echo "Fetching ${aws_bucket_dir}..."
+ mkdir -p $local_download_dir
+
+ remote_packages=$(curl -Ls ${aws_bucket_url} | xq | grep $aws_bucket_dir | grep 'Key' | sed -r "s/.*${aws_bucket_dir}\///g" | sed -r 's/",//g' | sed -r 's;;;g')
+
+ echo "remote_packages: ${remote_packages}"
+
+ local_only=$(comm -23 <(ls $local_download_dir | sort) <(for x in $( echo "${remote_packages}"); do echo $x; done | sort))
+ remote_only=$(comm -13 <(ls $local_download_dir | sort) <(for x in $( echo "${remote_packages}"); do echo $x; done | sort))
+
+ echo "Packages found locally that are not in the bucket: ${local_only}"
+ echo "Packages found in the bucket that we don't have a local copy of: ${remote_only}"
+
+ if [[ $(echo "${local_only}" | wc -c) -gt 1 ]]; then
+ echo "Additional downloaded packages detecting, removing them..."
+ for local_package in $(echo ${local_only}); do
+ echo " removing: ${local_download_dir}/${local_package}"
+ rm ${local_download_dir}/${local_package}
+ done
+ else
+ echo "No additional local packages found, continuing..."
+ fi
+
+ if [[ $(echo "${remote_only}" | wc -c) -gt 1 ]]; then
+ echo "Remote packages found that we don't have locally, downloading them..."
+ for remote_package in $(echo "${remote_only}"); do
+ echo " Downloading: ${remote_package}"
+ wget -q --show-progress -O ${local_download_dir}/${remote_package} ${aws_bucket_url}/${aws_bucket_dir}/${remote_package}
+ if [[ $(stat --print="%s" ${local_download_dir}/${remote_package}) -eq 0 ]]; then
+ echo -e "\n${RED}WARNING! The package ${remote_package} from ${aws_bucket_url}/${aws_bucket_dir}/${remote_package} has downloaded a file of zero bytes! This probably means s3 bucket permissions are wrong and is very likely to cause deployment issues on your system. Please contact shadow directly to get this fixed.${NC}\n"
+ rm ${local_download_dir}/${remote_package}
+ fi
+ done
+ fi
+}
+
+fetch_new_files "http://shadowrobot.aurora-host-packages-${codename}.s3.eu-west-2.amazonaws.com" "pip_packages"
+fetch_new_files "http://shadowrobot.aurora-host-packages-${codename}.s3.eu-west-2.amazonaws.com" "ansible_collections"
+ANSIBLE_SKIP_CONFLICT_CHECK=1 python -m pip install ${packages_download_root}/pip_packages/*
+
+# Fix for WSL - THIS IS NOT SUPPORTED AT ALL!!!
+if grep -q "microsoft" /proc/version && grep -iq "wsl" /proc/version; then
+ # python3 -m pip install pip --upgrade
+ pip install pyopenssl --upgrade
+ if [[ $(which docker | wc -l) -gt 0 ]]; then
+ if service docker status 2>&1 | grep -q "is not running"; then
+ wsl.exe --distribution "${WSL_DISTRO_NAME}" --user root --exec /usr/sbin/service docker start
+ fi
+ fi
fi
@@ -352,7 +455,8 @@ fi
# install ansible galaxy docker and aws collections
"${ansible_basic_executable}" --version
-#"${ansible_galaxy_executable}" collection install community.docker amazon.aws
+
+"${ansible_galaxy_executable}" collection install $(realpath ${packages_download_root}/ansible_collections/*)
#configure DHCP before running the actual playbook
if [[ "${playbook}" = "server_and_nuc_deploy" ]]; then
diff --git a/buildspec_local_inventories.yml b/buildspec_local_inventories.yml
index 0b79489c8..2dcdd2bce 100644
--- a/buildspec_local_inventories.yml
+++ b/buildspec_local_inventories.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
diff --git a/buildspec_server_and_nuc.yml b/buildspec_server_and_nuc.yml
index 97b45f086..67075be66 100644
--- a/buildspec_server_and_nuc.yml
+++ b/buildspec_server_and_nuc.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
diff --git a/buildspec_simulation.yml b/buildspec_simulation.yml
index f8b333a28..4c24070d9 100644
--- a/buildspec_simulation.yml
+++ b/buildspec_simulation.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
diff --git a/buildspec_teleop.yml b/buildspec_teleop.yml
index e002940c0..96baecb10 100644
--- a/buildspec_teleop.yml
+++ b/buildspec_teleop.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
diff --git a/docker/molecule/base/bionic/buildspec.yml b/docker/molecule/base/bionic/buildspec.yml
index 0e1a2b3e1..13799ca48 100644
--- a/docker/molecule/base/bionic/buildspec.yml
+++ b/docker/molecule/base/bionic/buildspec.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
diff --git a/docker/molecule/base/bionic/docker-compose.test.yml b/docker/molecule/base/bionic/docker-compose.test.yml
index fc319fda8..8bfbd4de0 100644
--- a/docker/molecule/base/bionic/docker-compose.test.yml
+++ b/docker/molecule/base/bionic/docker-compose.test.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: '3'
services:
diff --git a/docker/molecule/base/focal/Dockerfile b/docker/molecule/base/focal/Dockerfile
index 40c6bcc0b..5936ce1fb 100644
--- a/docker/molecule/base/focal/Dockerfile
+++ b/docker/molecule/base/focal/Dockerfile
@@ -55,3 +55,4 @@ RUN set -x && \
/root/.cache
VOLUME /var/lib/docker
+
diff --git a/docker/molecule/base/focal/buildspec.yml b/docker/molecule/base/focal/buildspec.yml
index 7cda0d6e0..a0ebcdf5b 100644
--- a/docker/molecule/base/focal/buildspec.yml
+++ b/docker/molecule/base/focal/buildspec.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
shell: bash
diff --git a/docker/molecule/base/focal/docker-compose.test.yml b/docker/molecule/base/focal/docker-compose.test.yml
index fc319fda8..8bfbd4de0 100644
--- a/docker/molecule/base/focal/docker-compose.test.yml
+++ b/docker/molecule/base/focal/docker-compose.test.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: '3'
services:
diff --git a/docker/molecule/devel/bionic/Dockerfile b/docker/molecule/devel/bionic/Dockerfile
index 17a4205cc..1ccb5b877 100644
--- a/docker/molecule/devel/bionic/Dockerfile
+++ b/docker/molecule/devel/bionic/Dockerfile
@@ -38,3 +38,4 @@ RUN set -x && \
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
VOLUME /var/lib/docker
CMD ["/usr/bin/terminator"]
+
diff --git a/docker/molecule/devel/bionic/buildspec.yml b/docker/molecule/devel/bionic/buildspec.yml
index 8ff52eb9e..a74b01dbb 100644
--- a/docker/molecule/devel/bionic/buildspec.yml
+++ b/docker/molecule/devel/bionic/buildspec.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
diff --git a/docker/molecule/devel/bionic/docker-compose.test.yml b/docker/molecule/devel/bionic/docker-compose.test.yml
index eb0b95aab..415286d1e 100644
--- a/docker/molecule/devel/bionic/docker-compose.test.yml
+++ b/docker/molecule/devel/bionic/docker-compose.test.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: '3'
services:
diff --git a/docker/molecule/devel/focal/Dockerfile b/docker/molecule/devel/focal/Dockerfile
index ff3573502..838f2449f 100644
--- a/docker/molecule/devel/focal/Dockerfile
+++ b/docker/molecule/devel/focal/Dockerfile
@@ -34,3 +34,4 @@ RUN set -x && \
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
VOLUME /var/lib/docker
CMD ["/usr/bin/terminator"]
+
diff --git a/docker/molecule/devel/focal/buildspec.yml b/docker/molecule/devel/focal/buildspec.yml
index f995f4781..3460f8dcc 100644
--- a/docker/molecule/devel/focal/buildspec.yml
+++ b/docker/molecule/devel/focal/buildspec.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
diff --git a/docker/molecule/devel/focal/docker-compose.test.yml b/docker/molecule/devel/focal/docker-compose.test.yml
index eb0b95aab..415286d1e 100644
--- a/docker/molecule/devel/focal/docker-compose.test.yml
+++ b/docker/molecule/devel/focal/docker-compose.test.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: '3'
services:
diff --git a/docker/molecule/docker/bionic/Dockerfile b/docker/molecule/docker/bionic/Dockerfile
index ae87e8e3e..d37bf8bff 100644
--- a/docker/molecule/docker/bionic/Dockerfile
+++ b/docker/molecule/docker/bionic/Dockerfile
@@ -17,7 +17,7 @@ RUN set -x && \
echo "Installing Docker" && \
wget -O /tmp/oneliner "$( echo "$ml_docker_aurora_script" | sed 's/#/%23/g' )" && \
chmod 755 /tmp/oneliner && \
- /tmp/oneliner install_software --branch $ml_docker_aurora_branch software=[docker] && \
+ /tmp/oneliner install_software --branch $ml_docker_aurora_branch software=[docker] skip_molecule_task=true && \
\
echo "Clean up" && \
apt-get clean && \
diff --git a/docker/molecule/docker/bionic/buildspec.yml b/docker/molecule/docker/bionic/buildspec.yml
index bd5aed4c0..45e5077c0 100644
--- a/docker/molecule/docker/bionic/buildspec.yml
+++ b/docker/molecule/docker/bionic/buildspec.yml
@@ -1,14 +1,26 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
shell: bash
variables:
- branch: master
image: aurora-molecule-docker
tag: bionic
dockerfile_folder: docker/molecule/docker/bionic/
exported-variables:
- - branch
- image
- tag
- dockerfile_folder
@@ -18,6 +30,15 @@ phases:
docker: 19
build:
commands:
+ - |
+ if [[ $CODEBUILD_SOURCE_VERSION == "pr/"* ]]; then
+ pr_number=${CODEBUILD_SOURCE_VERSION#pr/}
+ branch=$(curl -s "https://api.github.com/repos/shadow-robot/aurora/pulls/$pr_number" | jq -r '.head.ref')
+ elif [[ $CODEBUILD_SOURCE_VERSION =~ ^[0-9a-f]{40}$ ]]; then
+ branch=$(git ls-remote --symref origin | grep -m1 $CODEBUILD_SOURCE_VERSION | awk -F '/' '{print $NF}')
+ else
+ branch=$CODEBUILD_SOURCE_VERSION
+ fi
- cd ..
- rm -rf aurora
- git clone https://github.com/shadow-robot/aurora.git
@@ -30,7 +51,7 @@ phases:
- ./aws/install
- cd $dockerfile_folder
- aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/shadowrobot
- - docker build -t $image .
+ - docker build --build-arg ml_docker_aurora_branch=$branch -t $image .
- docker tag $image:latest public.ecr.aws/shadowrobot/$image:$tag
- docker push public.ecr.aws/shadowrobot/$image:$tag
- comm -13 <(aws ecr-public describe-image-tags --repository-name $image --region us-east-1 --output text | awk '{print $3}' | tr " " "\n" | sort -u) <(aws ecr-public describe-images --repository-name $image --region us-east-1 --output text | awk '{print $2}' | tr " " "\n" | sort -u) >> ids_to_delete.txt
diff --git a/docker/molecule/docker/bionic/docker-compose.test.yml b/docker/molecule/docker/bionic/docker-compose.test.yml
index 88e4fb629..5aa3a844a 100644
--- a/docker/molecule/docker/bionic/docker-compose.test.yml
+++ b/docker/molecule/docker/bionic/docker-compose.test.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: '3'
services:
diff --git a/docker/molecule/docker/focal/Dockerfile b/docker/molecule/docker/focal/Dockerfile
index 3394dff45..9fc777bfc 100644
--- a/docker/molecule/docker/focal/Dockerfile
+++ b/docker/molecule/docker/focal/Dockerfile
@@ -13,7 +13,7 @@ RUN set -x && \
echo "Installing Docker" && \
wget -O /tmp/oneliner "$( echo "$ml_docker_aurora_script" | sed 's/#/%23/g' )" && \
chmod 755 /tmp/oneliner && \
- /tmp/oneliner install_software --branch $ml_docker_aurora_branch software=[docker] && \
+ /tmp/oneliner install_software --branch $ml_docker_aurora_branch software=[docker] skip_molecule_task=true && \
\
echo "Clean up" && \
apt-get clean && \
diff --git a/docker/molecule/docker/focal/buildspec.yml b/docker/molecule/docker/focal/buildspec.yml
index bae411a33..8ec6598a2 100644
--- a/docker/molecule/docker/focal/buildspec.yml
+++ b/docker/molecule/docker/focal/buildspec.yml
@@ -1,14 +1,26 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
shell: bash
variables:
- branch: master
image: aurora-molecule-docker
tag: focal
dockerfile_folder: docker/molecule/docker/focal/
exported-variables:
- - branch
- image
- tag
- dockerfile_folder
@@ -18,6 +30,15 @@ phases:
docker: 19
build:
commands:
+ - |
+ if [[ $CODEBUILD_SOURCE_VERSION == "pr/"* ]]; then
+ pr_number=${CODEBUILD_SOURCE_VERSION#pr/}
+ branch=$(curl -s "https://api.github.com/repos/shadow-robot/aurora/pulls/$pr_number" | jq -r '.head.ref')
+ elif [[ $CODEBUILD_SOURCE_VERSION =~ ^[0-9a-f]{40}$ ]]; then
+ branch=$(git ls-remote --symref origin | grep -m1 $CODEBUILD_SOURCE_VERSION | awk -F '/' '{print $NF}')
+ else
+ branch=$CODEBUILD_SOURCE_VERSION
+ fi
- cd ..
- rm -rf aurora
- git clone https://github.com/shadow-robot/aurora.git
@@ -30,7 +51,7 @@ phases:
- ./aws/install
- cd $dockerfile_folder
- aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/shadowrobot
- - docker build -t $image .
+ - docker build --build-arg ml_docker_aurora_branch=$branch -t $image .
- docker tag $image:latest public.ecr.aws/shadowrobot/$image:$tag
- docker push public.ecr.aws/shadowrobot/$image:$tag
- comm -13 <(aws ecr-public describe-image-tags --repository-name $image --region us-east-1 --output text | awk '{print $3}' | tr " " "\n" | sort -u) <(aws ecr-public describe-images --repository-name $image --region us-east-1 --output text | awk '{print $2}' | tr " " "\n" | sort -u) >> ids_to_delete.txt
diff --git a/docker/molecule/docker/focal/docker-compose.test.yml b/docker/molecule/docker/focal/docker-compose.test.yml
index 88e4fb629..5aa3a844a 100644
--- a/docker/molecule/docker/focal/docker-compose.test.yml
+++ b/docker/molecule/docker/focal/docker-compose.test.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: '3'
services:
diff --git a/docker/molecule/ec2/bionic/Dockerfile b/docker/molecule/ec2/bionic/Dockerfile
index b7af5712a..e3bcd7259 100644
--- a/docker/molecule/ec2/bionic/Dockerfile
+++ b/docker/molecule/ec2/bionic/Dockerfile
@@ -30,3 +30,4 @@ RUN set -x && \
/root/.cache
VOLUME /var/lib/docker
+
diff --git a/docker/molecule/ec2/bionic/buildspec.yml b/docker/molecule/ec2/bionic/buildspec.yml
index cf3e43973..1c27a4430 100644
--- a/docker/molecule/ec2/bionic/buildspec.yml
+++ b/docker/molecule/ec2/bionic/buildspec.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
diff --git a/docker/molecule/ec2/bionic/docker-compose.test.yml b/docker/molecule/ec2/bionic/docker-compose.test.yml
index 2c2d6bb7e..f58338a43 100644
--- a/docker/molecule/ec2/bionic/docker-compose.test.yml
+++ b/docker/molecule/ec2/bionic/docker-compose.test.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: '3'
services:
diff --git a/docker/molecule/ec2/focal/Dockerfile b/docker/molecule/ec2/focal/Dockerfile
index 3957be924..4861f5652 100644
--- a/docker/molecule/ec2/focal/Dockerfile
+++ b/docker/molecule/ec2/focal/Dockerfile
@@ -29,3 +29,4 @@ RUN set -x && \
/root/.cache
VOLUME /var/lib/docker
+
diff --git a/docker/molecule/ec2/focal/buildspec.yml b/docker/molecule/ec2/focal/buildspec.yml
index 8001737c6..9cd029501 100644
--- a/docker/molecule/ec2/focal/buildspec.yml
+++ b/docker/molecule/ec2/focal/buildspec.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
diff --git a/docker/molecule/ec2/focal/docker-compose.test.yml b/docker/molecule/ec2/focal/docker-compose.test.yml
index 2c2d6bb7e..f58338a43 100644
--- a/docker/molecule/ec2/focal/docker-compose.test.yml
+++ b/docker/molecule/ec2/focal/docker-compose.test.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: '3'
services:
diff --git a/docker/test/docker/bionic/Dockerfile b/docker/test/docker/bionic/Dockerfile
index c3e19b2ac..c173d53ff 100644
--- a/docker/test/docker/bionic/Dockerfile
+++ b/docker/test/docker/bionic/Dockerfile
@@ -25,7 +25,7 @@ RUN set -x && \
echo "Installing Docker" && \
wget -O /tmp/oneliner "$( echo "$ts_docker_aurora_script" | sed 's/#/%23/g' )" && \
chmod 755 /tmp/oneliner && \
- /tmp/oneliner install_software --branch $ts_docker_aurora_branch software=[docker] && \
+ /tmp/oneliner install_software --branch $ts_docker_aurora_branch software=[docker] skip_molecule_task=true && \
\
echo "Clean up" && \
sudo apt-get clean && \
diff --git a/docker/test/docker/bionic/buildspec.yml b/docker/test/docker/bionic/buildspec.yml
index 32d18979f..ee40f1802 100644
--- a/docker/test/docker/bionic/buildspec.yml
+++ b/docker/test/docker/bionic/buildspec.yml
@@ -1,14 +1,26 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
shell: bash
variables:
- branch: master
image: aurora-test-ubuntu-docker
tag: bionic
dockerfile_folder: docker/test/docker/bionic/
exported-variables:
- - branch
- image
- tag
- dockerfile_folder
@@ -18,6 +30,15 @@ phases:
docker: 19
build:
commands:
+ - |
+ if [[ $CODEBUILD_SOURCE_VERSION == "pr/"* ]]; then
+ pr_number=${CODEBUILD_SOURCE_VERSION#pr/}
+ branch=$(curl -s "https://api.github.com/repos/shadow-robot/aurora/pulls/$pr_number" | jq -r '.head.ref')
+ elif [[ $CODEBUILD_SOURCE_VERSION =~ ^[0-9a-f]{40}$ ]]; then
+ branch=$(git ls-remote --symref origin | grep -m1 $CODEBUILD_SOURCE_VERSION | awk -F '/' '{print $NF}')
+ else
+ branch=$CODEBUILD_SOURCE_VERSION
+ fi
- cd ..
- rm -rf aurora
- git clone https://github.com/shadow-robot/aurora.git
@@ -30,7 +51,7 @@ phases:
- ./aws/install
- cd $dockerfile_folder
- aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/shadowrobot
- - docker build -t $image .
+ - docker build --build-arg ts_docker_aurora_branch=$branch -t $image .
- docker tag $image:latest public.ecr.aws/shadowrobot/$image:$tag
- docker push public.ecr.aws/shadowrobot/$image:$tag
- comm -13 <(aws ecr-public describe-image-tags --repository-name $image --region us-east-1 --output text | awk '{print $3}' | tr " " "\n" | sort -u) <(aws ecr-public describe-images --repository-name $image --region us-east-1 --output text | awk '{print $2}' | tr " " "\n" | sort -u) >> ids_to_delete.txt
diff --git a/docker/test/docker/bionic/docker-compose.test.yml b/docker/test/docker/bionic/docker-compose.test.yml
index f34d77d2d..1526cebf8 100644
--- a/docker/test/docker/bionic/docker-compose.test.yml
+++ b/docker/test/docker/bionic/docker-compose.test.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: '3'
services:
diff --git a/docker/test/docker/focal/Dockerfile b/docker/test/docker/focal/Dockerfile
index e634335e8..4370b5e68 100644
--- a/docker/test/docker/focal/Dockerfile
+++ b/docker/test/docker/focal/Dockerfile
@@ -25,7 +25,7 @@ RUN set -x && \
echo "Installing Docker" && \
wget -O /tmp/oneliner "$( echo "$ts_docker_aurora_script" | sed 's/#/%23/g' )" && \
chmod 755 /tmp/oneliner && \
- /tmp/oneliner install_software --branch $ts_docker_aurora_branch software=[docker] && \
+ /tmp/oneliner install_software --branch $ts_docker_aurora_branch software=[docker] skip_molecule_task=true && \
\
echo "Clean up" && \
sudo apt-get clean && \
diff --git a/docker/test/docker/focal/buildspec.yml b/docker/test/docker/focal/buildspec.yml
index 3b50c0dca..adcd8dabe 100644
--- a/docker/test/docker/focal/buildspec.yml
+++ b/docker/test/docker/focal/buildspec.yml
@@ -1,14 +1,26 @@
+# Copyright 2022-2023 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
shell: bash
variables:
- branch: master
image: aurora-test-ubuntu-docker
tag: focal
dockerfile_folder: docker/test/docker/focal/
exported-variables:
- - branch
- image
- tag
- dockerfile_folder
@@ -18,6 +30,15 @@ phases:
docker: 19
build:
commands:
+ - |
+ if [[ $CODEBUILD_SOURCE_VERSION == "pr/"* ]]; then
+ pr_number=${CODEBUILD_SOURCE_VERSION#pr/}
+ branch=$(curl -s "https://api.github.com/repos/shadow-robot/aurora/pulls/$pr_number" | jq -r '.head.ref')
+ elif [[ $CODEBUILD_SOURCE_VERSION =~ ^[0-9a-f]{40}$ ]]; then
+ branch=$(git ls-remote --symref origin | grep -m1 $CODEBUILD_SOURCE_VERSION | awk -F '/' '{print $NF}')
+ else
+ branch=$CODEBUILD_SOURCE_VERSION
+ fi
- cd ..
- rm -rf aurora
- git clone https://github.com/shadow-robot/aurora.git
@@ -30,7 +51,7 @@ phases:
- ./aws/install
- cd $dockerfile_folder
- aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/shadowrobot
- - docker build -t $image .
+ - docker build --build-arg ts_docker_aurora_branch=$branch -t $image .
- docker tag $image:latest public.ecr.aws/shadowrobot/$image:$tag
- docker push public.ecr.aws/shadowrobot/$image:$tag
- comm -13 <(aws ecr-public describe-image-tags --repository-name $image --region us-east-1 --output text | awk '{print $3}' | tr " " "\n" | sort -u) <(aws ecr-public describe-images --repository-name $image --region us-east-1 --output text | awk '{print $2}' | tr " " "\n" | sort -u) >> ids_to_delete.txt
diff --git a/docker/test/docker/focal/docker-compose.test.yml b/docker/test/docker/focal/docker-compose.test.yml
index f34d77d2d..1526cebf8 100644
--- a/docker/test/docker/focal/docker-compose.test.yml
+++ b/docker/test/docker/focal/docker-compose.test.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: '3'
services:
diff --git a/docker/test/ubuntu/bionic/buildspec.yml b/docker/test/ubuntu/bionic/buildspec.yml
index aed51ac0c..6070b3b07 100644
--- a/docker/test/ubuntu/bionic/buildspec.yml
+++ b/docker/test/ubuntu/bionic/buildspec.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
diff --git a/docker/test/ubuntu/bionic/docker-compose.test.yml b/docker/test/ubuntu/bionic/docker-compose.test.yml
index da8fa6a94..82244d3ef 100644
--- a/docker/test/ubuntu/bionic/docker-compose.test.yml
+++ b/docker/test/ubuntu/bionic/docker-compose.test.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: '3'
services:
diff --git a/docker/test/ubuntu/focal/buildspec.yml b/docker/test/ubuntu/focal/buildspec.yml
index 1f2d2809a..1f7a28755 100644
--- a/docker/test/ubuntu/focal/buildspec.yml
+++ b/docker/test/ubuntu/focal/buildspec.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: 0.2
env:
diff --git a/docker/test/ubuntu/focal/docker-compose.test.yml b/docker/test/ubuntu/focal/docker-compose.test.yml
index da8fa6a94..82244d3ef 100644
--- a/docker/test/ubuntu/focal/docker-compose.test.yml
+++ b/docker/test/ubuntu/focal/docker-compose.test.yml
@@ -1,3 +1,17 @@
+# Copyright 2022 Shadow Robot Company Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+
version: '3'
services:
diff --git a/docs/development.md b/docs/development.md
new file mode 100644
index 000000000..675cab55d
--- /dev/null
+++ b/docs/development.md
@@ -0,0 +1,630 @@
+# Table of Contents
+- [Development](#development)
+ * [Development Docker](#development-docker)
+- [Testing](#testing)
+ * [Test creation](#test-creation)
+ * [Unlimited scroll in terminator](#unlimited-scroll-in-terminator)
+ * [Testing with molecule_docker](#testing-with-molecule_docker)
+ * [Debugging and Lint](#debugging-and-lint)
+ * [Private docker images](#private-docker-images)
+ * [Testing with molecule_ec2](#testing-with-molecule_ec2)
+ * [Credentials](#credentials)
+ * [Automatic tests](#automatic-tests)
+ * [Testing on real hardware](#testing-on-real-hardware)
+- [Templating](#templating)
+- [Dependencies](#dependencies)
+- [Playbooks](#playbooks)
+ * [Playbook creation](#playbook-creation)
+- [Inventories](#inventories)
+- [Syntax and rules](#syntax-and-rules)
+- [Special variables](#special-variables)
+- [Tutorial 1 desktop icon](#tutorial-1-desktop-icon)
+- [Troubleshooting](#troubleshooting)
+
+# Development #
+
+The recommended way to develop code for this project is to pull a certain docker image ([Development Docker](#development-docker)) with a lot of tools already installed and open a container of this image, then clone the aurora GitHub repository inside it. It is not recommended to clone aurora directly on your local machine while you do development and testing.
+
+## Development Docker ##
+
+The docker images used for aurora development are [here](https://gallery.ecr.aws/shadowrobot/aurora-molecule-devel).
+
+Currently both bionic and focal tags are working well.
+
+Use the tag that matches your host operating system.
+
+The rest of the document assumes the user is using bionic tag.
+
+Instructions on how to use this:
+1. Use Ubuntu 20.04 computer
+
+2. Install Docker (using instructions from [here](https://docs.docker.com/install/linux/docker-ce/ubuntu/))
+
+3. Run the following command in terminal to create a container for aurora development:
+
+```
+docker run -it --name aurora_dev -e DISPLAY -e QT_X11_NO_MITSHM=1 -e LOCAL_USER_ID=$(id -u) -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/.X11-unix:/tmp/.X11-unix:rw public.ecr.aws/shadowrobot/aurora-molecule-devel:focal
+```
+4. Once the container has launched, clone aurora to home directory:
+```
+git clone https://github.com/shadow-robot/aurora.git
+```
+5. Go into the aurora folder:
+```
+cd aurora
+```
+6. Open Visual Studio Code which is already installed inside the Docker container:
+```
+code .
+```
+
+# Testing #
+
+## Test creation ##
+
+Create test case for both docker in ansible/playbooks/molecule_docker/molecule folder and for AWS EC2 in ansible/playbooks/molecule_ec2/molecule folder. For additional molecule_docker tests, copy the folder structure from other tests and modify the .py, converge.yml and molecule.yml files in tests folder.For additional molecule_ec2 tests, copy the folder structure of another EC2 test and modify the molecule.yml file inside. The EC2 tests just run the same tests as the Docker tests, but they do it in AWS EC2, using virtual machines, not Docker.
+
+## Unlimited scroll in terminator ##
+
+Before executing any tests, it is very useful to make sure you have unlimited scroll in terminator, because Molecule produces a lot of debug logs. Follow these steps to enable it: right click on the Terminator -> Preferences -> Profiles -> Scrolling and select Infinite scrollback.
+
+## Testing with molecule_docker ##
+
+Once you have written your code for aurora in your branch, test it locally with Molecule first before pushing to GitHub.
+
+There are some molecule_docker tests which require connecting to AWS to download files (such as downloading the hand manual). For this reason, before running any Molecule tests, ask the system administrator for your AWS access key and secret access key. Then, in the docker container terminal, type:
+```
+export AWS_ACCESS_KEY=your_key
+export AWS_SECRET_KEY=your_secret
+```
+
+1. In the docker container terminal execute the following command:
+
+```
+cd /home/user/aurora/ansible/playbooks/molecule_docker
+```
+
+2. Start with testing only your test case, without extra debug statements:
+
+```
+molecule test -s name_of_your_test_case
+```
+
+3. Fix any errors. If you want more debug information, execute the following:
+```
+molecule --debug test -s name_of_your_test_case
+```
+The --debug flag produces a lot of information. Remember to scroll up to see any possible lint or other errors that might have occurred.
+
+4. Now test all test cases to check for effects on other aurora components and knock-on-effects:
+```
+molecule test --all
+```
+5. Fix any errors. If you want more debug information, execute the following:
+```
+molecule --debug test all
+```
+
+6. Often it is useful to run Molecule in stages (create, converge, verify, login (if necessary), and finally destroy) for better debugging (so you can inspect every stage yourself). See [this](https://molecule.readthedocs.io/en/stable/usage.html) page, and do, for example:
+```
+molecule create -s name_of_your_test_case
+molecule converge -s name_of_your_test_case
+molecule verify -s name_of_your_test_case
+molecule login -s name_of_your_test_case
+molecule destroy -s name_of_your_test_case
+```
+
+## Debugging and Lint ##
+
+1. For a successful test, Molecule requires that all lint checks (yaml lint, flake8 python lint and ansible lint) pass. The AWS EC2 build will fail if any lint check fails or if any Molecule test fails.
+
+2. In the Molecule logs, do a text search for "error" or "error occurred" as well as "failure" and "fatal".
+
+3. You can add the --debug flag after molecule for more debug information, but remember to scroll up to see any possible lint or other errors that might have happened.
+
+4. It's useful to enable [Unlimited scroll in terminator](#unlimited-scroll-in-terminator)
+
+## Private docker images ##
+
+At the moment, we don't want to give Molecule access to private docker hub / AWS private ECR credentials for private docker images (e.g. shadow-teleop). That is why, in every converge.yml inside the test cases in the molecule_docker folder, we override the image with image="public.ecr.aws/shadowrobot/dexterous-hand" for any teleop-related test cases. When we actually deploy Aurora, the user will be asked to fill in their private Docker hub credentials.
+
+## Testing with molecule_ec2 ##
+
+Once you have written your code for aurora in your branch, and tested it locally with molecule_docker, you can test it with AWS EC2 (initiated from local), by following the steps here:
+
+## Credentials ##
+
+1. Ask the system administrator for your AWS access key and secret access key. Then, in the docker container terminal, type:
+
+```
+aws configure
+```
+2. Paste the access key and the secret access key
+
+3. Default region name must be: eu-west-2
+
+4. Press enter on the Default format
+
+
+Then continue testing with molecule_ec2:
+
+1. In the docker container terminal go to /ansible/playbooks/molecule_ec2 folder
+
+```
+cd /home/user/aurora/ansible/playbooks/molecule_ec2
+```
+
+2. Start with testing only your test case, without extra debug statements:
+
+```
+molecule test -s name_of_your_test_case
+```
+
+3. Fix any errors. If you want more debug information, execute the following:
+```
+molecule --debug test -s name_of_your_test_case
+```
+The --debug flag produces a lot of information. Remember to scroll up to see any possible lint or other errors that might have occurred.
+
+4. Now test all test cases to check for effects on other aurora components and knock-on-effects:
+```
+molecule test --all
+```
+5. Fix any errors. If you want more debug information, execute the following:
+```
+molecule --debug test all
+```
+
+6. Often it is useful to run Molecule in stages (create, converge, verify, login (if necessary), and finally destroy) for better debugging (so you can inspect every stage yourself). See [this](https://molecule.readthedocs.io/en/stable/usage.html) page, and do, for example:
+```
+molecule create -s name_of_your_test_case
+molecule converge -s name_of_your_test_case
+molecule verify -s name_of_your_test_case
+molecule login -s name_of_your_test_case
+molecule destroy -s name_of_your_test_case
+```
+## Automatic tests ##
+
+The buildspec.yml file in the root of the project defines what AWS CodeBuild should run when a PR is created or updated or when a daily build runs. It is configured to run all tests in /ansible/playbooks/molecule_ec2 folder. AWS buildspec specification is [here](https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html)
+
+Note that AWS EC2 tests take about 1 hour to complete a build due to provisioning a new AWS virtual machines for each test and for each test running in a separate virtual machine and each virtual machine needing to pull the right Docker images and then execute the tests
+
+## Testing on real hardware ##
+
+For debugging (not using the master branch), you can add the following immediately after playbook name (for example docker_deploy or teleop_deploy):
+
+* --branch name_of_aurora_repo_branch (e.g. --branch F#SRC-2603_add_ansible_bootstrap)
+
+## Templating ##
+
+For various bash/docker/etc. scripts, it's often useful to use Jinja2 templates (.j2 files). You can read more about .j2 files [here](https://docs.ansible.com/ansible/latest/user_guide/playbooks_templating.html)). They are stored either in /products/common/resources/ or if they are specific to a particular product, they should be in that products /templates/scripts folder.
+
+## Dependencies ##
+
+There are 2 main way of including dependencies in Ansible roles. The preferred way we use is the "include_role" method because it is dynamic (see [here](https://docs.ansible.com/ansible/latest/modules/include_role_module.html) for documentation).
+
+E.g. if we want to include a particular role to install Docker, we do:
+
+```bash
+- name: Include installation/docker role
+ include_role:
+ name: installation/docker
+```
+The other way of having dependencies in Ansible is by using the meta folder and main.yml inside the meta folder. Please note: any meta dependencies are static only and will not take into account any group_vars or dynamic variables. That means that meta dependencies will only use the default/main.yml default value, nothing else. Any tasks in meta/main.yml are run before the task/main.yml. An example of meta/main.yml:
+
+```bash
+dependencies:
+ - { role: installation/aws-cli-v2 }
+```
+
+# Playbooks #
+
+Playbooks are "the main thing that runs"/"main executable" in Aurora.
+
+From the Ansible [website](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html): "Playbooks are the basis for a really simple configuration management and multi-machine deployment system, unlike any that already exist, and one that is very well suited to deploying complex applications."
+
+## Playbook creation ##
+
+Create your playbook in ansible/playbooks folder. It has be a .yml file with no hyphens (underscores are allowed).
+
+You can read more about playbooks [here](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html)
+
+It has to have a similar structure to this (let's say your playbook is called "my_playbook")
+
+```bash
+---
+
+- name: Install Python 3
+ import_playbook: ./install_python3.yml
+
+- name: Install product Docker container and icons
+ hosts: docker_deploy
+ pre_tasks:
+
+ - name: include products/common/validation role
+ include_role:
+ name: products/common/validation
+ vars:
+ playbook: "docker_deploy"
+
+ - name: Running playbook setup role
+ include_role:
+ name: installation/playbook_setup
+ when: not skip_molecule_task|bool
+
+ - name: check if customer_key is provided and not false
+ when: customer_key is defined and customer_key | length > 0
+ set_fact:
+ use_aws: true
+
+ roles:
+ - { role: products/common/get-system-variables }
+ - { role: products/hand-e/docker-deploy/deploy }
+ - { role: products/common/dolphin-icons, when: ansible_distribution_release|string == 'focal' or ansible_distribution_release|string == 'jammy'}
+```
+Key points:
+
+Always start by having:
+
+```bash
+- name: Install Python 3
+ import_playbook: ./install_python3.yml
+```
+This is to ensure Python3 is installed. Aurora uses Python3.
+
+Then you need to have one or more of task sections (or pre-task sections, which are executed before tasks) and an optional role section. Another example of a task section in a playbook (without role section):
+
+```bash
+- name: Check which hosts are available for teleop system Install
+ hosts: all
+ gather_facts: no
+ tasks:
+ - name: ping all the machines
+ ping:
+ become: yes
+```
+Some task sections specify "hosts", which tells Ansible which hosts to limit the execution to. You can read more about hosts in playbooks [here](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#hosts-and-users)
+
+An example of a role section:
+
+```bash
+ roles:
+ - { role: products/common/get-system-variables }
+ - { role: products/hand-e/docker-deploy/deploy }
+ - { role: products/common/dolphin-icons, when: ansible_distribution_release|string == 'focal' or ansible_distribution_release|string == 'jammy' }
+```
+
+# Inventories #
+
+An inventory is a file with group names and fixed IP addresses and some limited connection-related variables of the machines where we want the playbook to run. The inventory group names are required in playbooks in the hosts parameter (e.g. hosts: all). You can read more about hosts in playbooks [here](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#hosts-and-users)
+
+Inventories for teleop correspond to fixed IP addresses as shown here:
+* [staging_b](ansible/inventory/teleop/staging_b)
+* [staging_a](ansible/inventory/teleop/staging_a)
+* [production](ansible/inventory/teleop/production)
+* [simulation](ansible/inventory/teleop/simulation)
+
+More information available [here](https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html)
+
+# Syntax and rules #
+
+1. Use lower case, words_separated_by_underscore file, folder, task, role, inventory group, playbook and any other names
+2. Spaces are very important! Don't leave extra, unnecessary spaces anywhere, but also remember to add a newline to the end of all files
+3. Follow [this](https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html) YAML syntax, paying special attention to the "Gotchas" [here](https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html#gotchas)
+
+# Special variables #
+
+Ansible has several special variables which can be accessed in playbooks, roles and tasks. E.g. if the special variable is ansible_user, you can access it using {{ ansible_user }}. Full list of special variables is [here](https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html)
+
+# Tutorial 1 desktop icon #
+
+Aim: to create a branch of aurora which has an Ansible role to install a desktop icon. When the user clicks on the desktop icon, a terminal window will open and say: "Hello, User!". The user can supply a different username as an extra vars parameter, so e.g. if the user runs the playbook with username=Peter, the terminal window will show "Hello, Peter!"
+
+Requirements: you need a laptop/PC with internet, Ubuntu 18.04 or 20.04 installed.
+
+Steps:
+
+1. Go to [Development Docker](#development-docker) section and follow instructions there to set up your development environment
+
+2. Create your own branch of aurora (from master). You can call your branch: Tutorial_YourName
+
+3. Follow instructions in the [Playbook creation](#playbook-creation) section to create your own playbook, you can call it tutorial_icon_deploy.yml. Remember use the Install Python3 import as documented in [Playbook creation](#playbook-creation) and include a roles section. Your playbook should look something like this (yes, use hosts: docker_deploy for this tutorial):
+
+```bash
+---
+
+- name: Install Python 3
+ import_playbook: ./install_python3.yml
+
+- name: Tutorial 1 installation
+ hosts: docker_deploy
+ roles:
+ - {role: products/tutorial/deploy }
+```
+
+4. Create a role in roles/products/tutorial folder (you will have to create the tutorial folder). Inside the tutorial folder, create the following folder structure and empty files where indicated. You should have the following file structure:
+
+ 
+
+5. You deploy/defaults/main.yml should look like this:
+```bash
+---
+user: "{{ ansible_user_id }}"
+user_folder: "/home/{{ user }}"
+
+```
+6. Your deploy/tasks/main.yml should look like this:
+```bash
+---
+- name: Include products/tutorial/desktop-icons role
+ include_role:
+ name: products/tutorial/desktop-icons
+```
+7. Your desktop-icons/defaults/main.yml should look like this:
+```bash
+---
+user: "{{ ansible_user_id }}"
+user_folder: "/home/{{ user }}"
+username: "{{ user }}"
+tutorial_launcher_folder: "{{ user_folder }}/.tutorial/tutorial_1"
+```
+8. Your desktop-icons/tasks/main.yml should look like this:
+```bash
+---
+- name: Ensures that Desktop folder exists
+ file:
+ path: "{{ desktop_path }}"
+ mode: '755'
+ state: directory
+
+- name: Ensures that tutorial directory exists
+ file:
+ path: "{{ tutorial_launcher_folder }}"
+ state: directory
+
+- name: Copy the tutorial desktop icon
+ copy:
+ src: files/tutorial_1_icon.png
+ dest: "{{ tutorial_launcher_folder }}/tutorial_1_icon.png"
+ mode: '664'
+
+- name: Create the executable launch script
+ template:
+ src: templates/scripts/show_terminal.j2
+ dest: "{{ tutorial_launcher_folder }}/show_terminal.sh"
+ mode: '755'
+
+- name: Create the tutorial desktop icon
+ template:
+ src: ../../../common/resources/templates/desktop-icons/standard-icon.j2
+ dest: "{{ desktop_path }}/Launch_Tutorial_1.desktop"
+ mode: '755'
+ vars:
+ desktop_shortcut_name: Launch_Tutorial_1
+ comment: "This is application launches Tutorial 1 of Aurora"
+ folder: "{{ tutorial_launcher_folder }}"
+ shell_script_file_name: show_terminal.sh
+ icon_file_name: tutorial_1_icon.png
+
+- name: Make Desktop icon trusted
+ shell: gio set "{{ desktop_path }}/Launch_Tutorial_1.desktop" "metadata::trusted" yes
+ when:
+ - ansible_distribution|string == 'Ubuntu'
+ - ansible_distribution_release|string == 'bionic'
+ - not skip_molecule_task|bool
+```
+9. Download a suitable image (.jpg or .png) (e.g min 64x64 resolution, max 1000x1000 resolution) from the internet to be your tutorial_1_icon.png (or .jpg but then remember to change the extension to .jpg in your Ansible scripts as well). Place this image in the desktop-icons/files folder
+
+10. Your desktop-icons/templates/scripts/show_terminal.j2 should look like this:
+(you can read more about .j2 files in [Templating](#templating))
+```bash
+#jinja2: trim_blocks:False
+#! /bin/bash
+echo -e \"Hello, {{ username }}!\"
+sleep infinity
+
+```
+11. Now, let's add a Molecule test, which tests if the desktop icon exists. In /playbooks/molecule_docker folder, copy an existing folder (e.g. teleop_empty_server_docker) and paste it and then change the name to e.g. tutorial_1_docker. Inside tutorial_1_docker folder you should have the following folders and files (change file and folder names when necessary)
+
+ 
+
+12. You don't need to edit the Dockerfile.j2. Just edit the molecule.yml so it looks like this:
+```bash
+---
+driver:
+ name: docker
+lint: |
+ set -e
+ yamllint .
+ ansible-lint
+ flake8
+platforms:
+ - name: tutorial_1_docker
+ image: public.ecr.aws/shadowrobot/aurora-test-ubuntu-docker:focal
+ groups:
+ - docker_deploy
+ volumes:
+ - /var/run/docker.sock:/var/run/docker.sock:rw
+provisioner:
+ name: ansible
+ env:
+ ANSIBLE_ROLES_PATH: ../../../../roles
+ AWS_ACCESS_KEY: ${AWS_ACCESS_KEY}
+ AWS_SECRET_KEY: ${AWS_SECRET_KEY}
+ inventory:
+ links:
+ group_vars: ../../../../inventory/local/group_vars
+verifier:
+ name: testinfra
+scenario:
+ create_sequence:
+ - create
+ check_sequence:
+ - destroy
+ - create
+ - converge
+ - check
+ - destroy
+ converge_sequence:
+ - create
+ - converge
+ destroy_sequence:
+ - destroy
+ test_sequence:
+ - lint
+ - destroy
+ - syntax
+ - create
+ - converge
+ - idempotence
+ - verify
+ - destroy
+```
+13. Edit the converge.yml so it looks like this:
+```bash
+---
+- name: Tutorial 1 playbook
+ import_playbook: ../../../tutorial_icon_deploy.yml
+
+```
+
+14. Edit the test_tutorial_1.py so it looks like this (we are using a general pattern here, which is why we have for loops for icons and scripts).
+```bash
+import os
+import testinfra.utils.ansible_runner
+
+testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
+ os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
+
+
+def test_icons_in_docker(host):
+ desktop_path = '/home/' + str(host.user().name) + '/Desktop/'
+ script_path = '/home/' + str(host.user().name) + \
+ '/.tutorial/tutorial_1/'
+ icons = (
+ 'Launch_Tutorial_1'
+ )
+ scripts = (
+ 'show_terminal'
+ )
+ for icon in icons:
+ assert host.file(desktop_path+icon+'.desktop').exists
+ for script in scripts:
+ assert host.file(script_path+script+'.sh').exists
+
+```
+15. Now that your Docker test is ready, create the EC2 test which tests if the desktop icon exists, but it runs on an AWS virtual machine (not in Docker). In /playbooks/molecule_ec2 folder, copy an existing folder (e.g. teleop_server_chrony_ec2) and paste it and then change the name to e.g. tutorial_1_ec2. Inside tutorial_1_ec2 folder you should have the following folders and files (change file and folder names when necessary):
+
+ 
+
+16. Edit the molecule.yml so it looks like this:
+```bash
+---
+dependency:
+ name: galaxy
+driver:
+ name: ec2
+lint: |
+ set -e
+ yamllint .
+ ansible-lint
+ flake8
+platforms:
+ # Adding CODEBUILD_BUILD_ID to instance name in order to allow parallel EC2 execution of tests from CodeBuild
+ - name: tutorial_1_ec2_${CODEBUILD_BUILD_ID}
+ image: ami-0820357ff5cf2333d
+ instance_type: t2.micro
+ region: eu-west-2
+ vpc_id: vpc-0f8cc2cc245d57eb4
+ vpc_subnet_id: subnet-0c8cfe80927f04845
+ groups:
+ - docker_deploy
+provisioner:
+ name: ansible
+ env:
+ ANSIBLE_ROLES_PATH: ../../../../roles
+ connection_options:
+ ansible_python_interpreter: /usr/bin/python3
+ inventory:
+ links:
+ group_vars: ../../../../inventory/local/group_vars
+ playbooks:
+ create: ../resources/ec2/create.yml
+ destroy: ../resources/ec2/destroy.yml
+ prepare: ../../../install_python3.yml
+ converge: ../../../molecule_docker/molecule/tutorial_1_docker/converge.yml
+verifier:
+ name: testinfra
+ directory: ../../../molecule_docker/molecule/tutorial_1_docker/tests/
+scenario:
+ create_sequence:
+ - dependency
+ - create
+ - prepare
+ check_sequence:
+ - dependency
+ - destroy
+ - create
+ - prepare
+ - converge
+ - check
+ - destroy
+ converge_sequence:
+ - dependency
+ - create
+ - prepare
+ - converge
+ destroy_sequence:
+ - dependency
+ - destroy
+ test_sequence:
+ - dependency
+ - lint
+ - destroy
+ - syntax
+ - create
+ - prepare
+ - converge
+ - idempotence
+ - verify
+ - destroy
+
+```
+17. Now all the Ansible code is done and both Docker and EC2 tests added. Next step is to execute the Docker test locally: follow the steps here: [Testing with molecule_docker](#testing-with-molecule_docker) (you may want to use the -s flag to limit the test to your tutorial_1 test only. Normally we want to re-test everything for every introduced change, but it's pretty safe to say tutorial_1 hasn't broken other parts of Aurora)
+
+18. After local Docker tests are complete, you can optionally run the EC2 triggered locally as well by following the steps here: [Testing with molecule_ec2](#testing-with-molecule_ec2) (However, you need to contact the System Administrator for credentials as explained here: [Credentials](#credentials))
+
+19. When all tests are passing (initiated locally), create a PR of your branch and see the AWS automatic build activate as well as the AWS ECR tests (building aurora Docker images). All tests must pass before even thinking about merging to master (and in this exercise, please DO NOT MERGE to master!). More information available here: [Automatic tests](#automatic-tests)
+
+20. Once your PR is passing (all green), you are ready to test your branch on real hardware. For this tutorial, you will test your branch on your own local machine by opening a terminal window by pressing Ctrl+Alt+T and run this:
+```bash
+bash <(curl -Ls bit.ly/run-aurora) tutorial_icon_deploy --branch NameOfYourBranch --inventory local/docker_deploy username=YourName
+```
+Rememeber to substitute in NameOfYourBranch and YourName
+
+You will have to enter the sudo password for your computer twice (once for the bash script and once for ansible)
+
+21. The desktop icon should be created and when you double-click on it, a window should pop up and greet you using the username you passed in. You have now completed Tutorial 1
+
+ 
+
+ 
+
+# Troubleshooting #
+
+1. **SSH warning** when using the same laptops for multiple different NUCs (in server_and_nuc_deploy and teleop_deploy): for a given server laptop, only 1 NUC is supposed to be used. If the NUC is changed, the SSH keys stored on the laptop don't match the NUC, so aurora has to be re-run. In this case, it's required that the user manually deletes the .ssh folder on the server laptop to clear ssh keys.
+
+2. **Unable to connect to a new NUC with SSH** (not cloned from Clonezilla image) (in server_and_nuc_deploy and teleop_deploy): the NUC with Ubuntu Server 18.04 needs manual netplan configuration as below in order to recognize and connect the ethernet-USB adapters: edit the file /etc/netplan/50-cloud-init.yaml in the NUC host so it has the following:
+
+```bash
+network:
+ version: 2
+ ethernets:
+ enx-usb-ethernet:
+ match:
+ name: enx*
+ dhcp4: true
+ optional: true
+```
+
+3. **Unable to launch RQT on NUC** (or other graphical programs running on the NUC), due to Xauthority issues (in server_and_nuc_deploy and teleop_deploy): Before running aurora, execute ssh -X user@nuc-control to create a proper .Xauthority file in the NUC host (user home folder). This is required before aurora runs and creates the container.