## 4 Hardware and Software Sub-Framework Navigation and Flight Control (HSFW3) Design  
The HSFW3 directly controls and manages the flight and navigation of the drone, and includes all elements related to the drone, as well as the drone itself. The functional purpose of HSFW3 assumes the control of a number of functions, for which special sensors are installed in the drone and an additional software is being developed. To perform a drone mission, the drone should be equipped with the ability to provide certain operations, in addition to those provided by the flight controller. These operations are as follows: autonomous correction of the route (based on the results of the HSFW1 operation), autonomous water landing and takeoff from the sea surface (to ensure the measurements for the HSFW2), and autonomous landing on a moving object (to complete the mission and board the vessel). The choice of a drone scheme with four carrier propellers as the carrier of the HSFW is due to the small-size solution, the energy efficiency of the layout, and the simplicity of design for manufacturing a hermetic version for the LIF spectrometer. The hardware part of the HSFW3 includes a controller, sensors that provide measurement of parameters for autonomous navigation, and motion control. The drone is powered by a Pixhawk Cube model controller that uses open-source software, and it is composed of three redundant IMUs (acceis, gyros, and compass), two redundant MS5611 barometers, two GPS/GLONASS receivers, a flight control microcontroller 32-bit ARM Cortex M4 core with FPU, and a 32-bit faislate co-processor. All sensors are combined on a vibration-damping platform and have built-in heating; therefore, operation in bad weather conditions is possible. In addition to the controller's sensors, a TFimi Plus lidar is included in the HSFW3, with a range of up to 12 m and a measurement accuracy of 1%. The use of a lidar is necessary for landing on a vessel and waver water surface. In this case, the height of the drone should be constantly adjusted. An active landing mark (IR light) is activated [33] for autonomous landing on a moving vessel. A modulated signal is emitted at a wavelength of 940 nm. The signal is modulated to cut off possible sun glare, and a camera with machine vision elements is installed on the drone, visually captures the mark, and sends the displacement values of the drone hull relative to the hull of the vessel to the microcomputer. Thus, autonomous landing is carried out with a decrease in altitude and accurate positioning. HSFW3 can also use QR codes for landing. The hull of the HSFW hardware is hermetic and designed concerning the buoyancy of the drone for landing on the water surface and measuring the concentration of dissolved hydrocarbons. The total volume of the hull is 16.1 L, whereas the volume of the hull, which  
Figure 5: Examples of datasets —(**a**) dataset of LIF spectra for five concentrations of DMA solution in seawater; (**b**) example of dataset of LIF spectra for DMA slicks with a thickness of about 100 microns. is below the waterline, is 11 L. Floats are fixed at the points of attachment of the motors to give stability on the water surface; they also give additional buoyancy. The windows of the LIF spectrometer are immersed in water to a depth of 15 cm in the mode of landing on water. Figure 6 shows a drone landing on water. The total payload of the HSFW for the monitoring mission was designed (including batteries and drone hull) to be up to 10 kg. The net flight time is 30 min with a total power consumption of 50 W. The main features of the drone developed as an HSFW carrier are described in the Table 2.  
The programs below were adapted for use in the HSFW3. The mission planner program is used for an autonomous program along a given route. The Precision landing and ArUcoMarker programs are used to follow the visual mark and board a moving vessel by IR light.