forked from autowarefoundation/autoware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecf9b59
commit 18a862c
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
- name: Verify OS | ||
ansible.builtin.fail: | ||
msg: Only Ubuntu 22.04 is supported | ||
when: ansible_distribution_version != '22.04' | ||
|
||
- name: Install dependencies | ||
ansible.builtin.apt: | ||
name: | ||
- git | ||
- cmake | ||
- libsoundio-dev | ||
- libgl1-mesa-dev | ||
- libjpeg-dev | ||
- libvulkan-dev | ||
- libx11-dev | ||
- libxcursor-dev | ||
- libxinerama-dev | ||
- libxrandr-dev | ||
- libusb-1.0-0-dev | ||
- libssl-dev | ||
- libudev-dev | ||
- mesa-common-dev | ||
- uuid-dev | ||
state: present | ||
|
||
- name: Clone SDK | ||
ansible.builtin.git: | ||
repo: https://github.com/ForteFibre/Azure-Kinect-Sensor-SDK.git | ||
dest: /tmp/Azure-Kinect-Sensor-SDK | ||
version: feature/ubuntu22.04 | ||
|
||
- name: Build SDK | ||
ansible.builtin.shell: | | ||
cd /tmp/Azure-Kinect-Sensor-SDK | ||
mkdir build | ||
cd build | ||
cmake .. -DCMAKE_BUILD_TYPE=Release | ||
make -j$(nproc) | ||
register: build_result | ||
changed_when: build_result.rc == 0 | ||
|
||
- name: Install SDK | ||
ansible.builtin.shell: | | ||
cd /tmp/Azure-Kinect-Sensor-SDK/build | ||
make install | ||
cp ../scripts/99-k4a.rules /etc/udev/rules.d/ | ||
when: build_result.rc == 0 | ||
register: install_result | ||
become: true | ||
changed_when: install_result.rc == 0 | ||
|
||
- name: Download closed-source firmware | ||
ansible.builtin.get_url: | ||
url: https://packages.microsoft.com/ubuntu/18.04/multiarch/prod/pool/main/libk/libk4a1.4/libk4a1.4_1.4.1_{{ ansible_architecture == 'x86_64' | ternary('amd64', 'arm64') }}.deb | ||
dest: /tmp/Azure-Kinect-Sensor-SDK/libk4a.deb | ||
mode: 0644 | ||
|
||
- name: Install closed-source firmware | ||
ansible.builtin.shell: | | ||
cd /tmp/Azure-Kinect-Sensor-SDK | ||
ar vx libk4a.deb && tar zxvf data.tar.gz | ||
cp usr/lib/*/libk4a1.4/libdepthengine.so.2.0 /usr/lib/{{ ansible_architecture == 'x86_64' | ternary('x86_64', 'aarch64') }}-linux-gnu/ | ||
register: firmware_result | ||
changed_when: firmware_result.rc == 0 | ||
|
||
- name: Remove build files | ||
ansible.builtin.file: | ||
path: /tmp/Azure-Kinect-Sensor-SDK | ||
state: absent |