Today's goal: The goal of this problem set is to extend the behavior from the previous problem set but have it work in a more complex setting with complex obstacles, i.e. our classroom.
The class room is a cluttered environment with obstacles that have complex 3D shapes, like tables where a robot might run into the top surface before it runs into the legs. With the depth camera, the robot can detect the distance to obstacles at different heights within its sensing range and properly avoid complex obstacles.
Your goal is to program the robot to wander through the classroom, using the depth camera.
- You can start with replicating the behavior of your robot roomba by using the depth camera as more sophisticated bumpers: By default, move straight. If something is in your way ("too close" by some threshold you set), then turn until there is enough open space to move forward.
- Another potential strategy is to by default always have the robot try to aim itself and move in the direction of "most open space" in its visual field. If the open space is not big enough, then turn until it is.
- You must also make use of the bumpers to avoid low obstacles that might not be visible to the robot. Note that the robot has a blind spot behind it, so moving backwards too much is not a good strategy. Your program should also display a window on the robot screen with what the depth camera is seeing and what your thresholding is doing. This will also help with debugging, but there is one caveat: this does not work as nicely over ssh, so you should run your program on the robot itself and not use ssh in this case.
Hints: (a) It will take some tuning to discover what "in your way" and "enough open space" mean physically. Remember that the depth camera returns distance from the camera, not from the front of the robot base, so spend some time placing obstacles in front of the robot and making sure you can threshold for too-close correctly. Before starting, it is useful to design tests on a stationary robot to see where the limits of the robot's depth vision are -- where are the edges of its vision, how does the depth value in an image correspond to actual distance to an obstacle, where are the blind spots. (b) Your robot should not try to squeeze through too tight a space, not go under the tables, and try your best not to hit the netbook USB ports on obstacles. You can also use the velocity-smoother, which the TF staff will explain on piazza.
- Whatever strategy you use, you must document it in a readme file in your code directory!
We will put your robot to several tests:
Test1: Robot wanders safely in the classroom without getting stuck on any obstacles (5 minutes for each team); we will simplify the room by making sure most chairs are pushed into the tables.
Test2: Same test but staff and all robots are allowed to move around together (5 minutes all together)
Grading Scheme (10 points): 6 points for good behavior on Test 1 (deduct points per bump, more for getting stuck, or for not exploring the room); 2 points for good behavior in Test 2; finally 2 points for good code. Remember to submit your code before class for every problem set.