Forked from madelinegannon/setup-azure-kinect-on-jetson-x-nx.md
Created
September 5, 2024 18:44
-
-
Save mimetikxs/a89cd261481d092784e0cbe02bbd2b27 to your computer and use it in GitHub Desktop.
Revisions
-
madelinegannon revised this gist
Feb 27, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -179,7 +179,7 @@ sudo apt remove libk4a1.4-dev ``` 2. Install the 1.3 Sensor and Body Tracking SDKs. ``` sudo apt install k4a-tools=1.3.0 k4a1.3-dev libk4abt1.0 libk4abt1.0-dev ``` 3. Run the apps ``` -
madelinegannon revised this gist
Apr 15, 2022 . 1 changed file with 13 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -85,6 +85,13 @@ k4aviewer > The `k4aviewer`, `k4arecorder`, and `AzureKinectFirmwareTool` downloaded through `k4a-tools` are all located in `/usr/bin`. ### 5. Download Samples Microsoft provides [code samples](https://github.com/microsoft/Azure-Kinect-Samples) that demonstrate how to use Microsoft's Azure Kinect DK Sensor and Body Tracking SDKs. ``` git clone https://github.com/microsoft/Azure-Kinect-Samples.git ``` --- @@ -185,13 +192,16 @@ k4abt_simple_3d_viewer > See [Microsoft's Instructions](https://docs.microsoft.com/en-us/azure/kinect-dk/update-device-firmware) 1. Download the latest firmware's .bin file (at the time it was [here](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/tree/develop/firmware)). - You can check the firmware of your connected device by running `$AzureKinectFirmwareTool -q` in the terminal. 2. In the terminal, go to the directory where you downloaded the firmware and update with the AzureKinectFirmwareTool: `AzureKinectFirmwareTool.exe -u <device_firmware_file.bin>` ``` git clone https://github.com/microsoft/Azure-Kinect-Sensor-SDK.git cd Azure-Kinect-Sensor-SDK/firmware/ AzureKinectFirmwareTool -u <device_firmware_file.bin> ``` I got the following error when running the firmware tool: ``` ERROR: The device failed to reset after an update. Please manually power cycle the device. -
madelinegannon revised this gist
Apr 15, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -41,7 +41,7 @@ Turns out you need specify the architecture of the repository to `[arch=amd64]`: ``` sudo -i ``` - Modify `/etc/apt/sources.list`. At the bottom of the file, change from: ``` deb https://packages.microsoft.com/ubuntu/18.04/prod bionic main # deb-src https://packages.microsoft.com/ubuntu/18.04/prod bionic main -
madelinegannon revised this gist
Jun 8, 2021 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -187,8 +187,9 @@ k4abt_simple_3d_viewer 1. Download the latest firmware's .bin file (at the time it was [here](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/1093)). - You can check the firmware of your connected device by running `$AzureKinectFirmwareTool -q` in the terminal. 2. In the terminal, go to the directory where you downloaded the firmware and update with the AzureKinectFirmwareTool: `AzureKinectFirmwareTool.exe -u <device_firmware_file.bin>` ``` cd ~/Downloads AzureKinectFirmwareTool -u AzureKinectDK_Fw_1.6.108079014.bin ``` I got the following error when running the firmware tool: -
madelinegannon revised this gist
Jun 16, 2020 . 1 changed file with 1 addition and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -172,10 +172,7 @@ sudo apt remove libk4a1.4-dev ``` 2. Install the 1.3 Sensor and Body Tracking SDKs. ``` sudo apt install k4a-tools=1.3.0 k4a1.3-dev k4abt1.0 k4abt1.0-dev ``` 3. Run the apps ``` -
madelinegannon revised this gist
Jun 12, 2020 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -158,6 +158,8 @@ Disabling the Color Camera avoids the errors, however [there's a fix](https://gi > See [Microsoft's Instructions](https://docs.microsoft.com/en-us/azure/kinect-dk/body-sdk-download#linux-installation-instructions) > The Body Tracking SDK is not currently supported on ARM ... supposedly that is [coming soon](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/1093#issuecomment-594313079) though. At the time of writing, the latest Body Tracking SDK (version 1.0.0) has a [dependency on version 1.3](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/1248) of the Sensor SDK. However, `k4a-tools` is dependent on version 1.4. It's currently [not possible to have multiple SDKs installed](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/836), so you have to pick one. To downgrade from SDK 1.4 to 1.3: -
madelinegannon revised this gist
Jun 12, 2020 . 1 changed file with 48 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -142,17 +142,61 @@ This is a bug that crashes the data stream when the color camera is enabled: Disabling the Color Camera avoids the errors, however [there's a fix](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/1249#issuecomment-642245118) in the next release, 1.4.1. But you can download the beta with the fix now: - Click this nuget download link https://www.nuget.org/api/v2/package/Microsoft.Azure.Kinect.Sensor/1.4.1-beta.0, rename from `.nupkg` to `.zip`, and unzip for access to the AMD64 and ARM64 libraries. 4. From from the `k4aviewer` app, I consistently got 30FPS from the 3 different camera streams and 60FPS. - 3-4 of the 6 CPUs were maxing out, with the other 2-3 running at 50% (with a few chrome tabs open). - You can max out all the CPUs just by opening a lot of tabs. - Disabling a camera frees up a CPU. - Microphone Array and IMU also worked reliably. 5. The Body Tracking SDK does not run on ARM yet ... supposedly that is [coming soon](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/1093#issuecomment-594313079) though. --- ## Installing Body Tracking SDK > See [Microsoft's Instructions](https://docs.microsoft.com/en-us/azure/kinect-dk/body-sdk-download#linux-installation-instructions) At the time of writing, the latest Body Tracking SDK (version 1.0.0) has a [dependency on version 1.3](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/1248) of the Sensor SDK. However, `k4a-tools` is dependent on version 1.4. It's currently [not possible to have multiple SDKs installed](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/836), so you have to pick one. To downgrade from SDK 1.4 to 1.3: 1. Remove the 1.4 SDK. ``` sudo apt remove k4a-tools sudo apt remove libk4a1.4 sudo apt remove libk4a1.4-dev ``` 2. Install the 1.3 Sensor and Body Tracking SDKs. ``` sudo apt install k4a-tools=1.3.0 sudo apt install k4a1.3-dev sudo apt install k4abt1.0 sudo apt install k4abt1.0-dev ``` 3. Run the apps ``` k4abt_simple_3d_viewer ``` --- ## Updating Firmware for Azure Kinect > See [Microsoft's Instructions](https://docs.microsoft.com/en-us/azure/kinect-dk/update-device-firmware) 1. Download the latest firmware's .bin file (at the time it was [here](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/1093)). - You can check the firmware of your connected device by running `$AzureKinectFirmwareTool -q` in the terminal. 2. In the terminal, go to the directory with the firmware and update with the AzureKinectFirmwareTool: `AzureKinectFirmwareTool.exe -u <device_firmware_file.bin>` ``` AzureKinectFirmwareTool -u AzureKinectDK_Fw_1.6.108079014.bin ``` I got the following error when running the firmware tool: ``` ERROR: The device failed to reset after an update. Please manually power cycle the device. [2020-06-10 11:33:27.424] [error] [t=19238] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/firmware/firmware.c (61): firmware_t_get_context(). Invalid firmware_t (nil) [2020-06-10 11:33:27.425] [error] [t=19238] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/firmware/firmware.c (313): Invalid argument to firmware_get_device_version(). firmware_handle ((nil)) is not a valid handle of type firmware_t ERROR: Failed to get updated versions ``` After power cylcing and unplugging from USB, the firmware did in fact update. -
madelinegannon revised this gist
Jun 12, 2020 . 1 changed file with 30 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -89,7 +89,7 @@ k4aviewer --- ## Installing Sensor SDK on Jetson Xavier NX At the time of writing (June 2020), Microsoft has debian packages for Ubuntu 18.04 for AMD64 and ARM64. However, this is the first release for ARM: there are some bugs and the Body Tracking SDK is not yet supported. More details on that below. ### 1. Add Microsoft's product repository for ARM64 ``` @@ -98,10 +98,10 @@ sudo apt-add-repository https://packages.microsoft.com/ubuntu/18.04/multiarch/pr sudo apt-get update ``` ### 2. Install Kinect Package Same as instructions [above](#2-install-kinect-packages). ### 3. Finish Device Setup Same as instructions [above](#3-finish-device-setup). ### 4. Increase default USB memory for Ubuntu By default, Linux-based host computers allocate the USB controller only 16 MB of kernel memory to handle USB transfers. This amount is supposed to be enough to support a single Azure Kinect ... so this step _might not_ be necessary. But I went ahead and did it anyway just to be safe. @@ -122,6 +122,33 @@ sudo sh -c 'echo 1000 > /sys/module/usbcore/parameters/usbfs_memory_mb' ``` > Here's a good overview of why USBFS matters for usb camera on Linux, also from [FLIR](https://www.flir.com/support-center/iis/machine-vision/application-note/understanding-usbfs-on-linux/) #### Notes on Running on Jetson Xavier NX 1. The Jetson Xavier NX Developer Kit seems compatible with [minimum system requirements](https://docs.microsoft.com/en-us/azure/kinect-dk/system-requirements#minimum-host-pc-hardware-requirements) of the Azure Kinect. 2. I'm running my X NX `15W 6CORE` mode with 250 GB NVMe SSD added to the DK. - See this [Jetson Hacks repo](https://github.com/jetsonhacks/rootOnNVMe) for a walkthrough of adding NVMe storage to the Jetson X NX. 3. Testing with `k4aviewer`, I got the following warnings and errors: This warning is constant, but harmless: ``` [ warning ] : depth_engine_thread(). Depth image processing is too slow at 1000ms (this may be transient). ``` This is a bug that crashes the data stream when the color camera is enabled: ``` [ error ] : DecodeMJPEGtoBGRA32(). MJPEG decode failed: -1 [ warning ] : capturesync_add_capture(). Capture Error Detected, Color [ error ] : capturesync_get_capture(device->capturesync, capture_handle, timeout_in_ms) returned failure in k4a_device_get_capture() ``` Disabling the Color Camera avoids the errors, however [there's a fix](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/1249#issuecomment-642245118) in the next release, 1.4.1. But you can download the beta with the fix now: - Click this download [link](https://www.nuget.org/api/v2/package/Microsoft.Azure.Kinect.Sensor/1.4.1-beta.0), rename from `.nupkg` to `.zip`, and unzip for access to the AMD64 and ARM64 libraries. 4. The Body Tracking SDK does not run on ARM yet ... supposedly that is [coming soon](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/1093#issuecomment-594313079) though. --- ## Installing Body Tracking SDK -
madelinegannon revised this gist
Jun 12, 2020 . 1 changed file with 33 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Jump to: > See [Microsoft's Installation Guide](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/docs/usage.md#debian-package) ### 1. Add link to Microsoft's Linux Software Repository for AMD64 By adding microsoft's code repository to your system so that you can call `sudo apt install xxx` to install system wide. > [Guide for Configuring the Repository](https://docs.microsoft.com/en-us/windows-server/administration/linux-package-repository-for-microsoft-software#ubuntu) @@ -89,6 +89,38 @@ k4aviewer --- ## Installing Sensor SDK on Jetson Xavier NX At the time of writing (June 2020), Microsoft has debian packages for Ubuntu 18.04 for AMD64 and ARM64. However, this is the first release for ARM: there are some bugs and the Body Tracking SDK is not yet supported. ### 1. Add Microsoft's product repository for ARM64 ``` curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - sudo apt-add-repository https://packages.microsoft.com/ubuntu/18.04/multiarch/prod sudo apt-get update ``` ### 2. Install Kinect Package Same as instructions above. ### 3. Finish Device Setup Same as instructions above. ### 4. Increase default USB memory for Ubuntu By default, Linux-based host computers allocate the USB controller only 16 MB of kernel memory to handle USB transfers. This amount is supposed to be enough to support a single Azure Kinect ... so this step _might not_ be necessary. But I went ahead and did it anyway just to be safe. Microsoft has [instructions](https://docs.microsoft.com/en-us/azure/kinect-dk/multi-camera-sync#linux-computers-usb-memory-on-ubuntu) for this, however Jetson boards don't have grub. So instead, I used these [instructions from FLIR](https://www.flir.com/support-center/iis/machine-vision/application-note/getting-started-with-the-nvidia-jetson-platform/) for the Jetson TX2. ``` To acquire images greater than 2 MB in resolution, add the following to the APPEND line: usbcore.usbfs_memory_mb=1000 to this file: /boot/extlinux/extlinux.conf If this method fails to set the memory limit, run the following command: sudo sh -c 'echo 1000 > /sys/module/usbcore/parameters/usbfs_memory_mb' ``` > Here's a good overview of why USBFS matters for usb camera on Linux, also from [FLIR](https://www.flir.com/support-center/iis/machine-vision/application-note/understanding-usbfs-on-linux/) --- -
madelinegannon revised this gist
Jun 12, 2020 . 1 changed file with 25 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,6 @@ Jump to: - [Installing Body Tracking SDK](#installing-body-tracking-sdk) - [Updating Firmware for Azure Kinect](#updating-firmware-for-azure-kinect) --- ## Installing Sensor SDK on Linux PC @@ -60,6 +59,31 @@ and save. ``` 3. Rerun `sudo apt-get update` ### 2. Install Kinect Packages If there are no more errors, you should be able to install the Kinect packages `install libk4a1.X libk4a1.X-dev k4a-tools` > If you install `k4a-tools` first, it automatically downloads the latest version of `libk4a1.X`. Take note of the version for installing `libk4a1.X-dev` (it must be the same version as `libk4a1.X`). ``` sudo apt install k4a-tools sudo apt install libk4a1.4-dev ``` > If you mess up, you can always uninstall and try again using `sudo apt remove k4a-tools` ### 3. Finish Device Setup [Finish device setup](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/docs/usage.md#linux-device-setup) by setting up udev rules: - Copy '[scripts/99-k4a.rules](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/scripts/99-k4a.rules)' into '/etc/udev/rules.d/'. - Detach and reattach Azure Kinect devices if attached during this process. ### 4. Run an App To run an app, you just call it directly in the terminal: ``` k4aviewer ``` > You may get a warning to upgrade your firmware when running `k4aviewer` the first time. See [instructions](#updating-firmware-for-azure-kinect) below. > The `k4aviewer`, `k4arecorder`, and `AzureKinectFirmwareTool` downloaded through `k4a-tools` are all located in `/usr/bin`. --- -
madelinegannon revised this gist
Jun 12, 2020 . 1 changed file with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -34,7 +34,7 @@ sudo apt install curl ``` 2. Specify the architecture of the repository. Running the repository command, I got this error on running`sudo apt-get update`: `N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://packages.microsoft.com/ubuntu/18.04/prod' doesn't support support architecture 'i386'`. Turns out you need specify the architecture of the repository to `[arch=amd64]`: @@ -47,14 +47,19 @@ Turns out you need specify the architecture of the repository to `[arch=amd64]`: deb https://packages.microsoft.com/ubuntu/18.04/prod bionic main # deb-src https://packages.microsoft.com/ubuntu/18.04/prod bionic main ``` to: ``` deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main # deb-src [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main ``` and save. - Log out of root: ``` exit ``` 3. Rerun `sudo apt-get update` --- -
madelinegannon revised this gist
Jun 12, 2020 . 1 changed file with 41 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -15,13 +15,47 @@ Jump to: > See [Microsoft's Installation Guide](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/docs/usage.md#debian-package) ### 1. Add link to Microsoft's Linux Software Repository By adding microsoft's code repository to your system so that you can call `sudo apt install xxx` to install system wide. > [Guide for Configuring the Repository](https://docs.microsoft.com/en-us/windows-server/administration/linux-package-repository-for-microsoft-software#ubuntu) Here are Microsoft's Instructions: ``` curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - sudo apt-add-repository https://packages.microsoft.com/ubuntu/18.04/prod sudo apt-get update ``` I ran into errors with these instructions. Here's how I solved them: 1. Install `curl` if you haven't already. ``` sudo apt update && upgrade sudo apt install curl ``` 2. Specify the architecture of the repository. Running the repository command, I got this error: `N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://packages.microsoft.com/ubuntu/18.04/prod' doesn't support support architecture 'i386'`. Turns out you need specify the architecture of the repository to `[arch=amd64]`: - Log in as root: ``` sudo -i ``` - Modify `etc/apt/sources.list`. At the bottom of the file, change from: ``` deb https://packages.microsoft.com/ubuntu/18.04/prod bionic main # deb-src https://packages.microsoft.com/ubuntu/18.04/prod bionic main ``` to: ``` deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main # deb-src [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main ``` 57 and save. --- -
madelinegannon renamed this gist
Jun 12, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
madelinegannon created this gist
Jun 12, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ ## Azure Kinect on Ubuntu 18.04 #### Notes on Installing Microsoft Azure Kinect Sensor and Body Tracking SDKs on Linux PC and NVIDIA Jetson Xavier NX _06.12.2020_ Jump to: - [Installing Sensor SDK on Linux PC](#installing-sensor-sdk-on-linux-pc) - [Installing on Jetson Xavier NX](#installing-sensor-sdk-on-jetson-xavier-nx) - [Installing Body Tracking SDK](#installing-body-tracking-sdk) - [Updating Firmware for Azure Kinect](#updating-firmware-for-azure-kinect) --- ## Installing Sensor SDK on Linux PC > See [Microsoft's Installation Guide](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/docs/usage.md#debian-package) ## 1. Add link to Microsoft's Linux Software Repository 20 Basically, you add microsoft's code repository to your system so that you can call `sudo apt install xxx` to install system wide. 21 22 - [Guide for Configuring the Repository](https://docs.microsoft.com/en-us/windows-server/administration/linux-package-repository-for-microsoft-software#ubuntu) --- ## Installing Sensor SDK on Jetson Xavier NX --- ## Installing Body Tracking SDK --- ## Updating Firmware for Azure Kinect