From d316e37dace4645ce6b81a65bc4bbb98b097ab68 Mon Sep 17 00:00:00 2001 From: Akihito Ohsato Date: Mon, 19 Jun 2023 21:46:42 +0900 Subject: [PATCH] feat(edge-auto-jetson): Edge.Auto release (#27) * Feat: humble (#21) * feat: add a role to build humble natively Signed-off-by: Manato HIRABAYASHI * docs: update readme and figure Signed-off-by: Manato HIRABAYASHI * style(pre-commit): autofix --------- Signed-off-by: Manato HIRABAYASHI Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * docs(readme): new perception launch system (#9) * change: enable x11 forwarding for launch via ssh Signed-off-by: Akihito Ohsato * docs: modify readme for new launch system Signed-off-by: Akihito Ohsato * style: update readme Signed-off-by: Akihito Ohsato * style: rename repos file Signed-off-by: Akihito OHSATO * add: experimental.repos Signed-off-by: Akihito OHSATO * docs: modify readme for new launch system Signed-off-by: Akihito Ohsato * style: update readme Signed-off-by: Akihito Ohsato * style: rename repos file Signed-off-by: Akihito OHSATO * add: experimental.repos Signed-off-by: Akihito OHSATO * modify: update commands on README.md Signed-off-by: Akihito Ohsato --------- Signed-off-by: Akihito Ohsato Signed-off-by: Akihito OHSATO * fix(repo): edge-auto repositories (#24) * feat: update version of autoware.universe (#23) * feat: update version of autoware.universe Signed-off-by: Manato HIRABAYASHI * docs: update compile option on README Signed-off-by: Manato HIRABAYASHI --------- Signed-off-by: Manato HIRABAYASHI * feat(repos/ansible): add calibration_tools setup (#22) * add: calibration_tools setup Signed-off-by: Akihito Ohsato * style(pre-commit): autofix * fix: change ansible python version for pip Signed-off-by: Akihito OHSATO --------- Signed-off-by: Akihito Ohsato Signed-off-by: Akihito OHSATO Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(ansible): update environmental setup (#26) * feat: add a role to install ptp4l client Signed-off-by: Manato HIRABAYASHI * feat: add a role to install netplan Signed-off-by: Manato HIRABAYASHI * feat: udpate cyclodds setting Signed-off-by: Manato HIRABAYASHI * feat: udpate roles to insert `source` operations in user's .bashrc Signed-off-by: Manato HIRABAYASHI * feat: change default configuration on the camera driver installation Deserializers accept only C1 by default Signed-off-by: Manato HIRABAYASHI * feat: add a role to enlarge tx queue length Signed-off-by: Manato HIRABAYASHI * feat: change camera's default settings (set to FSYNC mode and fix exposure time) Signed-off-by: Manato HIRABAYASHI * feat: add option to switch network configuration Signed-off-by: Manato HIRABAYASHI * feat: add DHCP support Signed-off-by: Manato HIRABAYASHI --------- Signed-off-by: Manato HIRABAYASHI * feat(edge-auto-jetson/docs): edge.auto documentation (#25) --------- Signed-off-by: Manato HIRABAYASHI Signed-off-by: Akihito Ohsato Signed-off-by: Akihito OHSATO Co-authored-by: Manato Hirabayashi <3022416+manato@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug.yaml | 71 +++ .github/ISSUE_TEMPLATE/config.yml | 13 + .github/ISSUE_TEMPLATE/task.yaml | 42 ++ .github/PULL_REQUEST_TEMPLATE.md | 8 + .github/PULL_REQUEST_TEMPLATE/small-change.md | 40 ++ .../PULL_REQUEST_TEMPLATE/standard-change.md | 50 +++ .github/stale.yml | 12 + README.md | 148 ++----- ansible/roles/autoware/tasks/main.yaml | 8 + ansible/roles/calibration_tools/README.md | 1 + .../calibration_tools/defaults/main.yaml | 3 + .../roles/calibration_tools/tasks/main.yaml | 26 ++ ansible/roles/cyclonedds/defaults/main.yaml | 2 - ansible/roles/cyclonedds/tasks/main.yaml | 3 +- .../templates/cyclonedds.xml.jinja2 | 10 +- .../roles/enlarge_txqueue/defaults/main.yaml | 1 + ansible/roles/enlarge_txqueue/tasks/main.yaml | 6 + .../99-enlarge-txqueuelen.rules.jinja2 | 5 + ansible/roles/netplan/tasks/main.yaml | 16 + .../templates/99-edge-auto-jetson.yaml.jinja2 | 17 + ansible/roles/ptp4l_client/defaults/main.yaml | 1 + .../roles/ptp4l_client/files/ptp4l@.service | 13 + ansible/roles/ptp4l_client/tasks/main.yaml | 20 + ansible/roles/ros2/README.md | 8 + ansible/roles/ros2/tasks/main.yaml | 417 +++++++++++++++++ .../defaults/main.yaml | 1 + .../tier4_hdr_camera_driver/tasks/main.yaml | 65 ++- .../tasks/mod_or_add.yaml | 31 ++ ansible/setup.yaml | 21 + perception_ecu.repos => autoware.repos | 8 +- docs/connection.drawio.svg | 419 ------------------ docs/overview.drawio.svg | 268 +++++------ experimental.repos | 0 33 files changed, 1069 insertions(+), 685 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug.yaml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/task.yaml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/small-change.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/standard-change.md create mode 100644 .github/stale.yml create mode 100644 ansible/roles/calibration_tools/README.md create mode 100644 ansible/roles/calibration_tools/defaults/main.yaml create mode 100644 ansible/roles/calibration_tools/tasks/main.yaml create mode 100644 ansible/roles/enlarge_txqueue/defaults/main.yaml create mode 100644 ansible/roles/enlarge_txqueue/tasks/main.yaml create mode 100644 ansible/roles/enlarge_txqueue/templates/99-enlarge-txqueuelen.rules.jinja2 create mode 100644 ansible/roles/netplan/tasks/main.yaml create mode 100644 ansible/roles/netplan/templates/99-edge-auto-jetson.yaml.jinja2 create mode 100644 ansible/roles/ptp4l_client/defaults/main.yaml create mode 100644 ansible/roles/ptp4l_client/files/ptp4l@.service create mode 100644 ansible/roles/ptp4l_client/tasks/main.yaml create mode 100644 ansible/roles/ros2/README.md create mode 100644 ansible/roles/ros2/tasks/main.yaml create mode 100644 ansible/roles/tier4_hdr_camera_driver/tasks/mod_or_add.yaml rename perception_ecu.repos => autoware.repos (89%) delete mode 100644 docs/connection.drawio.svg create mode 100644 experimental.repos diff --git a/.github/ISSUE_TEMPLATE/bug.yaml b/.github/ISSUE_TEMPLATE/bug.yaml new file mode 100644 index 0000000..12a8579 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yaml @@ -0,0 +1,71 @@ +name: Bug +description: Report a bug +body: + - type: checkboxes + attributes: + label: Checklist + description: Confirm the following items before proceeding. If one cannot be satisfied, create a discussion thread instead. + options: + - label: I've read the [contribution guidelines](https://github.com/autowarefoundation/autoware/blob/main/CONTRIBUTING.md). + required: true + - label: I've searched other issues and no duplicate issues were found. + required: true + - label: I'm convinced that this is not my fault but a bug. + required: true + + - type: textarea + attributes: + label: Description + description: Write a brief description of the bug. + validations: + required: true + + - type: textarea + attributes: + label: Expected behavior + description: Describe the expected behavior. + validations: + required: true + + - type: textarea + attributes: + label: Actual behavior + description: Describe the actual behavior. + validations: + required: true + + - type: textarea + attributes: + label: Steps to reproduce + description: Write the steps to reproduce the bug. + placeholder: |- + 1. + 2. + 3. + validations: + required: true + + - type: textarea + attributes: + label: Versions + description: Provide the version information. You can omit this if you believe it's irrelevant. + placeholder: |- + - OS: + - ROS 2: + - Autoware: + validations: + required: false + + - type: textarea + attributes: + label: Possible causes + description: Write the possible causes if you have any ideas. + validations: + required: false + + - type: textarea + attributes: + label: Additional context + description: Add any other additional context if it exists. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..48765c2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,13 @@ +blank_issues_enabled: false +contact_links: + - name: Question + url: https://github.com/autowarefoundation/autoware/discussions/new?category=q-a + about: Ask a question + + - name: Feature request + url: https://github.com/autowarefoundation/autoware/discussions/new?category=feature-requests + about: Send a feature request + + - name: Idea + url: https://github.com/autowarefoundation/autoware/discussions/new?category=ideas + about: Post an idea diff --git a/.github/ISSUE_TEMPLATE/task.yaml b/.github/ISSUE_TEMPLATE/task.yaml new file mode 100644 index 0000000..cd8322f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/task.yaml @@ -0,0 +1,42 @@ +name: Task +description: Plan a task +body: + - type: checkboxes + attributes: + label: Checklist + description: Confirm the following items before proceeding. If one cannot be satisfied, create a discussion thread instead. + options: + - label: I've read the [contribution guidelines](https://github.com/autowarefoundation/autoware/blob/main/CONTRIBUTING.md). + required: true + - label: I've searched other issues and no duplicate issues were found. + required: true + - label: I've agreed with the maintainers that I can plan this task. + required: true + + - type: textarea + attributes: + label: Description + description: Write a brief description of the task. + validations: + required: true + + - type: textarea + attributes: + label: Purpose + description: Describe the purpose of the task. + validations: + required: true + + - type: textarea + attributes: + label: Possible approaches + description: Describe possible approaches for the task. + validations: + required: true + + - type: textarea + attributes: + label: Definition of done + description: Write the definition of done for the task. + validations: + required: true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..97b0e95 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +**Note**: Confirm the [contribution guidelines](https://autowarefoundation.github.io/autoware-documentation/main/contributing/) before submitting a pull request. + +Click the `Preview` tab and select a PR template: + +- [Standard change](?expand=1&template=standard-change.md) +- [Small change](?expand=1&template=small-change.md) + +**Do NOT send a PR with this description.** diff --git a/.github/PULL_REQUEST_TEMPLATE/small-change.md b/.github/PULL_REQUEST_TEMPLATE/small-change.md new file mode 100644 index 0000000..2ff933c --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/small-change.md @@ -0,0 +1,40 @@ +## Description + + + +## Tests performed + + + + +Not applicable. + +## Effects on system behavior + + + +Not applicable. + +## Pre-review checklist for the PR author + +The PR author **must** check the checkboxes below when creating the PR. + +- [ ] I've confirmed the [contribution guidelines]. +- [ ] The PR follows the [pull request guidelines]. + +## In-review checklist for the PR reviewers + +The PR reviewers **must** check the checkboxes below before approval. + +- [ ] The PR follows the [pull request guidelines]. + +## Post-review checklist for the PR author + +The PR author **must** check the checkboxes below before merging. + +- [ ] There are no open discussions or they are tracked via tickets. + +After all checkboxes are checked, anyone who has write access can merge the PR. + +[contribution guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/ +[pull request guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/pull-request-guidelines/ diff --git a/.github/PULL_REQUEST_TEMPLATE/standard-change.md b/.github/PULL_REQUEST_TEMPLATE/standard-change.md new file mode 100644 index 0000000..7aedefd --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/standard-change.md @@ -0,0 +1,50 @@ +## Description + + + +## Related links + + + +## Tests performed + + + +## Notes for reviewers + + + +## Interface changes + + + +## Effects on system behavior + + + +## Pre-review checklist for the PR author + +The PR author **must** check the checkboxes below when creating the PR. + +- [ ] I've confirmed the [contribution guidelines]. +- [ ] The PR follows the [pull request guidelines]. + +## In-review checklist for the PR reviewers + +The PR reviewers **must** check the checkboxes below before approval. + +- [ ] The PR follows the [pull request guidelines]. +- [ ] The PR has been properly tested. +- [ ] The PR has been reviewed by the code owners. + +## Post-review checklist for the PR author + +The PR author **must** check the checkboxes below before merging. + +- [ ] There are no open discussions or they are tracked via tickets. +- [ ] The PR is ready for merge. + +After all checkboxes are checked, anyone who has write access can merge the PR. + +[contribution guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/ +[pull request guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/pull-request-guidelines/ diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..84928d1 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,12 @@ +# Modified from https://github.com/probot/stale#usage + +# Number of days of inactivity before an Issue or Pull Request with the stale label is closed +daysUntilClose: false + +# Label to use when marking as stale +staleLabel: stale + +# Comment to post when marking as stale +markComment: > + This pull request has been automatically marked as stale because it has not had + recent activity. diff --git a/README.md b/README.md index f418c89..ab3f6b5 100644 --- a/README.md +++ b/README.md @@ -1,120 +1,54 @@ -# Perception ECU Container +# edge-auto-jetson -This repository provides a sample ROS2 environment working on a Jetson AGX Xavier based ECU and GMSL2-compatible cameras. +This repository provides a sample ROS2 environment working on a Jetson-based ECU and GMSL2-compatible cameras. -As a sample application, the following images show object recognition results using the contents of this repository. Various perception applications will be added in the future and you can develop them in this provided environment. +As a sample application, the following images show object recognition results using the contents of this repository. Various perception applications will be added in +the future and you can develop them in this provided environment. -![object recognition example](docs/sample.png "perception_ecu_container object recognition example") +[Edge.Auto](http://edge.auto) sensor fusion system can be realized by using this with [edge-auto](https://github.com/tier4/edge-auto) repository. -This repository is a docker-based ROS2 environment. The system overview is shown below. +![object recognition example](docs/sample.png "edge-auto-jetson object recognition example") -![system overview](docs/overview.drawio.svg "perception_ecu_container overview") +# Prerequisites -## Getting Started - -### Prerequisites - -- Camera: v4l2 compatible cameras, including [TIER IV Automotive HDR Camera C1](https://sensor.tier4.jp/automotive-hdr-camera) -- ECU: Jetson AGX Xavier based ECU, including [RQX-58G](https://www.adlinktech.com/Products/ROS2_Solution/ROS2_Controller/RQX-580_58G) from ADLINK Technology Inc. and [Developer Kit](https://www.nvidia.com/ja-jp/autonomous-machines/embedded-systems/jetson-agx-xavier) from NVIDIA Corp. -- Board support packages: NVIDIA L4T R32.6.1 (including Ubuntu 18.04) or higher - -#### NOTE: BSP installation for ADLINK RQX-58G - -This repository assumes that RQX-58G has been properly configured by following the official quick start guide from ADLINK Technology, Inc. Please see the [official document](https://www.adlinktech.com/Products/Download.ashx?type=MDownload&isQuickStart=yes&file=1783%5croscube-x-bsp-qsg-l4t-32.5.0-kernel-1.0.8.pdf) in detail. To download the BSP image, please visit the ADLINK official page [here](https://www.adlinktech.com/Products/DownloadSoftware.aspx?lang=en&pdNo=1783&MainCategory=ROS2-Solution.aspx&kind=BS). (If you are accessing the site for the first time, you will be prompted to create an account.) - -TIER IV camera driver ([tier4/tier4_automotive_hdr_camera](https://github.com/tier4/tier4_automotive_hdr_camera)), is already installed in the RQX-58G BSP image and it can also be updated during your setup process. - -An example connection between sensors and ECUs: - -![system connection example](docs/connection.drawio.svg "system connection example") - -### Installing dependencies - -As a first step, clone `tier4/perception_ecu_container` and move to the directory. - -```sh -git clone https://github.com/tier4/perception_ecu_container.git -cd perception_ecu_container -``` - -You can install the dependencies using the provided ansible script. During the installation process, you will be asked if you want to install the TIER IV camera driver. If you already have the driver installed and want to skip this step, please type `N` to continue. - -```sh -./setup-dev-env.sh - -[Warning] Do you want to install/update the TIER IV camera driver? [y/N]: -``` - -Finally, please reboot the system to make the installed dependencies and permission settings effective. - -```sh -sudo reboot -``` +### System Overview -### Building docker +This repository is based on a natively built ROS2 environment. The system overview is shown below. -Build your docker image and build the ROS execution environment. +![system overview](docs/overview.drawio.svg "edge-auto-jetson overview") -```sh -./docker/build.sh -``` +### System Requirement -### Building ROS workspace - -Create your ROS workspace and clone repositories using vcstool. - -```sh -mkdir src -vcs import src < perception_ecu.repos -``` - -If you want to update cloned repositories, use the following command. - -```sh -vcs import src < perception_ecu.repos -vcs pull src -``` - -Build your ROS workspace using your built docker image. - -```sh -./docker/run_colcon_build.sh -``` - -### Running docker - -Launch your docker image to enter your ROS execution environment. - -```sh -./docker/run.sh -``` - -For example, the following shows how to execute single-camera object detection after running docker. - -(NOTE: The following command will display the object recognition results in a new window, but building TensorRT engine takes about 15 minutes at first time. from the second launch, it is skipped and the results are displayed immediately.) - -```sh -./docker/run.sh - -## in docker environment -source /workspace/install/setup.bash # Don't miss enabling workspace ROS packages -ros2 launch perception_ecu_or_launch perception_ecu_or.launch.xml -``` - -This sample is based on [tensorrt_yolox](https://github.com/autowarefoundation/autoware.universe/tree/main/perception/tensorrt_yolox) implemented in [autoware.universe](https://github.com/autowarefoundation/autoware.universe.git). -See this [README](https://github.com/autowarefoundation/autoware.universe/blob/main/perception/tensorrt_yolox/README.md) about the algorithm and the used trained model in more detail. +- Camera: v4l2 compatible cameras, including [TIER IV Automotive HDR Camera C1](https://sensor.tier4.jp/automotive-hdr-camera) +- ECU: Jetson AGX Xavier based ECU, including [RQX-58G](https://www.adlinktech.com/Products/ROS2_Solution/ROS2_Controller/RQX-580_58G) from ADLINK Technology Inc. and [Developer Kit](https://www.nvidia.com/ja-jp/autonomous-machines/embedded-systems/jetson-agx-xavier) from NVIDIA Corp. +- NVIDIA L4T: R32.6.1 (including Ubuntu 18.04) +- ROS: ROS2 Humble (native build) -## Repository overview +## Getting Started -- [tier4/perception_ecu_container](https://github.com/tier4/perception_ecu_container) - - Meta-repository containing `.repos` file to construct Perception ECU ROS workspace based on docker. -- [tier4/perception_ecu_launch](https://github.com/tier4/perception_ecu_launch.git) - - Launch configuration repository containing node configurations and their parameters for Perception ECU. -- [tier4/perception_ecu_individual_params](https://github.com/tier4/perception_ecu_individual_params) - - Repository for managing Perception ECU parameters including camera parameters, driver parameters, etc. -- [tier4/sensor_trigger](https://github.com/tier4/sensor_trigger.git) +Please see [Tutorials](https://github.com/tier4/edge-auto/tree/main/docs/tutorials.md). + +## Related repositories + +- [tier4/edge-auto](https://github.com/tier4/edge-auto) + - Meta-repository containing `autoware.repos` to construct ROS-based workspace on x86-based ECU. +- [tier4/edge-auto-jetson](https://github.com/tier4/edge-auto-jetson) + - Meta-repository containing `autoware.repos` file to construct ROS-based workspace on Jetson-based ECU. +- [tier4/edge_auto_launch](https://github.com/tier4/edge_auto_launch) + - Launch configuration repository containing node configurations and their parameters for x86-based ECU. +- [tier4/edge_auto_jetson_launch](https://github.com/tier4/edge_auto_jetson_launch) + - Launch configuration repository containing node configurations and their parameters for Jetson-based ECU. +- [tier4/edge_auto_individual_params](https://github.com/tier4/edge_auto_individual_params) + - Repository for managing system parameters including camera parameters, driver parameters, etc. +- [tier4/nebula](https://github.com/tier4/nebula) + - ROS2 package for unified ethernet-based LiDAR driver. +- [tier4/tier4_automotive_hdr_camera](https://github.com/tier4/tier4_automotive_hdr_camera) + - Kernel driver for using TIER IV cameras with Video4Linux2 interface. +- [tier4/ros2_v4l2_camera](https://github.com/tier4/ros2_v4l2_camera) + - ROS2 package for camera driver using Video4Linux2. +- [tier4/sensor_trigger](https://github.com/tier4/sensor_trigger) - ROS2 package for generating sensor trigger signals. -- [tier4/ros2_v4l2_camera](https://github.com/tier4/ros2_v4l2_camera.git) - - ROS2 camera driver using Video4Linux2. -- [autowarefoundation/autoware.universe](https://github.com/autowarefoundation/autoware.universe.git) - - Repository for experimental, cutting-edge ROS packages for Autonomous Driving. +- [tier4/calibration_tools](https://github.com/tier4/CalibrationTools) + - Repository for calibration tools to estimate parameters on autonomous driving systems. +- [autowarefoundation/autoware.universe](https://github.com/autowarefoundation/autoware.universe) + - Repository for experimental, cutting-edge ROS packages for autonomous driving. diff --git a/ansible/roles/autoware/tasks/main.yaml b/ansible/roles/autoware/tasks/main.yaml index 04c320b..ecb6e08 100644 --- a/ansible/roles/autoware/tasks/main.yaml +++ b/ansible/roles/autoware/tasks/main.yaml @@ -8,3 +8,11 @@ block: | export ROS_DOMAIN_ID={{ ros_domain_id }} become: true + +- name: Add sourcing command in user's bashrc + ansible.builtin.blockinfile: + path: "{{ ansible_env.HOME }}/.bashrc" + state: present + marker: "# {mark} autoware" + block: | + source {{ autoware_env_dir }}/autoware.env diff --git a/ansible/roles/calibration_tools/README.md b/ansible/roles/calibration_tools/README.md new file mode 100644 index 0000000..9792ff7 --- /dev/null +++ b/ansible/roles/calibration_tools/README.md @@ -0,0 +1 @@ +# Calibration Tools diff --git a/ansible/roles/calibration_tools/defaults/main.yaml b/ansible/roles/calibration_tools/defaults/main.yaml new file mode 100644 index 0000000..2f9059a --- /dev/null +++ b/ansible/roles/calibration_tools/defaults/main.yaml @@ -0,0 +1,3 @@ +pyside2_url_base: https://github.com/hiroyuki-s1/PySide2InstallForJetson/raw/main/dist +pyside2_wheel: PySide2-5.9.0a1-5.9.5-cp36-cp36m-linux_aarch64.whl +pyside2_download_dir: /tmp diff --git a/ansible/roles/calibration_tools/tasks/main.yaml b/ansible/roles/calibration_tools/tasks/main.yaml new file mode 100644 index 0000000..4d3a345 --- /dev/null +++ b/ansible/roles/calibration_tools/tasks/main.yaml @@ -0,0 +1,26 @@ +- name: Fix python interpreter version to 3 + set_fact: + ansible_python_interpreter: /usr/bin/python3.6 + +- name: Upgrade pip + pip: + name: pip + state: latest + +- name: Install dependencies + pip: + name: + - dt-apriltags + - ruamel.yaml + state: latest + +- name: Download PySide2 wheel + ansible.builtin.uri: + url: "{{ pyside2_url_base }}/{{ pyside2_wheel }}" + dest: "{{ pyside2_download_dir }}/{{ pyside2_wheel }}" + mode: 0644 + +- name: Install PySide2 + pip: + name: "{{ pyside2_download_dir }}/{{ pyside2_wheel }}" + state: latest diff --git a/ansible/roles/cyclonedds/defaults/main.yaml b/ansible/roles/cyclonedds/defaults/main.yaml index 526b923..6ab6c0c 100644 --- a/ansible/roles/cyclonedds/defaults/main.yaml +++ b/ansible/roles/cyclonedds/defaults/main.yaml @@ -1,6 +1,4 @@ cyclonedds: - network_interface_address: - - lo minimum_socket_receive_buffer_size: 20MB ipfrag_time: 3 ipfrag_high_thresh: 134217728 diff --git a/ansible/roles/cyclonedds/tasks/main.yaml b/ansible/roles/cyclonedds/tasks/main.yaml index 77f42f2..c8c00a8 100644 --- a/ansible/roles/cyclonedds/tasks/main.yaml +++ b/ansible/roles/cyclonedds/tasks/main.yaml @@ -26,7 +26,8 @@ enabled: true masked: false become: true - with_items: "{{ cyclonedds.network_interface_address }}" + when: item == "lo" + with_items: "{{ network_config }}" - name: Add kernel parameter config ansible.posix.sysctl: diff --git a/ansible/roles/cyclonedds/templates/cyclonedds.xml.jinja2 b/ansible/roles/cyclonedds/templates/cyclonedds.xml.jinja2 index fd483cd..50398dc 100644 --- a/ansible/roles/cyclonedds/templates/cyclonedds.xml.jinja2 +++ b/ansible/roles/cyclonedds/templates/cyclonedds.xml.jinja2 @@ -2,14 +2,20 @@ - {{ cyclonedds.network_interface_address|join(',') }} + +{% for key in network_config %} +{% if 'ros' in key %} + +{% endif %} +{% endfor %} + spdp 65500B 4000B true - {{ cyclonedds.minimum_socket_receive_buffer_size }} + diff --git a/ansible/roles/enlarge_txqueue/defaults/main.yaml b/ansible/roles/enlarge_txqueue/defaults/main.yaml new file mode 100644 index 0000000..41196e7 --- /dev/null +++ b/ansible/roles/enlarge_txqueue/defaults/main.yaml @@ -0,0 +1 @@ +txqueue_length: 20000 diff --git a/ansible/roles/enlarge_txqueue/tasks/main.yaml b/ansible/roles/enlarge_txqueue/tasks/main.yaml new file mode 100644 index 0000000..f1731c7 --- /dev/null +++ b/ansible/roles/enlarge_txqueue/tasks/main.yaml @@ -0,0 +1,6 @@ +- name: Copy rule file + ansible.builtin.template: + src: 99-enlarge-txqueuelen.rules.jinja2 + dest: /etc/udev/rules.d/99-enlarge-txqueuelen.rules + mode: 0644 + become: true diff --git a/ansible/roles/enlarge_txqueue/templates/99-enlarge-txqueuelen.rules.jinja2 b/ansible/roles/enlarge_txqueue/templates/99-enlarge-txqueuelen.rules.jinja2 new file mode 100644 index 0000000..e6703ab --- /dev/null +++ b/ansible/roles/enlarge_txqueue/templates/99-enlarge-txqueuelen.rules.jinja2 @@ -0,0 +1,5 @@ +{% for key in network_config %} +{% if 'dhcp' not in key %} +SUBSYSTEM=="net",ACTION=="add|change",KERNEL=="{{ network_config[key].interface_name }}",ATTR{tx_queue_len}="{{ txqueue_length }}" +{% endif %} +{% endfor %} diff --git a/ansible/roles/netplan/tasks/main.yaml b/ansible/roles/netplan/tasks/main.yaml new file mode 100644 index 0000000..401da90 --- /dev/null +++ b/ansible/roles/netplan/tasks/main.yaml @@ -0,0 +1,16 @@ +- name: Install netplan + ansible.builtin.apt: + name: netplan.io + update_cache: true + become: true + +- name: Copy network config file using template + ansible.builtin.template: + src: 99-edge-auto-jetson.yaml.jinja2 + dest: /etc/netplan/99-edge-auto-jetson.yaml + mode: 0644 + become: true + +- name: Netplan apply + command: netplan apply + become: true diff --git a/ansible/roles/netplan/templates/99-edge-auto-jetson.yaml.jinja2 b/ansible/roles/netplan/templates/99-edge-auto-jetson.yaml.jinja2 new file mode 100644 index 0000000..8654b91 --- /dev/null +++ b/ansible/roles/netplan/templates/99-edge-auto-jetson.yaml.jinja2 @@ -0,0 +1,17 @@ +network: + version: 2 + renderer: networkd + ethernets: +{% for key in network_config %} +{% if 'dhcp' in key %} + {{ network_config[key].interface_name }}: + dhcp4: true + dhcp-identifier: mac + optional: true +{% else %} + {{ network_config[key].interface_name }}: + addresses: [{{ network_config[key].interface_address }}/24] + dhcp4: false + dhcp6: false +{% endif %} +{% endfor %} diff --git a/ansible/roles/ptp4l_client/defaults/main.yaml b/ansible/roles/ptp4l_client/defaults/main.yaml new file mode 100644 index 0000000..1ce1cdf --- /dev/null +++ b/ansible/roles/ptp4l_client/defaults/main.yaml @@ -0,0 +1 @@ +ptp4l_client_interface: eth1 diff --git a/ansible/roles/ptp4l_client/files/ptp4l@.service b/ansible/roles/ptp4l_client/files/ptp4l@.service new file mode 100644 index 0000000..ed46ade --- /dev/null +++ b/ansible/roles/ptp4l_client/files/ptp4l@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Precision Time Protocol (PTP) service +After=network-online.target + +[Service] +Type=simple +ExecStart=/usr/sbin/ptp4l -i %i -m -S -A -s +ExecStop=/usr/bin/pkill -f ptp4l +Restart=always +RestartSec=5 + +[Install] +WantedBy=multi-user.target network-online.target diff --git a/ansible/roles/ptp4l_client/tasks/main.yaml b/ansible/roles/ptp4l_client/tasks/main.yaml new file mode 100644 index 0000000..510ac86 --- /dev/null +++ b/ansible/roles/ptp4l_client/tasks/main.yaml @@ -0,0 +1,20 @@ +- name: Install ptp4l + ansible.builtin.apt: + name: + - linuxptp + update_cache: true + become: true + +- name: Copy service template file + ansible.builtin.copy: + src: ptp4l@.service + dest: /etc/systemd/system/ + become: true + +- name: Install ptp4l client service file + ansible.builtin.systemd: + name: ptp4l@{{ ptp4l_client_interface }}.service + daemon_reload: true + enabled: true + masked: false + become: true diff --git a/ansible/roles/ros2/README.md b/ansible/roles/ros2/README.md new file mode 100644 index 0000000..c5435eb --- /dev/null +++ b/ansible/roles/ros2/README.md @@ -0,0 +1,8 @@ +# ROS2 + +This role installs [ROS 2](https://docs.ros.org) under `/opt/ros`. Because apt binaries for the latest ROS 2 distribution are not available on some NVIDIA L4T environments, such as L4T R32.6.1 (based on Ubuntu18.04), this role installs dependencies, clones ROS 2 source codes, and builds them. + +## Inputs + +| Name | Required | Description | +| ros_distro | true | The ROS distribution. Currently, only `humble` is supported. | diff --git a/ansible/roles/ros2/tasks/main.yaml b/ansible/roles/ros2/tasks/main.yaml new file mode 100644 index 0000000..00bac52 --- /dev/null +++ b/ansible/roles/ros2/tasks/main.yaml @@ -0,0 +1,417 @@ +- name: Fix python interpreter version to 3 + set_fact: + ansible_python_interpreter: /usr/bin/python3.6 + +- name: Setup dependencies + block: + - name: Apt install + ansible.builtin.apt: + name: + - curl + - wget + - gnupg + - gnupg2 + - lsb-release + - ca-certificates + - software-properties-common + - apt-transport-https + install_recommends: false + update_cache: true + - name: Add ROS2 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 + - build-essential + - cmake + - git + - libbullet-dev + - libpython3-dev + - python3-wheel + - python3-colcon-common-extensions + - python3-flake8 + - python3-pip + - python3-numpy + - python3-pytest-cov + - python3-rosdep + - python3-setuptools + - python3-vcstool + - python3-rosinstall-generator + - libasio-dev + - libtinyxml2-dev + - libcunit1-dev + - libflann-dev + install_recommends: false + update_cache: true + become: true + +- name: add CUDA into PATH + set_fact: + environment: + PATH: "/usr/local/cuda/bin:{{ ansible_env.PATH }}" + +- name: Python parts + ansible.builtin.pip: + name: + - wheel + - argcomplete + - flake8-blind-except + - flake8-builtins + - flake8-class-newline + - flake8-comprehensions + - flake8-deprecated + - flake8-docstrings + - flake8-import-order + - flake8-quotes + - pytest-repeat + - pytest-rerunfailures + - pytest + - pybind11-global + - importlib_resources + extra_args: -U + become: true # need to sudo privilege to install packages globally + +- name: Prepare for dependencies' source build + block: + - name: Define directory name + set_fact: + source_build_dir: "{{ ansible_env.HOME }}/source_builds" + - name: Create directory + ansible.builtin.file: + path: "{{ source_build_dir }}" + state: directory + +- name: Build and install Boost + block: + - name: "{{ block_name }}: Download and extract source" + ansible.builtin.unarchive: + src: https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.gz + dest: "{{ source_build_dir }}" + remote_src: yes + - name: "{{ block_name }}: Build boost" + shell: ./bootstrap.sh --prefix=/usr/local --with-python=python3 && ./b2 install -j7 + args: + chdir: "{{ source_build_dir }}/boost_1_74_0" + become: true + vars: + block_name: Boost + +- name: Build and install PCL + block: + - name: "{{ block_name }}: Download and extract source" + ansible.builtin.unarchive: + src: https://github.com/PointCloudLibrary/pcl/releases/download/pcl-1.12.1/source.tar.gz + dest: "{{ source_build_dir }}" + remote_src: yes + - set_fact: + pcl_build_dir: "{{ source_build_dir }}/pcl/build" + - name: "{{ block_name }}: Create build directory" + ansible.builtin.file: + path: "{{ pcl_build_dir }}" + state: directory + - name: "{{ block_name }}: cmake" + shell: cmake -DCMAKE_BUILD_TYPE=Release .. + args: + chdir: "{{ pcl_build_dir }}" + environment: + PATH: "/usr/local/cuda/bin:{{ ansible_env.PATH }}" + - name: "{{ block_name }}: build" + shell: make -j7 install + args: + chdir: "{{ pcl_build_dir }}" + become: true + vars: + block_name: PCL + +- name: Build and install fmt + block: + - name: "{{ block_name }}: Download and extract source" + ansible.builtin.unarchive: + src: https://github.com/fmtlib/fmt/archive/refs/tags/8.1.1.tar.gz + dest: "{{ source_build_dir }}" + remote_src: yes + - set_fact: + fmt_build_dir: "{{ source_build_dir }}/fmt-8.1.1/build" + - name: "{{ block_name }}: Create build directory" + ansible.builtin.file: + path: "{{ fmt_build_dir }}" + state: directory + - name: "{{ block_name }}: cmake" + shell: cmake -DBUILD_SHARED_LIBS=TRUE .. + args: + chdir: "{{ fmt_build_dir }}" + - name: "{{ block_name }}: build" + shell: make -j7 install + args: + chdir: "{{ fmt_build_dir }}" + become: true + vars: + block_name: fmt + +- name: Build and install Range-v3 + block: + - name: "{{ block_name }}: Download source" + ansible.builtin.git: + repo: https://github.com/ericniebler/range-v3.git + dest: "{{ source_build_dir }}/range-v3" + depth: 1 + version: 0.11.0 + - set_fact: + range_v3_build_dir: "{{ source_build_dir }}/range-v3/build" + - name: "{{ block_name }}: Create build directory" + ansible.builtin.file: + path: "{{ range_v3_build_dir }}" + state: directory + - name: "{{ block_name }}: cmake" + shell: cmake -DCMAKE_BUILD_TYPE=Release -DRANGE_V3_TESTS=Off -DRANGE_V3_EXAMPLES=Off .. + args: + chdir: "{{ range_v3_build_dir }}" + - name: "{{ block_name }}: build" + shell: make -j7 install + args: + chdir: "{{ range_v3_build_dir }}" + become: true + vars: + block_name: Range-v3 + +- 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 + +- name: Build and install YAML + block: + - name: "{{ block_name }}: Download source" + ansible.builtin.git: + repo: https://github.com/jbeder/yaml-cpp.git + dest: "{{ source_build_dir }}/yaml-cpp" + version: yaml-cpp-0.6.0 + - set_fact: + yaml_cpp_build_dir: "{{ source_build_dir }}/yaml-cpp/build" + - name: "{{ block_name }}: Create build directory" + ansible.builtin.file: + path: "{{ yaml_cpp_build_dir }}" + state: directory + - name: "{{ block_name }}: cmake" + shell: cmake -DBUILD_SHARED_LIBS=ON .. + args: + chdir: "{{ yaml_cpp_build_dir }}" + - name: "{{ block_name }}: build" + shell: make -j7 install + args: + chdir: "{{ yaml_cpp_build_dir }}" + become: true + vars: + block_name: YAML + +- 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: update GCC + block: + - name: "{{ block_name }}: update repository info" + ansible.builtin.apt_repository: + repo: ppa:ubuntu-toolchain-r/test + - name: "{{ block_name }}: install gcc11" + ansible.builtin.apt: + name: + - gcc-11 + - g++-11 + install_recommends: false + update_cache: true + - name: "{{ block_name }}: set gcc11 as default" + community.general.alternatives: + name: gcc + path: /usr/bin/gcc-11 + link: /usr/bin/gcc + state: selected + subcommands: + - name: g++ + path: /usr/bin/g++-11 + link: /usr/bin/g++ + + become: true + vars: + block_name: update GCC + +- name: Build ROS + block: + - set_fact: + ros_base_dir: "/opt/ros/{{ ros_distro }}" + - set_fact: + ros_src_dir: "{{ ros_base_dir }}/src" + - name: "{{ block_name }}: Create base directory" + ansible.builtin.file: + path: "{{ ros_base_dir }}" + state: directory + become: true + - name: "{{ block_name }}: Create soruce directory" + ansible.builtin.file: + path: "{{ ros_base_dir }}/src" + state: directory + become: true + - name: "{{ block_name }}: generate repository list using rosinstall_generator" + shell: "rosinstall_generator --deps --rosdistro {{ ros_distro }} ros_base launch_xml launch_yaml launch_testing launch_testing_ament_cmake demo_nodes_cpp demo_nodes_py example_interfaces camera_calibration_parsers camera_info_manager cv_bridge vision_opencv vision_msgs image_geometry image_pipeline image_transport compressed_image_transport compressed_depth_image_transport pcl_msgs perception_pcl --exclude rmw_connextdds > /tmp/ros2.{{ ros_distro }}.ros_base.rosinstall" + - name: "{{ block_name }}: copy repository list to target ddirectory" + ansible.builtin.copy: + src: "/tmp/ros2.{{ ros_distro }}.ros_base.rosinstall" + dest: "{{ ros_base_dir }}/ros2.{{ ros_distro }}.ros_base.rosinstall" + become: true + - name: "{{ block_name }}: clone all repositories via vcs" + shell: "vcs import src < ros2.{{ ros_distro }}.ros_base.rosinstall" + args: + chdir: "{{ ros_base_dir }}" + become: true + - name: "{{ block_name }}: remove ament_cmake for update" + ansible.builtin.file: + path: "{{ ros_src_dir }}/ament_cmake" + state: absent + become: true + - name: "{{ block_name }}: clone ament_cmake from git" + ansible.builtin.git: + repo: https://github.com/ament/ament_cmake + dest: "{{ ros_src_dir }}/ament_cmake" + version: humble + become: true + - name: "{{ block_name }}: clone diagnostics from git" + ansible.builtin.git: + repo: https://github.com/ros/diagnostics + dest: "{{ ros_src_dir }}/diagnostics" + version: ros2 + become: true + - name: "{{ block_name }}: remove rmw_connextdds entry from rmw_implementation" + ansible.builtin.replace: + path: "{{ ros_src_dir }}/rmw_implementation/package.xml" + regexp: .*rmw_connextdds.*\n + become: true + - stat: + path: /etc/ros/rosdep/sources.list.d/20-default.list + register: ros_sources_list_file + - name: "{{ block_name }}: rosdep init" + shell: rosdep init + become: true + when: not ros_sources_list_file.stat.exists + - name: "{{ block_name }}: rosdep update" + shell: rosdep update + become: true + - name: rosdep install + shell: rosdep install -y --ignore-src --from-paths src --rosdistro humble --skip-keys "libopencv-dev libopencv-contrib-dev libopencv-imgproc-dev python-opencv python3-opencv" + args: + chdir: "{{ ros_base_dir }}" + become: true + - name: "{{ block_name }}: correct file list under /var/lib/apt/lists" + ansible.builtin.find: + paths: /var/lib/apt/lists + hidden: true + recurse: true + file_type: any + register: file_under_var_lib_apt_lists + - name: "{{ block_name }}: remove all file under /var/lib/apt/lists" + ansible.builtin.file: + path: "{{ item.path }}" + state: absent + with_items: "{{ file_under_var_lib_apt_lists.files }}" + become: true + - name: "{{ block_name }}: apt-get clean" + ansible.builtin.apt: + clean: true + become: true + - name: "{{ block_name }}: apt-get purge pybind11-dev" + ansible.builtin.apt: + name: pybind11-dev + purge: true + become: true + - name: "{{ block_name }}: install pybind11-global" + ansible.builtin.pip: + name: pybind11-global + extra_args: -U + become: true + - name: "{{ block_name }}: apt-get purge libyaml-cpp-dev" + ansible.builtin.apt: + name: libyaml-cpp-dev + purge: true + become: true + - name: "{{ block_name }}: colcon build" + shell: colcon build --merge-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DPython3_EXECUTABLE=$(which python3.6) + args: + chdir: "{{ ros_base_dir }}" + become: true + vars: + block_name: Build ROS + +- name: Downgrade GCC as version 11 is too high for old CUDA version that is used in L4T + block: + - name: "{{ block_name }}: install gcc-8" + ansible.builtin.apt: + name: + - gcc-8 + - g++-8 + update_cache: true + - name: "{{ block_name }}: set gcc-8 as default" + community.general.alternatives: + name: gcc + path: /usr/bin/gcc-8 + link: /usr/bin/gcc + state: selected + subcommands: + - name: g++ + path: /usr/bin/g++-8 + link: /usr/bin/g++ + become: true + vars: + block_name: Downgrade gcc to 8 + +- name: Add sourcing command in user's bashrc + ansible.builtin.blockinfile: + path: "{{ ansible_env.HOME }}/.bashrc" + state: present + marker: "# {mark} ros2" + block: | + source {{ ros_base_dir }}/install/setup.bash diff --git a/ansible/roles/tier4_hdr_camera_driver/defaults/main.yaml b/ansible/roles/tier4_hdr_camera_driver/defaults/main.yaml index df8bb28..849feb2 100644 --- a/ansible/roles/tier4_hdr_camera_driver/defaults/main.yaml +++ b/ansible/roles/tier4_hdr_camera_driver/defaults/main.yaml @@ -1,2 +1,3 @@ camera_driver_repo: https://api.github.com/repos/tier4/tier4_automotive_hdr_camera/releases/latest camera_driver_download_dir: /tmp +exposure_time: 11000 diff --git a/ansible/roles/tier4_hdr_camera_driver/tasks/main.yaml b/ansible/roles/tier4_hdr_camera_driver/tasks/main.yaml index 4f36062..5b77a21 100644 --- a/ansible/roles/tier4_hdr_camera_driver/tasks/main.yaml +++ b/ansible/roles/tier4_hdr_camera_driver/tasks/main.yaml @@ -52,7 +52,7 @@ - name: Post process ansible.builtin.shell: cmd: | - /opt/nvidia/jetson-io/config-by-hardware.py -n 2="TIERIV ISX021 IMX490 GMSL2 Camera Device Tree Overlay" + /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 @@ -60,3 +60,66 @@ deb: "{{ camera_driver_download_dir }}/{{ sdk_deb_name }}" state: present when: sdk_deb_download_url is defined + +- name: Setup C1 configuration + block: + - name: "{{ block_name }} : Change trigger mode to Fsync mode" + include_tasks: mod_or_add.yaml + vars: + target_item: trigger_mode + target_val: "1" + # Set the same value to min/mid/max exposure time + # so that exposure time can be estimated under any brightness condition + - name: "{{ block_name }} : Fix exposure time" + block: + - name: "{{ block_name }} : Set min exposure" + include_tasks: mod_or_add.yaml + vars: + target_item: shutter_time_min + target_val: "{{ exposure_time }}" + - name: "{{ block_name }} : Set mid exposure" + include_tasks: mod_or_add.yaml + vars: + target_item: shutter_time_mid + target_val: "{{ exposure_time }}" + - name: "{{ block_name }} : Set max exposure" + include_tasks: mod_or_add.yaml + vars: + target_item: shutter_time_max + target_val: "{{ exposure_time }}" + vars: + target_file: /etc/modprobe.d/tier4-isx021.conf + config_prefix: options tier4_isx021 + block_name: ISX021 configuration + +- name: Setup C2 configuration + block: + - name: "{{ block_name }} : Change trigger mode to Fsync mode" + include_tasks: mod_or_add.yaml + vars: + target_item: trigger_mode + target_val: "1" + + # Set the same value to min/mid/max exposure time + # so that exposure time can be estimated under any brightness condition + - name: "{{ block_name }} : Fix exposure time" + block: + - name: "{{ block_name }} : Set min exposure" + include_tasks: mod_or_add.yaml + vars: + target_item: shutter_time_min + target_val: "{{ exposure_time }}" + - name: "{{ block_name }} : Set mid exposure" + include_tasks: mod_or_add.yaml + vars: + target_item: shutter_time_mid + target_val: "{{ exposure_time }}" + - name: "{{ block_name }} : Set max exposure" + include_tasks: mod_or_add.yaml + vars: + target_item: shutter_time_max + target_val: "{{ exposure_time }}" + vars: + target_file: /etc/modprobe.d/tier4-imx490.conf + config_prefix: options tier4_imx490 + block_name: IMX490 configuration diff --git a/ansible/roles/tier4_hdr_camera_driver/tasks/mod_or_add.yaml b/ansible/roles/tier4_hdr_camera_driver/tasks/mod_or_add.yaml new file mode 100644 index 0000000..e6065ba --- /dev/null +++ b/ansible/roles/tier4_hdr_camera_driver/tasks/mod_or_add.yaml @@ -0,0 +1,31 @@ +# +# The following sequence modifies configuration items if it exists in {{ target_file }}, +# or add it to the end of line starting with {{ config_prefix }} if it not exist +# +- name: Check item existence + lineinfile: + dest: "{{ target_file }}" + regexp: ^(.*){{ target_item }}={{ target_val }}(.*)$ + state: absent + check_mode: true + changed_when: false + register: does_exist + become: true + +- name: Modify + lineinfile: + dest: "{{ target_file }}" + regexp: ^(.*) {{ target_item }}=[a-z0-9]* (.*)$ + line: \1 {{ target_item }}={{ target_val }} \2 # Yaml requires escaping backslashes in double quotes but not in single quotes + backrefs: true + register: is_modified + become: true + +- name: Add + lineinfile: + dest: "{{ target_file }}" + regexp: ^({{ config_prefix }})(.*)$ + line: \1\2 {{ target_item }}={{ target_val }} + backrefs: true + when: not does_exist.found and not is_modified.changed + become: true diff --git a/ansible/setup.yaml b/ansible/setup.yaml index 024514c..be9bcfa 100644 --- a/ansible/setup.yaml +++ b/ansible/setup.yaml @@ -1,15 +1,36 @@ - name: Setup perception ECU hosts: localhost + vars: + - ros_distro: humble + - network_config: + ros: + interface_address: 192.168.2.2 + interface_name: eth1 + dhcp: + interface_name: eth0 + - ptp4l_client_interface: eth1 vars_prompt: - name: prompt_install_camera_driver prompt: |- [Warning] Do you want to install/update the TIER IV camera driver? [y/N] private: false + - name: prompt_configure_network + prompt: |- + [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: autoware - role: cuda - role: cyclonedds - role: docker - role: vcstool + - role: calibration_tools - role: tier4_hdr_camera_driver when: prompt_install_camera_driver == 'y' + - role: ros2 + - role: ptp4l_client + when: prompt_configure_network + - role: enlarge_txqueue + when: prompt_configure_network + - role: netplan + when: prompt_configure_network diff --git a/perception_ecu.repos b/autoware.repos similarity index 89% rename from perception_ecu.repos rename to autoware.repos index 31439c1..950dd09 100644 --- a/perception_ecu.repos +++ b/autoware.repos @@ -2,11 +2,11 @@ repositories: # perception stack launcher: type: git - url: https://github.com/tier4/perception_ecu_launch.git + url: https://github.com/tier4/edge_auto_jetson_launch.git version: main individual_params: type: git - url: https://github.com/tier4/perception_ecu_individual_params.git + url: https://github.com/tier4/edge_auto_individual_params.git version: main sensor_trigger: type: git @@ -19,11 +19,11 @@ repositories: autoware.universe: type: git url: https://github.com/autowarefoundation/autoware.universe.git - version: galactic + version: main calibration_tools: type: git url: https://github.com/tier4/CalibrationTools.git - version: galactic + version: tier4/universe # package dependencies autoware_common_msgs: type: git diff --git a/docs/connection.drawio.svg b/docs/connection.drawio.svg deleted file mode 100644 index 15ba723..0000000 --- a/docs/connection.drawio.svg +++ /dev/null @@ -1,419 +0,0 @@ - - - - - - - -
-
-
- - - Host -
- (optional) -
-
-
-
-
-
- - Host... - -
-
- - - - -
-
-
- - - RQX-58G - - -
-
-
-
- - RQX-58G - -
-
- - - - -
-
-
- - GMSL 2 - -
-
-
-
- - GMSL 2 - -
-
- - - - -
-
-
- - 4 - -
-
-
-
- - 4 - -
-
- - - - - - - - - -
-
-
- - 2 - -
-
-
-
- - 2 - -
-
- - - -
-
-
- - 3 - -
-
-
-
- - 3 - -
-
- - - - - - - - -
-
-
-
- - Connect C1 cam to - -
- -
- - GMSL2 port #1~8 - -
-
-
-
-
-
- - Connect C1 cam toGMS... - -
-
- - - - - - - -
-
-
- - - TIER IV -
- Automotive HDR camera -
-
-
-
-
-
- - TIER IV... - -
-
- - - - - - - - - -
-
-
- - GMSL 2 - -
-
-
-
- - GMSL 2 - -
-
- - - -
-
-
- - 1 - -
-
-
-
- - 1 - -
-
- - - -
-
-
- - - Display - - -
-
-
-
- - Display - -
-
- - - -
-
-
- - - Keyboard - - -
-
-
-
- - Keyboard - -
-
- - - -
-
-
- - 7 - -
-
-
-
- - 7 - -
-
- - - -
-
-
- - 6 - -
-
-
-
- - 6 - -
-
- - - -
-
-
- - 8 - -
-
-
-
- - 8 - -
-
- - - -
-
-
- - 5 - -
-
-
-
- - 5 - -
-
- - - - - - - -
-
-
- - - HDMI - - -
-
-
-
- - HDMI - -
-
- - - - - -
-
-
- - - USB - - -
-
-
-
- - USB - -
-
- - - - - -
-
-
- - - Ethernet - - -
-
-
-
- - Ethernet - -
-
- - -
- - - - - Viewer does not support full SVG 1.1 - - - -
diff --git a/docs/overview.drawio.svg b/docs/overview.drawio.svg index 6c4b7bc..e22691f 100644 --- a/docs/overview.drawio.svg +++ b/docs/overview.drawio.svg @@ -1,307 +1,277 @@ - + - + + + -
+
-
- Docker +
+ ROS nodes
- - Docker + + ROS nodes - - - - - - + -
-
-
- - Containers - -
-
-
-
- - Containers - -
-
- - - - -
+
-
- workspace +
+ camera node
- - workspace + + camera node - + + + + + -
-
-
- instantiate +
+
+
+ Access to/from other PCs +
+ on the same ROS network
- - instantiate + + Access to/from other PCs... - + -
-
-
- Ubuntu -
- + -
-
- - ROS2 - -
+
+
+
+ Access devices including +
+ TIER IV C1 camera
- - Ubuntu... + + Access devices including... - - - - - + + + -
-
-
- Access to/from other PCs -
- on the same ROS network +
+
+
+ GMSL2
- - Access to/from other PCs... + + GMSL2 - + + + + + -
-
-
- Access devices including -
- TIER IV C1 camera +
+
+
+ Ethernet
- - Access devices including... + + Ethernet - + -
-
-
- mount local directory -
- onto containers -
- (sources and build -
- results are saved persistently) +
+
+
+ TIER IV Automotive HDR camera driver
- - mount local directory... + + TIER IV Automotive HDR camera driver - + -
+
-
- GMSL2 +
+ ROS 2 base (naitively built on Base OS package)
- - GMSL2 + + ROS 2 base (naitively built on Base OS package) - - - - + -
+
-
- Ethernet +
+ Base OS package +
+ (a.k.a Linux4Tegra)
- - Ethernet + + Base OS package... - + -
+
-
- workspace +
+ 2D object detection
- - workspace + + 2D object detection - + -
+
-
- TIER IV Automotive HDR camera driver +
+ 2D object tracking
- - TIER IV Automotive HDR camera driver + + 2D object tracking - + -
+
-
- Base docker image +
+ experimental +
+ functions
- - Base docker image + + experimental... - + -
+
-
- Thin wrapped image +
+ user defined +
+ functions
- - Thin wrapped image + + user defined... - + + -
-
-
- Base OS package -
- (a.k.a Linux4Tegra) +
+
+
+ + + edge-auto-jetson + +
- - Base OS package... + + edge-auto-jetson - - - - - - - Viewer does not support full SVG 1.1 + Text is not SVG - cannot display diff --git a/experimental.repos b/experimental.repos new file mode 100644 index 0000000..e69de29