*3.2. Description of the Test Mission*

Tests were conducted to assess the performance and quality of integrating new technologies in autonomous robots for agriculture. First, the testing prototype was integrated with the components introduced in Section 2; then, several IoT devices were disseminated throughout the field (RGB and multispectral cameras, weather stations, soil probes, etc.); finally, a mission was defined to acquire data in the study site to perform quantitative analyses. The mission consisted of covering sections of 20 × 20 m2 with wheat and maize crops while the following occurred:


The mission proposed by the planner is illustrated in Figure 7. The robot tracked the path autonomously, and the following procedures were carried out.

**Figure 7.** Robot's path from the home garage to the study site. The planner provides the mission for covering the study site.

Perception system procedure

• Guiding vision system: This experiment was conducted in the treatment stage, where the crop was detected to adjust the errors derived from planning and the lack of precision of the maps. YOLOv4 [20], a real-time object detector based on a one-stage object detection network, was the base model for detecting early-stage growth in maize [8], a wide-row crop. The model was trained using a dataset acquired in an agricultural season before these tests using the same camera system [21]. Moreover, in the case of wheat, which is a narrow-row crop, a different methodology was applied through the use of segmentation models, such as MobileNet, a convolutional neural network for mobile vision applications [22], trained using a dataset acquired in an agricultural season before these tests [23], with the same camera system. The detection of both crops was evaluated with regard to the GNSS positions collected manually for the different crop lines.

The maize and wheat datasets were built with 450 and 125 labeled images, respectively. Data augmentation techniques (rotating, blurring, image cropping, and brightness changes) were used to increase the size of the datasets. For both crops, 80% of the data was destined for training, 10% for validation, and 10% for testing.

• The AI vision system: This system uses data from the installed RGB cameras to enable robust automated plant detection and discrimination. For this purpose, the stateof-the-art object detection algorithm Yolov7 is used in combination with the Nvidia framework DeepStream. Tracking the detected plants is performed in parallel by a pretrained DeepSort algorithm [24]. The reliability of the object detection algorithm is evaluated using test datasets with the commonly used metrics "intersection over union" (IoU) and "mean average precision" (mAP). This system works cooperatively with laser scanners as a stand-alone system. The information is not stored in the cloud.

The dataset used for training weed/crop discrimination was generated in fields in several European countries. It contains 4000 images, 1000 of which are fully labeled. Distinctions are made according to the processing steps to be applied: weeds, grasses, and crops. In addition, the dataset was expanded to three times its original size through augmentation measures. As well as generating new training data, this enables robustness against changing environmental influences, such as changing color representation, motion blur, and camera distortion. The YoloV7 network achieved a mean average precision (mAP) of 0.891 after 300 epochs of training. The dataset was divided into 80%, 10%, and 10% for training, validation, and testing subsets, respectively.

#### Autonomous robot procedure

The navigation controller: Given a set of trajectories based on RTK-GNSS, the performance of the guidance controller was evaluated by measuring lateral and angular error through the incorporation of colored tapes on the ground and using the onboard RGB camera and ToF to extract the tape positions to compute the errors concerning the robot's pace.

Smart Navigation Manager procedure:

	- -The period of messages by all publishers.
	- -The age of messages.
	- -The number of dropped messages.
	- -Traffic volume to be measured in real-time.
