\section{Problem Statement}
\label{sec problem statement}
\subsection*{Problem Definition}
Our project for this semester was to explore a possible strategy for fast goal
scoring with a NAO robot. An important note is that we started from scratch,
which means that at the beginning the robot is not aware of anything related to
the game of football, and to the goal scoring in particular.

\begin{figure}[ht]
	\includegraphics[width=\textwidth]{\fig Problem-Definition}
	\caption{Propose a strategy for NAO to score a goal fast}
	\label{W a strategy for Nao}
\end{figure}


\subsection*{Motivation}
When talking about the RoboCup
competition, goal scoring is one of the
most important elements, needed to win a game, which is exactly the target of our project.Another important aspect of our motivation for this project is that we hope that it will become a part of a RoboCup history at TUM. And finally the scientific contribution of our project is that we explorethe possibilities of interdisciplinary research in such fields as computervision, path planning and mechatronics.

 
\section{Propose Solution}
\subsubsection*{Project Milestones}


In order to finish our project scrupulously, we divided the project into four major sections, with ten minor milestones. And figure \ref{W milestones of the project} show the details of our project. 

 
\begin{figure}[ht]
	\includegraphics[width=\textwidth]{\fig Project-Milestones}
	\caption{Entire milestones of the project}
	\label{W milestones of the project}

\end{figure}

\subsubsection*{Detection Section} 
The detection section consists of \textbf{Ball Detection}, \textbf{Goal Detection} and \textbf{Field Detecition}. They mainly introduced the robot through the computer vision detection to find the ball and goal with ignoring other objects. At the same time make sure the robot can run normally in the field during the competition. \\

\subsubsection*{Planning Section} 
The planning section consists of \textbf{Turning to Ball}, \textbf{Distance Measurement} and \textbf{Approach Planning}. We make the robot rotate its body to the ball after finding the ball on the field. Then we need to calculate the distance to the ball and find a possible path for the robot to move closed to the ball.\\


\subsubsection*{Alignment Section}
The Alignment section consists of \textbf{Ball Approach}, \textbf{Goal Alignment} and \textbf{Ball Alignment}. Firstly, the robot will move closed to the ball according the proposed path planning. And it then adjust its body position to align itself with the ball and the center of the goal in a straight line. Finally the robot align itself to the kick position which means that the ball is in the front of his left leg for us.\\

\subsubsection*{Kick Section}
Because our robot is a striker, kick part is very crucial in our project. In this part, we are not only propose to raise the leg for a strong kick, but also need to make sure that the robot can keep balance during kicking.\\




\section{Ball Detection}
\subsection*{Problem Statement}
Find the position of the ball using the images form the cameras.

\subsection*{Proposed Solution}
In order to make the robot possible of detecting objects, we propose to segment the image first. Therefore, it will be necessary for use to define unique color regions by assigning pixels.

\begin{figure}[ht]
	\includegraphics[width=\textwidth]{\fig Ball-Detection}
	\caption{Ball detection with visual image}
	\label{W Ball detection with visual image}

\end{figure}

For the ball detection, we extract the pixels with the same color as the
ball via HSV method. To do that correctly, careful calibration is required, or else the
algorithm might detect foreign objects as the ball, or on the other hand might not be able to detect anything. When the correct pixels are extracted, we find the biggest area among them, and assume that this is the ball. We then find the center and the radius of the ball, as you can see in the figure \ref{W Ball detection with visual image}.

\subsection*{Results}
The HSV method for Ball detection worked fine, but sometimes, under the influence of light in the environment, we need to readjust the parameters of HSV.
