## 4 Testing and Result Discussion
### Preliminary Testing  
Before deploying the UAV where the sheep were located, a series of tests had to be carried out to assess (a) the general assembly of the prototype (especially any component that might had been not properly mounted) and (b) the flying capabilities of the prototype. It was decided that the first flight test should be conducted in a closed environment with enough space to be able to lift the UAV approximately one meter off the ground. With this test it could be assessed whether the placement of the motors and propellers is correct. Should any mistake had been made, the UAV would typically flip over before it was able to properly take off and stabilize itself on air. It is very important that during the configuration of the flight mode and the channels of the transmitter, a control switch is assigned to the \"emergency stop\" function. This function will halt the rotation of all the motors instantly and will bring the UAV to the ground in case it flies beyond the properly set boundaries of the mission due to external circumstances (usually related to weather conditions). During flight tests, this function made possible avoiding major accidents in the event of an unforeseen event. To test the correct operation of this emergency stop, it is enough with arming the UAV, activating the emergency stop and checking whether rotors are truly stopping when requested. Once the motor and propeller tests have been successful and the correct operation of the emergency stop of the motors had been verified, the first outdoor flight was made. Due to the dimensions and weight of the UAV that has been assembled, it was not possible to fly it just anywhere, as current regulations regarding aviation safety in the demonstrator location had to be observed. In addition to this, operators required a Remotely Piloted Aircraft System (RPAS) pilot certificate issued by a competent authority. The most important considerations to take into account when carrying out this flight outdoors were: (a) making sure that the location where the test was located was far from any population, (b) that this location was a place where it is not explicitly prohibited to fly a RPAS (due to proximity to an airport, military base, etc.) and that there was no group of people under the area where the tests were going to be carried out so as not to compromise anyone's safety. The first test that was carried out outside consisted of a manually operated UAV flight to become familiar with the response of the UAV to the controls. It was possible to observe that the flight was stable and precise. In addition, the humming sound emitted by the aircraft's own engines while it is in the air was expected to be loud enough to cause the desired movement of the herd of sheep intended to be directed. The operator always had visual contact with the UAV; the maximum horizontal distance reached was approximately 150 m.  
After performing the manual flight test, a simple autonomous flight test was performed. In this case, and to prevent any unwanted issues, the pilot had the ability to recover the control of the UAV at any time during the flight. For this test a simple flight plan was prepared consisting of the following actions:  
1. Takeoff from point A and lift to 10 m high. 2. Displacement in a straight line of 15 m to a point B. 3. Wait 5 s at point B. 4. Return to point A. 5. Landing. This second flight test had an unexpected ending, when the UAV began its descent before reaching point A due to a planning error. Having carried out the test in a rural environment with an irregular surface, when the supports touched the ground, there was a loss of stability that caused the UAV to land in an unwanted manner, to the point that it flipped over. This showed that rural operations with UAVs can face challenges unseen in other areas where human presence has modified the environment and created flat surfaces (i.e., open parking lots, asphalt, or pavement tiles).