*Article* **Task Space Model Predictive Control for Vineyard Spraying with a Mobile Manipulator**

**Ivo Vatavuk \*, Goran Vasiljevi´c and Zdenko Kovaˇci´c**

Faculty of Electrical Engineering and Computing, University of Zagreb, Unska 3, 10000 Zagreb, Croatia; goran.vasiljevic@fer.hr (G.V.); zdenko.kovacic@fer.hr (Z.K.)

**\*** Correspondence: ivo.vatavuk@fer.hr

**Abstract:** In this paper, a Model Predictive Control (MPC)-based approach for vineyard spraying is presented, able to adapt to different vine row structures and suitable for real-time applications. In the presented approach, the mobile base moves along a row of vines while the robotic arm controls the position and orientation of the spray nozzle. A reference lawnmower pattern trajectory is generated from the vine canopy description, with the aim of minimizing waste while ensuring vine coverage. MPC is used to compute the trajectory of the vehicle along the row and the manipulator tool trajectory, which follow the spray reference, while minimizing vehicle acceleration and tool displacement. The manipulator tool velocity commands provided by the MPC algorithm are tracked using task space control. The presented approach is evaluated in two experiments: a vineyard spraying scenario and an external evaluation scenario in an indoor environment equipped with the Optitrack camera system.

**Keywords:** mobile manipulation; optimization and optimal control; agricultural robotics; viticulture
