*3.2. Vineyard Spraying Demonstration*

The first experiment is a demonstration of the presented approach in a vineyard (Figure 8). The canopy description used in the experiment (Figure 9) was selected manually by an operator through a simple graphical user interface (GUI).

A graph showing the reference lawnmower trajectory tracking during the experiment is given in Figure 10. Here, the position of the spray frame *<sup>p</sup><sup>S</sup>* is calculated based on the encoder feedback from the robot arm, and the odometry of the mobile base. Since only the odometry feedback is used for mobile base control, its reference tracking is also evaluated with an external sensor, as part of the second experiment in Section 3.3. The MPC criterion function is tuned to follow the reference trajectory imperfectly, to minimize the accelerations of the mobile base and the robot arm end-effector. Figure 11 shows the reference tracking with respect to the actual reference trajectory of the spray frame *p*<sup>∗</sup> *S*, which is formed by accumulating the first control inputs of the optimal control sequences calculated by the MPC algorithm at each control step. There is still some error in the reference tracking caused by the non-ideal following of the joint velocity commands and the error in task space control. The task space Jacobian depends on the joint positions and is computed at the beginning of each control time step. During this time step, the joint positions, and the Jacobian, change. Larger joint velocities and larger time steps result in larger task space control errors. The position tracking errors are shown in Table 2. Spray frame position tracking was evaluated, with a measured root mean square (RMS) error of

4.32 mm, and the maximum error of 22.16 mm. The magnitude of the errors is a result of the fact that the spraying frame is defined at a certain distance to the last link of the robot arm, which makes its position sensitive to small errors in the robot arm joint positions. Based on the imperfections of the spray nozzle and its spraying area, the presented errors are adequate to ensure the effectiveness of the vineyard spraying task. There is a trade-off between reference tracking errors and the velocity of the reference spray frame trajectory. Reducing this velocity would result in slower task execution, but would also reduce the reference tracking errors.

**Figure 8.** Mobile manipulator performing a spraying experiment in a vineyard.

**Figure 9.** The canopy description used for the experiment selected by the operator.

**Figure 10.** Overall spray frame reference tracking. *p*Ref *<sup>S</sup>* represents a reference lawnmower trajectory generated based on the row description, where *zR* and *zR* represent the upper and lower foliage boundaries, respectively. The spray frame position *<sup>p</sup><sup>S</sup>* during the experiment is represented by a red line.

**Figure 11.** Spray frame tracking with respect to the optimal reference trajectory generated by the MPC algorithm. *p*\* *<sup>S</sup>* represents the optimal trajectory of the spray frame. This differs from the ideal lawnmower trajectory due to MPC tuning that sacrifices reference tracking to minimize the accelerations of the mobile base and the manipulator end-effector. *zR* and *zR* represent the upper and lower foliage boundaries, respectively. The spray frame position *<sup>p</sup><sup>S</sup>* during the experiment is represented by a red line.

**Table 2.** Spray frame position errors during the vineyard spraying experiment.


A non-uniform vine row structure allows the demonstration of the adaptability of the presented approach. The velocity of the vehicle adapts to the row description by automatically accelerating in areas without vines and decelerating to the lowest velocities in areas with the highest vines (Figure 12). The footage of the vineyard spraying experiment can be seen in the accompanying video https://youtu.be/BDO7qQldmyQ, accessed on 8 March 2022.

**Figure 12.** The upper diagram shows the *x* component of the reference trajectory *pS*,*x*, along with the robot arm and mobile base components, *pA*,*<sup>x</sup>* and *pB*,*x*, respectively. The bottom graph shows the forward velocity of the vehicle during the experiment.
