Azure Kinect ROS Driver

Pre-requisites

Read this

  • Get ROS Melodic for Ubuntu 18.04
  • Get Azure Kinect Sensor SDK

Optional : Inital your workspace

1
2
3
mkdir -p ~/AzureKinect_ws/src
cd ~/AzureKinect_ws/src
catkin_init_workspace

Go to catkin_ws/src or src of your ws folder (the ws folder in Optional part)

1
git clone https://github.com/microsoft/Azure_Kinect_ROS_Driver.git

If you didn’t have Azure Kinect Sensor SDK systemwide

Go to next section if you have installed everything systemwide.

If you didn’t install the Azure Kinect Sensor SDK in the system and want to have it locally:

1
2
cd Azure_Kinect_ROS_Driver/
mkdir -p ext/sdk

^Either you mkdir in catkin_ws/src or catkin_ws/src/Azure_Kinect_ROS_Driver/src.

1
2
3
4
cd ext/sdk/
mkdir bin
mkdir include
mkdir lib

Now your should have this folder structure.

1
2
3
4
.\ext\sdk\
bin\
include\
lib\

Then put corrsponding files to corrsponding folders.

First download libk4a1.3 and libk4a1.3-dev from This page

1
2
3
4
cd Downloads/
mkdir tmp
dpkg -x libk4a1.3_1.3.0_amd64.deb /tmp
dpkg -x libk4a1.3-dev_1.3.0_amd64.deb /tmp

After extraction you should get include folder and lib folder in tmp folder.

Meanwhile, prepare your AzureKinectSDK, you need the files inside /build/bin folder, and files inside include folder.

For \ext\sdk\:

bin folder:

  • copy the files inside /build/bin folder from SDK to here.

include folder:

  • copy the files inside include folder from SDK to here, then copy the files inside include folder from tmp folder to here. Merge/Replace if same file exist.

lib folder:

  • copy the files inside lib folder from tmp folder to here.

Test Azure Kinect ROS Driver with rviz

1
2
3
cd catkin_ws
catkin_make
catkin_make install
1
2
source ./devel/setup.bash
roslaunch azure_kinect_ros_driver driver.launch

Verifying the Camera is connected - Way1

Open another terminal to run rviz.

1
rviz

Click Add->Image->Image Topic->/rgb/image_raw

Click Add->Image->Image Topic->/depth_to_rgb/image_raw

You should see the camera.

Open another terminal to start the rqt_graph

1
rosrun rqt_graph rqt_graph

Click Nodes/Topics(active) and refresh the page

You should see something like this:

Verifying the Camera is connected - Way2

Another way to check the camera.

Open another terminal to run:

1
rosrun rqt_gui rqt_gui

Click Plugins -> Visualization -> Image View

Then select /rgb/image_raw and refresh the page.

You should see something like this.

Open another terminal to start the rqt_graph

1
rosrun rqt_graph rqt_graph

Click Nodes/Topics(active) and refresh the page

You should see something like this:

Finally

Check active topic

1
rostopic list

Check active topic (detailed)

1
rostopic list -v
  • If you want to record the topic using rosbag
    • rosbag record -O image.bag /rgb/image_raw /depth_to_rgb/image_raw
  • If you want to playback the rosbag
    • rosbag play image.bag

Now you can use ros topic to collect the depth and rgb from the kinect.

Reference