├── ansible ├── CATKIN_IGNORE ├── .gitignore ├── inventories │ └── local-dev.ini ├── ansible.cfg ├── roles │ ├── lttng │ │ ├── defaults │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── ros-tracing │ │ ├── defaults │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── visualizer │ │ ├── defaults │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── cyclonedds │ │ └── tasks │ │ │ └── main.yml │ ├── caret │ │ ├── defaults │ │ │ └── main.yml │ │ ├── templates │ │ │ ├── caret_topic_filter.bash.jinja2 │ │ │ └── setenv_caret.bash.jinja2 │ │ └── tasks │ │ │ └── main.yml │ ├── caret_iron │ │ ├── defaults │ │ │ └── main.yml │ │ ├── templates │ │ │ ├── caret_topic_filter.bash.jinja2 │ │ │ └── setenv_caret.bash.jinja2 │ │ └── tasks │ │ │ └── main.yml │ └── caret_jazzy │ │ ├── defaults │ │ └── main.yml │ │ ├── templates │ │ ├── caret_topic_filter.bash.jinja2 │ │ └── setenv_caret.bash.jinja2 │ │ └── tasks │ │ └── main.yml ├── playbook.yml ├── playbook_iron.yml └── playbook_jazzy.yml ├── .prettierignore ├── .cspell.json ├── docker ├── README.md └── build_autoware.dockerfile ├── .pre-commit-config-optional.yaml ├── .ansible-lint ├── .github ├── dependabot.yaml ├── workflows │ ├── semantic-pull-request.yaml │ ├── spell-check-differential.yaml │ ├── pre-commit-optional.yaml │ ├── build_autoware.yaml │ ├── pre-commit.yaml │ └── sync-files.yaml ├── sync-files.yaml ├── ISSUE_TEMPLATE │ ├── question.yaml │ ├── feature_request.yaml │ └── issue.yaml ├── pull_request_template.md └── CONTRIBUTING.md ├── .markdownlint.yaml ├── requirements.txt ├── .markdown-link-check.json ├── .prettierrc.yaml ├── .yamllint.yaml ├── caret_iron.repos ├── caret_jazzy.repos ├── release_script ├── template_caret.repos └── release_caret.sh ├── .pre-commit-config.yaml ├── caret.repos ├── .gitignore ├── setup_caret.sh ├── README.md └── LICENSE /ansible/CATKIN_IGNORE: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ansible/.gitignore: -------------------------------------------------------------------------------- 1 | *.retry 2 | -------------------------------------------------------------------------------- /ansible/inventories/local-dev.ini: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | *.param.yaml 2 | *.rviz 3 | -------------------------------------------------------------------------------- /ansible/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | cow_selection = random 3 | -------------------------------------------------------------------------------- /ansible/roles/lttng/defaults/main.yml: -------------------------------------------------------------------------------- 1 | lttng_version: stable-2.13 2 | -------------------------------------------------------------------------------- /.cspell.json: -------------------------------------------------------------------------------- 1 | { 2 | "import": ["@tier4/cspell-dicts/caret/cspell-ext.json"] 3 | } 4 | -------------------------------------------------------------------------------- /ansible/roles/ros-tracing/defaults/main.yml: -------------------------------------------------------------------------------- 1 | requirements_path: src/CARET/ros2caret/requirements.txt 2 | -------------------------------------------------------------------------------- /ansible/roles/visualizer/defaults/main.yml: -------------------------------------------------------------------------------- 1 | requirements_path: src/CARET/caret_analyze/src/requirements.txt 2 | -------------------------------------------------------------------------------- /docker/README.md: -------------------------------------------------------------------------------- 1 | ```sh 2 | cd ros2_caret_ws 3 | docker image build -t caret/caret -f ./docker/build_autoware.dockerfile . 4 | ``` 5 | -------------------------------------------------------------------------------- /.pre-commit-config-optional.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/tcort/markdown-link-check 3 | rev: v3.12.1 4 | hooks: 5 | - id: markdown-link-check 6 | args: [--quiet, --config=.markdown-link-check.json] 7 | -------------------------------------------------------------------------------- /.ansible-lint: -------------------------------------------------------------------------------- 1 | exclude_paths: 2 | - src/ 3 | 4 | skip_list: 5 | - meta-no-info # We don't publish to Ansible Galaxy. 6 | - package-latest # Since this is a development environment, we allow the latest versions. 7 | 8 | warn_list: [] 9 | -------------------------------------------------------------------------------- /.github/dependabot.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: / 5 | schedule: 6 | interval: daily 7 | open-pull-requests-limit: 1 8 | labels: 9 | - tag:bot 10 | - type:github-actions 11 | -------------------------------------------------------------------------------- /ansible/roles/cyclonedds/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: cyclonedds (Disable description to hide symbols) 2 | command: sed -i "s/^set_property(TARGET ddsc PROPERTY C_VISIBILITY_PRESET hidden)/\# &/" "{{ WORKSPACE_ROOT }}"/src/eclipse-cyclonedds/cyclonedds/src/core/CMakeLists.txt 3 | -------------------------------------------------------------------------------- /.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | # See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md for all rules. 2 | default: true 3 | MD013: false 4 | MD024: 5 | siblings_only: true 6 | MD029: 7 | style: ordered 8 | MD033: false 9 | MD041: false 10 | MD046: false 11 | MD049: false 12 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | jupyterlab 2 | pybind11 3 | pytest-mock 4 | flake8-blind-except 5 | flake8-builtins 6 | flake8-class-newline 7 | flake8-comprehensions 8 | flake8-deprecated 9 | flake8-docstrings 10 | flake8-import-order 11 | flake8-quotes 12 | pytest-repeat 13 | pytest-rerunfailures 14 | pytest 15 | -------------------------------------------------------------------------------- /ansible/roles/caret/defaults/main.yml: -------------------------------------------------------------------------------- 1 | rosdistro: humble 2 | targeted_skip_keys: console_bridge fastcdr fastrtps rti-connext-dds-6.0.1 urdfdom_headers 3 | setenv_caret_script_template: setenv_caret.bash.jinja2 4 | caret_topic_filter_template: caret_topic_filter.bash.jinja2 5 | requirements_path: requirements.txt 6 | -------------------------------------------------------------------------------- /ansible/roles/caret_iron/defaults/main.yml: -------------------------------------------------------------------------------- 1 | rosdistro: iron 2 | targeted_skip_keys: console_bridge fastcdr fastrtps rti-connext-dds-6.0.1 urdfdom_headers 3 | setenv_caret_script_template: setenv_caret.bash.jinja2 4 | caret_topic_filter_template: caret_topic_filter.bash.jinja2 5 | requirements_path: requirements.txt 6 | -------------------------------------------------------------------------------- /ansible/roles/caret_jazzy/defaults/main.yml: -------------------------------------------------------------------------------- 1 | rosdistro: jazzy 2 | targeted_skip_keys: console_bridge fastcdr fastrtps rti-connext-dds-6.0.1 urdfdom_headers 3 | setenv_caret_script_template: setenv_caret.bash.jinja2 4 | caret_topic_filter_template: caret_topic_filter.bash.jinja2 5 | requirements_path: requirements.txt 6 | -------------------------------------------------------------------------------- /.github/workflows/semantic-pull-request.yaml: -------------------------------------------------------------------------------- 1 | name: semantic-pull-request 2 | 3 | on: 4 | pull_request_target: 5 | types: 6 | - opened 7 | - edited 8 | - synchronize 9 | 10 | jobs: 11 | semantic-pull-request: 12 | uses: autowarefoundation/autoware-github-actions/.github/workflows/semantic-pull-request.yaml@v1 13 | -------------------------------------------------------------------------------- /.markdown-link-check.json: -------------------------------------------------------------------------------- 1 | { 2 | "aliveStatusCodes": [200, 206, 403], 3 | "ignorePatterns": [ 4 | { 5 | "pattern": "^http://localhost" 6 | }, 7 | { 8 | "pattern": "^http://127\\.0\\.0\\.1" 9 | }, 10 | { 11 | "pattern": "^https://github.com/.*/discussions/new" 12 | } 13 | ], 14 | "retryOn429": true, 15 | "retryCount": 10 16 | } 17 | -------------------------------------------------------------------------------- /ansible/roles/visualizer/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install graphviz 2 | apt: 3 | name: 4 | - graphviz 5 | - graphviz-dev 6 | update_cache: true 7 | become: true 8 | 9 | - name: Install caret dependent packages 10 | pip: 11 | requirements: "{{ requirements_path }}" 12 | executable: pip3 13 | extra_args: --ignore-installed 14 | become: false 15 | args: 16 | chdir: "{{ WORKSPACE_ROOT }}" 17 | -------------------------------------------------------------------------------- /ansible/roles/caret/templates/caret_topic_filter.bash.jinja2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export CARET_IGNORE_NODES=\ 4 | "\ 5 | /rviz*\ 6 | " 7 | 8 | export CARET_IGNORE_TOPICS=\ 9 | "\ 10 | /clock:\ 11 | /parameter_events\ 12 | " 13 | 14 | # if you want to select nodes or topics, 15 | # please remove comment out of the followings. 16 | # export CARET_SELECT_NODES=\ 17 | # "\ 18 | # /rviz*\ 19 | # " 20 | 21 | # export CARET_SELECT_TOPICS=\ 22 | # "\ 23 | # /clock:\ 24 | # /parameter_events\ 25 | # " 26 | -------------------------------------------------------------------------------- /ansible/roles/caret_iron/templates/caret_topic_filter.bash.jinja2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export CARET_IGNORE_NODES=\ 4 | "\ 5 | /rviz*\ 6 | " 7 | 8 | export CARET_IGNORE_TOPICS=\ 9 | "\ 10 | /clock:\ 11 | /parameter_events\ 12 | " 13 | 14 | # if you want to select nodes or topics, 15 | # please remove comment out of the followings. 16 | # export CARET_SELECT_NODES=\ 17 | # "\ 18 | # /rviz*\ 19 | # " 20 | 21 | # export CARET_SELECT_TOPICS=\ 22 | # "\ 23 | # /clock:\ 24 | # /parameter_events\ 25 | # " 26 | -------------------------------------------------------------------------------- /ansible/roles/caret_jazzy/templates/caret_topic_filter.bash.jinja2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export CARET_IGNORE_NODES=\ 4 | "\ 5 | /rviz*\ 6 | " 7 | 8 | export CARET_IGNORE_TOPICS=\ 9 | "\ 10 | /clock:\ 11 | /parameter_events\ 12 | " 13 | 14 | # if you want to select nodes or topics, 15 | # please remove comment out of the followings. 16 | # export CARET_SELECT_NODES=\ 17 | # "\ 18 | # /rviz*\ 19 | # " 20 | 21 | # export CARET_SELECT_TOPICS=\ 22 | # "\ 23 | # /clock:\ 24 | # /parameter_events\ 25 | # " 26 | -------------------------------------------------------------------------------- /.github/workflows/spell-check-differential.yaml: -------------------------------------------------------------------------------- 1 | name: spell-check-differential 2 | 3 | on: 4 | pull_request: 5 | 6 | jobs: 7 | spell-check-differential: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Check out repository 11 | uses: actions/checkout@v5 12 | 13 | - name: Run spell-check 14 | uses: autowarefoundation/autoware-github-actions/spell-check@v1 15 | with: 16 | cspell-json-url: https://raw.githubusercontent.com/tier4/autoware-spell-check-dict/main/.cspell.json 17 | -------------------------------------------------------------------------------- /.prettierrc.yaml: -------------------------------------------------------------------------------- 1 | printWidth: 100 2 | tabWidth: 2 3 | overrides: 4 | - files: package.xml 5 | options: 6 | printWidth: 1000 7 | xmlSelfClosingSpace: false 8 | xmlWhitespaceSensitivity: ignore 9 | 10 | - files: "*.launch.xml" 11 | options: 12 | printWidth: 200 13 | xmlSelfClosingSpace: false 14 | xmlWhitespaceSensitivity: ignore 15 | 16 | - files: "*.xacro" 17 | options: 18 | printWidth: 200 19 | xmlSelfClosingSpace: false 20 | xmlWhitespaceSensitivity: ignore 21 | -------------------------------------------------------------------------------- /ansible/roles/lttng/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: LTTng (add source list) 2 | apt_repository: 3 | repo: ppa:lttng/{{ lttng_version }} 4 | update_cache: true 5 | become: true 6 | 7 | - name: LTTng (apt install lttng/{{ lttng_version }}) 8 | apt: 9 | name: 10 | - lttng-tools 11 | - liblttng-ust-dev 12 | state: latest 13 | become: true 14 | 15 | - name: LTTng (install babeltrace) 16 | apt: 17 | name: 18 | - python3-babeltrace 19 | - python3-lttng 20 | state: latest 21 | become: true 22 | -------------------------------------------------------------------------------- /.github/workflows/pre-commit-optional.yaml: -------------------------------------------------------------------------------- 1 | name: pre-commit-optional 2 | 3 | on: 4 | pull_request: 5 | 6 | jobs: 7 | pre-commit-optional: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Check out repository 11 | uses: actions/checkout@v5 12 | with: 13 | fetch-depth: 0 14 | 15 | - name: Run pre-commit 16 | uses: autowarefoundation/autoware-github-actions/pre-commit@v1 17 | with: 18 | pre-commit-config: .pre-commit-config-optional.yaml 19 | base-branch: origin/${{ github.base_ref }} 20 | -------------------------------------------------------------------------------- /.yamllint.yaml: -------------------------------------------------------------------------------- 1 | extends: default 2 | 3 | ignore: | 4 | *.param.yaml 5 | 6 | rules: 7 | braces: 8 | level: error 9 | max-spaces-inside: 1 # To format with Prettier 10 | comments: 11 | level: error 12 | min-spaces-from-content: 1 # To be compatible with C++ and Python 13 | document-start: 14 | level: error 15 | present: false # Don't need document start markers 16 | line-length: disable # Delegate to Prettier 17 | truthy: 18 | level: error 19 | check-keys: false # To allow 'on' of GitHub Actions 20 | quoted-strings: 21 | level: error 22 | required: only-when-needed # To keep consistent style 23 | -------------------------------------------------------------------------------- /.github/sync-files.yaml: -------------------------------------------------------------------------------- 1 | - repository: autowarefoundation/autoware 2 | files: 3 | - source: .github/dependabot.yaml 4 | - source: .github/workflows/pre-commit.yaml 5 | - source: .github/workflows/pre-commit-optional.yaml 6 | - source: .github/workflows/semantic-pull-request.yaml 7 | - source: .github/workflows/spell-check-differential.yaml 8 | - source: .github/workflows/sync-files.yaml 9 | - source: .markdown-link-check.json 10 | - source: .markdownlint.yaml 11 | - source: .pre-commit-config-optional.yaml 12 | - source: .prettierignore 13 | - source: .prettierrc.yaml 14 | - source: .yamllint.yaml 15 | 16 | - repository: tier4/caret_common 17 | files: 18 | - source: .cspell.json 19 | -------------------------------------------------------------------------------- /.github/workflows/build_autoware.yaml: -------------------------------------------------------------------------------- 1 | name: Build with Autoware 2 | 3 | on: 4 | schedule: 5 | - cron: 0 17 * * * # run at 2 AM JST 6 | # pull_request: 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-22.04 12 | 13 | steps: 14 | - name: Check out repository 15 | uses: actions/checkout@v5 16 | 17 | - name: Clean up disk space 18 | run: | 19 | sudo apt-get autoremove -y 20 | sudo apt-get clean 21 | sudo rm -rf /usr/share/dotnet 22 | docker system prune -a -f --volumes || true 23 | 24 | - name: Docker Build 25 | run: | 26 | docker pull osrf/ros:humble-desktop 27 | docker image build --no-cache=true -t caret/caret_autoware:latest -f ./docker/build_autoware.dockerfile ./ 28 | -------------------------------------------------------------------------------- /caret_iron.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | CARET/caret_trace: 3 | type: git 4 | url: https://github.com/tier4/caret_trace.git 5 | version: main 6 | CARET/caret_analyze: 7 | type: git 8 | url: https://github.com/tier4/caret_analyze.git 9 | version: main 10 | CARET/caret_analyze_cpp_impl: 11 | type: git 12 | url: https://github.com/tier4/caret_analyze_cpp_impl.git 13 | version: main 14 | CARET/ros2caret: 15 | type: git 16 | url: https://github.com/tier4/ros2caret.git 17 | version: main 18 | # Dependency for CI/CD 19 | CARET/caret_common: 20 | type: git 21 | url: https://github.com/tier4/caret_common.git 22 | version: main 23 | eclipse-cyclonedds/cyclonedds: 24 | type: git 25 | url: https://github.com/eclipse-cyclonedds/cyclonedds.git 26 | version: releases/0.10.x 27 | -------------------------------------------------------------------------------- /caret_jazzy.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | CARET/caret_trace: 3 | type: git 4 | url: https://github.com/tier4/caret_trace.git 5 | version: main 6 | CARET/caret_analyze: 7 | type: git 8 | url: https://github.com/tier4/caret_analyze.git 9 | version: main 10 | CARET/caret_analyze_cpp_impl: 11 | type: git 12 | url: https://github.com/tier4/caret_analyze_cpp_impl.git 13 | version: main 14 | CARET/ros2caret: 15 | type: git 16 | url: https://github.com/tier4/ros2caret.git 17 | version: main 18 | # Dependency for CI/CD 19 | CARET/caret_common: 20 | type: git 21 | url: https://github.com/tier4/caret_common.git 22 | version: main 23 | eclipse-cyclonedds/cyclonedds: 24 | type: git 25 | url: https://github.com/eclipse-cyclonedds/cyclonedds.git 26 | version: releases/0.10.x 27 | -------------------------------------------------------------------------------- /ansible/roles/ros-tracing/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install dependencies of python 2 | apt: 3 | name: 4 | - build-essential 5 | - python3-bt2 6 | become: true 7 | 8 | - name: install some python modules for caret 9 | pip: 10 | requirements: "{{ requirements_path }}" 11 | executable: pip3 12 | become: false 13 | args: 14 | chdir: "{{ WORKSPACE_ROOT }}" 15 | 16 | - name: Install ros-tracing 17 | apt: 18 | name: 19 | - ros-{{ rosdistro }}-ros2trace 20 | - ros-{{ rosdistro }}-ros2trace-analysis 21 | - ros-{{ rosdistro }}-tracetools 22 | - ros-{{ rosdistro }}-tracetools-analysis 23 | - ros-{{ rosdistro }}-tracetools-launch 24 | - ros-{{ rosdistro }}-tracetools-read 25 | - ros-{{ rosdistro }}-tracetools-test 26 | - ros-{{ rosdistro }}-tracetools-trace 27 | become: true 28 | -------------------------------------------------------------------------------- /ansible/roles/caret/templates/setenv_caret.bash.jinja2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /opt/ros/{{ rosdistro }}/setup.bash 4 | source {{ WORKSPACE_ROOT }}/install/local_setup.bash 5 | source {{ WORKSPACE_ROOT }}/caret_topic_filter.bash 6 | 7 | export LD_PRELOAD=$(readlink -f {{ WORKSPACE_ROOT}}/install/caret_trace/lib/libcaret.so):$LD_PRELOAD 8 | 9 | USERNAME=$(whoami) 10 | ps -axo user:32,command | grep lttng-sessiond | grep $USERNAME | grep -v grep > /dev/null 11 | if [ $? -ne 0 ]; then 12 | lttng-sessiond --daemonize 13 | fi 14 | 15 | # If you want to apply CARET to a large application, 16 | # it is recommended to increase the maximum number of 17 | # file descriptors to avoid data loss. 18 | # Execute ulimit command as below. 19 | # ulimit -n 16384 20 | 21 | # Add user application built with caret/rclcpp 22 | # source /path/to/your/application/install/setup.bash 23 | -------------------------------------------------------------------------------- /ansible/roles/caret_iron/templates/setenv_caret.bash.jinja2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /opt/ros/{{ rosdistro }}/setup.bash 4 | source {{ WORKSPACE_ROOT }}/install/local_setup.bash 5 | source {{ WORKSPACE_ROOT }}/caret_topic_filter.bash 6 | 7 | export LD_PRELOAD=$(readlink -f {{ WORKSPACE_ROOT}}/install/caret_trace/lib/libcaret.so):$LD_PRELOAD 8 | 9 | USERNAME=$(whoami) 10 | ps -axo user:32,command | grep lttng-sessiond | grep $USERNAME | grep -v grep > /dev/null 11 | if [ $? -ne 0 ]; then 12 | lttng-sessiond --daemonize 13 | fi 14 | 15 | # If you want to apply CARET to a large application, 16 | # it is recommended to increase the maximum number of 17 | # file descriptors to avoid data loss. 18 | # Execute ulimit command as below. 19 | # ulimit -n 16384 20 | 21 | # Add user application built with caret/rclcpp 22 | # source /path/to/your/application/install/setup.bash 23 | -------------------------------------------------------------------------------- /ansible/roles/caret_jazzy/templates/setenv_caret.bash.jinja2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /opt/ros/{{ rosdistro }}/setup.bash 4 | source {{ WORKSPACE_ROOT }}/install/local_setup.bash 5 | source {{ WORKSPACE_ROOT }}/caret_topic_filter.bash 6 | 7 | export LD_PRELOAD=$(readlink -f {{ WORKSPACE_ROOT}}/install/caret_trace/lib/libcaret.so):$LD_PRELOAD 8 | 9 | USERNAME=$(whoami) 10 | ps -axo user:32,command | grep lttng-sessiond | grep $USERNAME | grep -v grep > /dev/null 11 | if [ $? -ne 0 ]; then 12 | lttng-sessiond --daemonize 13 | fi 14 | 15 | # If you want to apply CARET to a large application, 16 | # it is recommended to increase the maximum number of 17 | # file descriptors to avoid data loss. 18 | # Execute ulimit command as below. 19 | # ulimit -n 16384 20 | 21 | # Add user application built with caret/rclcpp 22 | # source /path/to/your/application/install/setup.bash 23 | -------------------------------------------------------------------------------- /.github/workflows/pre-commit.yaml: -------------------------------------------------------------------------------- 1 | name: pre-commit 2 | 3 | on: 4 | pull_request: 5 | 6 | jobs: 7 | pre-commit: 8 | if: ${{ github.event.repository.private }} # Use pre-commit.ci for public repositories 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Generate token 12 | id: generate-token 13 | uses: tibdex/github-app-token@v2 14 | with: 15 | app_id: ${{ secrets.APP_ID }} 16 | private_key: ${{ secrets.PRIVATE_KEY }} 17 | 18 | - name: Check out repository 19 | uses: actions/checkout@v5 20 | with: 21 | ref: ${{ github.event.pull_request.head.ref }} 22 | 23 | - name: Run pre-commit 24 | uses: autowarefoundation/autoware-github-actions/pre-commit@v1 25 | with: 26 | pre-commit-config: .pre-commit-config.yaml 27 | token: ${{ steps.generate-token.outputs.token }} 28 | -------------------------------------------------------------------------------- /ansible/playbook.yml: -------------------------------------------------------------------------------- 1 | - hosts: localhost 2 | connection: local 3 | become: false 4 | vars_prompt: 5 | - name: package_install 6 | prompt: Would you like to install the require packages[y/n] 7 | default: y 8 | private: false 9 | pre_tasks: 10 | - name: Verify OS 11 | ansible.builtin.fail: 12 | msg: Only Ubuntu 22.04 is supported for this branch. Please refer to https://tier4.github.io/caret_doc/latest/installation/installation/ 13 | when: ansible_distribution_version != '22.04' 14 | 15 | roles: 16 | - { role: lttng, tags: [lttng], when: package_install == 'y' } 17 | - { role: ros-tracing, rosdistro: humble, tags: [ros-tracing], when: package_install == 'y' } 18 | - { role: visualizer, tags: [visualizer], when: package_install == 'y' } 19 | - { role: caret, rosdistro: humble, tags: [caret] } 20 | - { role: cyclonedds, rosdistro: humble, tags: [cyclonedds] } 21 | -------------------------------------------------------------------------------- /ansible/playbook_iron.yml: -------------------------------------------------------------------------------- 1 | - hosts: localhost 2 | connection: local 3 | become: false 4 | vars_prompt: 5 | - name: package_install 6 | prompt: Would you like to install the require packages[y/n] 7 | default: y 8 | private: false 9 | pre_tasks: 10 | - name: Verify OS 11 | ansible.builtin.fail: 12 | msg: Only Ubuntu 22.04 is supported for this branch. Please refer to https://tier4.github.io/caret_doc/latest/installation/installation/ 13 | when: ansible_distribution_version != '22.04' 14 | 15 | roles: 16 | - { role: lttng, tags: [lttng], when: package_install == 'y' } 17 | - { role: ros-tracing, rosdistro: iron, tags: [ros-tracing], when: package_install == 'y' } 18 | - { role: visualizer, tags: [visualizer], when: package_install == 'y' } 19 | - { role: caret_iron, rosdistro: iron, tags: [caret] } 20 | - { role: cyclonedds, rosdistro: iron, tags: [cyclonedds] } 21 | -------------------------------------------------------------------------------- /ansible/playbook_jazzy.yml: -------------------------------------------------------------------------------- 1 | - hosts: localhost 2 | connection: local 3 | become: false 4 | vars_prompt: 5 | - name: package_install 6 | prompt: Would you like to install the require packages[y/n] 7 | default: y 8 | private: false 9 | pre_tasks: 10 | - name: Verify OS 11 | ansible.builtin.fail: 12 | msg: Only Ubuntu 24.04 is supported for this branch. Please refer to https://tier4.github.io/caret_doc/latest/installation/installation/ 13 | when: ansible_distribution_version != '24.04' 14 | 15 | roles: 16 | - { role: lttng, tags: [lttng], when: package_install == 'y' } 17 | - { role: ros-tracing, rosdistro: jazzy, tags: [ros-tracing], when: package_install == 'y' } 18 | - { role: visualizer, tags: [visualizer], when: package_install == 'y' } 19 | - { role: caret_jazzy, rosdistro: jazzy, tags: [caret] } 20 | - { role: cyclonedds, rosdistro: jazzy, tags: [cyclonedds] } 21 | -------------------------------------------------------------------------------- /.github/workflows/sync-files.yaml: -------------------------------------------------------------------------------- 1 | name: sync-files 2 | 3 | on: 4 | schedule: 5 | - cron: 0 0 * * * 6 | workflow_dispatch: 7 | 8 | jobs: 9 | check-secret: 10 | uses: autowarefoundation/autoware-github-actions/.github/workflows/check-secret.yaml@v1 11 | secrets: 12 | secret: ${{ secrets.APP_ID }} 13 | 14 | sync-files: 15 | needs: check-secret 16 | if: ${{ needs.check-secret.outputs.set == 'true' }} 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Generate token 20 | id: generate-token 21 | uses: tibdex/github-app-token@v2 22 | with: 23 | app_id: ${{ secrets.APP_ID }} 24 | private_key: ${{ secrets.PRIVATE_KEY }} 25 | 26 | - name: Run sync-files 27 | uses: autowarefoundation/autoware-github-actions/sync-files@v1 28 | with: 29 | token: ${{ steps.generate-token.outputs.token }} 30 | pr-labels: | 31 | tag:bot 32 | tag:sync-files 33 | auto-merge-method: squash 34 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.yaml: -------------------------------------------------------------------------------- 1 | name: Question 2 | description: Ask a general question 3 | labels: [question] 4 | body: 5 | - type: checkboxes 6 | attributes: 7 | label: Checklist 8 | description: Confirm the following items before proceeding. 9 | options: 10 | - label: I've read the [contribution guidelines](https://github.com/tier4/caret/blob/main/.github/CONTRIBUTING.md). 11 | required: true 12 | - label: I've read [document](https://tier4.github.io/CARET_doc/main/) and no solution were found. 13 | required: true 14 | 15 | - type: dropdown 16 | id: step 17 | attributes: 18 | label: Step where the question is related to 19 | description: Which step is the question related to? 20 | multiple: true 21 | options: 22 | - Setup 23 | - Build 24 | - Recording 25 | - Visualization 26 | - Documentation 27 | - Others 28 | validations: 29 | required: true 30 | 31 | - type: textarea 32 | id: question_description 33 | attributes: 34 | label: Description 35 | description: Describe the question. 36 | validations: 37 | required: true 38 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yaml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Suggest an idea for this project 3 | labels: [enhancement] 4 | body: 5 | - type: checkboxes 6 | attributes: 7 | label: Checklist 8 | description: Confirm the following items before proceeding. 9 | options: 10 | - label: I've read the [contribution guidelines](https://github.com/tier4/caret/blob/main/.github/CONTRIBUTING.md). 11 | required: true 12 | - label: I've read [document](https://tier4.github.io/CARET_doc/main/) and no solution were found. 13 | required: true 14 | 15 | - type: dropdown 16 | id: step 17 | attributes: 18 | label: Step where the feature is related to 19 | description: Which step is the feature related to? 20 | multiple: true 21 | options: 22 | - Setup 23 | - Build 24 | - Recording 25 | - Visualization 26 | - Documentation 27 | - Others 28 | validations: 29 | required: true 30 | 31 | - type: textarea 32 | id: feature_description 33 | attributes: 34 | label: Description 35 | description: Describe the feature. 36 | validations: 37 | required: true 38 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | 4 | 5 | ## Related links 6 | 7 | 8 | 9 | ## Notes for reviewers 10 | 11 | 12 | 13 | ## Pre-review checklist for the PR author 14 | 15 | - [ ] I've confirmed the [contribution guidelines](https://github.com/tier4/caret/blob/main/.github/CONTRIBUTING.md). 16 | - [ ] The PR is ready for review. 17 | 18 | ## In-review checklist for the PR reviewers 19 | 20 | The PR reviewers **must** check the checkboxes below before approval. 21 | 22 | - [ ] The PR has been properly tested. 23 | - [ ] The PR has been reviewed. 24 | 25 | ## Post-review checklist for the PR author 26 | 27 | The PR author **must** check the checkboxes below before merging. 28 | 29 | - [ ] (Optional) The PR has been properly tested with CARET_report verification. 30 | - [ ] There are no open discussions or they are tracked via tickets. 31 | - [ ] The PR is ready for merge. 32 | 33 | After all checkboxes are checked, anyone who has write access can merge the PR. 34 | -------------------------------------------------------------------------------- /release_script/template_caret.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | ros2/rcl: 3 | type: git 4 | url: https://github.com/ros2/rcl.git 5 | version: RCL_HASH 6 | ros2/rclcpp: 7 | type: git 8 | url: https://github.com/tier4/rclcpp.git 9 | version: RCLCPP_HASH 10 | ros-tracing/ros2_tracing: 11 | type: git 12 | url: https://github.com/tier4/ros2_tracing.git 13 | version: ROS_TRACING_HASH 14 | CARET/caret_trace: 15 | type: git 16 | url: https://github.com/tier4/caret_trace.git 17 | version: CARET_TAG 18 | CARET/caret_analyze: 19 | type: git 20 | url: https://github.com/tier4/caret_analyze.git 21 | version: CARET_TAG 22 | CARET/caret_analyze_cpp_impl: 23 | type: git 24 | url: https://github.com/tier4/caret_analyze_cpp_impl.git 25 | version: CARET_TAG 26 | CARET/ros2caret: 27 | type: git 28 | url: https://github.com/tier4/ros2caret.git 29 | version: CARET_TAG 30 | CARET/caret_common: 31 | type: git 32 | url: https://github.com/tier4/caret_common.git 33 | version: CARET_TAG 34 | eclipse-cyclonedds/cyclonedds: 35 | type: git 36 | url: https://github.com/eclipse-cyclonedds/cyclonedds.git 37 | version: CYCLONEDDS_HASH 38 | ros-tooling/topic_tools: 39 | type: git 40 | url: https://github.com/ros-tooling/topic_tools.git 41 | version: TOPIC_TOOLS_HASH 42 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | ci: 2 | autofix_commit_msg: "ci(pre-commit): autofix" 3 | autoupdate_commit_msg: "ci(pre-commit): autoupdate" 4 | 5 | repos: 6 | - repo: https://github.com/pre-commit/pre-commit-hooks 7 | rev: v4.6.0 8 | hooks: 9 | - id: check-json 10 | - id: check-merge-conflict 11 | - id: check-toml 12 | - id: check-xml 13 | - id: check-yaml 14 | - id: detect-private-key 15 | - id: end-of-file-fixer 16 | - id: mixed-line-ending 17 | - id: trailing-whitespace 18 | args: [--markdown-linebreak-ext=md] 19 | 20 | - repo: https://github.com/igorshubovych/markdownlint-cli 21 | rev: v0.41.0 22 | hooks: 23 | - id: markdownlint 24 | args: [-c, .markdownlint.yaml, --fix] 25 | 26 | - repo: https://github.com/pre-commit/mirrors-prettier 27 | rev: v4.0.0-alpha.8 28 | hooks: 29 | - id: prettier 30 | 31 | - repo: https://github.com/adrienverge/yamllint 32 | rev: v1.35.1 33 | hooks: 34 | - id: yamllint 35 | 36 | - repo: https://github.com/shellcheck-py/shellcheck-py 37 | rev: v0.10.0.1 38 | hooks: 39 | - id: shellcheck 40 | 41 | - repo: https://github.com/scop/pre-commit-shfmt 42 | rev: v3.9.0-1 43 | hooks: 44 | - id: shfmt 45 | args: [-w, -s, -i=4] 46 | 47 | - repo: https://github.com/AleksaC/hadolint-py 48 | rev: v2.12.1b3 49 | hooks: 50 | - id: hadolint 51 | 52 | exclude: .svg 53 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thank you for investing your time in contributing to CARET. In this guide you will get an overview of the contribution. 4 | 5 | ## Getting started 6 | 7 | To get an overview of the project, read the [CARET document](https://tier4.github.io/CARET_doc/main/). The document guides you will get how to use CARET, the design and the internals of CARET. 8 | 9 | ## Issues 10 | 11 | ### Create a new issue 12 | 13 | When you create a new issue, [search FAQ in the document for known issues/solutions](https://tier4.github.io/CARET_doc/main/faq/faq). 14 | 15 | CARET consists of multi repositories and is a meta repository. A new issue should be created in the meta repository, unless the issue is explicitly related to a certain repository. 16 | 17 | ### Solve an issue 18 | 19 | Scan through our [existing issues](https://github.com/tier4/caret/issues) to find one that interests you. You can narrow down the search using `labels` as filters. If you find an issue to work on, you are welcome to open a PR with a fix. 20 | 21 | ## Pull Request 22 | 23 | When you're finished with the changes, create a pull request, also known as a PR. Your PR will be submitted to a sub repository, so don't forget to link the PR to a issue if you are solving one. 24 | 25 | Your PR needs to pass checks in workflows like pytest, spell check, etc. Also, code review and approval from one or more other developers are required to be merged. 26 | -------------------------------------------------------------------------------- /caret.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | ros2/rcl: 3 | type: git 4 | url: https://github.com/ros2/rcl.git 5 | version: humble 6 | ros2/rclcpp: 7 | type: git 8 | url: https://github.com/tier4/rclcpp.git 9 | version: humble_tracepoint_added 10 | ros-tracing/ros2_tracing: 11 | type: git 12 | url: https://github.com/tier4/ros2_tracing.git 13 | version: humble_tracepoint_added 14 | CARET/caret_trace: 15 | type: git 16 | url: https://github.com/tier4/caret_trace.git 17 | version: main 18 | CARET/caret_analyze: 19 | type: git 20 | url: https://github.com/tier4/caret_analyze.git 21 | version: main 22 | CARET/caret_analyze_cpp_impl: 23 | type: git 24 | url: https://github.com/tier4/caret_analyze_cpp_impl.git 25 | version: main 26 | CARET/ros2caret: 27 | type: git 28 | url: https://github.com/tier4/ros2caret.git 29 | version: main 30 | # Dependency for CI/CD 31 | CARET/caret_common: 32 | type: git 33 | url: https://github.com/tier4/caret_common.git 34 | version: main 35 | 36 | ### Optional packages. Apply CARET for widely used pre-built packages ### 37 | ### Delete or change version depending on a target application ### 38 | eclipse-cyclonedds/cyclonedds: 39 | type: git 40 | url: https://github.com/eclipse-cyclonedds/cyclonedds.git 41 | version: releases/0.10.x 42 | ros-tooling/topic_tools: 43 | type: git 44 | url: https://github.com/ros-tooling/topic_tools.git 45 | version: 1.1.1 46 | -------------------------------------------------------------------------------- /ansible/roles/caret_jazzy/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: ROS2 (check rosdep file) 2 | stat: 3 | path: /etc/ros/rosdep/sources.list.d/20-default.list 4 | register: ros_repository 5 | 6 | - name: ROS2 (install rosdep) 7 | apt: 8 | name: python3-rosdep 9 | state: latest 10 | update_cache: true 11 | become: true 12 | 13 | - name: ROS2 (initialize rosdep) 14 | command: rosdep init 15 | when: ros_repository.stat.exists == false 16 | become: true 17 | 18 | - name: ROS2 (update rosdep) 19 | command: rosdep update 20 | become: false 21 | 22 | - name: caret (rosdep install dependencies) 23 | shell: | 24 | rosdep install -y --from-paths src --ignore-src --rosdistro {{ rosdistro }} -y --skip-keys "{{ targeted_skip_keys }}" 25 | args: 26 | chdir: "{{ WORKSPACE_ROOT }}" 27 | 28 | - name: caret (install some packages for build) 29 | apt: 30 | name: 31 | - ros-{{ rosdistro }}-osrf-testing-tools-cpp 32 | - ros-{{ rosdistro }}-performance-test-fixture 33 | - ros-{{ rosdistro }}-mimick-vendor 34 | - ros-{{ rosdistro }}-test-msgs 35 | - ros-{{ rosdistro }}-cyclonedds 36 | become: true 37 | 38 | - name: caret (install python module) 39 | pip: 40 | requirements: "{{ requirements_path }}" 41 | executable: pip3 42 | become: false 43 | args: 44 | chdir: "{{ WORKSPACE_ROOT }}" 45 | 46 | - name: caret (copy CARET setenv template as reference) 47 | ansible.builtin.template: 48 | src: "{{ setenv_caret_script_template }}" 49 | dest: "{{ WORKSPACE_ROOT }}/setenv_caret.bash" 50 | mode: 0755 51 | become: false 52 | 53 | - name: caret (copy topic filter as reference) 54 | ansible.builtin.template: 55 | src: "{{ caret_topic_filter_template }}" 56 | dest: "{{ WORKSPACE_ROOT }}/caret_topic_filter.bash" 57 | mode: 0755 58 | become: false 59 | -------------------------------------------------------------------------------- /ansible/roles/caret_iron/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: ROS2 (check rosdep file) 2 | stat: 3 | path: /etc/ros/rosdep/sources.list.d/20-default.list 4 | register: ros_repository 5 | 6 | - name: ROS2 (install rosdep) 7 | apt: 8 | name: python3-rosdep 9 | state: latest 10 | update_cache: true 11 | become: true 12 | 13 | - name: ROS2 (initialize rosdep) 14 | command: rosdep init 15 | when: ros_repository.stat.exists == false 16 | become: true 17 | 18 | - name: ROS2 (update rosdep) 19 | command: rosdep update --include-eol-distros 20 | become: false 21 | 22 | - name: caret (rosdep install dependencies) 23 | shell: | 24 | rosdep install -y --from-paths src --ignore-src --rosdistro {{ rosdistro }} -y --skip-keys "{{ targeted_skip_keys }}" 25 | args: 26 | chdir: "{{ WORKSPACE_ROOT }}" 27 | 28 | - name: caret (install some packages for build) 29 | apt: 30 | name: 31 | - ros-{{ rosdistro }}-osrf-testing-tools-cpp 32 | - ros-{{ rosdistro }}-performance-test-fixture 33 | - ros-{{ rosdistro }}-mimick-vendor 34 | - ros-{{ rosdistro }}-test-msgs 35 | - ros-{{ rosdistro }}-cyclonedds 36 | become: true 37 | 38 | - name: caret (install python module) 39 | pip: 40 | requirements: "{{ requirements_path }}" 41 | executable: pip3 42 | become: false 43 | args: 44 | chdir: "{{ WORKSPACE_ROOT }}" 45 | 46 | - name: caret (copy CARET setenv template as reference) 47 | ansible.builtin.template: 48 | src: "{{ setenv_caret_script_template }}" 49 | dest: "{{ WORKSPACE_ROOT }}/setenv_caret.bash" 50 | mode: 0755 51 | become: false 52 | 53 | - name: caret (copy topic filter as reference) 54 | ansible.builtin.template: 55 | src: "{{ caret_topic_filter_template }}" 56 | dest: "{{ WORKSPACE_ROOT }}/caret_topic_filter.bash" 57 | mode: 0755 58 | become: false 59 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # colcon 2 | build/ 3 | install/ 4 | log/ 5 | 6 | # Byte-compiled / optimized / DLL files 7 | __pycache__/ 8 | *.py[cod] 9 | *$py.class 10 | 11 | # C extensions 12 | *.so 13 | 14 | # Distribution / packaging 15 | .Python 16 | build/ 17 | develop-eggs/ 18 | dist/ 19 | downloads/ 20 | eggs/ 21 | .eggs/ 22 | lib/ 23 | lib64/ 24 | parts/ 25 | sdist/ 26 | var/ 27 | wheels/ 28 | pip-wheel-metadata/ 29 | share/python-wheels/ 30 | *.egg-info/ 31 | .installed.cfg 32 | *.egg 33 | MANIFEST 34 | 35 | # PyInstaller 36 | # Usually these files are written by a python script from a template 37 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 38 | *.manifest 39 | *.spec 40 | 41 | # Installer logs 42 | pip-log.txt 43 | pip-delete-this-directory.txt 44 | 45 | # Unit test / coverage reports 46 | htmlcov/ 47 | .tox/ 48 | .nox/ 49 | .coverage 50 | .coverage.* 51 | .cache 52 | nosetests.xml 53 | coverage.xml 54 | *.cover 55 | *.py,cover 56 | .hypothesis/ 57 | .pytest_cache/ 58 | 59 | # Translations 60 | *.mo 61 | *.pot 62 | 63 | # Django stuff: 64 | *.log 65 | local_settings.py 66 | db.sqlite3 67 | db.sqlite3-journal 68 | 69 | # Flask stuff: 70 | instance/ 71 | .webassets-cache 72 | 73 | # Scrapy stuff: 74 | .scrapy 75 | 76 | # Sphinx documentation 77 | docs/_build/ 78 | 79 | # PyBuilder 80 | target/ 81 | 82 | # Jupyter Notebook 83 | .ipynb_checkpoints 84 | 85 | # IPython 86 | profile_default/ 87 | ipython_config.py 88 | 89 | # pyenv 90 | .python-version 91 | 92 | # pipenv 93 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 94 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 95 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 96 | # install all needed dependencies. 97 | #Pipfile.lock 98 | 99 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 100 | __pypackages__/ 101 | 102 | # Celery stuff 103 | celerybeat-schedule 104 | celerybeat.pid 105 | 106 | # SageMath parsed files 107 | *.sage.py 108 | 109 | # Environments 110 | .env 111 | .venv 112 | env/ 113 | venv/ 114 | ENV/ 115 | env.bak/ 116 | venv.bak/ 117 | 118 | # Spyder project settings 119 | .spyderproject 120 | .spyproject 121 | 122 | # Rope project settings 123 | .ropeproject 124 | 125 | # mkdocs documentation 126 | /site 127 | 128 | # mypy 129 | .mypy_cache/ 130 | .dmypy.json 131 | dmypy.json 132 | 133 | # Pyre type checker 134 | .pyre/ 135 | 136 | # Visual Studio Code 137 | .vscode/ 138 | log/ 139 | -------------------------------------------------------------------------------- /ansible/roles/caret/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: ROS2 (check rosdep file) 2 | stat: 3 | path: /etc/ros/rosdep/sources.list.d/20-default.list 4 | register: ros_repository 5 | 6 | - name: ROS2 (install rosdep) 7 | apt: 8 | name: python3-rosdep 9 | state: latest 10 | update_cache: true 11 | become: true 12 | 13 | - name: ROS2 (initialize rosdep) 14 | command: rosdep init 15 | when: ros_repository.stat.exists == false 16 | become: true 17 | 18 | - name: ROS2 (update rosdep) 19 | command: rosdep update 20 | become: false 21 | 22 | - name: caret (rosdep install dependencies) 23 | shell: | 24 | rosdep install -y --from-paths src --ignore-src --rosdistro {{ rosdistro }} -y --skip-keys "{{ targeted_skip_keys }}" 25 | args: 26 | chdir: "{{ WORKSPACE_ROOT }}" 27 | 28 | - name: caret (install some packages for build) 29 | apt: 30 | name: 31 | - ros-{{ rosdistro }}-osrf-testing-tools-cpp 32 | - ros-{{ rosdistro }}-performance-test-fixture 33 | - ros-{{ rosdistro }}-mimick-vendor 34 | - ros-{{ rosdistro }}-test-msgs 35 | - ros-{{ rosdistro }}-cyclonedds 36 | become: true 37 | 38 | - name: caret (install python module) 39 | pip: 40 | requirements: "{{ requirements_path }}" 41 | executable: pip3 42 | become: false 43 | args: 44 | chdir: "{{ WORKSPACE_ROOT }}" 45 | 46 | - name: caret (make symbolic link to rclcpp) 47 | ansible.builtin.file: 48 | src: "{{ WORKSPACE_ROOT }}/src/ros-tracing/ros2_tracing/tracetools/include/tracetools" 49 | dest: "{{ WORKSPACE_ROOT }}/src/ros2/rclcpp/rclcpp/include/tracetools" 50 | state: link 51 | force: true 52 | 53 | - name: caret (make symbolic link to rclcpp_action) 54 | ansible.builtin.file: 55 | src: "{{ WORKSPACE_ROOT }}/src/ros2/rclcpp/rclcpp_action/include/rclcpp_action" 56 | dest: "{{ WORKSPACE_ROOT }}/src/ros2/rclcpp/rclcpp/include/rclcpp_action" 57 | state: link 58 | force: true 59 | 60 | - name: caret (make symbolic link to rclcpp_components) 61 | ansible.builtin.file: 62 | src: "{{ WORKSPACE_ROOT }}/src/ros2/rclcpp/rclcpp_components/include/rclcpp_components" 63 | dest: "{{ WORKSPACE_ROOT }}/src/ros2/rclcpp/rclcpp/include/rclcpp_components" 64 | state: link 65 | force: true 66 | 67 | - name: caret (make symbolic link to rclcpp_lifecycle) 68 | ansible.builtin.file: 69 | src: "{{ WORKSPACE_ROOT }}/src/ros2/rclcpp/rclcpp_lifecycle/include/rclcpp_lifecycle" 70 | dest: "{{ WORKSPACE_ROOT }}/src/ros2/rclcpp/rclcpp/include/rclcpp_lifecycle" 71 | state: link 72 | force: true 73 | 74 | - name: caret (copy CARET setenv template as reference) 75 | ansible.builtin.template: 76 | src: "{{ setenv_caret_script_template }}" 77 | dest: "{{ WORKSPACE_ROOT }}/setenv_caret.bash" 78 | mode: 0755 79 | become: false 80 | 81 | - name: caret (copy topic filter as reference) 82 | ansible.builtin.template: 83 | src: "{{ caret_topic_filter_template }}" 84 | dest: "{{ WORKSPACE_ROOT }}/caret_topic_filter.bash" 85 | mode: 0755 86 | become: false 87 | -------------------------------------------------------------------------------- /setup_caret.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -Ceu 4 | 5 | SCRIPT_DIR=$(readlink -f "$(dirname "$0")") 6 | 7 | function show_usage() { 8 | echo "${0} executes setup for CARET." 9 | echo "Options " 10 | echo " -h or --help: show help message" 11 | echo " -c or --no-interactive" 12 | echo " -n or --no-package-install" 13 | echo " -d or --ros-distro" 14 | exit 0 15 | } 16 | 17 | ALLOWED_ROS_DISTRO=("humble" "iron" "jazzy") 18 | 19 | function validate_ros_distro() { 20 | if [[ " ${ALLOWED_ROS_DISTRO[*]} " != *" $1 "* ]]; then 21 | echo "error: $1 is not supported ROS Distribution." >&2 22 | echo "Supported ROS Distributions are ${ALLOWED_ROS_DISTRO[*]}" >&2 23 | exit 1 24 | fi 25 | } 26 | 27 | # parse command options. 28 | OPT=$(getopt -o nchd: -l no-interactive,no-package-install,help,ros-distro: -- "$@") # cSpell:ignore nchd 29 | 30 | eval set -- "$OPT" 31 | 32 | # Parse args 33 | noninteractive=0 34 | package_install=1 35 | ros_distro=humble 36 | 37 | while true; do 38 | case $1 in 39 | -h | --help) 40 | show_usage 41 | ;; 42 | -c | --no-interactive) 43 | noninteractive=1 44 | shift 45 | ;; 46 | -n | --no-package-install) 47 | package_install=0 48 | shift 49 | ;; 50 | -d | --ros-distro) 51 | shift 52 | ros_distro=$1 53 | shift 54 | ;; 55 | --) 56 | shift 57 | break 58 | ;; 59 | esac 60 | done 61 | 62 | # Check ROS Distribution 63 | validate_ros_distro "$ros_distro" 64 | 65 | # Confirm whether to start installation 66 | if [ $noninteractive -eq 0 ]; then 67 | # Prevent root execution in interactive mode 68 | if [ "$(id -u)" -eq 0 ]; then 69 | echo "Do not run setup as root!" >&2 70 | exit 1 71 | fi 72 | 73 | echo "Setting up the build environment take up to 20 minutes." 74 | read -rp "> Are you sure you want to run setup? [y/N] " answer 75 | 76 | # Check whether to cancel 77 | if ! [[ ${answer:0:1} =~ y|Y ]]; then 78 | echo -e "\e[33mCancelled.\e[0m" 79 | exit 1 80 | fi 81 | else 82 | echo -e "\e[36mRun the setup in non-interactive mode.\e[m" 83 | fi 84 | 85 | # Install sudo 86 | if ! (command -v sudo >/dev/null 2>&1); then 87 | apt-get -y update 88 | apt-get -y install sudo 89 | fi 90 | 91 | # Install pip for ansible 92 | if ! (command -v pip3 >/dev/null 2>&1); then 93 | sudo apt-get -y update 94 | sudo apt-get -y install python3-pip 95 | fi 96 | 97 | # Run ansible if confirmed 98 | # Install ansible 99 | if [ "$ros_distro" = "jazzy" ]; then 100 | pip3 install -U ansible 101 | else 102 | ansible_version=$(pip3 list | grep -oP "^ansible\s+\K([0-9]+)" || true) 103 | if [ "$ansible_version" != "6" ]; then 104 | sudo apt-get -y update 105 | sudo apt-get -y purge ansible 106 | sudo pip3 install -U "ansible==6.*" 107 | fi 108 | fi 109 | 110 | # Set options 111 | if [ $noninteractive -eq 0 ]; then 112 | options=("--ask-become-pass") 113 | fi 114 | 115 | if [ $package_install -eq 0 ]; then 116 | options=("--extra-vars" "package_install=n") 117 | fi 118 | 119 | # Select playbook 120 | PLAYBOOK="playbook.yml" 121 | if [ "$ros_distro" = "iron" ]; then 122 | PLAYBOOK="playbook_iron.yml" 123 | elif [ "$ros_distro" = "jazzy" ]; then 124 | PLAYBOOK="playbook_jazzy.yml" 125 | fi 126 | 127 | # Run ansible 128 | if ansible-playbook "$SCRIPT_DIR/ansible/$PLAYBOOK" -e WORKSPACE_ROOT="$SCRIPT_DIR" "${options[@]}"; then 129 | echo -e "\e[32mCompleted.\e[0m" 130 | else 131 | echo -e "\e[31mFailed.\e[0m" 132 | exit 1 133 | fi 134 | 135 | # Add PATH 136 | grep -Fxq "export PATH=\$PATH:$HOME/.local/bin" "$HOME/.bashrc" || { 137 | echo "export PATH=\$PATH:$HOME/.local/bin" >>"$HOME/.bashrc" 138 | } 139 | exit 0 140 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | CARET logo 3 |
4 | 5 | [![build-and-test](https://github.com/tier4/caret_trace/actions/workflows/build-and-test.yaml/badge.svg)](https://github.com/tier4/caret_trace/actions/workflows/build-and-test.yaml) 6 | [![pytest](https://github.com/tier4/caret_analyze/actions/workflows/pytest.yaml/badge.svg)](https://github.com/tier4/caret_analyze/actions/workflows/pytest.yaml) 7 | [![Build with Autoware](https://github.com/tier4/caret/actions/workflows/build_autoware.yaml/badge.svg)](https://github.com/tier4/caret/actions/workflows/build_autoware.yaml) 8 | [![Test with Autoware](https://github.com/tier4/CARET_report/actions/workflows/test_autoware.yaml/badge.svg)](https://github.com/tier4/CARET_report/actions/workflows/test_autoware.yaml) 9 | 10 | # CARET 11 | 12 | CARET (Chain-Aware ROS Evaluation Tool) is one of performance analysis tool dedicated with ROS 2 applications. It is able to measure not only callback latency and communication latency, but also path latency, in other words, chain of node or callback. As additional tracepoints are introduced by function hook, tracing resolution is improved. 13 | 14 |
15 | overview 16 |
17 | 18 | ## Publications & presentations 19 | 20 | If you find CARET is useful in your research, please consider citing: 21 | 22 | - T. Kuboichi, A. Hasegawa, B. Peng, K. Miura, K. Funaoka, S. Kato, and T. Azumi, "CARET: Chain-Aware ROS 2 Evaluation Tool," _IEEE international conference on Embedded and Ubiquitous Computing (EUC)_, 2022. 23 | 24 | - B. Peng, A. Hasegawa, and T. Azumi, "Scheduling Performance Evaluation Framework for ROS 2 Applications," _IEEE International Conference on Embedded Software and Systems (ICESS)_, 2022. 25 | 26 |
27 | BibTeX 28 | 29 | ```bibtex 30 | @inproceedings{CARET, 31 | title={{CARET}: Chain-{Aware} {ROS} 2 {Evaluation Tool}}, 32 | author={Kuboichi, Takahisa and Hasegawa, Atsushi and Peng, Bo and Miura, Keita and Funaoka, Kenji and Kato, Shinpei and Azumi, Takuya}, 33 | booktitle={Proceedings of IEEE international conference on embedded and ubiquitous computing (EUC)}, 34 | year={2022}} 35 | ``` 36 | 37 | ```bibtex 38 | @inproceedings{callback_scheduling, 39 | title={Scheduling Performance Evaluation Framework for {ROS} 2 Applications}, 40 | author={Peng, Bo and Hasegawa, Atsushi and Azumi, Takuya}, 41 | booktitle={Proceedings of IEEE International Conference on Embedded Software and Systems (ICESS)}, 42 | year={2022}} 43 | ``` 44 | 45 |
46 | 47 | Also, check out ROSCON 2022 presentation titled "Chain-Aware ROS Evaluation Tool (CARET)" ([video](https://vimeo.com/showcase/9954564/video/767150288), [slide]()). 48 | 49 | ## Documentation 50 | 51 | - To learn about using CARET, refer to the [caret document](https://tier4.github.io/caret_doc/main/) 52 | - To find API document, refer to [caret analyze API document](https://tier4.github.io/caret_analyze/latest/) 53 | 54 | ## Repository overview 55 | 56 | - [caret](https://github.com/tier4/caret) 57 | - Meta-repository containing `.repos` files to construct a CARET workspace 58 | - [caret_trace](https://github.com/tier4/caret_trace) 59 | - Define tracepoints added by function hooking 60 | - [caret_analyze](https://github.com/tier4/caret_analyze) 61 | - Library for scripts to analyze and visualize data 62 | - [caret_analyze_cpp_impl](https://github.com/tier4/caret_analyze_cpp_impl.git) 63 | - Efficient helper functions to analyze trace data written in C++ 64 | - [ros2caret](https://github.com/tier4/ros2caret.git) 65 | - CLI commands like `ros2 caret` 66 | - [caret_doc](https://github.com/tier4/caret_doc) 67 | - Documentation 68 | - [caret_demos](https://github.com/tier4/caret_demos) 69 | - Demo programs for CARET 70 | - [rclcpp](https://github.com/tier4/rclcpp/tree/v0.3.0) 71 | - The forked `rclcpp` including CARET-dedicated tracepoints 72 | - [ros2_tracing](https://github.com/tier4/ros2_tracing/tree/v0.3.0) 73 | - The forked `ros2_tracing` including definition of CARET-dedicated tracepoints 74 | -------------------------------------------------------------------------------- /docker/build_autoware.dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | 3 | ARG CARET_VERSION="main" 4 | ARG AUTOWARE_VERSION="main" 5 | 6 | ENV DEBIAN_FRONTEND=noninteractive 7 | 8 | RUN apt-get update -y && \ 9 | apt-get install -y --no-install-recommends \ 10 | locales \ 11 | && \ 12 | apt-get clean && \ 13 | rm -rf /var/lib/apt/lists/* 14 | RUN locale-gen en_US.UTF-8 15 | ENV LANG=en_US.UTF-8 16 | ENV TZ=Asia/Tokyo 17 | ENV ROS_DISTRO=humble 18 | 19 | # Do not use cache 20 | ADD "https://www.random.org/sequences/?min=1&max=52&col=1&format=plain&rnd=new" /dev/null 21 | 22 | RUN echo "===== GET CARET =====" 23 | # RUN git clone https://github.com/tier4/caret.git ros2_caret_ws && \ 24 | # cd ros2_caret_ws && \ 25 | # git checkout "$CARET_VERSION" 26 | COPY ./ /ros2_caret_ws 27 | 28 | # cspell: disable 29 | RUN apt update && apt install -y git && \ 30 | apt-get install -y tzdata && \ 31 | ln -fs /usr/share/zoneinfo/Asia/Tokyo /etc/localtime && \ 32 | dpkg-reconfigure --frontend noninteractive tzdata 33 | # cspell: enable 34 | 35 | RUN echo "===== Setup Autoware =====" 36 | RUN git clone https://github.com/autowarefoundation/autoware.git && \ 37 | cd autoware && \ 38 | git checkout "$AUTOWARE_VERSION" && \ 39 | apt install python3.10-venv -y && \ 40 | ./setup-dev-env.sh -y --no-nvidia --no-cuda-drivers && \ 41 | mkdir src && \ 42 | vcs import src < autoware.repos && \ 43 | vcs export --exact src && \ 44 | . /opt/ros/"$ROS_DISTRO"/setup.sh && \ 45 | rosdep update && \ 46 | apt-get install -y ros-humble-pacmod3-msgs=1.0.0-0jammy && \ 47 | apt-get remove -y python3-gpg && \ 48 | rosdep install -y --from-paths src --ignore-src --rosdistro "$ROS_DISTRO" 49 | # workarounds: 50 | # install ros-humble-pacmod3-msgs manually because rosdep tries to install ros-galactic-pacmod3-msgs 51 | # remove gpg because build error happens in ad_api_visualizers for some reasons... 52 | 53 | # workaround: remove agnocast because CARET doesn't support Agnocast yet and Agnocast is not used by default 54 | RUN rm -rf autoware/src/middleware/external/agnocast 55 | RUN rm -rf autoware/src/universe/autoware_universe/common/autoware_agnocast_wrapper 56 | 57 | # https://github.com/ament/ament_cmake/commit/799183ab9bcfd9b66df0de9b644abaf8c9b78e84 58 | RUN echo "===== Modify ament_cmake_auto as workaround =====" 59 | RUN cd /opt/ros/humble/share/ament_cmake_auto/cmake && \ 60 | backup_date="`date +"%Y%m%d_%H%M%S"`" && \ 61 | cp ament_auto_add_executable.cmake ament_auto_add_executable.cmake_"$backup_date" && \ 62 | cp ament_auto_add_library.cmake ament_auto_add_library.cmake_"$backup_date" && \ 63 | sed -i -e 's/SYSTEM//g' ament_auto_add_executable.cmake && \ 64 | sed -i -e 's/SYSTEM//g' ament_auto_add_library.cmake 65 | 66 | RUN echo "===== Modify pcl_ros (libtracetools.so) as workaround =====" 67 | RUN cd /opt/ros/humble/share/pcl_ros/cmake && \ 68 | backup_date="`date +"%Y%m%d_%H%M%S"`" && \ 69 | cp export_pcl_rosExport.cmake export_pcl_rosExport.cmake_"$backup_date" && \ 70 | sed -i -e 's/\/opt\/ros\/humble\/lib\/libtracetools.so;//g' export_pcl_rosExport.cmake 71 | 72 | RUN echo "===== Modify pcl_ros (rclcpp) as workaround =====" 73 | RUN cd /opt/ros/humble/share/pcl_ros/cmake && \ 74 | backup_date="`date +"%Y%m%d_%H%M%S"`" && \ 75 | cp export_pcl_rosExport.cmake export_pcl_rosExport.cmake_"$backup_date"_2 && \ 76 | sed -i -e 's/\/opt\/ros\/humble\/include\/rclcpp;//g' export_pcl_rosExport.cmake 77 | 78 | RUN echo "===== Setup CARET =====" 79 | RUN cd ros2_caret_ws && \ 80 | rm -rf src build log install && \ 81 | mkdir src && \ 82 | vcs import src < caret.repos && \ 83 | . /opt/ros/"$ROS_DISTRO"/setup.sh && \ 84 | ./setup_caret.sh -c 85 | 86 | RUN echo "===== Build CARET =====" 87 | RUN cd ros2_caret_ws && \ 88 | . /opt/ros/"$ROS_DISTRO"/setup.sh && \ 89 | colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF 90 | 91 | RUN echo "===== Build Autoware =====" 92 | RUN cd autoware && \ 93 | . /opt/ros/"$ROS_DISTRO"/setup.sh && \ 94 | . /ros2_caret_ws/install/local_setup.sh && \ 95 | colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=Off -DCMAKE_CXX_FLAGS="-w" 96 | 97 | RUN echo "===== Verify Build =====" 98 | RUN cd autoware && \ 99 | . /opt/ros/"$ROS_DISTRO"/setup.sh && \ 100 | . /ros2_caret_ws/install/local_setup.sh && \ 101 | ros2 caret check_caret_rclcpp ./ 102 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/issue.yaml: -------------------------------------------------------------------------------- 1 | name: Issue 2 | description: Report a bug/issue 3 | labels: [bug] 4 | body: 5 | - type: checkboxes 6 | attributes: 7 | label: Checklist 8 | description: Confirm the following items before proceeding. 9 | options: 10 | - label: I've read the [contribution guidelines](https://github.com/tier4/caret/blob/main/.github/CONTRIBUTING.md). 11 | required: true 12 | - label: I've read [document](https://tier4.github.io/CARET_doc/main/) and no solution were found. 13 | required: true 14 | 15 | - type: dropdown 16 | id: issue-type 17 | attributes: 18 | label: Issue type 19 | description: What type of issue would you like to report? 20 | multiple: false 21 | options: 22 | - Bug 23 | - Help wanted 24 | - Others 25 | validations: 26 | required: true 27 | 28 | - type: dropdown 29 | id: step 30 | attributes: 31 | label: Step where the issue is related to 32 | description: Which step is the issue related to? 33 | multiple: true 34 | options: 35 | - Setup 36 | - Build 37 | - Recording 38 | - Visualization 39 | - Documentation 40 | - Others 41 | validations: 42 | required: true 43 | 44 | - type: textarea 45 | id: environments 46 | attributes: 47 | label: Environments 48 | description: | 49 | Examples: 50 | - **OS**: Ubuntu 22.04.1 LTS 51 | - **Kernel version**: 5.14.0-1052-oem 52 | - **ROS 2**: Humble 53 | - **CPU**: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz x 12 54 | - **Memory**: 32.0 GiB 55 | placeholder: | 56 | - OS: 57 | - Kernel version: 58 | - ROS 2: 59 | - CPU: 60 | - Memory: 61 | validations: 62 | required: true 63 | 64 | - type: textarea 65 | id: caret_version 66 | attributes: 67 | label: CARET version 68 | description: | 69 | Write CARET version. If you use main branch, please give us hash id of CARET_analyze and CARET_trace you used. 70 | Examples: 71 | - **CARET**: v0.3.3 72 | - **CARET_analyze**: a69abae9fa2a8270fa855356815d650d27cfb323 73 | - **CARET_trace**: 38f5cc4f35cc15b9a3499125851819ea78fe37c1 74 | placeholder: | 75 | - CARET: 76 | - CARET_analyze: 77 | - CARET_trace: 78 | validations: 79 | required: true 80 | 81 | - type: textarea 82 | id: target_application 83 | attributes: 84 | label: Target application 85 | description: Describe the target application. 86 | placeholder: |- 87 | - Application name: Autoware 88 | - URL: https://github.com/autowarefoundation/autoware 89 | - Version: main branch at 2022/12/07 90 | - How to run: Rosbag replay simulation 91 | - https://autowarefoundation.github.io/autoware-documentation/main/tutorials/ad-hoc-simulation/rosbag-replay-simulation/ 92 | validations: 93 | required: false 94 | 95 | - type: textarea 96 | id: issue_description 97 | attributes: 98 | label: Description 99 | description: Describe the issue and expected behavior. 100 | validations: 101 | required: true 102 | 103 | - type: textarea 104 | attributes: 105 | label: Steps to reproduce 106 | description: Write the steps to reproduce the issue. 107 | placeholder: |- 108 | 1. 109 | 2. 110 | 3. 111 | validations: 112 | required: true 113 | 114 | - type: textarea 115 | id: commands 116 | attributes: 117 | label: Commands 118 | description: Copy and paste commands to reproduce the issue. You can omit this if 'Steps to reproduce' includes it. 119 | render: shell 120 | validations: 121 | required: false 122 | 123 | - type: textarea 124 | id: logs 125 | attributes: 126 | label: Logs 127 | description: Copy and paste any relevant log output. If the issue is related to recording or visualization, please add the result of `check_ctf` command. If the issue is related to path visualization, please add the result of `path.verify`. 128 | render: shell 129 | validations: 130 | required: false 131 | 132 | - type: textarea 133 | id: lttng_trace_log_file 134 | attributes: 135 | label: LTTng trace log file 136 | description: If applicable, add LTTng trace log file stored in `~/.ros/tracing/` 137 | validations: 138 | required: false 139 | 140 | - type: textarea 141 | id: screenshots 142 | attributes: 143 | label: Screenshots 144 | description: If applicable, add screenshots to help explain your problem. 145 | placeholder: |- 146 | ![DESCRIPTION](LINK.png) 147 | validations: 148 | required: false 149 | -------------------------------------------------------------------------------- /release_script/release_caret.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # echo usage 4 | 5 | function show_usage() { 6 | echo "Warning: This script may break your repositories, please be careful to use $0" 7 | echo "Usage: $0 [-h or --help" 8 | echo " [-d or --dry-run]" 9 | echo " [-p or --push]" 10 | echo " [-t or --tag tag-id]" 11 | echo "" 12 | echo "Options" 13 | echo "-h or --help: show usage" 14 | echo "-d or --dry-run: run without any change. only message is displayed." 15 | echo "-p or --push: push branch or tag to origin" 16 | echo "-t --tag: tag id, which is to added repository. this is mandatory" 17 | 18 | exit 0 19 | } 20 | 21 | # get script directory. 22 | SCRIPT_DIR=$( 23 | cd "$(dirname "$0")" || exit 24 | pwd 25 | ) 26 | ROOT_DIR=$( 27 | cd "$(dirname "$0")" || exit 28 | cd ../ || exit 29 | pwd 30 | ) 31 | 32 | # target repositories 33 | # CARET_* repositories 34 | CARET_DIRS_PATH="${ROOT_DIR}/src/CARET" 35 | 36 | CARET_REPOS_ARRAY=("caret_trace" 37 | "caret_analyze" 38 | "caret_analyze_cpp_impl" 39 | "ros2caret" 40 | "caret_common") 41 | 42 | # ros-tracing repository 43 | ROS_TRACING_REPOS="ros2_tracing" 44 | 45 | # rclcpp repository 46 | ROS_RCLCPP_REPOS="rclcpp" 47 | ROS_RCL_REPOS="rcl" 48 | 49 | # cyclonedds 50 | CYCLONEDDS_REPOS="cyclonedds" 51 | 52 | # topic_tools 53 | TOPIC_TOOLS_REPOS="topic_tools" 54 | 55 | # variables 56 | DRY_RUN= 57 | TAG_ID= 58 | PUSH_REMOTE= 59 | 60 | # cspell:disable-next-line 61 | OPTIONS=$(getopt -o hdpt: -l help,dry-run,push,tag: -- "$@") 62 | 63 | eval set -- "$OPTIONS" 64 | 65 | while true; do 66 | case $1 in 67 | -h | --help) 68 | show_usage 69 | ;; 70 | -d | --dry-run) 71 | DRY_RUN='echo' 72 | shift 73 | ;; 74 | -p | --push) 75 | PUSH_REMOTE=true 76 | shift 77 | ;; 78 | -t | --tag) 79 | TAG_ID="$2" 80 | shift 2 81 | ;; 82 | --) 83 | shift 84 | break 85 | ;; 86 | esac 87 | done 88 | 89 | # check options and output messages. 90 | if [ -z "${TAG_ID}" ]; then 91 | echo "tag should be given with option --tag or -t." 92 | exit 1 93 | fi 94 | 95 | # check the format of version tag 96 | if ! [[ ${TAG_ID} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then 97 | echo "Error: Invalid tag format. Tag must be in the format e.g. v0.4.24" 98 | exit 1 99 | fi 100 | 101 | if [ "${DRY_RUN}" == "echo" ]; then 102 | ${DRY_RUN} "This program will run by dry-run mode." 103 | ${DRY_RUN} "TAG ID: ${TAG_ID}" 104 | fi 105 | 106 | # add tags to caret repositories 107 | function add_tag_to_caret_repository() { 108 | DIR_PATH=${CARET_DIRS_PATH}/${1} 109 | echo "enter ${DIR_PATH}..." 110 | cd "${DIR_PATH}" || exit 111 | ${DRY_RUN} git checkout main 112 | ${DRY_RUN} git checkout -b rc/"${2}" 113 | ${DRY_RUN} git tag "${2}" 114 | ${DRY_RUN} git remote add github git@github.com:tier4/"${1}".git 115 | if [ "${PUSH_REMOTE}" == "true" ]; then 116 | ${DRY_RUN} git push github rc/"${2}" 117 | ${DRY_RUN} git push github "${2}" 118 | fi 119 | cd "${ROOT_DIR}" || exit 120 | echo "leave ${1} ..." 121 | } 122 | 123 | for repos in "${CARET_REPOS_ARRAY[@]}"; do 124 | add_tag_to_caret_repository "${repos}" "${TAG_ID}" 125 | done 126 | 127 | # get tags from repository 128 | 129 | function get_hash_from_repository() { 130 | cd "${1}" || exit 131 | HASH_ID=$(git rev-parse HEAD) 132 | cd "${ROOT_DIR}" || exit 133 | echo "${HASH_ID}" 134 | } 135 | 136 | # get hash number from ros-tracing repos 137 | ROS_TRACING_PATH="src/ros-tracing/${ROS_TRACING_REPOS}" 138 | ROS_TRACING_HASH=$(get_hash_from_repository "${ROOT_DIR}"/${ROS_TRACING_PATH}) 139 | 140 | # get hash number from rclcpp 141 | ROS_RCLCPP_PATH="src/ros2/${ROS_RCLCPP_REPOS}" 142 | ROS_RCLCPP_HASH=$(get_hash_from_repository "${ROOT_DIR}"/${ROS_RCLCPP_PATH}) 143 | 144 | # get hash number from rcl 145 | ROS_RCL_PATH="src/ros2/${ROS_RCL_REPOS}" 146 | ROS_RCL_HASH=$(get_hash_from_repository "${ROOT_DIR}"/${ROS_RCL_PATH}) 147 | 148 | # get hash number from cyclonedds 149 | CYCLONEDDS_PATH="src/eclipse-cyclonedds/${CYCLONEDDS_REPOS}" 150 | CYCLONEDDS_HASH=$(get_hash_from_repository "${ROOT_DIR}"/${CYCLONEDDS_PATH}) 151 | 152 | # get hash number from topic_tools 153 | TOPIC_TOOLS_PATH="src/ros-tooling/${TOPIC_TOOLS_REPOS}" 154 | TOPIC_TOOLS_HASH=$(get_hash_from_repository "${ROOT_DIR}"/${TOPIC_TOOLS_PATH}) 155 | 156 | # checkout caret repository. 157 | ${DRY_RUN} git checkout -b rc/"${TAG_ID}" 158 | 159 | # copy caret repos and edit as pointing specific tag and hash. 160 | ${DRY_RUN} cp "${SCRIPT_DIR}"/template_caret.repos "${ROOT_DIR}"/caret.repos 161 | ${DRY_RUN} sed -i -e "s/ROS_TRACING_HASH/${ROS_TRACING_HASH}/g" "${ROOT_DIR}"/caret.repos 162 | ${DRY_RUN} sed -i -e "s/RCLCPP_HASH/${ROS_RCLCPP_HASH}/g" "${ROOT_DIR}"/caret.repos 163 | ${DRY_RUN} sed -i -e "s/RCL_HASH/${ROS_RCL_HASH}/g" "${ROOT_DIR}"/caret.repos 164 | ${DRY_RUN} sed -i -e "s/CYCLONEDDS_HASH/${CYCLONEDDS_HASH}/g" "${ROOT_DIR}"/caret.repos 165 | ${DRY_RUN} sed -i -e "s/TOPIC_TOOLS_HASH/${TOPIC_TOOLS_HASH}/g" "${ROOT_DIR}"/caret.repos 166 | ${DRY_RUN} sed -i -e "s/CARET_TAG/${TAG_ID}/g" "${ROOT_DIR}"/caret.repos 167 | 168 | ${DRY_RUN} git add "${ROOT_DIR}"/caret.repos 169 | ${DRY_RUN} git commit -m "release(caret.repos): change version of sub repositories for ${TAG_ID}" 170 | 171 | ${DRY_RUN} git tag "${TAG_ID}" 172 | 173 | if [ "${PUSH_REMOTE}" == "true" ]; then 174 | ${DRY_RUN} cd "${ROOT_DIR}" || exit 175 | ${DRY_RUN} git push origin rc/"${TAG_ID}" 176 | ${DRY_RUN} git push origin "${TAG_ID}" 177 | ${DRY_RUN} cd "${SCRIPT_DIR}" 178 | fi 179 | 180 | echo "[Info] Completed release script." 181 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------