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

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

\begin{center}
\Large{ CS354 HW \#1 }
\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 rotate around the $z$-axis of
the the ``shoulder'' joint, labeled ``s'' in the image, and around the
$y$-axis of 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
\vspace*{-1.0in}
\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. 

The first answer is provided for you.

\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{ $(0,  0,  .41)$ } \\ 

  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 $[.4\;  0\;  0]^T_g$ in coordinate frame $b$? 
  \underline{ \hspace{1in} }  \\ 

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

\end{itemize}

\vspace*{-.2in}
\newpage
\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. 

\vspace{.3in}
\begin{itemize}
\item What is $F_g^e$?
  
   $F_g^e = \text{Trans}(0, 0, -.18)$ (First answer provided for you.)
  \vspace{.5in}
  
\item What is $F_e^s$?
\vspace{.5in}
\item What is $F_s^b$?
\vspace{.5in}
\item Show how to calculate $T^g_b$ from $F_g^e$, $F_e^s$ and  $F_s^b$.
\vspace{.5in}
\item What is $F_b^s$?
\vspace{.5in}
\item What is $F_s^e$?
\vspace{.5in}
\item What is $F_e^g$?
\vspace{.5in}
\item Show how to calculate $T^b_g$ from  $F_b^s$, $F_s^e$ and $F_e^g$. 
\vspace{.5in}
\end{itemize}


\vspace*{-.2in}
\subsubsection*{Question 3}

Download the file \verb+kinematics_hw.py+  and
complete the unfinished functions.  Confirm that the output corresponds to your answers from Question 1.

\subsubsection*{Question 4}

\begin{itemize}
\item Consider the Euler angles $\alpha=90.0^o$, $\beta=0^o$,
  $\gamma=0^o$ expressed as intrinsic rotations with the axis order
  $x-y-z$.  How would this rotation be expressed using the following
  representations?
  \begin{itemize}
  \item Euler angles with \emph{extrinsic} rotations and the axis
    order $x-y-z$. \vspace{.5in}
  \item Axis-angle \vspace{.5in}
  \item Quaternion \vspace{.5in}
  \item Rotation Matrix \vspace{.5in}
  \end{itemize}
\item Consider the Euler angles $\alpha=90.0^o$, $\beta=90^o$,
  $\gamma=0^o$ expressed as extrinsic rotations with the axis order
  $z-y-x$.  How would this rotation be expressed using the following
  representations?
  \begin{itemize}
  \item Euler angles with \emph{extrinsic} rotations and the axis
    order $x-y-z$. \vspace{.5in}
  \item Rotation Matrix \vspace{.5in}
  \end{itemize}
\end{itemize}


\end{document}
