Setup Azure Kinect ROS Driver on Ubuntu 18.04
Azure Kinect ROS Driver
Pre-requisites
- 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 | cd Azure_Kinect_ROS_Driver/ |
^Either you mkdir in
catkin_ws/src
orcatkin_ws/src/Azure_Kinect_ROS_Driver/src
.
1 | cd ext/sdk/ |
Now your should have this folder structure.
1 | .\ext\sdk\ |
Then put corrsponding files to corrsponding folders.
First download libk4a1.3
and libk4a1.3-dev
from This page
1 | cd Downloads/ |
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 insideinclude
folder fromtmp
folder to here. Merge/Replace if same file exist.
lib
folder:
- copy the files inside
lib
folder fromtmp
folder to here.
Test Azure Kinect ROS Driver with rviz
1 | cd catkin_ws |
1 | source ./devel/setup.bash |
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.