# Construction of Robotics and Application of the Optical-Flow Algorithm in Determining Robot Motions
## 4 Results and Discussion
### Experiment 4  
In the fourth experiment, the authors had Robot 2 (carrying the objects to be identified as person models) move along a pre-established sine curve (starting from point 5 with an initial velocity of 0 cm/s, passing through reference points 12, 28, 48, and 64--Figure 14a) at a set speed of 10 cm/s. Note that in comparison to previous experiments, the trajectory of the robot in this experiment is much more complicated. In detail, the movement of the model is not in a line but in a curvature. In this trajectory, the control position of Robot 2 is also complicated for the system in the robot. Firstly, we examine the difference between the desired trajectory with the movement of Robot 2 from the camera. The actual and desiring trajectories of the object are shown in Figure 27. It can be seen that although the trajectory is complicated, the robot can move along the trajectory with a sufficiently low error. This is due to the high-performance design of the robot, as well as the control system for the dynamic movement of the robot. In terms of the speed and angles, the results present that the uncertainty is small enough. Some change of the angle around the desired values was observed. This is due to the complication of the trajectory in a narrow place, where the direction movement of the robot is highly modified by time. However, the main trajectory is captured well by the current optical-flow method. The average error of the trajectory from the measurement system of Robot 2 is less than 1 cm. Consequently, the accuracy of the measurement was guaranteed. The results also confirm that the step size of 2\({}^{\circ}\) can be used in the current study for good results. Increasing the accuracy of the robot is an important task for further study. However, before that, a powerful and light computer system should be developed.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Object** & \multicolumn{2}{c}{**Truck**} & \multicolumn{2}{c}{**Person**} & \multicolumn{2}{c}{**Car**} \\ \hline
**Errors** & **Velocity (\%)** & **Angle (\({}^{\circ}\))** & **Velocity (\%)** & **Angle (\({}^{\circ}\))** & **Velocity (\%)** & **Angle (\({}^{\circ}\))** \\ \hline Exp. 1 & 5.2 & 0.49 & 7.1 & 0.49 & 11.8 & 0.50 \\ Exp. 2 & 7.0 & 1.48 & 7.0 & 1.73 & 6.6 & 2.10 \\ Exp. 3 & 7.6 & 1.90 & 7.8 & 1.78 & 8.0 & 1.28 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Measurement errors of the velocity and angles for different cases (moving velocity at 10 cm/s).  
Figure 27: Trajectory with error when moving at a speed of 10 cm/s along a sinusoidal path.  
Figure 28 shows the velocity error and angular displacement error. For the details of the error, we see that the average speed error is 8.9%, with the largest speed error being 32.2% when the object moves at a speed of 10 cm/s and is at a greater distance from the observation camera, particularly at the bends of the movement trajectory. The average angle error is 2.40 degrees, with the largest angle error being 8.40 degrees when the object's trajectory involves rapid changes in direction at the bends. The results of the experiment indicate that both the movement of the robot and system measurements were designed well. The current results can be applied to another object in the initial determination of the velocity and angles.  
It should be noted that the results of the optical-flow method depend on the resolution of the camera, which can result in a large measurement error for a large space. However, this error can be reduced by applying a high-resolution camera or using a pre-process to increase the resolution of the image. Additionally, by applying other telecameras and a combination of the wide camera, the results of the measurement method could provide highly accurate results compared to other advanced techniques, such as laser. Since this study focuses on the algorithm and its application, real application is left for future study.