Kinect Project, Due 3/27

Our final sensor to use on the turtlebots is the Kinect depth sensor.

You'll do two things in this project. First, you'll program your robot to be constantly in motion, without running into anything (no, merely spinning in place doesn't count - you can spin, but only to pick another direction to drive).

Second, you should take your image recognition program from last week (whichever parter's you feel most confident in), and modify is so the robot stops just short of the cereal box, rather than driving right over it.

Your depth sensor is pretty easy to access - if you call getDepth() from your robot object, you'll get back a depth image, where each pixel stores the distance from the camera to that pixel. You'll find your depth image has a lot of nans in it - if it can't determine a distance either due to a shadow or because it's too close, then it just designates it as nan. Note that numpy has lots of useful functions that may be handy like nanmean, nanmin, and all sort of others.