1
$\begingroup$

I have been trying to configure my Azure Kinect to be used in ROS2 Humble but I haven't had success. Here are a few links I found with good information

https://gist.github.com/madelinegannon/c212dbf24fc42c1f36776342754d81bc

https://learn.microsoft.com/en-us/windows-server/administration/linux-package-repository-for-microsoft-software#ubuntu

Any help would be awesome!

Update (still not working)

Following the comments below (thank you)

  1. Manually downloaded libsoudio and installed
  2. Downloaded the k4a files and installed (from here)
  3. Made a ros workspace and cloned the Azure demo project
  4. rosdep install --from-paths src --ignore-src -r -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
azure_kinect_ros_driver: Cannot locate rosdep definition for [K4A]
Continuing to install resolvable dependencies...
#All required rosdeps installed successfully

If I just ignore this a colcon build the package, this is the result:

Starting >>> azure_kinect_ros_driver
--- stderr: azure_kinect_ros_driver                              
Finding K4A SDK binaries
!!! Body Tracking SDK not found: body tracking features will not be available !!!
K4A Libs: k4a::k4a;k4a::k4arecord
K4A DLLs: /usr/lib/x86_64-linux-gnu/libk4a.so.1.4.1;/usr/lib/x86_64-linux-gnu/libk4arecord.so.1.4.1
K4A Install Needed: FALSE
---
Finished <<< azure_kinect_ros_driver [6.39s]

Summary: 1 package finished [6.51s]

Doesn't seem a terrible output but it still doesn't work.

I also followed the instructions here and created the /etc/udev/rules.d/99-k4a.rules file with the following content:

# Bus 002 Device 116: ID 045e:097a Microsoft Corp.  - Generic Superspeed USB Hub
# Bus 001 Device 015: ID 045e:097b Microsoft Corp.  - Generic USB Hub
# Bus 002 Device 118: ID 045e:097c Microsoft Corp.  - Azure Kinect Depth Camera
# Bus 002 Device 117: ID 045e:097d Microsoft Corp.  - Azure Kinect 4K Camera
# Bus 001 Device 016: ID 045e:097e Microsoft Corp.  - Azure Kinect Microphone Array

BUS!="usb", ACTION!="add", SUBSYSTEM!=="usb_device", GOTO="k4a_logic_rules_end"

ATTRS{idVendor}=="045e", ATTRS{idProduct}=="097a", MODE="0666", GROUP="plugdev"
ATTRS{idVendor}=="045e", ATTRS{idProduct}=="097b", MODE="0666", GROUP="plugdev"
ATTRS{idVendor}=="045e", ATTRS{idProduct}=="097c", MODE="0666", GROUP="plugdev"
ATTRS{idVendor}=="045e", ATTRS{idProduct}=="097d", MODE="0666", GROUP="plugdev"
ATTRS{idVendor}=="045e", ATTRS{idProduct}=="097e", MODE="0666", GROUP="plugdev"

LABEL="k4a_logic_rules_end"

But k4aviewer gives me this error:

[ error    ] : usb_cmd_io(). Error calling libusb_bulk_transfer for initial tx, result:LIBUSB_ERROR_IO
[ error    ] : usb_cmd_io(usbcmd_handle, cmd, p_cmd_data, cmd_data_size, p_data, data_size, NULL, 0, bytes_read, &cmd_status) returned failure in usb_cmd_read()
[ error    ] : usb_cmd_read(depthmcu->usb_cmd, DEV_CMD_DEPTH_READ_PRODUCT_SN, NULL, 0, (uint8_t *)temp_serial_number, sizeof(temp_serial_number) - 1 , &bytes_read) returned failure in depthmcu_get_serialnum()
[ error    ] : depthmcu_get_serialnum(device->depthmcu, serial_number, &serial_number_size) != K4A_BUFFER_RESULT_SUCCEEDED returned failure in k4a_device_open()

$\endgroup$
1

1 Answer 1

2
$\begingroup$

Install Ubuntu 22.04.

Install the Azure Kinect Sensor SDK as per official documentation stated here

Install ros2-humble-desktop

Setup your ros2 workspace

Download the humble branch of the official driver from here into the src folder of your workspace

Run rosdep rosdep install --from-paths src --ignore-src -r -y

Build the workspace with colcon build

Source the workspace source install/setup.bash

Run the launch file ros2 launch Azure_Kinect_ROS_Driver driver.launch.py

$\endgroup$
5
  • $\begingroup$ JJrome thank you. See updated post. $\endgroup$
    – guidout
    Commented Mar 14, 2023 at 11:51
  • $\begingroup$ @guidout I have updated my answer. It may be because you did not run rosdep install to install all the deps of the ros2 package. I also noticed that one of the core deps is the azure kinect sensor sdk. Which you must build and install manually. $\endgroup$
    – JJerome
    Commented Mar 16, 2023 at 23:46
  • $\begingroup$ Also please look at this comment on how to install the deps using debian pacakges github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/… $\endgroup$
    – JJerome
    Commented Mar 17, 2023 at 1:14
  • $\begingroup$ guys, thank you for the comments and sorry for the delay. Please see update. I think I'm much closer but still one last step missing $\endgroup$
    – guidout
    Commented Mar 23, 2023 at 23:04
  • $\begingroup$ @guidout did you follow these instructions? github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/… And did you do the device setup as outlined here github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/docs/… It seems like the problem is coming from not properly building K4A. Perhaps the debs you installed are not for ubuntu 22.04 so you must install the from source. $\endgroup$
    – JJerome
    Commented Mar 27, 2023 at 1:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.