CS536 - Homework Assignment 5
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:
- The robot is defined by 6 parameters
Default values: θ1 = -51°, θ2 = 39°, θ3 = 65°,
L1 = 4, L2 = 3, L3 = 2.5
- 3 joint angles θ1: -t θ1_val, θ2: -u θ2_val, θ3: -v θ3_val
- 3 link lengths L1: -l L1_val, L2 -m L2_val, L3 -n L3_val
- θ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.
- The origins of the Links' coordinate systems are in the center of
their bases. The Ln's are measured in the Z direction.
- Your output file should contain 4 cuboids defined with polylines and
The vertices and translations of all objects should be specified in world
Do not use Inventor transformations to create your model.
- Write the resulting graphics primitives in the Open Inventor format
to standard out.
- Your program will be tested with the command "./CG_hw5 > out.iv" and other similar commands.
- Your program should not require arguments and should be able to
process a subset of them in arbitrary order.
- Display link geometry correctly : 1 point
- Display/place spheres correctly : 2 points
- Evaluate and apply transformations correctly : 7 points
4. Submission Guidelines:
- Assignments must be submitted via Bb Learn.
- Makefile whose default action is to create the executable, or
include a script with the appropriate name.
- 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.
- All source code. Your code must compile and run
on tux (Linux).
- You may program in any language you like as long it can produce
a usable executable on tux.
- 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.
- 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.
- 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.