From e344e0bdf450abbb0101b5807ff2401815c44ee1 Mon Sep 17 00:00:00 2001 From: Georgia Blanco-Litchfield Date: Mon, 9 Nov 2020 15:12:07 +0000 Subject: [PATCH] Src 5502 changing right ethercat variable (#305) * updating varible and fixing some errors * fixing an error * changing a missed ethercat_interface * fixed molecule tests (#302) * fixes (#303) * fixes * Delete main.yml * fixes due to molecule (#304) Co-authored-by: ToivoS <38542384+ToivoS@users.noreply.github.com> --- README.md | 20 +++++++++---- .../local/group_vars/docker_deploy.yml | 2 +- .../group_vars/control_machine.yml | 2 +- .../teleop/group_vars/control_machine.yml | 2 +- ansible/playbooks/docker_deploy.yml | 15 ++++++++-- .../molecule/default/converge.yml | 2 +- .../molecule/default/molecule.yml | 2 ++ .../hand_e_empty_machine_docker/converge.yml | 2 +- .../hand_e_empty_machine_docker/molecule.yml | 2 ++ .../converge.yml | 2 +- .../molecule.yml | 2 ++ .../tests/test_server.py | 2 +- .../converge.yml | 4 ++- .../molecule.yml | 2 ++ .../converge.yml | 4 ++- .../molecule.yml | 2 ++ .../converge.yml | 2 +- .../molecule.yml | 2 ++ .../tests/test_teleop_server.py | 1 - .../converge.yml | 2 +- .../molecule.yml | 2 ++ .../tests/test_teleop_server.py | 2 +- .../molecule.yml | 2 ++ .../tests/test_teleop_server.py | 1 + ansible/playbooks/server_and_nuc_deploy.yml | 30 ++++++++++++++++--- .../common/docker-container/defaults/main.yml | 2 +- .../no-setup-no-terminator.yml | 2 +- .../no-setup-with-terminator.yml | 2 +- .../nvidia-with-setup-with-terminator.yml | 2 +- .../with-setup-no-terminator.yml | 2 +- .../with-setup-with-terminator.yml | 2 +- .../local-hand-launch/defaults/main.yml | 2 +- .../defaults/main.yml | 2 +- .../tasks/main.yml | 2 +- .../resources/templates/scripts/setup-hand.j2 | 4 +-- .../control_machine/deploy/defaults/main.yml | 2 +- .../products/hand-e/deploy/defaults/main.yml | 2 +- .../hand-e/server/deploy/defaults/main.yml | 2 +- .../server/desktop-icons/tasks/main.yml | 6 ++-- ...-docker-container-nuc-bimanual-arm-hand.j2 | 2 +- .../start-docker-container-nuc-bimanual.j2 | 2 +- .../products/hand-h/deploy/defaults/main.yml | 2 +- .../teleop/client/deploy/defaults/main.yml | 4 ++- .../teleop/client/deploy/tasks/main.yml | 5 ++++ .../teleop/server/deploy/defaults/main.yml | 2 +- .../server/desktop-icons/defaults/main.yml | 2 +- .../tasks/demohands-unimanual.yml | 6 ++-- .../desktop-icons/tasks/real-robots.yml | 4 +-- .../start-docker-container-nuc-bimanual.j2 | 2 +- 49 files changed, 122 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index c6f2af3e5..cc874462a 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ If no inventory name is provided, and if remote_teleop=true, then "production_re Example for real robots with haptx bimanual teleop: ```bash -bash <(curl -Ls bit.ly/run-aurora) teleop_deploy --inventory production --read-input docker_username --read-secure docker_password ethercat_interface=enx000ec6bfe185 ethercat_left_hand=enx000ec6c042d5 config_branch=bimanual_demohands_B_D reinstall=true bimanual=true use_aws=true upgrade_check=true image="shadowrobot/teleop-haptx-binary" tag="melodic-v0.0.1" 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 bit.ly/run-aurora) teleop_deploy --inventory production --read-input docker_username --read-secure docker_password ethercat_right_hand=enx000ec6bfe185 ethercat_left_hand=enx000ec6c042d5 config_branch=bimanual_demohands_B_D reinstall=true bimanual=true use_aws=true upgrade_check=true image="shadowrobot/teleop-haptx-binary" tag="melodic-v0.0.1" 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 ``` Example for simulated robots without a real vive system or real gloves: @@ -136,7 +136,7 @@ bash <(curl -Ls bit.ly/run-aurora) server_and_nuc_deploy option1=value1 option2= Example: ```bash -bash <(curl -Ls bit.ly/run-aurora) server_and_nuc_deploy product=hand_e ethercat_interface=enx5647929203 config_branch=demohand_C +bash <(curl -Ls bit.ly/run-aurora) server_and_nuc_deploy product=hand_e ethercat_right_hand=enx5647929203 config_branch=demohand_C ``` Options for server_and_nuc_deploy playbook are here for the following machines: @@ -169,7 +169,7 @@ launches the hand. **Ethercat interface** -Before running the docker_deploy playbook, the ethercat_interface parameter for the hand needs to be discovered. In order to do so, after plugging the hand’s ethernet cable into your machine and powering it up, please run +Before running the docker_deploy playbook, the ethercat_right_hand parameter for the hand needs to be discovered. In order to do so, after plugging the hand’s ethernet cable into your machine and powering it up, please run ```shell sudo dmesg ``` @@ -177,20 +177,20 @@ command in the console. At the bottom, there will be information similar to the ```shell [490.757853] IPv6: ADDRCONF(NETDEV_CHANGE): enp0s25: link becomes ready ``` -In the above example, ‘enp0s25’ is the ethercat_interface that is needed. +In the above example, ‘enp0s25’ is the ethercat_right_hand that is needed. **How to run:** Open a terminal with Ctrl+Alt+T and run: ```bash -bash <(curl -Ls bit.ly/run-aurora) docker_deploy ethercat_interface=enp0s25 option1=value1 option2=value2 option3=value3 +bash <(curl -Ls bit.ly/run-aurora) docker_deploy ethercat_right_hand=enp0s25 option1=value1 option2=value2 option3=value3 ``` Example: ```bash -bash <(curl -Ls bit.ly/run-aurora) docker_deploy product=hand_e ethercat_interface=enp0s25 config_branch=demohand_C +bash <(curl -Ls bit.ly/run-aurora) docker_deploy product=hand_e ethercat_right_hand=enp0s25 config_branch=demohand_C ``` Options for docker_deploy playbook are [here](ansible/inventory/local/group_vars/docker_deploy.yml) @@ -294,6 +294,12 @@ Before executing any tests, it is very useful to make sure you have unlimited sc 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: ``` @@ -737,6 +743,8 @@ 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 diff --git a/ansible/inventory/local/group_vars/docker_deploy.yml b/ansible/inventory/local/group_vars/docker_deploy.yml index d6e00d5c2..4ec6529a2 100644 --- a/ansible/inventory/local/group_vars/docker_deploy.yml +++ b/ansible/inventory/local/group_vars/docker_deploy.yml @@ -8,7 +8,7 @@ nvidia_docker: false # Define if nvidia docker 2 is used (default is false) desktop_icon: true # Generates a desktop icon to launch the hand cyberglove: "" # Specify the branch of sr_cyberglove_config for cyberglove configuration use_aws: false # Flag to prompt for customer key for uploading files to AWS -ethercat_interface: "eth0" # Ethercat interface of the right hand +ethercat_right_hand: "eth0" # Ethercat interface of the right hand ethercat_left_hand: "enx1" # Ethercat interface of the left hand config_branch: "" # Specify the branch for the specific hand (Only for dexterous hand) shortcut_name: "Shadow_Hand_Launcher" # Specify the name for the desktop icon (default: Shadow_Hand_Launcher) 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 021143549..1d40d6a5a 100644 --- a/ansible/inventory/server_and_nuc/group_vars/control_machine.yml +++ b/ansible/inventory/server_and_nuc/group_vars/control_machine.yml @@ -4,7 +4,7 @@ tag: "melodic-release" # 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, hand_h) reinstall: false # Flag to know if the docker container should be fully reinstalled container_name: "dexterous_hand_real_hw" # Name of the docker container -ethercat_interface: "eth0" # Ethercat interface of the right hand +ethercat_right_hand: "eth0" # Ethercat interface of the right hand ethercat_left_hand: "enx1" # Ethercat interface of the left hand ethercat_right_arm: "enp3s0" # Ethercat interface of the right arm ethercat_left_arm: "enx2" # Ethercat interface of the left arm diff --git a/ansible/inventory/teleop/group_vars/control_machine.yml b/ansible/inventory/teleop/group_vars/control_machine.yml index 4702a2e47..ee530e474 100644 --- a/ansible/inventory/teleop/group_vars/control_machine.yml +++ b/ansible/inventory/teleop/group_vars/control_machine.yml @@ -3,7 +3,7 @@ image: "shadowrobot/shadow-teleop-polhemus" # Docker image name tag: "melodic-night-build" # Tag of the exact Docker hub image to pull reinstall: false # Flag to know if the docker container should be fully reinstalled container_name: "teleop" # Name of the docker container -ethercat_interface: "eth0" # Ethercat interface of the right hand +ethercat_right_hand: "eth0" # Ethercat interface of the right hand bimanual: false # Determines if left arm and left hand should be set up ethercat_left_hand: "enx1" # Ethercat interface of the left hand ethercat_left_arm: "enx2" # Ethercat interface of the left arm diff --git a/ansible/playbooks/docker_deploy.yml b/ansible/playbooks/docker_deploy.yml index 04e52a4ec..1baed2389 100644 --- a/ansible/playbooks/docker_deploy.yml +++ b/ansible/playbooks/docker_deploy.yml @@ -8,7 +8,13 @@ pre_tasks: - name: No product is defined - when: product != 'hand_e' and product != 'arm_hand_e' and product != 'hand_lite' and product != 'arm_hand_lite' and product != 'hand_extra_lite' and product != 'arm_hand_extra_lite' and product != 'hand_h' + when: (product != 'hand_e') and + (product != 'arm_hand_e') and + (product != 'hand_lite') and + (product != 'arm_hand_lite') and + (product != 'hand_extra_lite') and + (product != 'arm_hand_extra_lite') and + (product != 'hand_h') meta: end_play - name: check if customer_key is provided and not false @@ -25,5 +31,10 @@ - {role: installation/docker} - {role: installation/nvidia-docker, when: nvidia_docker | bool} - {role: products/hand-h/deploy, when: product == 'hand_h'} - - {role: products/hand-e/deploy, when: product == 'hand_e' or product == 'arm_hand_e' or product == 'hand_lite' or product == 'arm_hand_lite' or product == 'hand_extra_lite' or product == 'arm_hand_extra_lite' } + - {role: products/hand-e/deploy, when: (product == 'hand_e') or + (product == 'arm_hand_e') or + (product == 'hand_lite') or + (product == 'arm_hand_lite') or + (product == 'hand_extra_lite') or + (product == 'arm_hand_extra_lite')} - {role: docker/aws, when: use_aws|bool} diff --git a/ansible/playbooks/molecule_docker/molecule/default/converge.yml b/ansible/playbooks/molecule_docker/molecule/default/converge.yml index d4dde4b45..cd612eaed 100644 --- a/ansible/playbooks/molecule_docker/molecule/default/converge.yml +++ b/ansible/playbooks/molecule_docker/molecule/default/converge.yml @@ -2,6 +2,6 @@ - name: Docker deploy playbook for non existing product import_playbook: ../../../docker_deploy.yml product="non_existing_product" - ethercat_interface="enp0s25" + ethercat_right_hand="enp0s25" allow_auto_reboot=true skip_molecule_task=true diff --git a/ansible/playbooks/molecule_docker/molecule/default/molecule.yml b/ansible/playbooks/molecule_docker/molecule/default/molecule.yml index 2eccac261..20f7f88d2 100644 --- a/ansible/playbooks/molecule_docker/molecule/default/molecule.yml +++ b/ansible/playbooks/molecule_docker/molecule/default/molecule.yml @@ -19,6 +19,8 @@ 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 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 1d466a99a..f39a1a151 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 @@ -2,7 +2,7 @@ - name: Docker deploy playbook for Hand E import_playbook: ../../../docker_deploy.yml product="hand_e" - ethercat_interface="enp0s25" + ethercat_right_hand="enp0s25" container_name="test_hand_e_empty_machine_container" allow_auto_reboot=true skip_molecule_task=true 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 0daee938b..ccc62f8e6 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 @@ -19,6 +19,8 @@ provisioner: name: ansible env: ANSIBLE_ROLES_PATH: ../../../../roles + AWS_ACCESS_KEY: ${AWS_ACCESS_KEY} + AWS_SECRET_KEY: ${AWS_SECRET_KEY} playbooks: cleanup: cleanup.yml inventory: 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 bcc89d37e..76a56c454 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 @@ -5,7 +5,7 @@ skip_molecule_task=true allow_auto_reboot=true reinstall=true - ethercat_interface="enp0s25" + ethercat_right_hand="enp0s25" ethercat_left_hand="enx1" nvidia_docker=false config_branch="demohand_A" 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 ac8ff9760..db2ce99fe 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 @@ -23,6 +23,8 @@ 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/server_and_nuc/group_vars 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 e912ee31d..4f35aa20c 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 @@ -76,7 +76,7 @@ def test_icons_in_docker(host): 'shadow_local_zero_force_mode_right_launcher', 'shadow_local_zero_force_mode_left_launcher', 'shadow_zero_force_mode_right', - 'shadow_zero_force_mode_left' + 'shadow_zero_force_mode_left' ) for icon in icons: assert host.file(desktop_path+icon+'.desktop').exists diff --git a/ansible/playbooks/molecule_docker/molecule/teleop_client_check_desktop_icons_docker/converge.yml b/ansible/playbooks/molecule_docker/molecule/teleop_client_check_desktop_icons_docker/converge.yml index a4b695506..e2ad0a83b 100644 --- a/ansible/playbooks/molecule_docker/molecule/teleop_client_check_desktop_icons_docker/converge.yml +++ b/ansible/playbooks/molecule_docker/molecule/teleop_client_check_desktop_icons_docker/converge.yml @@ -3,10 +3,12 @@ import_playbook: ../../../teleop_deploy.yml reinstall=true use_openvpn=false - ethercat_interface="enp0s25" + ethercat_right_hand="enp0s25" image="shadowrobot/dexterous-hand" tag="melodic-release" nvidia_docker=false allow_auto_reboot=true remote_teleop=true skip_molecule_task=true + ansible_become_password=ubuntu + ansible_ssh_pass=ubuntu diff --git a/ansible/playbooks/molecule_docker/molecule/teleop_client_check_desktop_icons_docker/molecule.yml b/ansible/playbooks/molecule_docker/molecule/teleop_client_check_desktop_icons_docker/molecule.yml index 8b02014db..3fe624675 100644 --- a/ansible/playbooks/molecule_docker/molecule/teleop_client_check_desktop_icons_docker/molecule.yml +++ b/ansible/playbooks/molecule_docker/molecule/teleop_client_check_desktop_icons_docker/molecule.yml @@ -19,6 +19,8 @@ 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/teleop/group_vars 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 6be81ddf4..c2964cd2a 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 @@ -5,7 +5,7 @@ tag="melodic-release" reinstall=true use_openvpn=false - ethercat_interface="enp0s25" + ethercat_right_hand="enp0s25" nvidia_docker=false allow_auto_reboot=true bimanual=true @@ -14,3 +14,5 @@ ethercat_left_arm="enx0002" config_branch="bimanual_demohands_B_D" skip_molecule_task=true + ansible_become_password=ubuntu + ansible_ssh_pass=ubuntu 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 274622d37..41d8cf64f 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 @@ -19,6 +19,8 @@ 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/teleop/group_vars 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 a3d27549e..1f69b38cc 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 @@ -3,7 +3,7 @@ import_playbook: ../../../teleop_deploy.yml reinstall=true use_openvpn=false - ethercat_interface="enp0s25" + ethercat_right_hand="enp0s25" image="shadowrobot/dexterous-hand" tag="melodic-release" nvidia_docker=false 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 898453322..823bc39dd 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 @@ -23,6 +23,8 @@ 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/teleop/group_vars 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 6e903695e..f9d5006e8 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,6 +1,5 @@ import os import testinfra.utils.ansible_runner -import docker testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') 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 a32f05605..0176d7897 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 @@ -3,7 +3,7 @@ import_playbook: ../../../teleop_deploy.yml reinstall=true use_openvpn=false - ethercat_interface="enp0s25" + ethercat_right_hand="enp0s25" image="shadowrobot/dexterous-hand" tag="melodic-release" nvidia_docker=false 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 52656cf7a..684958b6f 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 @@ -19,6 +19,8 @@ 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/teleop/group_vars 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 db07a0a14..a5ccb76d0 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 @@ -111,7 +111,7 @@ def test_icons_in_docker(host): 'shadow_local_zero_force_mode_right_launcher', 'shadow_local_zero_force_mode_left_launcher', 'shadow_zero_force_mode_right', - 'shadow_zero_force_mode_left' + 'shadow_zero_force_mode_left' ) for icon in icons: assert host.file(desktop_path+icon+'.desktop').exists 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 ec3d229e1..496d30f70 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 @@ -19,6 +19,8 @@ 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/teleop/group_vars 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 1c7f52831..485f2f1fb 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 @@ -4,6 +4,7 @@ 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) + \ diff --git a/ansible/playbooks/server_and_nuc_deploy.yml b/ansible/playbooks/server_and_nuc_deploy.yml index 641ef4ff0..8b3d331ee 100644 --- a/ansible/playbooks/server_and_nuc_deploy.yml +++ b/ansible/playbooks/server_and_nuc_deploy.yml @@ -41,7 +41,13 @@ hosts: server pre_tasks: - name: No product is defined - when: product != 'hand_e' and product != 'arm_hand_e' and product != 'hand_lite' and product != 'arm_hand_lite' and product != 'hand_extra_lite' and product != 'arm_hand_extra_lite' and product != 'hand_h' + when: (product != 'hand_e') and + (product != 'arm_hand_e') and + (product != 'hand_lite') and + (product != 'arm_hand_lite') and + (product != 'hand_extra_lite') and + (product != 'arm_hand_extra_lite') and + (product != 'hand_h') meta: end_play - name: check if customer_key is provided and not false @@ -65,13 +71,24 @@ become: yes roles: - - { role: products/hand-e/server/deploy, when: product == 'hand_e' or product == 'arm_hand_e' or product == 'hand_lite' or product == 'arm_hand_lite' or product == 'hand_extra_lite' or product == 'arm_hand_extra_lite' } + - { role: products/hand-e/server/deploy, when: (product == 'hand_e') or + (product == 'arm_hand_e') or + (product == 'hand_lite') or + (product == 'arm_hand_lite') or + (product == 'hand_extra_lite') or + (product == 'arm_hand_extra_lite') } - name: Install Hand software on control machine hosts: control_machine pre_tasks: - name: No product is defined - when: product != 'hand_e' and product != 'arm_hand_e' and product != 'hand_lite' and product != 'arm_hand_lite' and product != 'hand_extra_lite' and product != 'arm_hand_extra_lite' and product != 'hand_h' + when: (product != 'hand_e') and + (product != 'arm_hand_e') and + (product != 'hand_lite') and + (product != 'arm_hand_lite') and + (product != 'hand_extra_lite') and + (product != 'arm_hand_extra_lite') and + (product != 'hand_h') meta: end_play - name: check if customer_key is provided and not false @@ -95,7 +112,12 @@ become: yes roles: - - { role: products/hand-e/control_machine/deploy, when: product == 'hand_e' or product == 'arm_hand_e' or product == 'hand_lite' or product == 'arm_hand_lite' or product == 'hand_extra_lite' or product == 'arm_hand_extra_lite' } + - { role: products/hand-e/control_machine/deploy, when: (product == 'hand_e') or + (product == 'arm_hand_e') or + (product == 'hand_lite') or + (product == 'arm_hand_lite') or + (product == 'hand_extra_lite') or + (product == 'arm_hand_extra_lite')} - name: Inform user for reboot hosts: 127.0.0.1 diff --git a/ansible/roles/products/common/docker-container/defaults/main.yml b/ansible/roles/products/common/docker-container/defaults/main.yml index 3f92d5e3c..7535cdc9a 100644 --- a/ansible/roles/products/common/docker-container/defaults/main.yml +++ b/ansible/roles/products/common/docker-container/defaults/main.yml @@ -3,7 +3,7 @@ container_name: "dexterous_hand_real_hw" image: "shadowrobot/dexterous-hand" tag: "melodic-release" full_image_name: "shadowrobot/dexterous-hand:melodic-release" -ethercat_interface: "eth0" +ethercat_right_hand: "eth0" launch_hand: true config_branch: "" use_cyberglove: false 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 0cb2e3688..e6389e292 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 @@ -18,7 +18,7 @@ pull: yes env: verbose: "true" - interface: "{{ ethercat_interface }}" + interface: "{{ ethercat_right_hand }}" interface_left: "{{ ethercat_left_hand }}" QT_X11_NO_MITSHM: "1" LOCAL_USER_ID: "{{ id.stdout }}" 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 fadd5197f..aae5c5d26 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 @@ -13,7 +13,7 @@ pull: yes env: verbose: "true" - interface: "{{ ethercat_interface }}" + interface: "{{ ethercat_right_hand }}" interface_left: "{{ ethercat_left_hand }}" QT_X11_NO_MITSHM: "1" LOCAL_USER_ID: "{{ id.stdout }}" 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 15bf234d3..dda991cfa 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 @@ -13,7 +13,7 @@ runtime: "{{ docker_runtime }}" env: verbose: "true" - interface: "{{ ethercat_interface }}" + interface: "{{ ethercat_right_hand }}" interface_left: "{{ ethercat_left_hand }}" QT_X11_NO_MITSHM: "1" LOCAL_USER_ID: "{{ id.stdout }}" 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 615575bc9..cc749a9dd 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 @@ -18,7 +18,7 @@ pull: yes env: verbose: "true" - interface: "{{ ethercat_interface }}" + interface: "{{ ethercat_right_hand }}" interface_left: "{{ ethercat_left_hand }}" QT_X11_NO_MITSHM: "1" LOCAL_USER_ID: "{{ id.stdout }}" 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 8e57217c8..08bd62930 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 @@ -13,7 +13,7 @@ pull: yes env: verbose: "true" - interface: "{{ ethercat_interface }}" + interface: "{{ ethercat_right_hand }}" interface_left: "{{ ethercat_left_hand }}" QT_X11_NO_MITSHM: "1" LOCAL_USER_ID: "{{ id.stdout }}" 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 2f3f19973..805815198 100644 --- a/ansible/roles/products/common/local-hand-launch/defaults/main.yml +++ b/ansible/roles/products/common/local-hand-launch/defaults/main.yml @@ -12,7 +12,7 @@ icon_folder: "{{ user_folder }}/Desktop/Shadow Advanced Launchers" launch_hand: false override_launch_hand: false config_branch: "" -ethercat_interface: "enx0" +ethercat_right_hand: "enx0" ethercat_left_hand: "enx1" hand_serial: "1082" hand_serial_left: "2346" 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 2c0920a76..c934bd62a 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 @@ -10,7 +10,7 @@ container_name: "dexterous_hand_real_hw" setup_directory: "/usr/local/bin" hand_serial: "1082" hand_serial_left: "2346" -ethercat_interface: "eth0" +ethercat_right_hand: "eth0" ethercat_left_hand: "eth1" icon_folder: "{{ user_folder }}/Desktop/Shadow Advanced Launchers" launch_hand: 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 bbbd04e7e..e79fea145 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 @@ -26,7 +26,7 @@ dest: "{{ shadow_hand_launcher_folder }}/{{ local_zero_force_mode_right_hand_script }}" mode: '755' vars: - launch_file_name: "sr_hardware_control_loop.launch hand_serial:={{ hand_serial }} eth_port:={{ ethercat_interface }} side:=right pwm_control:=false hand_ctrl:=false arm:=false" + launch_file_name: "sr_hardware_control_loop.launch hand_serial:={{ hand_serial }} eth_port:={{ ethercat_right_hand }} side:=right pwm_control:=false hand_ctrl:=false arm:=false" launch_package_name: "sr_robot_launch" override_launch_hand: True when: bimanual|bool or hand_side=="right" 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 bcb3c1d29..8670b5ff8 100644 --- a/ansible/roles/products/common/resources/templates/scripts/setup-hand.j2 +++ b/ansible/roles/products/common/resources/templates/scripts/setup-hand.j2 @@ -8,9 +8,9 @@ if [ ! -z {{ config_branch }} ]; then git checkout sr_lhand.launch git checkout sr_bimanual.launch git checkout {{ config_branch }} - sed -i 's|eth_port" value=.*|eth_port" value="{{ ethercat_interface }}" />|' $(rospack find sr_ethercat_hand_config)/launch/sr_rhand.launch + sed -i 's|eth_port" value=.*|eth_port" value="{{ ethercat_right_hand }}" />|' $(rospack find sr_ethercat_hand_config)/launch/sr_rhand.launch sed -i 's|eth_port" value=.*|eth_port" value="{{ ethercat_left_hand }}" />|' $(rospack find sr_ethercat_hand_config)/launch/sr_lhand.launch - sed -i 's|eth_port" value=.*|eth_port" value="{{ ethercat_interface }}_{{ ethercat_left_hand }}" />|' $(rospack find sr_ethercat_hand_config)/launch/sr_bimanual.launch + sed -i 's|eth_port" value=.*|eth_port" value="{{ ethercat_right_hand }}_{{ ethercat_left_hand }}" />|' $(rospack find sr_ethercat_hand_config)/launch/sr_bimanual.launch sed -i 's|rh_serial" value=.*|rh_serial" value="{{ hand_serial }}" />|' $(rospack find sr_ethercat_hand_config)/launch/sr_bimanual.launch sed -i 's|lh_serial" value=.*|lh_serial" value="{{ hand_serial_left }}" />|' $(rospack find sr_ethercat_hand_config)/launch/sr_bimanual.launch sed -i 's|rh_mapping_path" value=.*|rh_mapping_path" value="{{ mapping_path_right }}" />|' $(rospack find sr_ethercat_hand_config)/launch/sr_bimanual.launch 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 1d86aaefc..4915ad42a 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 @@ -3,7 +3,7 @@ image: "shadowrobot/dexterous-hand" tag: "melodic-release" reinstall: false container_name: "dexterous_hand_real_hw" -ethercat_interface: "eth0" +ethercat_right_hand: "eth0" ethercat_left_hand: "enx1" ethercat_left_arm: "enx2" ethercat_right_arm: "enp3s0" diff --git a/ansible/roles/products/hand-e/deploy/defaults/main.yml b/ansible/roles/products/hand-e/deploy/defaults/main.yml index b777ffd5d..b67b1bc57 100644 --- a/ansible/roles/products/hand-e/deploy/defaults/main.yml +++ b/ansible/roles/products/hand-e/deploy/defaults/main.yml @@ -2,7 +2,7 @@ container_name: "dexterous_hand_real_hw" image: "shadowrobot/dexterous-hand" tag: "melodic-release" -ethercat_interface: "eth0" +ethercat_right_hand: "eth0" ethercat_left_hand: "eth1" demo_icons: false user: "{{ ansible_user_id }}" 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 5f3127a0d..34fab5ae3 100644 --- a/ansible/roles/products/hand-e/server/deploy/defaults/main.yml +++ b/ansible/roles/products/hand-e/server/deploy/defaults/main.yml @@ -5,7 +5,7 @@ reinstall: false container_name: "dexterous_hand_real_hw" nvidia_docker: true use_aws: false -ethercat_interface: "eth0" +ethercat_right_hand: "eth0" ethercat_left_hand: "eth0" ethercat_left_arm: "enx2" user: "{{ ansible_user_id }}" 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 74c99edbf..ddd24847b 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 @@ -192,7 +192,7 @@ hand_branch: "{{ config_branch }}" desktop_icon_name: "3 - Launch NUC Container and Right Hand Hardware Control Loop" desktop_icon_path: "Shadow Advanced Launchers/3 - Launch NUC Container and Right Hand Hardware Control Loop" - ethercat_interface_value: "{{ ethercat_interface }}" + ethercat_interface_value: "{{ ethercat_right_hand }}" hand_serial_value: "{{ hand_serial }}" hand_side_value: "right" xacro_value: "{{ xacro_right }}" @@ -210,7 +210,7 @@ mode: '755' vars: hand_serial_var: "{{ hand_serial }}" - ethercat_interface_var: "{{ ethercat_interface }}" + ethercat_interface_var: "{{ ethercat_right_hand }}" hand_side_var: "right" xacro_var: "{{ xacro_system }}" mapping_path_var: "{{ mapping_path_right }}" @@ -295,7 +295,7 @@ hand_branch: "{{ config_branch }}" desktop_icon_name: "3 - Zero Force Mode - Right Hand" desktop_icon_path: "Shadow Advanced Launchers/3 - Zero Force Mode - Right Hand" - ethercat_interface_value: "{{ ethercat_interface }}" + ethercat_interface_value: "{{ ethercat_right_hand }}" hand_serial_value: "{{ hand_serial }}" hand_side_value: "right" xacro_value: "{{ xacro_right }}" 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 1b04b8a8c..d81810078 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,7 +13,7 @@ if [ $chrony_status -eq 0 ]; then sleep 3 fi -ssh -X $NUC_NAME@$NUC_ADDRESS CONTAINER={{ container_name }} SR_BRANCH={{ config_branch }} HAND_SERIALN={{ hand_serial }} HAND_SERIALN_LEFT={{ hand_serial_left }} ETH_PORT={{ ethercat_interface }} ETH_PORT_LHAND={{ ethercat_left_hand }} HOST_IP=$LOCAL_IP NUC_ADDRESS=$NUC_ADDRESS UR_TYPE={{ ur_robot_type }} INCLUDE_WRIST_IN_ARM_CONTROLLER={{ include_wrist_in_arm_controller_var | lower }} 'bash -s' <<'ENDSSH' +ssh -X $NUC_NAME@$NUC_ADDRESS CONTAINER={{ container_name }} SR_BRANCH={{ config_branch }} HAND_SERIALN={{ hand_serial }} HAND_SERIALN_LEFT={{ hand_serial_left }} ETH_PORT={{ ethercat_right_hand }} ETH_PORT_LHAND={{ ethercat_left_hand }} HOST_IP=$LOCAL_IP NUC_ADDRESS=$NUC_ADDRESS UR_TYPE={{ ur_robot_type }} INCLUDE_WRIST_IN_ARM_CONTROLLER={{ include_wrist_in_arm_controller_var | lower }} '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) & XACRO='{{ xacro_system }}' MAPPING_RIGHT='{{ mapping_path_right }}' diff --git a/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc-bimanual.j2 b/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc-bimanual.j2 index 5586fd5e8..8496465b6 100644 --- a/ansible/roles/products/hand-e/server/desktop-icons/templates/scripts/start-docker-container-nuc-bimanual.j2 +++ b/ansible/roles/products/hand-e/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 }} SR_BRANCH={{ config_branch }} HAND_SERIALN={{ hand_serial }} HAND_SERIALN_LEFT={{ hand_serial_left }} ETH_PORT={{ ethercat_interface }} ETH_PORT_LHAND={{ ethercat_left_hand }} HOST_IP=$LOCAL_IP NUC_ADDRESS=$NUC_ADDRESS UR_TYPE={{ ur_robot_type }} 'bash -s' <<'ENDSSH' +ssh -X $NUC_NAME@$NUC_ADDRESS CONTAINER={{ container_name }} SR_BRANCH={{ config_branch }} HAND_SERIALN={{ hand_serial }} HAND_SERIALN_LEFT={{ hand_serial_left }} ETH_PORT={{ ethercat_right_hand }} ETH_PORT_LHAND={{ ethercat_left_hand }} HOST_IP=$LOCAL_IP NUC_ADDRESS=$NUC_ADDRESS UR_TYPE={{ ur_robot_type }} '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) & XACRO='{{ xacro_bimanual }}' MAPPING_RIGHT='{{ mapping_path_right }}' diff --git a/ansible/roles/products/hand-h/deploy/defaults/main.yml b/ansible/roles/products/hand-h/deploy/defaults/main.yml index c97c16a09..9ee4eb7b2 100644 --- a/ansible/roles/products/hand-h/deploy/defaults/main.yml +++ b/ansible/roles/products/hand-h/deploy/defaults/main.yml @@ -2,7 +2,7 @@ container_name: "flexible_hand_real_hw" user: "user" password: "password" -ethercat_interface: "eth0" +ethercat_right_hand: "eth0" image: "shadowrobot/flexible-hand" tag: "melodic-release" full_image_name: "shadowrobot/flexible-hand:melodic-release" \ No newline at end of file diff --git a/ansible/roles/products/teleop/client/deploy/defaults/main.yml b/ansible/roles/products/teleop/client/deploy/defaults/main.yml index 65f420afd..526d3d0ef 100644 --- a/ansible/roles/products/teleop/client/deploy/defaults/main.yml +++ b/ansible/roles/products/teleop/client/deploy/defaults/main.yml @@ -9,7 +9,7 @@ cyberglove: "" use_aws: false use_openvpn: false setup_directory: "/usr/local/bin" -ethercat_interface: "eth0" +ethercat_right_hand: "eth0" config_branch: "" allow_auto_reboot: true user: "{{ ansible_user_id }}" @@ -33,3 +33,5 @@ mapping_path_left: "$(find sr_edc_launch)/mappings/default_mappings/lh_E_v4.yaml sim_hand: false launch_package_name: "sr_ethercat_hand_config" launch_file_name: "sr_rhand.launch" +hand_serial: "1082" +hand_serial_left: "2346" diff --git a/ansible/roles/products/teleop/client/deploy/tasks/main.yml b/ansible/roles/products/teleop/client/deploy/tasks/main.yml index 6b7dd6d82..b62278fbb 100644 --- a/ansible/roles/products/teleop/client/deploy/tasks/main.yml +++ b/ansible/roles/products/teleop/client/deploy/tasks/main.yml @@ -47,6 +47,11 @@ ros_master: "{{ server_hostname }}" container_terminal_title: "Teleop Client Container" +- name: Include products/common/hand-parameters role + include_role: + name: products/common/hand-parameters + when: config_branch is defined and config_branch | length > 0 + - name: Include docker/aws role include_role: name: docker/aws diff --git a/ansible/roles/products/teleop/server/deploy/defaults/main.yml b/ansible/roles/products/teleop/server/deploy/defaults/main.yml index a743bb3f0..e392fc1a9 100644 --- a/ansible/roles/products/teleop/server/deploy/defaults/main.yml +++ b/ansible/roles/products/teleop/server/deploy/defaults/main.yml @@ -8,7 +8,7 @@ glove: "shadow_glove" cyberglove: "" use_aws: false use_openvpn: false -ethercat_interface: "eth0" +ethercat_right_hand: "eth0" ethercat_left_hand: "eth0" ethercat_left_arm: "enx2" user: "{{ ansible_user_id }}" 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 b5494f940..d9f6cb1b2 100644 --- a/ansible/roles/products/teleop/server/desktop-icons/defaults/main.yml +++ b/ansible/roles/products/teleop/server/desktop-icons/defaults/main.yml @@ -13,7 +13,7 @@ remote_cyberglove: false sim_icon: false upgrade_script: false hand_side_var: right -ethercat_interface: "eth00" +ethercat_right_hand: "eth00" ethercat_left_hand: "eth01" ethercat_interface_var: "eth0" ethercat_interface_value: "eth0" 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 9524045ee..1a471f743 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 @@ -7,7 +7,7 @@ config_branch_value: "demohand_A" 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" - ethercat_interface_value: "{{ ethercat_interface }}" + ethercat_interface_value: "{{ ethercat_right_hand }}" hand_serial_value: "634" hand_side_value: "right" mapping_path_value: "$(find sr_edc_launch)/mappings/default_mappings/rh_E_v3.yaml" @@ -20,7 +20,7 @@ config_branch_value: "demohand_B" 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" - ethercat_interface_value: "{{ ethercat_interface }}" + ethercat_interface_value: "{{ ethercat_right_hand }}" hand_serial_value: "1130" hand_side_value: "right" mapping_path_value: "$(find sr_edc_launch)/mappings/default_mappings/rh_E_v3.yaml" @@ -33,7 +33,7 @@ config_branch_value: "demohand_C" 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" - ethercat_interface_value: "{{ ethercat_interface }}" + ethercat_interface_value: "{{ ethercat_right_hand }}" hand_serial_value: "1370" hand_side_value: "right" mapping_path_value: "$(find sr_edc_launch)/mappings/default_mappings/rh_E_v3.yaml" 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 1b204284b..d2912a97e 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 @@ -135,7 +135,7 @@ config_branch_value: "{{ config_branch }}" desktop_icon_name: "3 - Launch NUC Right Side Teleop Hardware Control Loop" desktop_icon_path: "Shadow Advanced Launchers/3 - Launch NUC Right Side Teleop Hardware Control Loop" - ethercat_interface_value: "{{ ethercat_interface }}" + ethercat_interface_value: "{{ ethercat_right_hand }}" hand_serial_value: "{{ hand_serial }}" hand_side_value: "right" mapping_path_value: "{{ mapping_path_right }}" @@ -454,7 +454,7 @@ hand_branch: "{{ config_branch }}" desktop_icon_name: "3 - Zero Force Mode - Right Hand" desktop_icon_path: "Shadow Advanced Launchers/3 - Zero Force Mode - Right Hand" - ethercat_interface_value: "{{ ethercat_interface }}" + ethercat_interface_value: "{{ ethercat_right_hand }}" hand_serial_value: "{{ hand_serial }}" hand_side_value: "right" xacro_value: "{{ xacro_right }}" 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 1392ba50b..93e869d18 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 }} SR_BRANCH={{ config_branch_var }} HAND_SERIALN={{ hand_serial }} HAND_SERIALN_LEFT={{ hand_serial_left }} ETH_PORT={{ ethercat_interface }} ETH_PORT_LHAND={{ ethercat_left_hand }} 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 }} SR_BRANCH={{ config_branch_var }} HAND_SERIALN={{ hand_serial }} HAND_SERIALN_LEFT={{ hand_serial_left }} ETH_PORT={{ ethercat_right_hand }} ETH_PORT_LHAND={{ ethercat_left_hand }} HOST_IP=$LOCAL_IP NUC_ADDRESS=$NUC_ADDRESS UR_TYPE={{ ur_robot_type }} BIOTACS={{ biotacs | lower }} '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) & MAPPING_RIGHT='{{ mapping_path_right }}' MAPPING_LEFT='{{ mapping_path_left }}'