This homework assignment is a simple introduction to C-spaces and how they relate to the workspace. Your primary task is to setup a simple 2D robot environment and create collision detection functions for it. This will later form the basis for some of the motion planning algorithms you'll be asked to program. For now, you are only required to visualize the free C-space of the robot. The robot has 3 degrees of freedom, so this can be done by sampling and approximating the 3D surface of the boundaries of the free C-space (i.e., the boundary between collisions and non-collisions).
Your program should process an environment configuration file describing the collision geometry of objects and the robot. It then has to output a visual representation of the free C-space of the robot.
Objects in the environment (including the robot) are composed of 2D
oriented bounding boxes (OBBs). There are a number of techniques for
testing whether two OBBs intersect (e.g. using the Separating Axis
Theorom). Your program (or script) will read a text file containing
the placement of the robot base, and the relative positions of the obstacles
in the environment.
To make the problem a little more interesting, the robot is a 3-link gripper. The configuration angles are marked on the figure as AngleX. The centers of rotation for each joint are given by the green circles. The red text indicates joint indices. The range of each joint is in [0,2*pi). The smaller extent (half width) for each box of the robot is 0.1. Finally, the center of Joint 3 lies on the center of the gripper's biggest box.
The format for the environment file is:
Where
Because we do not know the complex shape of the C-space obstacles, we will approximate them through sampling. Specifically, a given joint configuration q = (Angle1, Angle2, Angle3) of the robot can be tested whether or not it is collision free by applying the forward kinematics of the robot to position the links and testing for collisions between the link geometry and the obstacles in the workspace.
This process requires both a forward kinematics and a collision detection routine to be available. You are free to use publicly available collision detection software, or implement your own. If you would like to get a head-start on upcoming programming assignments, you may utilize 3D collision detection libraries by representing the 2D OBBs internally as 3D OBBs that are constrained to lie in a plane.
For this lab, you will be sampling the C-space by discretizing along each of the joint axes and testing a regular grid in the 3D C-space volume. Your program should allow the user to adjust the resolution of the discretization along each axis independently and rerun the sampling process.
Even without any obstacles in the environment, the robot can possibly collide with itself depending upon shape and movement capabilities. These "self-collisions" tend to occur between non-adjacent links. Collisions between adjacent links are typically prevented by setting proper joint limits.
For each test environment, make sure to show the resulting free C-space when considering self-collisions only.
For visualization, you may render 3D triangles obtained by 1) running any flavor of "marching cubes" algorithm, 2) using the Matlab script provided below, or 3) coming up with your own method of interpreting and visualizing the C-obstacle volumes.
If you are using Matlab, the following function will take care of displaying the visualization of the free C-space.
You can use any language or program for this, as long as there are clear instructions on how to run it. Although you won't be graded specifically for the speed of your program, you have the potential to earn bonus points if your implementation is clean, robust, and efficient.
Everything should be turned in electronically using the subversion (SVN) account provided to you on the course server.
Please answer the following questions:
1. Determine the C-space for a car that drives around on a huge sphere (such as the earth with no mountains or oceans). Assume the sphere is big enough so that its curvature may be neglected (e.g., the car rests flatly on the earth without wobbling). [Hint: it is not S^2 x S^1] (#10, Planning Algorithms, pg. 180)
2. Suppose five polyhedral bodies float freely in a 3D world. They are each capable of rotating and translating. If these are treated as "one" composite robot, what is the topology of the resulting C-space (assume that the bodies are not attached to each other)? What is its dimension? (#16, Planning Algorithms, pg. 180)