Skip to content

Commit

Permalink
Add Azure Kinect
Browse files Browse the repository at this point in the history
  • Loading branch information
f0reachARR committed Oct 30, 2024
1 parent ecf9b59 commit 18a862c
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions ansible/roles/azure_kinect/tasks/main.yaml
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

0 comments on commit 18a862c

Please sign in to comment.