Skip to content

Commit

Permalink
jazzy support
Browse files Browse the repository at this point in the history
  • Loading branch information
miyakoshi-dev committed Jan 21, 2025
1 parent 57bdbd6 commit 7fe47bb
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 2 deletions.
20 changes: 20 additions & 0 deletions ansible/playbook_jazzy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- hosts: localhost
connection: local
become: false
vars_prompt:
- name: package_install
prompt: Would you like to install the require packages[y/n]
default: y
private: false
pre_tasks:
- name: Verify OS
ansible.builtin.fail:
msg: Only Ubuntu 22.04 is supported for this branch. Please refer to https://tier4.github.io/caret_doc/latest/installation/installation/
when: ansible_distribution_version != '22.04'

roles:
- { role: lttng, tags: [lttng], when: package_install == 'y' }
- { role: ros-tracing, rosdistro: jazzy, tags: [ros-tracing], when: package_install == 'y' }
- { role: visualizer, tags: [visualizer], when: package_install == 'y' }
- { role: caret_jazzy, rosdistro: jazzy, tags: [caret] }
- { role: cyclonedds, rosdistro: jazzy, tags: [cyclonedds] }
5 changes: 5 additions & 0 deletions ansible/roles/caret_jazzy/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rosdistro: jazzy
targeted_skip_keys: console_bridge fastcdr fastrtps rti-connext-dds-6.0.1 urdfdom_headers
setenv_caret_script_template: setenv_caret.bash.jinja2
caret_topic_filter_template: caret_topic_filter.bash.jinja2
requirements_path: requirements.txt
58 changes: 58 additions & 0 deletions ansible/roles/caret_jazzy/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
- name: ROS2 (check rosdep file)

Check warning on line 1 in ansible/roles/caret_jazzy/tasks/main.yml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Forbidden word (ROS2)
stat:
path: /etc/ros/rosdep/sources.list.d/20-default.list
register: ros_repository

- name: ROS2 (install rosdep)

Check warning on line 6 in ansible/roles/caret_jazzy/tasks/main.yml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Forbidden word (ROS2)
apt:
name: python3-rosdep
state: latest
update_cache: true
become: true

- name: ROS2 (initialize rosdep)

Check warning on line 13 in ansible/roles/caret_jazzy/tasks/main.yml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Forbidden word (ROS2)
command: rosdep init
when: ros_repository.stat.exists == false
become: true

- name: ROS2 (update rosdep)

Check warning on line 18 in ansible/roles/caret_jazzy/tasks/main.yml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Forbidden word (ROS2)
command: rosdep update
become: false

- name: caret (rosdep install dependencies)
shell: |
rosdep install -y --from-paths src --ignore-src --rosdistro {{ rosdistro }} -y --skip-keys "{{ targeted_skip_keys }}"
args:
chdir: "{{ WORKSPACE_ROOT }}"

- name: caret (install some packages for build)
apt:
name:
- ros-{{ rosdistro }}-osrf-testing-tools-cpp
- ros-{{ rosdistro }}-performance-test-fixture
- ros-{{ rosdistro }}-mimick-vendor
- ros-{{ rosdistro }}-test-msgs
- ros-{{ rosdistro }}-cyclonedds
become: true

- name: caret (install python module)
pip:
requirements: "{{ requirements_path }}"
executable: pip3
become: false
args:
chdir: "{{ WORKSPACE_ROOT }}"

- name: caret (copy CARET setenv template as reference)
ansible.builtin.template:
src: "{{ setenv_caret_script_template }}"
dest: "{{ WORKSPACE_ROOT }}/setenv_caret.bash"
mode: 0755
become: false

- name: caret (copy topic filter as reference)
ansible.builtin.template:
src: "{{ caret_topic_filter_template }}"
dest: "{{ WORKSPACE_ROOT }}/caret_topic_filter.bash"
mode: 0755
become: false
25 changes: 25 additions & 0 deletions ansible/roles/caret_jazzy/templates/caret_topic_filter.bash.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

export CARET_IGNORE_NODES=\
"\
/rviz*\
"

export CARET_IGNORE_TOPICS=\
"\
/clock:\
/parameter_events\
"

# if you want to select nodes or topics,
# please remove comment out of the followings.
# export CARET_SELECT_NODES=\
# "\
# /rviz*\
# "

# export CARET_SELECT_TOPICS=\
# "\
# /clock:\
# /parameter_events\
# "
22 changes: 22 additions & 0 deletions ansible/roles/caret_jazzy/templates/setenv_caret.bash.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

source /opt/ros/{{ rosdistro }}/setup.bash
source {{ WORKSPACE_ROOT }}/install/local_setup.bash
source {{ WORKSPACE_ROOT }}/caret_topic_filter.bash

export LD_PRELOAD=$(readlink -f {{ WORKSPACE_ROOT}}/install/caret_trace/lib/libcaret.so):$LD_PRELOAD

USERNAME=$(whoami)
ps -axo user:32,command | grep lttng-sessiond | grep $USERNAME | grep -v grep > /dev/null
if [ $? -ne 0 ]; then
lttng-sessiond --daemonize
fi

# If you want to apply CARET to a large application,
# it is recommended to increase the maximum number of
# file descriptors to avoid data loss.
# Execute ulimit command as below.
# ulimit -n 16384

# Add user application built with caret/rclcpp
# source /path/to/your/application/install/setup.bash
2 changes: 1 addition & 1 deletion ansible/roles/visualizer/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- graphviz
- graphviz-dev
update_cache: true
become: true
become: false

- name: Install caret dependent packages
pip:
Expand Down
26 changes: 26 additions & 0 deletions caret_jazzy.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
repositories:
CARET/caret_trace:
type: git
url: https://github.com/tier4/caret_trace.git
version: main
CARET/caret_analyze:
type: git
url: https://github.com/tier4/caret_analyze.git
version: main
CARET/caret_analyze_cpp_impl:
type: git
url: https://github.com/tier4/caret_analyze_cpp_impl.git
version: main
CARET/ros2caret:
type: git
url: https://github.com/tier4/ros2caret.git
version: main
# Dependency for CI/CD
CARET/caret_common:
type: git
url: https://github.com/tier4/caret_common.git
version: main
eclipse-cyclonedds/cyclonedds:
type: git
url: https://github.com/eclipse-cyclonedds/cyclonedds.git
version: releases/0.10.x
4 changes: 3 additions & 1 deletion setup_caret.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function show_usage() {
exit 0
}

ALLOWED_ROS_DISTRO=("humble" "iron")
ALLOWED_ROS_DISTRO=("humble" "iron", "jazzy")

function validate_ros_distro() {
if [[ " ${ALLOWED_ROS_DISTRO[*]} " != *" $1 "* ]]; then
Expand Down Expand Up @@ -116,6 +116,8 @@ fi
PLAYBOOK="playbook.yml"
if [ "$ros_distro" = "iron" ]; then
PLAYBOOK="playbook_iron.yml"
elif [ "$ros_distro" = "jazzy" ]; then
PLAYBOOK="playbook_jazzy.yml"
fi

# Run ansible
Expand Down

0 comments on commit 7fe47bb

Please sign in to comment.