\documentclass[10pt,letterpaper]{article}
\usepackage[margin=1.5in]{geometry}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{multirow}
\usepackage{listings}
\usepackage{graphicx}
\title{
        CS480 HW \#2
}
\author{}
\date{}
\usepackage[parfill]{parskip}

\newcommand{\bq}{\item \begin{samepage} }
  \newcommand{\eq}{\end{samepage}\vspace{.2in}}
\begin{document}
\vspace*{-1.0in}

\begin{center}
\Large{ CS480 HW \#2 }
\end{center}

\subsubsection*{Introduction}

Figure \ref{arm} shows an image of the PhantomX Pincher Arm
manufactured by Trossen Robotics.  This arm has five degrees of
freedom: one gripper and four rotational joints.  The goal of this
assignment is to explore the kinematics of this arm.

\begin{figure}[h]
  \centering
    \includegraphics[width=0.5\textwidth]{gripper.jpg}
  \caption{The Arm.}
  \label{arm}
\end{figure}

In order to simplify the analysis, we will consider only two of the
arm's degrees of freedom and assume that the rest of the joints are
frozen in place.  The arm is allowed to swivel at the ``shoulder''
joint, labeled ``s'' in the image, and rotate at the ``elbow'' joint,
labeled ``e'' in the image.


We will organize our analysis around the four different coordinate
frames labeled in the figure.  For each coordinate frame, the red
arrow corresponds to the $x$-axis, the green arrow corresponds to the
$y$-axis, and the blue arrow corresponds to the $z$-axis. We will express
the rotation of the two joints as $\Theta_s$ and $\Theta_e$.  In Figure \ref{arm} $\Theta_s = -45^\circ$ and $\Theta_e = 45^\circ$.


The dimensions of the arm are as follows: 
\begin{itemize}
\item The shoulder joint is 8cm above the base.
\item The elbow joint is 15cm from the shoulder.
\item The gripper is 18cm from the elbow. 
\end{itemize}

\pagebreak
\subsubsection*{Question 1}

Perform the following coordinate transforms by hand.  You should be
able to work these out directly, without doing any matrix arithmetic.
Throughout these exercises, I will use subscripts on position vectors
to indicate which coordinate frame I am referring to.  In other words
$[0\; 0\; 1]^T_g$ refers the position $(0, 0, 1)$ in the gripper coordinate
frame. Distances are in meters. 

\begin{itemize}
\item  Assuming that $\Theta_s = 0^\circ$ and $\Theta_e = 0^\circ$, \\ \\
  What is the location of $[0\;  0\;  0]^T_g$ in coordinate frame $b$? 
  \underline{ \hspace{1in} }  \\ 

  What is the location of $[0\;  0 \;0]^T_b$ in coordinate frame $g$? 
  \underline{ \hspace{1in} }  \\ 

\item  Assuming that $\Theta_s = 90^\circ$ and $\Theta_e = 0^\circ$, \\ \\
  What is the location of $[0\;  0\;  0]^T_g$ in coordinate frame $b$? 
  \underline{ \hspace{1in} }  \\ 

  What is the location of $[0\;  0 \;0]^T_b$ in coordinate frame $g$? 
  \underline{ \hspace{1in} }  \\ 

\item  Assuming that $\Theta_s = 90^\circ$ and $\Theta_e = 90^\circ$, \\ \\
  What is the location of $[0\;  0\;  0]^T_g$ in coordinate frame $b$? 
  \underline{ \hspace{1in} }  \\ 

  What is the location of $[0\;  0 \;0]^T_b$ in coordinate frame $g$? 
  \underline{ \hspace{1in} }  \\ 

  What is the location of $[.1\;  0\;  0]^T_g$ in coordinate frame $b$? 
  \underline{ \hspace{1in} }  \\ 

  What is the location of $[.1\;  0 \;0]^T_b$ in coordinate frame $g$? 
  \underline{ \hspace{1in} }  \\ 

\end{itemize}
\pagebreak
\subsubsection*{Question 2}

For this question, feel free to use the matrix ``nicknames'' from
Figure 22 of the Jennifer Kay paper. You don't need to actually
calculate the matrix products.  For example, The solution for the
simple arm in Figure 27 could be written as:
\[T_g^w = \text{Trans}(L1, 0, 0) \times \text{Rotz}(\Psi) \times \text{Trans}(L2, 0, 0).\]

This corresponds to the result presented in Figure 29. 


\begin{itemize}
\item Show how to calculate $T^g_b$.
\vspace{1in}
\item Show how to calculate $T^b_g$. 
\vspace{1in}
\end{itemize}


\subsubsection*{Question 3}

Download the file \verb+hw2.py+ from the course schedule page and
complete the unfinished functions.  Confirm that the output of the
finished code corresponds to your answers from Question 1.

\end{document}
