From d758113b377bdc58dde0a2acfbf24ea3c0d5569f Mon Sep 17 00:00:00 2001 From: tokuda99 Date: Mon, 10 Jun 2024 22:06:04 +0900 Subject: [PATCH 01/11] fix: update tier4_hdr_camera_driver tasks - Added a task to check if the GitHub API return is valid - Added a task to ensure driver_deb_download_url is defined - Added tasks to extract and fix the driver tar.gz file - Added a task to run the installation script - Removed the task to install the driver from deb file - Removed the task to install the SDK from deb file - Updated the task to setup camera driver and SDK --- .../tier4_hdr_camera_driver/tasks/main.yaml | 46 ++++++++++++++----- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/ansible/roles/tier4_hdr_camera_driver/tasks/main.yaml b/ansible/roles/tier4_hdr_camera_driver/tasks/main.yaml index 5b77a21..9667d54 100644 --- a/ansible/roles/tier4_hdr_camera_driver/tasks/main.yaml +++ b/ansible/roles/tier4_hdr_camera_driver/tasks/main.yaml @@ -3,12 +3,22 @@ url: "{{ camera_driver_repo }}" register: github_api_return_info +- name: Check if GitHub API return is valid + fail: + msg: "Failed to fetch data from GitHub API." + when: github_api_return_info.status != 200 + - name: Parse download URL for driver loop: "{{ github_api_return_info.json.assets }}" ansible.builtin.set_fact: driver_deb_download_url: "{{ item.browser_download_url }}" driver_deb_name: "{{ item.name }}" - when: item.name | regex_search('tier4-camera-gmsl_(.+)_arm64.deb') + when: item.name | regex_search('tier4-camera-drivers-for-anvil.tar.gz') + +- name: Ensure driver_deb_download_url is defined + fail: + msg: "driver_deb_download_url is not defined. Check the regex or GitHub API response." + when: driver_deb_download_url is not defined - name: Parse download URL for SDK loop: "{{ github_api_return_info.json.assets }}" @@ -17,12 +27,33 @@ sdk_deb_name: "{{ item.name }}" when: item.name | regex_search('t4cam_sdk-(.+)-rqx58g.deb') -- name: Download driver deb file from public repo - ansible.builtin.uri: +- name: Download driver tar.gz file from public repo + ansible.builtin.get_url: url: "{{ driver_deb_download_url }}" dest: "{{ camera_driver_download_dir }}/{{ driver_deb_name }}" mode: 0644 +- name: Extract driver tar.gz file + ansible.builtin.unarchive: + src: "{{ camera_driver_download_dir }}/{{ driver_deb_name }}" + dest: "{{ camera_driver_download_dir }}" + remote_src: yes + +- name: Ensure install.sh has execute permission + ansible.builtin.file: + path: "{{ camera_driver_download_dir }}/tier4-camera-drivers-for-anvil/install.sh" + mode: '0755' + state: file + +- name: Fix shebang line in install.sh + ansible.builtin.shell: | + sed -i '1s/^#\/bin\/bash$/#!\/bin\/bash/' {{ camera_driver_download_dir }}/tier4-camera-drivers-for-anvil/install.sh + +- name: Run installation script + command: "echo $EUID && c {{ camera_driver_download_dir }}/tier4-camera-drivers-for-anvil/install.sh" + become: true + become_user: root + - name: Download SDK deb file from public repo ansible.builtin.uri: url: "{{ sdk_deb_download_url }}" @@ -45,21 +76,12 @@ - name: Setup camera driver and SDK become: true block: - - name: Install driver from deb file - ansible.builtin.apt: - deb: "{{ camera_driver_download_dir }}/{{ driver_deb_name }}" - state: present - name: Post process ansible.builtin.shell: cmd: | /opt/nvidia/jetson-io/config-by-hardware.py -n 2="TIERIV ISX021 GMSL2 Camera Device Tree Overlay" # noqa no-changed-when # TODO: check dtb file - - name: Install SDK from deb file - ansible.builtin.apt: - deb: "{{ camera_driver_download_dir }}/{{ sdk_deb_name }}" - state: present - when: sdk_deb_download_url is defined - name: Setup C1 configuration block: From a8b9caca7de654bf9a404598a0eafc20630db00c Mon Sep 17 00:00:00 2001 From: tokuda99 Date: Thu, 13 Jun 2024 17:26:57 +0900 Subject: [PATCH 02/11] Revert "fix: update tier4_hdr_camera_driver tasks" This reverts commit d758113b377bdc58dde0a2acfbf24ea3c0d5569f. --- .../tier4_hdr_camera_driver/tasks/main.yaml | 46 +++++-------------- 1 file changed, 12 insertions(+), 34 deletions(-) diff --git a/ansible/roles/tier4_hdr_camera_driver/tasks/main.yaml b/ansible/roles/tier4_hdr_camera_driver/tasks/main.yaml index 9667d54..5b77a21 100644 --- a/ansible/roles/tier4_hdr_camera_driver/tasks/main.yaml +++ b/ansible/roles/tier4_hdr_camera_driver/tasks/main.yaml @@ -3,22 +3,12 @@ url: "{{ camera_driver_repo }}" register: github_api_return_info -- name: Check if GitHub API return is valid - fail: - msg: "Failed to fetch data from GitHub API." - when: github_api_return_info.status != 200 - - name: Parse download URL for driver loop: "{{ github_api_return_info.json.assets }}" ansible.builtin.set_fact: driver_deb_download_url: "{{ item.browser_download_url }}" driver_deb_name: "{{ item.name }}" - when: item.name | regex_search('tier4-camera-drivers-for-anvil.tar.gz') - -- name: Ensure driver_deb_download_url is defined - fail: - msg: "driver_deb_download_url is not defined. Check the regex or GitHub API response." - when: driver_deb_download_url is not defined + when: item.name | regex_search('tier4-camera-gmsl_(.+)_arm64.deb') - name: Parse download URL for SDK loop: "{{ github_api_return_info.json.assets }}" @@ -27,33 +17,12 @@ sdk_deb_name: "{{ item.name }}" when: item.name | regex_search('t4cam_sdk-(.+)-rqx58g.deb') -- name: Download driver tar.gz file from public repo - ansible.builtin.get_url: +- name: Download driver deb file from public repo + ansible.builtin.uri: url: "{{ driver_deb_download_url }}" dest: "{{ camera_driver_download_dir }}/{{ driver_deb_name }}" mode: 0644 -- name: Extract driver tar.gz file - ansible.builtin.unarchive: - src: "{{ camera_driver_download_dir }}/{{ driver_deb_name }}" - dest: "{{ camera_driver_download_dir }}" - remote_src: yes - -- name: Ensure install.sh has execute permission - ansible.builtin.file: - path: "{{ camera_driver_download_dir }}/tier4-camera-drivers-for-anvil/install.sh" - mode: '0755' - state: file - -- name: Fix shebang line in install.sh - ansible.builtin.shell: | - sed -i '1s/^#\/bin\/bash$/#!\/bin\/bash/' {{ camera_driver_download_dir }}/tier4-camera-drivers-for-anvil/install.sh - -- name: Run installation script - command: "echo $EUID && c {{ camera_driver_download_dir }}/tier4-camera-drivers-for-anvil/install.sh" - become: true - become_user: root - - name: Download SDK deb file from public repo ansible.builtin.uri: url: "{{ sdk_deb_download_url }}" @@ -76,12 +45,21 @@ - name: Setup camera driver and SDK become: true block: + - name: Install driver from deb file + ansible.builtin.apt: + deb: "{{ camera_driver_download_dir }}/{{ driver_deb_name }}" + state: present - name: Post process ansible.builtin.shell: cmd: | /opt/nvidia/jetson-io/config-by-hardware.py -n 2="TIERIV ISX021 GMSL2 Camera Device Tree Overlay" # noqa no-changed-when # TODO: check dtb file + - name: Install SDK from deb file + ansible.builtin.apt: + deb: "{{ camera_driver_download_dir }}/{{ sdk_deb_name }}" + state: present + when: sdk_deb_download_url is defined - name: Setup C1 configuration block: From 3a019534abb1da1acfb2f76926f66f30c5372a63 Mon Sep 17 00:00:00 2001 From: tokuda99 Date: Thu, 13 Jun 2024 17:34:35 +0900 Subject: [PATCH 03/11] fix: Fix camera driver repository URL --- ansible/roles/tier4_hdr_camera_driver/defaults/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/tier4_hdr_camera_driver/defaults/main.yaml b/ansible/roles/tier4_hdr_camera_driver/defaults/main.yaml index 849feb2..30d996f 100644 --- a/ansible/roles/tier4_hdr_camera_driver/defaults/main.yaml +++ b/ansible/roles/tier4_hdr_camera_driver/defaults/main.yaml @@ -1,3 +1,3 @@ -camera_driver_repo: https://api.github.com/repos/tier4/tier4_automotive_hdr_camera/releases/latest +camera_driver_repo: https://api.github.com/repos/tier4/tier4_automotive_hdr_camera/releases/142093397 camera_driver_download_dir: /tmp exposure_time: 11000 From 5e461d8a68439f4074e1a4ac2985210ea2545515 Mon Sep 17 00:00:00 2001 From: urasakikeisuke Date: Tue, 18 Jun 2024 18:58:25 +0900 Subject: [PATCH 04/11] fix missing dependencies edge auto jetson launcher Signed-off-by: urasakikeisuke --- ansible/roles/artifacts/defaults/main.yaml | 1 + ansible/roles/artifacts/tasks/main.yaml | 80 ++++++++++++++++++++++ ansible/setup.yaml | 1 + autoware.repos | 8 +++ setup-dev-env.sh | 2 +- 5 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 ansible/roles/artifacts/defaults/main.yaml create mode 100644 ansible/roles/artifacts/tasks/main.yaml diff --git a/ansible/roles/artifacts/defaults/main.yaml b/ansible/roles/artifacts/defaults/main.yaml new file mode 100644 index 0000000..832ca2e --- /dev/null +++ b/ansible/roles/artifacts/defaults/main.yaml @@ -0,0 +1 @@ +script_download_dir: /tmp diff --git a/ansible/roles/artifacts/tasks/main.yaml b/ansible/roles/artifacts/tasks/main.yaml new file mode 100644 index 0000000..0d8bcf8 --- /dev/null +++ b/ansible/roles/artifacts/tasks/main.yaml @@ -0,0 +1,80 @@ +# tensorrt_yolox +- name: Create tensorrt_yolox directory inside {{ data_dir }} + ansible.builtin.file: + path: "{{ data_dir }}/tensorrt_yolox" + mode: "755" + state: directory + +- name: Download tensorrt_yolox/yolox-tiny.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/yolox-tiny.onnx + dest: "{{ data_dir }}/tensorrt_yolox/yolox-tiny.onnx" + mode: "644" + checksum: sha256:471a665f4243e654dff62578394e508db22ee29fe65d9e389dfc3b0f2dee1255 + +- name: Download tensorrt_yolox/yolox-sPlus-opt.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/yolox-sPlus-opt.onnx + dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-opt.onnx" + mode: "644" + checksum: sha256:36b0832177b01e6b278e00c7369f1de71e616c36261cbae50f0753d41289da01 + +- name: Download tensorrt_yolox/yolox-sPlus-opt.EntropyV2-calibration.table + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/yolox-sPlus-opt.EntropyV2-calibration.table + dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-opt.EntropyV2-calibration.table" + mode: "644" + checksum: sha256:b9e9d7da33342262ccaea4469b4d02b8abb32b6d7bf737f9e0883fece1b8f580 + +- name: Download tensorrt_yolox/yolox-sPlus-T4-960x960-pseudo-finetune.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/object_detection_yolox_s/v1/yolox-sPlus-T4-960x960-pseudo-finetune.onnx + dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-T4-960x960-pseudo-finetune.onnx" + mode: "644" + checksum: sha256:f5054e8a890c3be86dc1b4b89a5a36fb2279d4f6110b0159e793be062641bf65 + +- name: Download tensorrt_yolox/yolox-sPlus-T4-960x960-pseudo-finetune.EntropyV2-calibration.table + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/object_detection_yolox_s/v1/yolox-sPlus-T4-960x960-pseudo-finetune.EntropyV2-calibration.table + dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-T4-960x960-pseudo-finetune.EntropyV2-calibration.table" + mode: "644" + checksum: sha256:cc378d327db5616b0b3a4d077bf37100c25a50ecd22d2b542f54098da100f34c + +- name: Download tensorrt_yolox/label.txt + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/label.txt + dest: "{{ data_dir }}/tensorrt_yolox/label.txt" + mode: "644" + checksum: sha256:3540a365bfd6d8afb1b5d8df4ec47f82cb984760d3270c9b41dbbb3422d09a0c + +- name: Download tensorrt_yolox/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/object_detection_semseg_yolox_s/v1/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.onnx + dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.onnx" + mode: "644" + checksum: sha256:73b3812432cedf65cebf02ca4cb630542fc3b1671c4c0fbf7cee50fa38e416a8 + +- name: Download tensorrt_yolox/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.EntropyV2-calibration.table + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/object_detection_semseg_yolox_s/v1/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.EntropyV2-calibration.table + dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.EntropyV2-calibration.table" + mode: "644" + checksum: sha256:28cd6524d4bcdb2809592a225d28330433e58dc02c92169ea555b44c1a51a584 + +- name: Download tensorrt_yolox/semseg_color_map.csv + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/object_detection_semseg_yolox_s/v1/semseg_color_map.csv + dest: "{{ data_dir }}/tensorrt_yolox/semseg_color_map.csv" + mode: "644" + checksum: sha256:3d93ca05f31b63424d7d7246a01a2365953705a0ed3323ba5b6fddd744a4bfea + + diff --git a/ansible/setup.yaml b/ansible/setup.yaml index f7dfee4..a1f903f 100644 --- a/ansible/setup.yaml +++ b/ansible/setup.yaml @@ -19,6 +19,7 @@ [Warning] Do you want to configure the network? This configuration may overwrite the IP address of the specific network interface [y/N] private: false roles: + - role: artifacts - role: autoware - role: cuda - role: cyclonedds diff --git a/autoware.repos b/autoware.repos index 950dd09..a7ea7e7 100644 --- a/autoware.repos +++ b/autoware.repos @@ -58,3 +58,11 @@ repositories: type: git url: https://github.com/tier4/tensorrt_cmake_module.git version: main + demos: + type: git + url: https://github.com/ros2/demos.git + version: humble + autoware_internal_msgs: + type: git + url: https://github.com/autowarefoundation/autoware_internal_msgs.git + version: main diff --git a/setup-dev-env.sh b/setup-dev-env.sh index d991aff..893c333 100755 --- a/setup-dev-env.sh +++ b/setup-dev-env.sh @@ -49,7 +49,7 @@ export PATH="$HOME/.local/bin:$PATH" echo -e "\e[36mRunning ansible playbook to setup ECU.\e[0m" # Run ansible -if ansible-playbook "${SCRIPT_DIR}"/ansible/setup.yaml --ask-become-pass; then +if ansible-playbook "${SCRIPT_DIR}"/ansible/setup.yaml --ask-become-pass --extra-vars data_dir=$HOME/autoware_data; then echo -e "\e[32mCompleted.\e[0m" exit 0 else From f19a6b99cd2b76e9249bd3ecf6117a553563cf52 Mon Sep 17 00:00:00 2001 From: amc-nu Date: Thu, 18 Jul 2024 20:26:08 +0900 Subject: [PATCH 05/11] ros2. fix compilation Signed-off-by: amc-nu --- ansible/roles/ros2/tasks/main.yaml | 115 +++++++++++++++-------------- ansible/setup.yaml | 2 +- 2 files changed, 61 insertions(+), 56 deletions(-) diff --git a/ansible/roles/ros2/tasks/main.yaml b/ansible/roles/ros2/tasks/main.yaml index 1efa09f..25f06bf 100644 --- a/ansible/roles/ros2/tasks/main.yaml +++ b/ansible/roles/ros2/tasks/main.yaml @@ -17,32 +17,33 @@ - apt-transport-https install_recommends: false update_cache: true - - name: Add ROS 2 source list - shell: echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null - - name: Download gpg key - ansible.builtin.uri: - url: https://raw.githubusercontent.com/ros/rosdistro/master/ros.key - dest: /usr/share/keyrings/ros-archive-keyring.gpg - follow_redirects: all + # - name: Add ROS 2 source list + # shell: echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null + # - name: Download gpg key + # ansible.builtin.uri: + # url: https://raw.githubusercontent.com/ros/rosdistro/master/ros.key + # dest: /usr/share/keyrings/ros-archive-keyring.gpg + # follow_redirects: all - name: Apt install ansible.builtin.apt: name: - nvidia-jetpack + - nvidia-opencv - build-essential - cmake - git - libbullet-dev - libpython3-dev - python3-wheel - - python3-colcon-common-extensions + # - python3-colcon-common-extensions - python3-flake8 - python3-pip - python3-numpy - python3-pytest-cov - - python3-rosdep + # - python3-rosdep - python3-setuptools - - python3-vcstool - - python3-rosinstall-generator + # - python3-vcstool + # - python3-rosinstall-generator - libasio-dev - libtinyxml2-dev - libcunit1-dev @@ -74,6 +75,10 @@ - pytest - pybind11-global - importlib_resources + - rosdep + - vcstool + - colcon-common-extensions + - rosinstall-generator extra_args: -U become: true # need to sudo privilege to install packages globally @@ -209,26 +214,26 @@ path: "{{ source_build_dir }}/jetson-containers" register: opencv_build_dir_exist -- name: Build and install OpenCV - block: - - name: "{{ block_name }}: Download install script" - ansible.builtin.git: - repo: https://github.com/dusty-nv/jetson-containers.git - dest: "{{ source_build_dir }}/jetson-containers" - version: L4T-R35.1.0 - - name: "{{ block_name }}: install dependencies" - shell: ./opencv_install_deps.sh - args: - chdir: "{{ source_build_dir }}/jetson-containers/scripts" - become: true - - name: "{{ block_name }}: execute install script" - shell: ./opencv_install.sh https://nvidia.box.com/shared/static/5v89u6g5rb62fpz4lh0rz531ajo2t5ef.gz OpenCV-4.5.0-aarch64.tar.gz - args: - chdir: "{{ source_build_dir }}/jetson-containers/scripts" - become: true - vars: - block_name: OpenCV - when: not opencv_build_dir_exist.stat.exists +# - name: Build and install OpenCV +# block: +# - name: "{{ block_name }}: Download install script" +# ansible.builtin.git: +# repo: https://github.com/dusty-nv/jetson-containers.git +# dest: "{{ source_build_dir }}/jetson-containers" +# version: L4T-R35.1.0 +# - name: "{{ block_name }}: install dependencies" +# shell: ./opencv_install_deps.sh +# args: +# chdir: "{{ source_build_dir }}/jetson-containers/scripts" +# become: true +# - name: "{{ block_name }}: execute install script" +# shell: ./opencv_install.sh https://nvidia.box.com/shared/static/5v89u6g5rb62fpz4lh0rz531ajo2t5ef.gz OpenCV-4.5.0-aarch64.tar.gz +# args: +# chdir: "{{ source_build_dir }}/jetson-containers/scripts" +# become: true +# vars: +# block_name: OpenCV +# when: not opencv_build_dir_exist.stat.exists - name: Check YAML build directory existence ansible.builtin.stat: @@ -261,34 +266,34 @@ block_name: YAML when: not yaml_cpp_build_dir_exist.stat.exists -- name: Upgrade CMake - block: - - name: "{{ block_name }}: update gpg key" - shell: wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null - # Follow drirections here: https://apt.kitware.com/ - - name: "{{ block_name }}: update repository info" - ansible.builtin.apt_repository: - repo: deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ {{ ansible_distribution_release }} main - filename: kitware - - name: "{{ block_name }}: apt update" - ansible.builtin.apt: - update_cache: true - state: present +# - name: Upgrade CMake +# block: + # - name: "{{ block_name }}: update gpg key" + # shell: wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null + # # Follow drirections here: https://apt.kitware.com/ + # - name: "{{ block_name }}: update repository info" + # ansible.builtin.apt_repository: + # repo: deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ {{ ansible_distribution_release }} main + # filename: kitware + # - name: "{{ block_name }}: apt update" + # ansible.builtin.apt: + # update_cache: true + # state: present # - name: "{{ block_name }}: delete gpg key" # ansible.builtin.file: # path: /usr/share/keyrings/kitware-archive-keyring.gpg # state: absent - - name: "{{ block_name }}: install kitware-arcyhive-keyring" - ansible.builtin.apt: - name: kitware-archive-keyring - - name: "{{ block_name }}: install newer cmake" - ansible.builtin.apt: - name: cmake - install_recommends: false - state: latest - become: true - vars: - block_name: Upgrade CMake + # - name: "{{ block_name }}: install kitware-arcyhive-keyring" + # ansible.builtin.apt: + # name: kitware-archive-keyring + # - name: "{{ block_name }}: install newer cmake" + # ansible.builtin.apt: + # name: cmake + # install_recommends: false + # state: latest + # become: true + # vars: + # block_name: Upgrade CMake - name: update GCC block: diff --git a/ansible/setup.yaml b/ansible/setup.yaml index f7dfee4..d3c63cc 100644 --- a/ansible/setup.yaml +++ b/ansible/setup.yaml @@ -27,10 +27,10 @@ - role: calibration_tools - role: tier4_hdr_camera_driver when: prompt_install_camera_driver == 'y' - - role: ros2 - role: ptp4l_client when: prompt_configure_network == 'y' - role: enlarge_txqueue when: prompt_configure_network == 'y' - role: netplan when: prompt_configure_network == 'y' + - role: ros2 From 2464476e61fef97af53a6d10fd4e6c98729882bc Mon Sep 17 00:00:00 2001 From: amc-nu Date: Tue, 23 Jul 2024 12:27:14 +0900 Subject: [PATCH 06/11] roscube. ros2 build fixed Signed-off-by: amc-nu --- ansible/roles/ros2/tasks/main.yaml | 70 +++++++++++++++--------------- ansible/setup.yaml | 2 +- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/ansible/roles/ros2/tasks/main.yaml b/ansible/roles/ros2/tasks/main.yaml index 25f06bf..423bf2a 100644 --- a/ansible/roles/ros2/tasks/main.yaml +++ b/ansible/roles/ros2/tasks/main.yaml @@ -17,13 +17,13 @@ - apt-transport-https install_recommends: false update_cache: true - # - name: Add ROS 2 source list - # shell: echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null - # - name: Download gpg key - # ansible.builtin.uri: - # url: https://raw.githubusercontent.com/ros/rosdistro/master/ros.key - # dest: /usr/share/keyrings/ros-archive-keyring.gpg - # follow_redirects: all + - name: Add ROS 2 source list + shell: echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null + - name: Download gpg key + ansible.builtin.uri: + url: https://raw.githubusercontent.com/ros/rosdistro/master/ros.key + dest: /usr/share/keyrings/ros-archive-keyring.gpg + follow_redirects: all - name: Apt install ansible.builtin.apt: name: @@ -266,34 +266,34 @@ block_name: YAML when: not yaml_cpp_build_dir_exist.stat.exists -# - name: Upgrade CMake -# block: - # - name: "{{ block_name }}: update gpg key" - # shell: wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null - # # Follow drirections here: https://apt.kitware.com/ - # - name: "{{ block_name }}: update repository info" - # ansible.builtin.apt_repository: - # repo: deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ {{ ansible_distribution_release }} main - # filename: kitware - # - name: "{{ block_name }}: apt update" - # ansible.builtin.apt: - # update_cache: true - # state: present - # - name: "{{ block_name }}: delete gpg key" - # ansible.builtin.file: - # path: /usr/share/keyrings/kitware-archive-keyring.gpg - # state: absent - # - name: "{{ block_name }}: install kitware-arcyhive-keyring" - # ansible.builtin.apt: - # name: kitware-archive-keyring - # - name: "{{ block_name }}: install newer cmake" - # ansible.builtin.apt: - # name: cmake - # install_recommends: false - # state: latest - # become: true - # vars: - # block_name: Upgrade CMake +- name: Upgrade CMake + block: + # Follow drirections here: https://apt.kitware.com/ + - name: "{{ block_name }}: update repository info" + ansible.builtin.apt_repository: + repo: deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ {{ ansible_distribution_release }} main + filename: kitware + - name: "{{ block_name }}: delete gpg key" + ansible.builtin.file: + path: /usr/share/keyrings/kitware-archive-keyring.gpg + state: absent + - name: "{{ block_name }}: update gpg key" + shell: wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null + - name: "{{ block_name }}: apt update" + ansible.builtin.apt: + update_cache: true + state: present + - name: "{{ block_name }}: install kitware-archive-keyring" + ansible.builtin.apt: + name: kitware-archive-keyring + - name: "{{ block_name }}: install newer cmake" + ansible.builtin.apt: + name: cmake + install_recommends: false + state: latest + become: true + vars: + block_name: Upgrade CMake - name: update GCC block: diff --git a/ansible/setup.yaml b/ansible/setup.yaml index e09b85c..a1f903f 100644 --- a/ansible/setup.yaml +++ b/ansible/setup.yaml @@ -28,10 +28,10 @@ - role: calibration_tools - role: tier4_hdr_camera_driver when: prompt_install_camera_driver == 'y' + - role: ros2 - role: ptp4l_client when: prompt_configure_network == 'y' - role: enlarge_txqueue when: prompt_configure_network == 'y' - role: netplan when: prompt_configure_network == 'y' - - role: ros2 From 5e689f64467289f231c1b966a06bc7fe98f79541 Mon Sep 17 00:00:00 2001 From: amc-nu Date: Wed, 24 Jul 2024 19:29:40 +0900 Subject: [PATCH 07/11] reorder tasks order Signed-off-by: amc-nu --- ansible/roles/ros2/tasks/main.yaml | 11 ++--------- ansible/setup.yaml | 12 ++++++------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/ansible/roles/ros2/tasks/main.yaml b/ansible/roles/ros2/tasks/main.yaml index 423bf2a..77a2576 100644 --- a/ansible/roles/ros2/tasks/main.yaml +++ b/ansible/roles/ros2/tasks/main.yaml @@ -269,23 +269,16 @@ - name: Upgrade CMake block: # Follow drirections here: https://apt.kitware.com/ + - name: "{{ block_name }}: update gpg key" + shell: wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null - name: "{{ block_name }}: update repository info" ansible.builtin.apt_repository: repo: deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ {{ ansible_distribution_release }} main filename: kitware - - name: "{{ block_name }}: delete gpg key" - ansible.builtin.file: - path: /usr/share/keyrings/kitware-archive-keyring.gpg - state: absent - - name: "{{ block_name }}: update gpg key" - shell: wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null - name: "{{ block_name }}: apt update" ansible.builtin.apt: update_cache: true state: present - - name: "{{ block_name }}: install kitware-archive-keyring" - ansible.builtin.apt: - name: kitware-archive-keyring - name: "{{ block_name }}: install newer cmake" ansible.builtin.apt: name: cmake diff --git a/ansible/setup.yaml b/ansible/setup.yaml index a1f903f..e04aefb 100644 --- a/ansible/setup.yaml +++ b/ansible/setup.yaml @@ -20,6 +20,12 @@ private: false roles: - role: artifacts + - role: ptp4l_client + when: prompt_configure_network == 'y' + - role: enlarge_txqueue + when: prompt_configure_network == 'y' + - role: netplan + when: prompt_configure_network == 'y' - role: autoware - role: cuda - role: cyclonedds @@ -29,9 +35,3 @@ - role: tier4_hdr_camera_driver when: prompt_install_camera_driver == 'y' - role: ros2 - - role: ptp4l_client - when: prompt_configure_network == 'y' - - role: enlarge_txqueue - when: prompt_configure_network == 'y' - - role: netplan - when: prompt_configure_network == 'y' From ba8c028bf8c0a08b95937376cd9c4adaf222fb8a Mon Sep 17 00:00:00 2001 From: amc-nu Date: Thu, 5 Sep 2024 13:09:39 +0900 Subject: [PATCH 08/11] cspell. add missing words Signed-off-by: amc-nu --- .cspell.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.cspell.json b/.cspell.json index 029bb7c..f717c2d 100644 --- a/.cspell.json +++ b/.cspell.json @@ -152,6 +152,8 @@ "soruce", "TIERIV", "txqueue", - "txqueuelen" + "txqueuelen", + "semseg", + "adlinktech" ] } From 5bc90dc3dc8d9abf8e961a953116d68a949fa752 Mon Sep 17 00:00:00 2001 From: amc-nu Date: Thu, 5 Sep 2024 13:10:03 +0900 Subject: [PATCH 09/11] ansible. fix linting issues Signed-off-by: amc-nu --- ansible/roles/artifacts/defaults/main.yaml | 2 +- ansible/roles/artifacts/tasks/main.yaml | 2 -- ansible/roles/ros2/tasks/main.yaml | 29 ++-------------------- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/ansible/roles/artifacts/defaults/main.yaml b/ansible/roles/artifacts/defaults/main.yaml index 832ca2e..5fc8bb1 100644 --- a/ansible/roles/artifacts/defaults/main.yaml +++ b/ansible/roles/artifacts/defaults/main.yaml @@ -1 +1 @@ -script_download_dir: /tmp +artifacts_script_download_dir: /tmp diff --git a/ansible/roles/artifacts/tasks/main.yaml b/ansible/roles/artifacts/tasks/main.yaml index 0d8bcf8..8edc2e6 100644 --- a/ansible/roles/artifacts/tasks/main.yaml +++ b/ansible/roles/artifacts/tasks/main.yaml @@ -76,5 +76,3 @@ dest: "{{ data_dir }}/tensorrt_yolox/semseg_color_map.csv" mode: "644" checksum: sha256:3d93ca05f31b63424d7d7246a01a2365953705a0ed3323ba5b6fddd744a4bfea - - diff --git a/ansible/roles/ros2/tasks/main.yaml b/ansible/roles/ros2/tasks/main.yaml index 77a2576..a222d23 100644 --- a/ansible/roles/ros2/tasks/main.yaml +++ b/ansible/roles/ros2/tasks/main.yaml @@ -35,15 +35,11 @@ - libbullet-dev - libpython3-dev - python3-wheel - # - python3-colcon-common-extensions - python3-flake8 - python3-pip - python3-numpy - - python3-pytest-cov - # - python3-rosdep + - python3-pytest-covdep - python3-setuptools - # - python3-vcstool - # - python3-rosinstall-generator - libasio-dev - libtinyxml2-dev - libcunit1-dev @@ -214,27 +210,6 @@ path: "{{ source_build_dir }}/jetson-containers" register: opencv_build_dir_exist -# - name: Build and install OpenCV -# block: -# - name: "{{ block_name }}: Download install script" -# ansible.builtin.git: -# repo: https://github.com/dusty-nv/jetson-containers.git -# dest: "{{ source_build_dir }}/jetson-containers" -# version: L4T-R35.1.0 -# - name: "{{ block_name }}: install dependencies" -# shell: ./opencv_install_deps.sh -# args: -# chdir: "{{ source_build_dir }}/jetson-containers/scripts" -# become: true -# - name: "{{ block_name }}: execute install script" -# shell: ./opencv_install.sh https://nvidia.box.com/shared/static/5v89u6g5rb62fpz4lh0rz531ajo2t5ef.gz OpenCV-4.5.0-aarch64.tar.gz -# args: -# chdir: "{{ source_build_dir }}/jetson-containers/scripts" -# become: true -# vars: -# block_name: OpenCV -# when: not opencv_build_dir_exist.stat.exists - - name: Check YAML build directory existence ansible.builtin.stat: path: "{{ source_build_dir }}/yaml-cpp" @@ -268,7 +243,7 @@ - name: Upgrade CMake block: - # Follow drirections here: https://apt.kitware.com/ + # Follow directions here: https://apt.kitware.com/ - name: "{{ block_name }}: update gpg key" shell: wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null - name: "{{ block_name }}: update repository info" From 568f20c9853575aec80b7048d79de0675baff373 Mon Sep 17 00:00:00 2001 From: amc-nu Date: Thu, 5 Sep 2024 13:11:20 +0900 Subject: [PATCH 10/11] cspell. add missing package Signed-off-by: amc-nu --- .cspell.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.cspell.json b/.cspell.json index f717c2d..b9089a4 100644 --- a/.cspell.json +++ b/.cspell.json @@ -154,6 +154,7 @@ "txqueue", "txqueuelen", "semseg", - "adlinktech" + "adlinktech", + "covdep" ] } From 7145f42d2cfd2aede809b04b55e29e282e9b01dc Mon Sep 17 00:00:00 2001 From: amc-nu Date: Thu, 5 Sep 2024 13:13:47 +0900 Subject: [PATCH 11/11] precommit. fix SC2086 Signed-off-by: amc-nu --- setup-dev-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-dev-env.sh b/setup-dev-env.sh index 893c333..2ea07e5 100755 --- a/setup-dev-env.sh +++ b/setup-dev-env.sh @@ -49,7 +49,7 @@ export PATH="$HOME/.local/bin:$PATH" echo -e "\e[36mRunning ansible playbook to setup ECU.\e[0m" # Run ansible -if ansible-playbook "${SCRIPT_DIR}"/ansible/setup.yaml --ask-become-pass --extra-vars data_dir=$HOME/autoware_data; then +if ansible-playbook "${SCRIPT_DIR}"/ansible/setup.yaml --ask-become-pass --extra-vars data_dir="$HOME"/autoware_data; then echo -e "\e[32mCompleted.\e[0m" exit 0 else