\chapter{Software Notes}\label{appendix:software}
\thispagestyle{myheadings}
% -------------------------------------------------------------
% pc hardware
% -------------------------------------------------------------
% \section{Computer Hardware Configuration}\label{sec:appendix_software_hardware}
% This work was conducted on a Hewlett-Packard Compaq nx9420 notebook with the following specifications:
% 
% \begin{itemize}
% \item \textbf{Hardware}
% 	\begin{itemize}
% 	\item Intel Corp. T2400 @1.83GHz processor (32 bits)
% 	\item 4GB (2+2) SODIMM DDR2 Synchronous 667 MHz RAM memory
% 	\item ATI Technologies Radeon Mobility X1600 graphics card
% 	\item Fujitsu MJA2500B 465GiB (500GB) SATA hard drive
% 	\item Texas Instruments PCIxx12 OHCI Compliant IEEE-1394 Host Controller (internal)
% 	\end{itemize}
% \item \textbf{System}
% 	\begin{itemize}
% 	\item Ubuntu Linux version 10.04 LTS
% 	\item Linux kernel version 2.6.32-43-generic-pae
% 	\item ROS Fuerte version
% 	\end{itemize}
% \end{itemize}
% 
% % -------------------------------------------------------------
% % pdd instalation and openhaptics instalation
% % -------------------------------------------------------------
% \section{PHANToM Device Drivers and OpenHaptics}\label{sec:appendix_software_pdd}
% Installation of the PHANToM device software is hereby described for future reference.\\
% 
% \paragraph{Note:} As Ubuntu is a Debian-based Linux distribution, software installation files come frequently in the form of \textit{.deb} packages. Other Linux distributions have similar packages, but the instructions for installation and setup may differ. Beware of this fact beforehand, for this text is meant for Debian-like systems.
% 
% Also, system component dependencies, as the \textit{libc} libraries, the \textit{gcc} and \textit{g++} compilers or the \textit{raw1394 (FireWire)} module libraries, will not be explicitly requested to be updated on automatic configuration scripts. However, keep in mind that distribution-dependent repositories not always provide the latest version for system components, even non kernel-dependent software. Core components update may be recommended to advanced users to improve execution speeds and memory management.
% 
% \subsection{SensAble Software Pre-requisites}\label{subsec:appendix_software_prerequisites}
% \begin{itemize}
% \item \textbf{SensAble Developer Support Center (DSC) access credentials}:
% 
% Place a request for credential generation at the SensAble Developer Support Center website (\url{dsc.sensable.com}). As the software components are proprietary (libraries and drivers), these credentials will be needed to download all the software and documentation, as well to give access to the online discussion forum.
% 
% \item \textbf{Necessary libraries}:
% 
% According to the respective Linux distribution, install all the dependencies and requisites mentioned on the file ''HW\_userguide\_Linux.pdf''. As stated there, all the dependencies must be satisfied before attempting to install the PHANToM drivers.
% 
% \item \textbf{Mesa3D libraries}:
% 
% In the previous \textit{.pdf} file, the MesaLib7.4.2 library appears as a pre-requisite. However, this version was flagged on Ubuntu 10.04 for its numerous bugs, so the installed version was 7.5.2. This version is recommended, along with the MesaGLUT associated package, and is available at \url{www.mesa3d.org}.
% 
% For a better system integration, the library should be compiled as follows (\textit{sudo} is optional if the working subdirectory is within the \textit{/home} directory):
% 
% \begin{enumerate}
% \item Extract the downloaded file and run the package configuration in a console:\\
% \hspace*{5mm} \textit{sudo ./configure -\,-enable-motif}\\
% (The configuration report detects both critical and optional dependencies. If any critical library fails, the Linux distribution's repositories should have a version available. The \textit{motif} package linking may not be required for every system.)
% \item Compile the libraries with the command:\\
% \hspace*{5mm} \textit{sudo make}
% \item Install with the command:\\
% \hspace*{5mm} \textit{sudo make install}
% \item Check if the location of installed libraries is in directory \textit{/usr/lib}:\\
% \hspace*{5mm} \textit{sudo locate libGlw}\\
% \hspace*{5mm} \textit{sudo locate libGLUT}
% \end{enumerate}
% \end{itemize}
% 
% \subsection{SensAble Software Installation}\label{subsec:appendix_software_installation}
% The installation of the OpenHaptics v3.0 suite must only be executed after the correct installation of the PHANToM drivers. To install both, navigate to the directory of the \textit{.deb} files (or extract the compressed version) downloaded and run consecutively in a console (''*'' represents the version downloaded):\\
% 
% \hspace*{5mm} \textit{sudo dpkg -i phantomdevicedrivers\_*.*-*\_i386.deb}\\
% 
% \hspace*{5mm} \textit{sudo dpkg -i openhaptics\_*.*-*\_i386.deb}\\
% 
% Alternatively, a \textit{GUI} application for the \textit{.deb} package manager \textit{dpkg} can also be used. But installing the \textit{.deb} file through the GUI may not work. If running amd64-based systems or other 64bit system, \textit{dpkg} requires a different argument list, as exemplified:\\
% 
% \hspace*{5mm} \textit{dpkg -i –force-architecture /path/to/file.deb}\\
% 
% After the installation is complete, device communication must be tested. These libraries are equipped with two small applications, installed by default with the drivers. The \textit{PHANToMConfiguration} is an application for managing the connected hardware, defining the default device and allowing for dual-device setup configurations. The \textit{PHANToMTest} is a small application designed to test the device's capabilities. This library, drivers, and applications were not designed for systems running in any other than the English language. For that reason, normal execution of these programs, via command line calls, is not possible. The only way these applications can run is by calling their configuration routines, which are no other than scripts that change the environment language just for the program's execution.
% 
% The configuration application is called by running:\\
% 
% \hspace*{5mm} \textit{sudo /usr/sbin/runPHANToMConfiguration}\\
% 
% Select the correct PHANToM device and press ''OK''. Next, to test the device:\\
% 
% \hspace*{5mm} \textit{sudo /usr/sbin/runPHANToMTest}\\
% 
% The PHANToM drivers do not have access to the FireWire communication port object, so it falls to the user the responsibility to probe it and change the access rules. To workaround these issues, a small \textit{shell} file was created with the lines:
% 
% \begin{verbatim}
% #!/bin/bash
% modprobe raw1394
% chmod 777 /dev/raw1394
% \end{verbatim}
% 
% This script is to be run before any call for device applications. Alternatively, these commands can be added to the \textit{shell}'s startup script or to the system's startup routines.
% 
% The OpenHaptics toolkit deploys compilable examples to demonstrate both the device and the libraries capabilities. If correctly installed, the compilable source code should be installed on the directory \textit{/usr/share/3DTouch/examples}. All the provided documentation is also installed in the hard-drive on the directory \textit{/usr/share/3DTouch/doc}.
% 
% \paragraph{Note:} Some examples require the creation of an environment variable \textit{3DTOUCH\_BASE} that is supposed to point at a directory. However, the Ubuntu Linux \textit{bash} does not allow to initiate an environment variable started by a number. The most common workaround for this case is to use the \textit{tcsh shell}, an old \textit{C-shell} still supported on Linux, and run the following commands:\\
% 
% \hspace*{5mm} \textit{sudo tcsh}
% 
% \hspace*{5mm} \textit{sudo setenv 3DTOUCH\_BASE /usr/share/3DTouch}\\
% 
% The examples can be run inside the \textit{tcsh} terminal, or outside back in the \textit{bash shell}, exiting with the command ''\textit{exit}''.
% 
% % -------------------------------------------------------------
% % other libraries
% % -------------------------------------------------------------
% \section{Adicional Software}\label{sec:appendix_other}
% 
% \subsection[Robot Operating System]{Robot Operating System (ROS)}\label{subsec:appendix_other_ROS}
% In this work, the \textit{ROS} version installed was \textit{Fuerte}. The installable Linux version is system dependent, but the detailed instructions can be found on \url{http://www.ros.org}. Here it can also be found tutorials, code examples, discussion forums, etc\ldots
% 
% \subsection[Eigen Library]{\textit{Eigen} Library}\label{subsec:appendix_other_eigen}
% The \textit{Eigen} library is a C++ template library for linear algebra, with matrices, vectors, numerical solvers, and  other related algorithms, and is provided together with \textit{ROS}. Should it be needed for another purpose, the compilable source code can be found on \url{http://eigen.tuxfamily.org}.
% 
% \subsection[Armadillo Library]{\textit{Armadillo} Library}\label{subsec:appendix_other_armadillo}
% Armadillo is an open-source \textit{C++} linear algebra library with a syntax that is deliberately similar to Matlab. It supports integer, floating point and complex numbers, and has a built trigonometric and statistics functions. Various matrix decompositions are provided through optional integration with \textit{LAPACK}, or one of its high performance drop-in replacements (such as the multi-threaded \textit{MKL} or \textit{ACML} libraries). Primarily developed at NICTA (Australia), it has contributions from around the world.
% 
% To install the library, instructions are as follows (\textit{sudo} is optional if the working subdirectory is within the \textit{/home} directory):
% 
% \begin{enumerate}
% \item Install \textit{ROS} as detailed above.
% This will install a series of dependencies that will be needed to compile this library.
% \item Install CMake:\\[2mm]
% \hspace*{5mm} \textit{sudo apt-get install cmake}
% \item Install BLAS, LAPACK and ATLAS libraries:\\[2mm]
% \hspace*{5mm} \textit{sudo apt-get install libblas-dev}\\[2mm]
% \hspace*{5mm} \textit{sudo apt-get install liblapack-dev}\\[2mm]
% \hspace*{5mm} \textit{sudo apt-get install libatlas-base-dev libatlas-headers}
% \item Download and unpack the source code from \url{http://arma.sourceforge.net}.
% \item Open a command line and change into the directory that was created by unpacking the downloaded archive:\\[2mm]
% \hspace*{5mm} \textit{sudo cmake .}\\[2mm]
% (CMake should detect all necessary dependencies and warn if any fails.)
% \item Compile the library with the command:\\[2mm]
% \hspace*{5mm} \textit{sudo make}
% \item Install with the command:\\[2mm]
% \hspace*{5mm} \textit{sudo make install}
% \end{enumerate}

% \clearpage
% ~\\[5mm]
% \thispagestyle{empty}