Testing Kinect
In addition to its cliff sensors and bumpers, Kinect is one of the ways TurtleBot “sees” its environment. We’ve already installed the drivers for Kinect so now we’ll test it to make sure it works.
Test Driver and USB Connection (TurtleBot Only)
Before doing anything, check the default 3D sensor of TurtleBot by printing an environment variable and confirm the output:
If you see another 3D sensor, for example asus_xtion_pro, you will need to set the default value of the environment variable in .bashrc and restart your terminal:
On TurtleBot, close all terminals, then open a new window and run:
Then open another terminal window and run:
If you get a collection of lines that start with process[camera...
everything is perfect and you can skip the troubleshooting section below and move on to the “View Image Data” section. Leave the two terminal windows open.
Troubleshooting
If you repeatedly receive:
this is probably because the Kinect driver wasn’t installed. See Install Kinect Driver in our previous post.
If you receive:
or
these have occurred because Kinect isn’t compatible with USB 3.0. Plug it into a USB 2.0 port. (Problems can also occur with USB 2.0 ports that are 3.0 compatible.).
Troubleshooting: I don’t have a USB 2.0 port or it’s still giving the above errors
We’re going to disable USB 3.0 in the BIOS.
- Boot into BIOS by rebooting your computer and holding down the F2 key (it could be a different key on your computer).
- Go to the advanced tab.
- This part varies depending on your computer. If you have a USB option go there first.
- If your BIOS lists xHCI, disable it.
- If your BIOS lists USB Debugging, enable it.
- Save and exit BIOS.
Troubleshooting: Kinect’s USB connection is dropping randomly
On some GNU/Linux systems, specific power settings may drop the USB connection of Kinect. In order to prevent this, run this command, plug Kinect out and in:
If you still have trouble, check that the Kinect has power by running:
and verify that there are three lines about Microsoft Corp.
, two of which are regarding XBox NUI
. If you only have one line or none, Kinect may not be plugged in or is lacking power.
View Image Data (Workstation)
Close all terminal windows, open a new one, and run:
You should see a live video stream from the Kinect. Press ‘q’ to quit.
This is not much more exciting than a webcam, so let’s see a visual representation of distance by running:
You should see a grayscale video stream where objects closer to the Kinect appear darker.
TIP: If you see only solid gray, check that you are still running openni.launch on TurtleBot.
Press ‘q’ to quit the depth image.
Stop Openni (TurtleBot)
Go to the terminal on TurtleBot where openni is running. Press ctrl + C to stop it. Leave minimal.launch running. Now run:
RViz (Workstation)
Close all terminal windows, then open a new one and run:
Under “Displays” check “Registered DepthCloud” and “Image”. Hold down the left mouse button to rotate or the middle mouse button to move the camera.
NOTE: If you don’t see the display panel, scroll your mouse to the top of the screen and click “Panels”. Check the box next to “Display Panel” to enable it.
If you have trouble, here’s a YouTube walkthrough:
Learn more at wiki.ros.org
- 3D Visualization
- Follower Demo - Have TurtleBot follow you around.
TIP: To complete the follower demo you may need to install libfreenect as mentioned on ROS Answers.
Troubleshooting
If you get a warning about “no image available”, try closing everything on both TurtleBot and workstation and then re-opening.