\section{Goal Alignment} \label{p sec goal align} After the approach, described in the section \ref{p sec approach}, is finished, the robot is facing the ball, and the ball is at a short distance. In the stage of goal alignment, the task is to ensure that from the robot's point of view the ball lies between the goalposts. This means, that when the robot is centered at the ball, the goalposts should lie on either side of the center of the camera image. So the robot will first detect the goal and determine if that is the case. If that is not the case, the robot will go around the ball in a circle in the appropriate direction, until the ball is indeed between the goalposts. The walk in circle was implemented in the following way: the robot will step several steps sideways, then will turn to ball, as described in the section \ref{j sec turning to ball}, and finally will adjust the distance to the ball by stepping forwards or backwards, so that the ball is neither too close nor too far. The distance to the ball, similarly to the stage of the direct approach, is not measured explicitly, but is approximated through the position of the ball image in the camera frame. After performing these steps, the check is performed, if the goal alignment is completed. Otherwise, the steps will be repeated until alignment is achieved. The figure \ref{p figure goal-alignment} depicts the successful completion of this stage. \begin{figure}[ht] \includegraphics[width=\textwidth]{\fig goal-alignment} \caption{Successful goal alignment} \label{p figure goal-alignment} \end{figure} \section{Ball Alignment} Now that the ball and the goal are aligned, the robot has to move into a position, from which the kick can be performed. Depending on the situation, it may be feasible to select the foot, with which the kick should be performed, but due to time constraints we programmed the robot to kick with the left foot only. So, the task now is to place the ball in front of the left foot. We realized, that when the ball is in the correct position, then its image in the lower camera should be within a certain region. We experimentally determined the extents of this region, which is schematically presented in figure \ref{p figure ball-alignment}. The algorithm therefore is for the robot to gradually adjust its position in small steps, until the ball image reaches the target, after which the robot will proceed with the kick. Our tests have shown, that this method while being relatively simple, works sufficiently robust, which means that we didn't have the situations, when the robot missed the ball after alignment or even hit the ball with an edge of the foot. \begin{figure}[ht] \includegraphics[width=\textwidth]{\fig ball-align} \caption{Ball alignment} \label{p figure ball-alignment} \end{figure}