Monocular Visual Autonomous Landing System for Quadcopter Drones Using Software in the Loop commands and to let the inner controllers ofthe flight controller unit (FCU) handle the thrust. We use a reference vector for the controllers Sp ¼ 2 ; Ih ½Iw 2 ; Ih 2 ; 0T,where Iw 2 represent the center of the current image frame and zero corresponds to the desired angle between the aircraft and template measured with respect to the x-axis of the image. These controllers command the x; y velocities of the rotorcraft, denoted as x_a; y_a, to center the vehicle with respect to the template detected in the current image frame. The third controller modifies the yaw rate c_ of the aircraft in order to align it with the landing padinthe x-axis. The error vector et 2 R3 ofthe controllers at time t is given by the following equation: et ¼ SptXði¼1:3Þ t : (16) Figure 5 is a simplified representation of the three PIDbased controllers and an altitude controller with an ON/OFF strategy to control the descent ofthe UAV. The error vector e is used to feed the first three controllers and to produce a control effort Ut 2 R3, which is delivered to the cascade controllers of the FCU. The output of the three PID controllers is provided by the vector in (17). Each PID controller was discretized using trapezoidal integration and derivation Ut ¼½ _xa; y_a; c_T: (17) The ON/OFF altitude controller in Figure 5 starts to land the aircraft whenever the difference between the height and width of the template estimates Xði¼4:5Þ (18). uzt t tends to zero represents the output of the altitude controller, Zp is the current height in meters of the vehicle, and Zf is a descent constant. This descent condition guarantees that the aircraft will land only if the template dimensions form a square, which is the actual shape of the landing platform uzt ¼ ZpZf; Zp; if jOwOhj < 5 otherwise: (18) Acquiring feedback from the vision-based module closes the visual servoing control loop and allows for the implementation ofan on-board end-to-end control strategy for a UAV. Algorithm 2 shows pseudocode for the controller pipeline for the rotorcraft. SIMULATION RESULTS This section describes the experiments carried out to assess the different modules of the autonomous landing system using a Gazebo-based simulation. We provide an open-source implementation ofour system in Github.2 2https://github.com/MikeS96/autonomous_landing_uav 8 Algorithm 2. Landing Controller 1: Inputs: X 2 R10 State vector Iw image Width Ih image Height 2: Initialization:PIDxa 2 R3 PID parameters for x_a PIDya 2 R3 PID parameters for y_a PIDc 2 R3 PID parameters for c_ Sp 2 R3 x; y; and u setpoints Zp initial height of the vehicle Zf descent factor 3: Outputs: U 2 R3 PID control efforts uz ON/OFF altitude controller output 4: for each state vector X do 5: 6: et SptXði¼1:3Þ errorSize absðXði¼4Þhttps://github.com/MikeS96/autonomous_landing_uav