diff --git a/documentation/align.tex b/documentation/align.tex new file mode 100644 index 0000000..aa01966 --- /dev/null +++ b/documentation/align.tex @@ -0,0 +1,49 @@ +\section{Goal Alignment} + +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 turn 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. + +\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 to the ball +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. 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 approach 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} diff --git a/documentation/approach.tex b/documentation/approach.tex new file mode 100644 index 0000000..32c0f33 --- /dev/null +++ b/documentation/approach.tex @@ -0,0 +1,45 @@ +\section{Ball approach} + +\subsection{Approach from the Side} + +The first possibility is that in the approach planing stage, described in the +section \ref{j sec approach planing}, the decision was taken to approach the +ball from the side. In this case the robot will walk the calculated distance in +the calculated direction. Normally, after the movement the robot should lose +the sight of the ball. However, the approximate angle, where the ball should be +relative to the robot after the movement, is known. Therefore, the robot will +rotate by that angle and will then try to detect the ball and turn to it, using +the \textbf{Turn to Ball} algorithm, described in the section \ref {j sec turn + to ball}. Once this was done, the approach planning stage is repeated. +Normally, the distance to the ball should now be small, and the ball and the +goal should lie in the same direction, which means that only short direct +approach at this point will be necessary. That might not always be the case, so +in rare situations another step of the approach from the side might be +necessary. + +\begin{figure}[ht] + \includegraphics[width=\textwidth]{\fig after-sideways} + \caption{After approach from the side} + \label{p figure after-sideways} +\end{figure} + +\subsection{Direct Approach} + +It is also possible that the decision will be taken to approach the ball +directly, either from the start or after the robot already has approached the +ball from the side. In this stage the robot will walk towards the ball trying +to stay centered at it. To do so, it will be constantly checked that the ball +stays within some tolerance angle from the center of the camera frame. If the +ball moves from the center further than by some tolerance angle, then the robot +will stop moving, will adjust the movement direction and then will go further. +The robot will continue moving until the ball is close enough to start the goal +alignment. Do determine if that is the case, we don't use trigonometry, but +simply define a threshold, which the image of the ball in the robot's lower +camera should reach. Once this happened, the approach stage is over and the +robot will start aligning itself to the goal. + +\begin{figure}[ht] + \includegraphics[width=\textwidth]{\fig direct-approach} + \caption{Approach termination condition} + \label{p figure direct-approach} +\end{figure} diff --git a/documentation/figures/after-sideways.png b/documentation/figures/after-sideways.png new file mode 100644 index 0000000..89f8a55 Binary files /dev/null and b/documentation/figures/after-sideways.png differ diff --git a/documentation/figures/ball-align.png b/documentation/figures/ball-align.png new file mode 100644 index 0000000..cd12049 Binary files /dev/null and b/documentation/figures/ball-align.png differ diff --git a/documentation/figures/direct-approach.png b/documentation/figures/direct-approach.png new file mode 100644 index 0000000..5367b59 Binary files /dev/null and b/documentation/figures/direct-approach.png differ diff --git a/documentation/figures/goal-alignment.png b/documentation/figures/goal-alignment.png new file mode 100644 index 0000000..71062ac Binary files /dev/null and b/documentation/figures/goal-alignment.png differ diff --git a/documentation/robotum_report.tex b/documentation/robotum_report.tex index fca3156..5d931b9 100644 --- a/documentation/robotum_report.tex +++ b/documentation/robotum_report.tex @@ -41,6 +41,8 @@ \input{perception} % Ball goal and field % \input{Yuankai} \input{jonas} % Distance, approach planing +\input{approach} % Ball approach +\input{align} % Goal alignment \input{overview} % The complete strategy \input{conclusion} % Results and future work