CS536 - Homework Assignment 5
Hierarchical Models

Programming Problem:

Write a program, named CG_hw5, that evaluates a hierarchical, robot-like model. Given a description of a 4-link, 3-joint robot, calculate the positions and orientations of the robot's links in world coordinates. You will be given the relative transformations from one link to the next, and the lengths of the four links will be parameters of the robot, along with its joint angles.

The links should be represented by rectangular cuboids. You may use the description of the cuboids in the example Inventor file for your own program and output. The focus of the assignment is calculating the correct transformations of each link of the "robot" and applying them to the links' vertices. The output of your program should be 4 cuboids (defined with polylines) and two spheres. One sphere (with radius 0.2) should be placed at the origin. The second sphere (with radius 0.2) should be placed at the end of the fourth link.

The first link of your robot is a fixed base whose lower left corner is [-2, -2, 0] and upper right corner is [2, 2, 1].

The remaining links have the corner vertices of [-0.5, -0.5, 0] and [0.5, 0.5, Ln], where Ln is the length of the nth link in the Z direction, in their own local coordinate systems.
The full robot, along with all of its parameters, is displayed below.
Each link is connected to the previous link at and rotates around the origin of its own local coordinate system.


Here is the Inventor model of the robot produced by the default values.

CG_hw5 has the following specification:

  1. The robot is defined by 6 parameters Default values: θ1 = -51°,   θ2 = 39°,   θ3 = 65°,   L1 = 4,    L2 = 3,    L3 = 2.5   
  2. θ1 defines a rotation around the Z axis in world coordinates.
    θ2 defines a rotation around the Y axis of Link 1's coordinate system.
    θ3 defines a rotation around the Y axis of Link 2's coordinate system.
  3. The origins of the Links' coordinate systems are in the center of their bases. The Ln's are measured in the Z direction.
  4. Your output file should contain 4 cuboids defined with polylines and 2 spheres.
    The vertices and translations of all objects should be specified in world coordinates.
    Do not use Inventor transformations to create your model.
  5. Write the resulting graphics primitives in the Open Inventor format to standard out.
  6. Your program will be tested with the command "./CG_hw5 > out.iv" and other similar commands.
  7. Your program should not require arguments and should be able to process a subset of them in arbitrary order.

Grading Scheme

  1. Display link geometry correctly : 1 point
  2. Display/place spheres correctly : 2 points
  3. Evaluate and apply transformations correctly : 7 points

4. Submission Guidelines:

  1. Assignments must be submitted via Bb Learn.
  2. Makefile whose default action is to create the executable, or include a script with the approriate name.
  3. README file: explain the features of your program, language and OS used, compiler or interpreter used, name of file containing main(). Text files only. Word and PDF documents will NOT be accepted.
  4. All source code. Your code must compile and run on tux (Linux).
  5. You may program in any language you like as long it can produce a usable executable on tux.
  6. Your program will be run by the TA. Please do NOT submit any image files, Visual C++ project files, or anything not requested in this section. Your program must run on tux without the installation of "special" libraries.
  7. If you are using a language that doesn't produce an executable file, e.g. python, then be sure to include a script called CG_hw5 that accepts arguments and prints Inventor to standard out.
  8. Points will be deducted if submission guidelines are not followed.

NOTE: Your source code for all programming assignments will be run through a plagiarism detection system. This program uses compiler techniques which are invariant of syntax and style. If you are sharing code with other classmates, you will get caught. Please refer to the student handbook for actions that will be taken.

Last modified on November 13, 2016.