CS5350: Assignment 1

DUE: 11:59pm, Tuesday 2/14

Worth: 7% of your final grade

The course policies page outlines academic honesty as applied to this course, including policies for working with other students on assignments. It also gives the rules for on-time homework submission.

Goals

Assignment

There are three problems. Grading and turn-in details are given below.

  1. In this problem you will use a dynamic geometry system to explore the Peaucellier-Lipkin linkage, a classic result in kinematics from the 19th century (the steam age). The Peaucellier-Lipkin linkage is a construction of rigid bars and rotating joints such that (i) the rotation axes of all joints are parallel (this makes the mechanism planar) and (ii) moving one part of the linkage in a circle results in another part moving along a straight line, and vice-versa. The most common form of the construction uses eight bars (one of which is held immobile) and ten joints (some of which are on top of each other):
    1. Install the free version 1.4 of the dynamic geometry software Cinderella. On Windows you may have better luck using the “with JVM” download, and on Windows 7 you may need to right click on the installer executable in Windows Explorer and set the compatibility mode to Windows NT. Please use only version 1.4 for this assignment.
    2. Familiarize yourself with the Cinderella manual (this is for the later version 2, which adds physics and scripting features, but the documentation for the core dynamic geometry functionality still applies to 1.4). In particular, you will find the documentation for General Operations and Operations for Elementary Geometry useful.
    3. Follow this tutorial to construct a 4-bar linkage in Cinderella (the fixed distance between the first and last “anchor” points acts as a fourth bar). Save your work, and include the resulting .cdy file with your hand-in.
    4. Construct a model of the Peaucellier-Lipkin linkage in Cinderella. Your model should have line segments corresponding to the red, green, and blue segments in the animation above (you can set the color of objects easily in Cinderella). Design your model so that you are free to change the angle of the blue segment (possibly by dragging one of its endpoints). Save your work, and include the resulting .cdy file with your hand-in.
    5. Use Cinderella to generate the locus of the position of the rightmost point on the linkage as a function of the motion of the blue segment (or at least, as a function of its moving endpoint).
    6. The above locus should look like a straight line, which is the point (pun?) of the linkage. However, “looking” like a line does not prove that the motion is in fact a straight line. Add a construction for an actual line corresponding to the dotted line in the above animation ( should also end up on top of the generated locus). The construction for must not depend on the blue segment (or its moving endpoint). Use Cinderella’s probabilistic theorem prover to verify that the rightmost point on the Peaucellier-Lipkin linkage actually does travel along a straight line. (Open the “information window” by the menu function “Views->Information Window” and look for a message to appear when you add the constructed line.) Save your work, and include the resulting .cdy file with your hand-in. (Note: you should hand in a total of 3 .cdy files, one for part c, one for part d, and one for part f. These count as “code”, so you may work with a partner on this problem.)
  2. We have studied a variety of parameterizations for 3D rotation, including rotation matrices, Euler angles, unit quaternions, and the exponential map. In general it is possible to convert among them; for example, a given unit quaternion it is possible to calculate an equivalent orthogonal rotation matrix . Such conversions can be viewed as mathematical mappings from to where is the size of the input parameterization and is the size of the output parameterization. For example and in the mapping from to .

    It is also true that the forward kinematics of a serial-chain robot, for example the three-link manipulator developed in the beginning of Selig Chapter 4, is a mapping from some dimensional input space to some dimensional output space. In this case, equals the number of degrees of freedom in the robot joints (if every joint has only one degree of freedom, such as one rotation, then is simply the number of joints), and the input space is called the joint space. We use to represent a vector in this space. And typically is either 2 or 3 for a planar robot, controlling the position of the end-effector and possibly also its orientation (similarly, is typically either 3 or 6 for a spatial robot). The output space is called the task space, and we use to represent a vector in it. The forward kinematic mapping can thus be written as a function that takes an -vector input and produces an -vector output:

    We have further studied that the Jacobian is defined for the kinematic mapping as an matrix of partial derivatives. The entry in this matrix at row col is .

    In fact, Jacobians are defined in the same manner not just for robot kinematics, but for any differentiable mapping from to . A “Jacobian” is just the multidimensional equivalent of a derivative. It turns out that the mappings that represent conversions among rotation parameterizations are differentiable, and in this problem you will derive symbolic expressions for some of their Jacobians.

    1. On the second-from-last page his famous SIGGRAPH’85 paper, Shoemake gives a formula for converting a unit quaternion to a orthogonal rotation matrix . We may consider this formula to be a mapping . Derive symbolic expressions for the four partial derivatives , , , of this mapping. Write each as a matrix, with each entry an expression involving only . The Jacobian of can be considered a matrix where the first column consists of the 9 entries of “unraveled”, the second column consists of the 9 entries of , etc.
    2. Grassia’s paper centers on the exponential map where and . What are the dimensions of the Jacobian of this map? Derive expressions for all its components in terms of the quantities . Show your work in the derivation (if you read carefully, you will note that Grassia gives the final answers; you may ignore the case that is near zero).
    3. For what set of surfaces do all exponential map vectors correspond to the same rotation? Note that a surface must be two-dimensional.
    4. Finally, consider the composite mapping . The input is a 3-dimensional exponential map vector, and the output is a orthogonal rotation matrix. What are the dimensions of the Jacobian of this mapping? Give a short formula for computing it, using the results of parts a and b.
  3. Using a programming environment of your choice (*), write a program that graphically displays a simulation of an -link planar revolute chain robot, i.e. a generalization of the three-link robot shown in figure 4.1 of the Selig reading. All links should have equal length, and the number of links should be settable when the program is invoked (i.e. without requiring a re-compile). Set up the scale of your graphics output so that in the range 1 to 10 are clearly shown in the window. The initial pose of the robot should be “straight out”, like the home position in Selig’s development. This should correspond to setting all the joint rotations to zero.

    (*) The only limitation on programming environment is that the course staff needs to be able to compile (if applicable) and run your program for grading purposes (note that it is not sufficient to simply supply both the source code and a pre-compiled executable—if you use a compiled language, we need to be able to re-compile your code). This mainly limits you to using freely-available programming environments, though we do have Matlab. Please resolve any questions you may have about this requirement with the course staff prior to beginning your work.

    1. Implement a feature to control the simulation by forward kinematics, i.e., setting joint angles. One way would be to allow the user to click on a joint to select it, then use the keyboard or mouse to set its angle. The specific design is up to you, but you must document how to use it in the README file that accompanies your hand-in. It should be possible to set every joint to its own angle, independent of the setting of other joints.
    2. Implement a second feature to control the simulation by inverse kinematics. You should be able to click and drag on the end effector (the outer tip of the last segment of the robot), and the program should dynamically compute joint angles to make the end effector follow the mouse. Again, the exact design is up to you, including the choice of IK algorithm, but please document the design (and how to use it) your README. Reasonable options include the Jacobian transpose, pseudoinverse, and damped least squares methods as presented in the Buss reading. If you do choose to use any of these methods, please state so in your README.

      You may also find the method to compute the Jacobian on page 5 of the Buss reading to be very handy.

      When there are more joints than needed to make the end effector follow the mouse, provided the mouse point is reachable at all (i.e. provided it is no further than from the first joint, where is the link length). In such cases the robot is called redundant with respect to the task, and there are an infinite number of postures the robot could take that all satisfy the task. Make sure the IK method you choose works for these cases. In particular, analytical IK (solving the equations in closed form, as Selig later does for the two-link case) generally does not work for redundant robots.

      Speed is important; it is not hard to implement IK that is not perceptibly “slow” for serial chains of up to at least on modern desktop and laptop computers.

    Here are some figures from our Java implementation (note that we also implemented control of the orientation (absolute angle) of the last link, which helped us make the poses in some of these snapshots; you may add IK control of the EE orientation as extra credit). We used the damped least squares algorithm as Buss presents it, but we also implemented his presentation of the Jacobian transpose method, and found that it too works reasonably well for this kind of task (though some wild behavior can occur when the target location is unreachable). There was no perceptible slowness in our system while dragging the end of this 44-link chain.

Turn In

To submit your code for problems 1 and 3, follow the instructions on the assignments page.

For problem 2, you may either include an electronic document of your solution in the above submission, or you may hand in hardcopy in class or office hours prior to the due date and time. Or, scan your hardcopy and include it with your electronic submission.

Grading

Out of 100 total possible points, 20 will be allocated to problem 1, 30 to problem 2, and 50 to problem 3.