Multi-robot collision avoidance method in sweet potato fields

Currently, precise spraying of sweet potatoes is mainly accomplished through semi-mechanized or single spraying robots, which results in low operating efficiency. Moreover, it is time-consuming and labor-intensive, and the pests and diseases cannot be eliminated in time. Based on multi robot navigation technology, multiple robots can work simultaneously, improving work efficiency. One of the main challenges faced by multi robot navigation technology is to develop a safe and robust collision avoidance strategy, so that each robot can safely and efficiently navigate from its starting position to the expected target. In this article, we propose a low-cost multi-robot collision avoidance method to solve the problem that multiple robots are prone to collision when working in field at the same time. This method has achieved good results in simulation. In particular, our collision avoidance method predicts the possibility of collision based on the robot’s position and environmental information, and changes the robot’s path in advance, instead of waiting for the robot to make a collision avoidance decision when it is closer. Finally, we demonstrate that a multi-robot collision avoidance approach provides an excellent solution for safe and effective autonomous navigation of a single robot working in complex sweet potato fields. Our collision avoidance method allows the robot to move forward effectively in the field without getting stuck. More importantly, this method does not require expensive hardware and computing power, nor does it require tedious parameter tuning.


Introduction
Sweet potato is an important food crop after rice, wheat, and corn.With the development of large-scale sweet potato cultivation, sweet potato diseases and pests are becoming increasingly serious.Traditional prevention and treatment methods are high in cost and low in efficiency, and there are problems such as prevention and treatment of chemical abuse and overuse.Harmful pesticide chemicals will spread into the air, causing pollution to the environment and sweet potato crops, and may enter farmers' bodies through the respiratory system (Meshram et al., 2022).Precision spraying technology can solve the problems of pesticide waste and overuse, improve pesticide utilization, and reduce pesticide pollution to the environment (Xiongkui, 2020).However, in the current precision spraying operations, a single robot is mainly used for spraying operations, such as Danton et al., 2020;Baltazar et al., 2021;Oberti andSchmilovitch, 2021, andLiu et al., 2022.A single robot has the disadvantages of limited operating capacity and long operating time.Especially for sweet potato fields with a relatively large area, using a single robot for spraying will take a lot of time (Kim and Son, 2020), and pests and diseases cannot be eliminated in time, causing irreparable economic losses to agriculture.In addition, if the robot fails, the entire spraying operation will be delayed, resulting in greater economic losses.Therefore, applying a multi-robot system to sweet potato spraying can effectively solve the problem of low operating efficiency of a single device, reduce agricultural maintenance costs, and indirectly improve agricultural economic benefits.There are many benefits to using a multi-robot system instead of a single robot (Parker et al., 2016;Jawhar et al., 2018): (1) Multiple robots can perform tasks simultaneously to complete tasks faster.(2) Multiple robots can effectively handle tasks that are essentially distributed over a wide area.(3) When any robot fails, multiple robots that can perform similar processes can be used to compensate.
As the number of agricultural workers continues to decrease around the world, the use of multi-robot systems to perform agricultural tasks has become increasingly common in large-scale fields with fewer people (Carbone et al., 2018), and multi-robot systems have gradually become a hot topic of research.However, one of the main challenges facing multi-robot systems is to develop a safe and robust collision avoidance strategy that enables each robot to navigate safely and efficiently from the starting position to the desired target (Long et al., 2017).The robot's obstacle avoidance method can be divided into local obstacle avoidance and global path according to the operation requirements (Tang et al., 2024), such as Genetic algorithm (Zhao et al., 2021), dynamic window approach (Chang et al., 2021), RRT* (Hu et al., 2024), A* (Zhang et al., 2024) and other algorithms.However, these obstacle avoidance methods are all for a single robot and are not suitable for multi-robot systems (Cai et al., 2007).At present, the collision avoidance methods of multi-robots are mainly divided into centralized control and decentralized control.
Initially, scholars used a centralized control method to avoid collisions between multiple robots.This approach assumed that the behavior of all robots was determined by a central controller that had comprehensive knowledge of all robots' intentions (e.g., initial states and goals) and their workspaces (e.g., 2D grid maps).Schwartz and Sharir (1983) proposed to find the continuous motion of two given structures connecting objects within a given region, during which they avoided collisions with walls and each other.He et al. (2016) used the cloud platform to calculate local collision-free paths for each robot, which improved the processing capabilities of the device.However, this method needed to ensure that each robot had networking capabilities.Yu and LaValle (2016); Tang et al. (2018); Matoui et al. (2020) and Cheng et al. (2023) proposed a centralized trajectory generation algorithm to find trajectories that navigate robots from starting positions to noninterchangeable target positions in a collision-free manner by planning optimal paths for all robots.In addition, Keshmiri and Payandeh (2009) used a centralized method to keep multiple robots in formation to avoid collisions between robots, but it was not suitable for the agricultural field and cannot control multiple robots to maintain formation during precise spraying.Centralized approaches can ensure multi-robot system safety, integrity, and near-optimality, but they are difficult to scale to large systems with many robots due to the high computational cost of multi-robot scheduling, heavy reliance on reliable synchronous communication, and low tolerance for failures or interference.
Compared with centralized methods, some existing studies proposed decentralized collision avoidance strategies, where each robot made decisions independently by considering the observable states (such as shape, speed, and position) of other robots.Cai et al. (2007) developed an advanced method for collision avoidance in multi-robot systems based on established techniques of omnidirectional vision systems, automatic control, and dynamic programming.However, each robot in this system must be an autonomous robot, equipped with equipment or systems such as omnidirectional vision systems, target recognition systems, communication systems, and control systems.Claes et al. (2012); Hennes et al. (2012), and Godoy et al. (2016) designed inter-agent communication protocols to share position and velocity information among nearby agents.However, communication systems posed additional difficulties, such as delays or blocking of communication signals due to obstruction by obstacles.Althoff et al. (2012) proposed a probabilistic threat assessment method for reasoning about the safety of robot trajectories.In this method, the trajectories of other dynamic obstacles needed to be sampled and then the global collision probability was calculated.Lacked of possibilities for safe navigation in dynamic multi-robot environments.Sun et al. (2014) proposed a behavior-based multirobot collision avoidance method in large robot teams inspired by the concept of swarm intelligence, which could solve the coordination problem of multi-robots by using group behavior.Fiorini and Shiller (1998), Van den Berg et al. (2008); Snape et al. (2009);Hennes et al. (2012);Alonso-Mora et al. (2013); Claes andTuyls (2018), andZhu et al. (2020) designed a robot collision avoidance strategy based on the speed obstacle framework.This algorithm effectively inferred the local collision-free motion of multiple agents in a chaotic workspace.However, these methods have several serious limitations that hinder their widespread application in practical scenarios.First of all, it is difficult to meet the requirement that each agent has perfect perception of the surrounding environment.This requirement does not hold true in real scenarios.A second limitation is that speed barrier-based strategies are controlled by multiple adjustable parameters that are sensitive to scene settings and therefore must be set carefully to achieve satisfactory multi-robot locomotion.
Inspired by methods based on the speed obstacle framework, Chen et al. (2017b), andChen et al. (2017a) trained a collision avoidance strategy using deep reinforcement learning.This strategy explicitly mapped the agent's own state and that of its neighbors to collision-free actions, but it still required perfect awareness of the surrounding environment.Long et al. (2017);Pfeiffer et al. (2017); Wang et al. (2020); Huang et al. (2022);Xiao et al. (2022), andHan et al. (2022) used deep neural network modeling and trained using supervised learning on large datasets.However, there are several limitations to supervised learning policies.First, it requires a large amount of training data, which should cover different interaction situations of multiple robots, and the training time cost is high.Secondly, the expert trajectories in the data set are not guaranteed to be optimal in interactive scenarios, which makes it difficult for training to converge to a robust solution.Third, it is difficult to manually design a suitable loss function to train a robust collision avoidance strategy.Fourth, the hardware requirements required for model deployment on robots are relatively high.When the number of robots increases, the hardware cost increases exponentially.
Multi-robot systems based on reinforcement learning or transfer learning require a large amount of data sets for training, which requires relatively high time and economic costs.However, the economic benefits obtained in agriculture are obviously not suitable for the large-scale application of such robots.Ünal et al. (2023) proposed a robot collision avoidance algorithm for traveling along tangent paths to solve the problem of multi-robot collision avoidance in precision agriculture.However, they only considered two robots and did not introduce the specific application environment.In addition, they did not consider whether the robot would damage the surrounding crops when avoiding collision.Currently, research on multi-robot collision avoidance strategies mainly focuses on confined space scenes or in relatively open and empty spaces, and no scholars have considered how to avoid collisions among multi-robots in large field (Raibail et al., 2022).Due to the special field environment, the robot can only move along the ridges, and can only move forward or backward.It cannot move freely in all directions, otherwise it will damage the crops and the robot, causing unnecessary economic losses.The current multi-robot collision avoidance strategy cannot be directly applied to this situation.In order to overcome the shortcomings of the above method, we propose a low-cost multirobot collision avoidance method, which uses position and known environmental information to predict the possibility of collision, and changes the robot path in advance to achieve the purpose of robot collision avoidance.The method outperforms existing agentand sensor-level methods in terms of navigation speed and safety.It can be directly and smoothly deployed on physical robots, without the need for expensive laser radars, cameras, and terminal controllers, and without the need for cumbersome parameter adjustments.Based on this, we propose a multi-robot collisionfree method suitable for the special environment of field.The main innovations and contributions are as follows: 1.The multi-robot collision avoidance method we proposed only requires the robot to have a communication module, a positioning module and a low-cost control chip.It does not require the robot to have vision, radar and other sensors, nor does it require the ability to deploy reinforcement learning models.Reduce farmers' purchase costs and field maintenance costs, thereby increasing farmers' economic income.
2. We proposed a rapid robot path generation method suitable for farmland.The global information of the farmland was generated through the two endpoints of the crop rows and the row spacing.The global information included the straight-line equation and the two endpoints of the crop rows, occupying very little storage space.Then based on the requirements of farm operations and the robot's target location, we could quickly generate a global path for the robot.3. We proposed a robot collision avoidance method that could determine its own direction and working status only based on global information and the robot's position.Then the robot's position and global information were used to predict the possibility of collision in advance.Finally, the robot's local path was adjusted according to the robot's priority to avoid collisions.This method could quickly find collision-free paths for multi-robot systems and can be safely generalized to other work scenarios.
The rest of this paper is as follows: Section 2 introduces the working environment of multi-robot systems, related definitions and collision types.In Section 3, we discussed in detail how to predict the possibility of robot collision through maps and robot positions, and how to adjust local paths in the special environment of field to avoid collisions among multiple robots.The fourth section introduces the simulation environment and simulation settings of the multi-robot collision avoidance method, and verifies the method proposed in the third section.The final section presents the summary and prospects of this study.

The working environment of robots
The sweet potato field is simplified to facilitate the description of the robot's working conditions, as shown in Figure 1.The rectangle F a F b F c F d represents the field, and R n (n ∈ N * ) represents the working robots (Figure 1A).The line segments A j B j (j ∈ N * ), A s A u , and B s B u (s ≠ u, 0 < s ≤ j, 0 < u ≤ j) represent the robot's paths in the field (Figure 1B).The line segment A j B j is called the working path, the points A j and B j are the endpoints of the A j B j , respectively, and j is the serial number of the working path.Line segments A s A u and B s B u are called the transition path.We set the sweet potato field to be planted in a standardized manner, with working paths running parallel to each other.The distance between each working path is represented by D.

Definitions of robots
R represents a group of working robots, as shown in Equation 1. R n has the same dynamic model in vertical and horizontal dimensions.The real-time location of R n is represented by P R n , and R O represents other robots except for R n , as shown in Equation 2.
A group of target points of robot R n is represented by P n , as shown in Equation 3. Robot R n moves at a constant speed along the target point.After robot R n reaches target P n , it stops for 3 seconds and performs precision spraying operations.
where the coordinates of p ni are represented by (x ni , y ni ), and x ni and y ni are the horizontal and vertical coordinates on a twodimensional plane, respectively.r n represents the global path of the robot, and r n j represents the local path of the robot, as shown in Equation 4. The local path comprises a series of points, such as r n 8 = A 8 , p n1 , p n2 , B 8 f g and r n 9 = B 9 , p n3 , A 9 f g , as shown in the solid black line in Figure 1B.r n comprises a series of local paths, such as allblack paths in Figure 1B.
There are two types of paths: the working and transition.In Figure 1B, the solid black lines A 8 B 8 , A 9 B 9 , and A 13 B 13 are the working path, and the dotted black lines B 8 B 9 and A 9 A 13 are the transition path.
The robot has different moving directions on the working and transition paths.When the robot is moving on the working path, the robot's direction at points A j and B j are 0 and 1, respectively.When going from point A j to B j , the direction of the robot is 0 → 1.When the robot goes from point B j to A j , the robot's direction is 1 → 0. Therefore, we can get the direction of the robot only through the two endpoints of the local path without using other sensors.The expression method of the robot's moving direction in the working path is shown in Equation 5.
When the robot moves on the transition path, the direction is determined according to the serial number of the current and last working paths, as shown in Equation 6.The robot's direction is up when the sign is a positive number.When the sign is negative, the direction of the robot is down.The direction on the transition path is only judged by the j, and no other sensors are needed.
where j c represents the serial number of the current working path, and j l represents the serial number of the last working path.

The working rules of robots
The width of the working path A j B j in the field is relatively narrow, and it does not support operations such as moving side by side or turning; otherwise, the robots will crush or knock down the crops.Therefore, robots with different moving directions cannot simultaneously exist in the working path A j B j ; otherwise, the robots will collide.
The robots move in a 'U' shape in the field (Hameed et al., 2013), and the working method is shown in the black path in Figure 1B.For example, R n starts from point A 8 , moves along the working path A 8 B 8 , reaches the end point B 8 , and moves along B 8 B 9 to A 9 B 9 .In addition, robots start from the garage, go to the field to work, and then return to the garage.

Collision and conflict scenarios of robots
During the research, we found that the possibility of a robot collision can be judged based on the robot's path type.When robots move on the same path type, we can determine whether the robots will collide by simply comparing their serial number of the working paths and directions.The path type and serial number are the same, indicating that they are in the same working path.At this time, if they are moving in opposite directions, it means that they are moving toward each other and a collision will inevitably occur.If they are moving in the same direction, as long as their speeds are the same, there will be no collision.Therefore, we divide the robot collision scenarios into four types based on the different positions of R 1 and R 2 : 1) working path and different movement directions; 2) working path and same movement direction; 3) transition path and same movement direction; 4) transition path and different movement directions.As shown in Figure 2, it describes the possibility of collision when the robot is working.The green line segments represent the working paths, and the two working robots are represented by R 1 and R 2 ; their target points are p 1a and p 2b .

Working path and different movement directions
Figure 2A describes that robot R 2 has been moving in the working path A u B u , and robot R 1 is about to enter the working path A u B u .Robots R 1 and R 2 move in opposite directions.According to section 2.1, there cannot be two robots with different moving directions in the same working path.If robot R 1 continues to enter the working path A u B u without changing its path, it will inevitably collide with R 2 .
Figure 2B describes that R 1 and R 2 are about to enter the same working path A u B u .Robots R 1 and R 2 are moving in opposite directions.If the path of robot R 1 or R 2 is not changed, R 1 and R 2 will eventually collide together.

Working path and same movement direction
Figure 2C describes that robot R 2 is already moving in the working path A u B u , and robot R 1 is about to enter the working path A u B u .Figure 2D describes that the robots R 1 and R 2 are already moving in the working path A u B u .Robots R 1 and R 2 move in the same direction.According to Section 2.1, two arobots with the same moving direction can exist in the same working path.Since the speeds of the robots are the same, there will be a constant distance between robots moving in the same direction.However, when robot R 2 arrives at target point p 2b , the spraying operation takes time, and robot R 1 is still moving normally.R 1 needs to keep a safe distance from R 2 to stop moving and then wait for R 2 to complete its work.Otherwise, R 1 and R 2 will collide together.

Transition path and same movement direction
Figure 2E describes that R 1 and R 2 move in the same direction and go to different working paths.Since R 2 and R 1 move in the same direction and speed, they will not collide.However, when R 2 goes to the working path A s B s where the target point p 2b is located, it will turn around, which takes a certain amount of time.If R 1 does not stop moving and waits for R 2 to complete its turn, R 1 and R 2 will collide.

Transition path and different movement directions
Figure 2F describes that R 1 and R 2 move in different directions and go to different working paths.When R 1 goes to the target point p 1a , R 2 goes to the target point p 2b from the opposite direction.If the path of R 1 or R 2 is not changed, they will collide at a particular moment.

Global map generation method
In order to get the serial number j of working path and the robot's moving direction, the geographic information is needed.Use straight lines A j B j and the endpoints A j and B j to generate a field map.Represent this map as a point-line map (plm).Use straight line A 1 B 1 as the baseline to generate other parallel line segment.As described in Algorithm 1, according to the straight-line equation of A 1 B 1 and the distance D between each working path, the straight-line equations of all A j B j and the coordinates of the endpoints A j and B j are obtained.Finally, all working paths A j B j and endpoints A j and B j are stored in the plm.
Input: the coordinates (x A 1 , y A 1 ), and (x B 1 , y B 1 ) of the two endpoints A 1 and B 1 Output: plm Types of robot conflicts.//Update straight-line equation of A j B j 6: 11: //Update coordinates of A j and B j 12: The plm generation method.

Calculating the equation of the working path
As shown in Figure 1, take A 1 B 1 as the baseline, and make j parallel line segments A 1 B 1 , A 2 B 2 ,…,.Suppose the slope of line segment A 1 B 1 is k A 1 B 1 , and the intercept is b A 1 B 1 , then the straightline equation of line segment A 1 B 1 is expressed as: The coordinates (x A 1 , y A 1 ), and (x B 1 , y B 1 ) of the two endpoints and B 1 of A 1 B 1 are obtained through the positioning device.Then the slope k A 1 B 1 and intercept b A 1 B 1 of A 1 B 1 are expressed as: According to Equation 10, the straight-line equation of A 2 B 2 is expressed as: The distance from straight-line segment A 3 B 3 to straight-line segment A 1 B 1 is 2 D. Then according to Equation 10, the intercept b A 3 B 3 of the straight line A 3 B 3 is expressed as: According to Equation 12, the straight-line equation of A 3 B 3 is expressed as: According to Equations 10-13, the straight-line equation of A j B j is expressed as: According to the coordinates of the endpoints A 1 and B 1 , the straight-line equation of A 1 B 1 is obtained, and then the straight-line equations of all other working paths are obtained according to D.

Calculating endpoint coordinates
According to the straight-line equation of A j B j obtained from Equation 14, determine the coordinates of the endpoints A j and B j .Make perpendicular lines A 1 A m and B 1 B m from point A 1 and point The straight-line equation of A 1 A m can be obtained according to the intercept b A 1 A m and slope k A 1 A m .Then combine the linear equations of A 1 A m and A m B m to obtain the coordinates of the foot point A m as (x A m , y A m ), as shown in Equations 17, 18.
The coordinate (x B m , y B m ) of the foot point B m is represented as, Finally, according to Equations 14, 17-20 and the coordinates of the endpoints A 1 and B 1 , the coordinates (x A m , y A m ) and (x B m , y B m ) of all other endpoints can be obtained.

Fusion of endpoints and lines
The straight-line equation of A j B j and the coordinates of endpoints A j and B j are obtained from Sections 3.1.1and 3.1.2,where the straight-line equation of A j B j includes information such as slope k A j B j , intercept b A j B j , and serial number j. Use plm to represent endpoints A j , B j , and working path A j B j , as shown in Equation 21.
The plm provides detailed field information for the robot, supporting the robot to obtain its own direction, serial number of working paths, and path.

Robots global path generation method
When a robot detects a work conflict, it needs to re-plan the path for the low-priority robot.In order to quickly plan new paths, we first use plm and target points to generate the local path of each working path.Then, all local paths are merged into the global path of the robot, as shown in Algorithm 2. When the robot needs to adjust its path, it only needs to change the order and direction of the local path.Figure 3A shows all target points of the robot.Figure 3B shows global path and all local paths of the robot.
Algorithm 2. Robots global path generation method.

The local path of the robot
According to the plm and target point p n = p n1 , p n2 , …, p ni f g of the robot R n , plan the local path r n j of the robot.Let the coordinates of p ni be (x p ni , y p ni ), and calculate the distance d p ni A j B j from point p ni to straight line A j B j according to Equation 22.
Let j d min represent the serial number of the working path when d p ni A j B j takes the minimum value, as shown in Equation 23.When d p ni A j B j takes the minimum value, the target point p ni is in the working path Calculate the distance d p nv A j (0 < v ≤ i) from point p ni to A j according to Equation 25 when two or more target points are in the same working path.
Sort the target points p n1 , p n2 , …, p nv f g according to the size of d p nv A j , and then update the local path r n j , as shown in Equation 26.
In Figure 3A, p n1 and p n2 are in the working path A 1 B 1 .Since According to the target point p n , a series of local paths r n 1 , r n 2 , r n 3 ,…, r n j are obtained.For example, Figure 3A contains target points p n1 , p n2 , …, p n10 f g , and six groups of local paths are obtained, as shown in Equation 27.

Robots global path generation method
According to the local path r n j of the robot, it is known that the serial number of the working path is j.Sort the local paths r n j according to j and then get the path r n = r n 1 , r n 2 , r n 3 , …, r n j n o .For example, the path sorting in Figure 3A results in r n = r n 1 , r n 3 , r n 5 , r n 6 , r n 12 , r n 16 f g .However, the sorted r n cannot be directly used as a robot's global path because the connection between local paths is not continuous.For example, r n 1 to r n 3 in Equation 27 is from point B 1 to A 3 and finally to B 3 , which does not conform to the 'U' shape path of the robot.The robot cannot go directly from B 1 to A 3 but should go from B 1 to B 3 , then to A 3 .Therefore, it is necessary to adjust r n 3 to B 3 , :, A 3 f g , and at the same time, reorder the target points inside r n 3 according to Equation 25 to obtain the updated r n 3 = B 3 , p n5 , p n4 , p n3 , A 3 f g (1 → 0).Similarly, update r n 5 , r n 6 , r n 12 , r n 16 according to this rule, and finally update the six groups of local paths in Equation 27 to get Equation 28.
Combining the six groups of local paths in Equation 28, the global path r n is obtained, as shown in Equation 31.Finally, according to the target point p n = p n1 , p n2 , …, p n10 f gof the robot R n in Figure 3A, plan the black path r n in Figure 3B.

Itinerary table with all global information
Based on the plm and its own position, the robot can calculate the direction of the robot, the number of the current working path, and the type of path.Combined with the global path and priority, the robot can learn all global information.When robot R n learns its own information, it needs to send its global information to other robots so that other robots can understand the status of R n , thereby judging the relationship between robots and predicting the possibility of collision.We designed an itinerary table (as shown in Table 1) that contains the robot's serial number, priority, path type, moving direction, real-time position, target position, current serial number of the working path and last serial number of the working path to facilitate the robot's sending and receive.When robot R n is started, it generates an itinerary table H R n .`Hrepresents the itinerary table of a group of working robots, and H R n represents the itinerary table of robot R n , as shown in Equation 32.
H O represents other itinerary tables except for H R n , as shown in Equation 33.
Robot R n constantly updates the data in the itinerary table while working and broadcasts its H R n to other robots R O .At the same time, robot R n receives H O and makes decisions.

Multi-robot collision avoidance method
Based on the point-line map, global path and itinerary table, the robot can understand the global information of the field and the status of other robots.With this information, the robot can make reasonable decisions and avoid collisions with other robots.The multi-robot collision avoidance algorithm is shown in Algorithm 3. We calculate the direction of the robot R n in different path type through Equations 5, 6.Then obtain the moving direction of other robots through the received itinerary table H O .Finally, we can compare whether the robots have the same direction.
Calculate the directions of robots according to Equations 5, 6.
3: if the robots move in the same direction then n o

20:
Then, the robot continues to move along the new path 21: else

22:
The robot continues to move along the global path 23: end if

24:
else if path type is transition path then //Add obstacle avoidance paths to the r n of low-priority robot.

29:
Then, the robot continues to move along the new path 30: else

31:
The robot continues to move along the But if the directions are different, the robot must make different decisions depending on the path type.We determine the path type of the robot based on its local path.If the robot path is from A j to B j or B j to A j , the path type of the robot is a working path.If the robot's path is from A s to A u or B s to B u , the path type of the robot is a transition path.

On the working path
If the path types of multiple robots are working path, we query the current serial number of the working path of the robot through the local path r n j .If the serial number j c is different, R n and R O are not in the same working path, and there is no possibility of conflict.Robots continue to move according to the global path and do not need to do anything.
If the serial number j c is the same, R n and R O are in the same working path, and conflicts or collisions will occur.There are two conflict cases: The first case is that one robot is moving in the working path, and another robot is moving from the transition path to the working path; The second is that all robots are entering the working path from the transition path.
For the first case, for example, when R O is already moving in the working path A s B s , R n is moving from A s A u to A s B s .Since they are going in different directions, they must collide.We do not consider the priorities of the robots at this time, directly let the robot R n give up the current working path, and then re-plan the global path.In order not to hinder the robot's work and quickly generate the remaining path of the robot, we move the current conflicting local path r n s to the end of the global path, as shown in Equation 34.Then, using the content of Section 3.2.2,according to the direction continuity between local paths, modify the target point order of the local path, and then update r n .The robot R n continues to move according to the updated r n .
For the second case, for example, both R O and R n are moving on the transition path and have not yet reached the working path.At this time, consider the priority of R O and R n , assuming that the priority of R n is lower than R O .The robot R n with low priority abandons the current working path A s B s and re-plans the path.The remaining path re-planning rules are the same as in the first case.

On the transition path
If multiple robots are on a transition path, we first query the real-time positions of the robots on the same path type.Then, calculate the distance d R n R o between the robots.When d R n R o > 1, robots maintain the current moving state.When d R n R o ≤ 1, the robot with low priority avoids the one with high priority.Since the width of the transition path is generally relatively wide, multiple robots can be accommodated simultaneously in the lateral direction.We can add some extra paths to avoid robot collisions.
In Figure 4A, robot R 1 goes from point A s to P 11 , robot R 2 goes from point A u to P 21 .It is obvious that R 1 and R 2 have different directions.R1 and R2 are close together and are about to collide.Assuming that robot R 1 has a lower priority than robot R 2 .The lowpriority robot translates the current local path a certain distance to the left or right to avoid collision.For example, in Figure 4B, robot R 1 translates the local path P R n A u to P a P b to avoid collision with R 2 .After translating the local path, the path P a P b is updated to {P R n , P a , P b , A u } according to the continuity of the path.We set the new path to r 1 t , as shown in Equation 35.
The conflict occurs on the transition path A s A u , and A s A u is located between the local paths r 1 s and r 1 u , so insert r 1 t between r 1 s and r 1 u , as shown in Equation 36.The moving direction of the robot on the transition path A s A u is up or down, and it is 0 → 1 or 1 → 0 on the working paths A s B s and A u B u , so insert r 1 t between r 1 s and r 1 u , and the direction between other local paths in r 1 still satisfies (0 → 1) (1 → 0) (0 → 1) ⋯ or (1 → 0) (0 → 1) → 0 ) ⋯. Therefore, we only need to simply insert the local obstacle avoidance path r 1 t between r 1 s and r 1 u without doing other operations.
When a new robot is detected, the low-priority robot continues to translate the local path left or right.In Figure 4C, robot R 3 is detected on path P a P b after R 1 passes through point P a , and robot R 1 plans local avoidance path r 1 t 1 , as shown in Equation 37.
Update r 1 t according to the local avoidance path r 1 t 1 , as shown in Equation 38.Then insert the updated r 1 t into the global path r 1 .
The updated local avoidance path is shown in Figure 4D.If R 1 conflicts with other robots again, plan the local obstacle avoidance path according to this rule and then update r 1 t and r 1 .
4 Experiment and result

Simulate initial conditions
In order to verify our proposed multi-robot collision avoidance method, we used Gazebo software to design the robot working environment.The working environment includes field, crops, roads, and four working robots, as shown in Figure 5.Each working robot contains a medicine storage barrel, a medicine spraying device, communication device, positioning device and controller.
In order to facilitate the description of the working process of the robot, a GUI display interface is designed to display the garage, field, crops, and robot, as shown in Figure 6.Set up a group of working robots R = R 1 , R 2 , R 3 , R 4 f g , with priorities of 0, 1, 2, and 3, respectively.Set the field length to 20 meters and width to 16 meters.The field has 20 rows of crops (1 ≤ j < 20), and the distance between each row of crops is 1 meter (D = 1).The coordinate system is established with point O as the origin, and the coordinates of the two endpoints A 1 and B 1 of the baseline A 1 B 1 are set to (0, -9) and (16, -9), respectively.

Generating a point-line map
We first generate all working path A j B j and endpoints A j and B j based on the baseline A 1 B 1 .Calculate the slope k A 1 B 1 and intercept b A 1 B 1 of the working path A 1 B 1 based on points A 1 and B 1 and the straight-line equation of A 1 B 1 , as shown in Equation 39.
According to Equations 14, 39, calculate the straight-line equation of the working path A j B j , as shown in Equation 40.

Generating the global path
We randomly generated the coordinates of 35 diseased crops, and then used them as the target points of the robot (Meshram et al., 2022).The target point is denoted as P = p 1 , p 2 , p 3 , …, p 35 f g .Then, the coordinates P are randomly assigned to R 1 , R 2 , R 3 , and R 4 , as shown in Figure 7. Randomly divide the targets into four groups: The robot's simulation work environment.

FIGURE 6
The initial diagram of the robot's working environment. where where where where

Simulation experiment of multi-robot collision avoidance method
After planning the global path, the robots start spraying operations and simultaneously create an itinerary table H, as shown in Table 1.During the operation, the robot determines the position, path, and direction of moving of other robots by querying their itinerary tables.Then, the robots detect four types of collision and conflict according to section 2.2.Next, the multi-robot collision avoidance method is simulated considering four types of collisions and conflicts.

Working path and different movement directions
When the serial number j c of the working path is the same, and the moving direction is different, there are two conflict cases: The first case is that one robot is moving in the working path, and another robot is moving from the transition path to the working path; The second is that all robots are entering the working path from the transition path.Figure 9 shows the first case (The green path represents the path that has not been passed, while the black path represents the path that has already been passed).Robot R 2 is moving in the working path A 2 B 2 , and robot R 3 is moving from the transition path B 1 B 2 to the working path A 2 B 2 .Figure 9A shows that at 121 seconds, robot R 3 is about to leave its current working path A 1 B 1 move to the next working path A 2 B 2 for work.Figure 9B shows that at 125s, robot R 3 moves to the transition path B 1 B 2 and detects a robot R 2 (At 25 seconds, R 2 works on working path A 2 B 2 , as shown in Figure 9C) with a different direction of moving in the working path A 2 B 2 according to the itinerary table.
In order to avoid collision, robot R 2 will abandon the current local path r 3 2 and then re-plan the remaining path.We follow the method proposed in Section 3 and first move the current local path r 3 2 to the end of the global path r 3 , as shown in Equation 46.But in the global path r 3 , r 3 1 and r 3 4 do not satisfy the continuity of direction, and (0 → 1) to (0 → 1) appear, so we need to change the direction of the remaining path r 3 4 , r 3 7 , r 3 10 , r 3 11 , r 3 12 and r 3 2 .
where We change the direction of the local path by modifying the order of the points of the local path, as shown in Equation 47.The robot continues driving along the updated path r 3 .Figure 9D shows that at 522 seconds, robot R 3 moves to the last working path, and the black path in the figure clearly shows the updated new path. where Figure 10 shows the second case.Robots R 1 and R 2 move to the same working path A 15 B 15 from other paths.Figure 10A shows that at 10 seconds, robot R 2 is about to leave its current working path A 14 B 14 and move to the next working path A 15 B 15 .Figure 10B shows that at 13 seconds, robot R 2 reaches the transition path B 14 B 15 and begins to move toward the working path A 15 B 15 .At this time, it is detected that another robot R 1 (Figure 10C shows the operational status of R 1 at 13 seconds) is also moving toward the working path A 15 B 15 according to the itinerary table.
Since R 1 has a higher priority than R 2 , in order to avoid collision, R 2 abandons the current local path r 2 15 and re-plans a new path.The global path update method of r 2 is the same as Equations 46, 47.The updated path r 2 of R 2 is as shown in Equation 48. Figure 10D shows that at 173 seconds, the robot R 2 moves to the last working path, and the black path in the figure clearly shows the updated new path.

Working path and same movement direction
When the robots have the same serial number j c and the same moving direction, there are two cases: The robots maintain the current speed and move in the order of one after the other.The second is that when one of the robots stops working at the target point, the other robots at the back must wait for the front robot to complete the work.
Figure 11 shows the first case.Robots R 2 and R 4 maintain a certain speed and distance, and move in a front-to-back sequence.Figure 11A shows the states of robots R 2 and R 4 at 11 seconds.
Figure 11B shows that at 31 seconds, robot R 2 and R 4 keep moving forward in this state.
Figure 12 shows the second case.Robot R 4 stops moving and performs the spraying operation after reaching the target point p 431 .Robot R 2 stops moving, waiting for robot R 4 to complete the operation.Figure 12A shows that at 33 seconds, robot R 2 moves toward R 4 along the path.As depicted in Figure 12B, robot R 2 detects the halt of R 4 at 36 seconds, and R 2 maintains a safe distance from R 4 when it stops.Figure 12C shows that at 36 seconds, robot fpls.2024.1393541stops at the target point p 431 .Figure 12D shows that at 39 seconds, robot R 2 stops moving until R 4 completes the work.

Transition path and same movement direction
When the robot is on the transition path and moves in the same direction as other robots, there are two cases: One is that the robot keeps the current speed and follows the others.The other is that when one of the robots turns to the working path, the robots behind stop at a safe distance and wait for the turn to finish.
The first case is the same as the first case in 4.4.2.As long as the safe distance between robots is ensured, no other operations are performed.Figure 13 shows the second case, robots R 2 and R 3 are moving on the transition path.Figure 13A shows that at 11 seconds, robot R 2 detects that R 3 is moving from the working path to the transition path B 2 B 11 , and R 2 stops moving and waits for R 3 to complete the turn.Figure 13B shows that at 15 seconds, after R 3 completes its turn, R 2 and R 3 maintain a certain safe distance and move along the transition path B 2 B 11 .Figure 13C shows that at 22 robot R 2 maintains a safe distance from R 3 and moves in the same direction.Figure 13D shows that at 30 seconds, robot R 3 switches from the transition path B 2 B 11 to the working path A 7 B 7 , and robot R 2 stops at a safe distance, waiting for robot R 3 to finish the turn.

Transition path and different movement directions
Figure 14 shows that robots R 1 , R 2 , and R 3 are moving on the transition path.The j c and j l of R 1 are 4 and 6 respectively.The j c and j l of R 2 are 11 and 2 respectively.The j c and j l of R 3 are 4 and 6 respectively.According to Equation their directions on the transition path are down, up, and down respectively.The moving direction of R 2 is different from that of R 1 and R 3 .Change the priority of R 1 , R 2 , and R 3 to 0, 2, and 1, respectively.
Figure 14A shows that at 31 seconds, robot R 2 detects that R 1 (Figure 14B shows the global path of R 1 at 31 seconds) is approaching from the opposite direction.Since the priority of R 2 is lower than that of R 1 , R 2 plans the obstacle avoidance path according to Section 3.4.2.R 2 translates the current local path a certain distance to the right and adds a new obstacle avoidance path r 1 t , as shown in Equation 49.
Then, we directly insert r 1 t between r 2 2 and r 2 11 in r 2 , as shown in Equation 50.R 2 moves according to updated r 2 .Figure 14C shows the new path of R 2 .14D shows the global path of R 3 at 47 seconds) approaching from the opposite direction at 47 seconds in Figure 14C.Since R 2 has a lower priority than R 3 , R 2 plans an obstacle avoidance path to avoid colliding with R 3 .Just like the rules for avoiding R 1 , move the current local path r 1 t a certain distance to the right, and then update the local path r 1 t , as shown in Equation 51.
Then, we directly insert the updated r 1 t between r 2 2 and r 2 11 in r 2 , as shown in Equation 52.R 2 moves according to updated r 2 .Figure 14E shows the new path of R 2 at 56 seconds.

Analysis of multi-robot collision avoidance results
We recorded the number of times the multi-robot system avoided collisions and the time spent executing tasks for various numbers of target points, as shown in Table 2.We randomly generated sets of 15, 25, 35, and 45 target points and conducted 10 experiments for each set, with target points randomly generated in each experiment.For the multi-robot system, we recorded the total number collisions avoided and the total time spent on task execution for each robot.For a single robot, we recorded only the total time spent on the spraying task.
As shown in Table 2, under different numbers of target points, the time taken by the multi-robot system to complete the task is much shorter than that of a single robot.Specifically, for 15 target points, the multi-robot system avoids collisions 119 times in total, saving 55.6% of the time compared to a single robot.For 25 target points, the multi-robot system avoids collisions 130 times in total, saving 57.9% of the time compared to a single robot.For 35 target points, the multi-robot system avoids collisions 140 times in total, saving 48.9% of the time compared to a single robot.For 45 target points, the multi-robot system avoids collisions 145 times in total, saving 40.7% of the time compared to a single robot.The experimental results show that under the same number of target points, the multi-robot system can complete the spraying task while avoiding collisions or conflicts between robots, and the completion time can be reduced by more than 40%.

Comparison experiment with other methods
To evaluate our method, we compare it with the classic Reciprocal Velocity Obstacles (RVO) (Van den Berg et al., 2008) and Optimal Reciprocal Collision Avoidance (ORCA) (Niu et al., 2021) algorithms.In terms of time complexity, the time complexity of RVO and ORCA algorithms is O(n 2 ).As shown in Algorithms 1-3, their time complexity are O(n), O(n 2 ), and O(n), respectively.Therefore, the overall time complexity of our algorithm is O(n 2 ).
Since the width of the working path in the field is relatively narrow, it cannot support two robots moving side by side.When two robots move toward each other on the working path (as shown in Figure 2B), if the low-priority robot performs an evasive action, it will inevitably collide with the crops.Therefore, we made some modifications to the RVO and ORCA algorithms.If they are detected to be moving in opposite directions on the working path, the low-priority robot stops and waits for the other robot to complete the work before continuing the work.Under the same settings, ten spraying tests with the same number and the same order are conducted for each collision avoidance method with different numbers of target points.The completion time mainly reflects the efficiency of different methods, and the number of collisions avoided reflects the performance from the side.
The experimental results are shown in Table 3, demonstrating that the proposed collision avoidance algorithm outperforms the RVO and ORCA algorithms.Specifically, for 15 target points, the completion time of our algorithm is reduced by 5.2% and 2.9% compared with RVO and ORCA, respectively.This is because when the number of target points is relatively small, the probability of collision or conflict between robots in a large field is relatively small, so the total completion time is not much different.For 25 target points, the completion time is reduced by 9.8% and 3.8% compared with the RVO and ORCA algorithms, respectively.For 35 target points, the completion time is reduced by 14.9% and 8.2% compared with the RVO and ORCA algorithms, respectively.For 45 target points, the completion time is reduced by 16.8% and 9.5% compared with the RVO and ORCA algorithms, respectively.As the number of target points increases, the likelihood of collisions or conflicts between robots also increases.Our proposed algorithm demonstrates better performance, with a greater reduction in completion time compared to RVO and ORCA.In addition, the number of collision avoidance of our proposed algorithm is less than that of RVO and ORCA.This is because our collision avoidance algorithm can pre-judge potential collisions or conflicts on the working path, thereby reducing their occurrence.In summary, our proposed algorithm can complete the spraying task on large-scale fields in a timely and efficient manner, exhibiting high operational efficiency.

Summary
We designed a simulation environment for precise spraying of sweet potato fields, and then experimentally verified the collision avoidance method we proposed against four types of collisions or conflicts that may occur between multiple robots in the field.We demonstrate that our multi-robot collision avoidance method can be well deployed on robots even though they only have communication modules, positioning modules and low-cost control chips.We validate the collision avoidance strategy in various collision or conflict scenarios and show that our method can run robustly for long periods of time without collisions.

Conclusion
In this article, we propose a multi-robot collision avoidance method that only uses point-line maps and real-time robot positions to determine the relationship between robots, make reasonable decisions, and avoid collisions between robots.We evaluate the performance of our method through a series of comprehensive experiments and demonstrate that the collision avoidance method is simple and efficient in terms of success rate, safety, and navigation efficiency.For the current situation where only a single robot is used to complete the operation, the method we proposed can greatly improve the efficiency of farmland robot operations.At the same time, the method we proposed has extremely low requirements for robot hardware performance, which greatly reduces the cost of each robot, thereby reducing farmers' farmland management costs and labor intensity, and indirectly increasing farmers' economic income.It provides the theoretical basis and technical support for reducing the cost of multi-robot systems and accelerating the promotion and application of multi-robot systems in agriculture.
Our work is a first step toward reducing robot costs, avoiding robot collisions, and improving the efficiency of multi-agricultural robots.Although we are fully aware that as a local collision avoidance method, our approach cannot completely replace reinforcement learning-based multi-robot path planners when scheduling.Our future work will be how to extend our method to larger-scale robot systems at low cost and apply this method to real field environments to achieve a safe and efficient multi-robot collision avoidance method.

FIGURE 1 A
FIGURE 1 A simplified diagram of the robot's working environment.(A) Simplified diagram of field.(B) The working path of the robot.
(A, B) Working path and different movement directions.(C, D) Working path and same movement direction.(E) Transition path and same movement direction.(F) Transition path and different movement directions.
and the foot points are A m and B m .Let the slopes of line segments A 1 A m and B 1 B m be k A 1 A m and k B 1 B m , and the intercepts be b A 1 A m and b B 1 B m , respectively.Then the straight-line equations of A 1 A m and B 1 B m are expressed as, FIGURE 3 Target point and global path.(A) Target point.(B) Global path.
23)The endpoints A j d min and B j d min of the working path A j d min B j d min and point p ni constitute the local path r n j d min , as shown in Equation24.Put p ni between points A j d min and B j d min because the robot starts from the endpoint A j d min or B j d min and then passes through the target point p ni .
FIGURE 7Random distribution of target points.

FIGURE 8
FIGURE 8 The global path of four robots.(A) The global path of R 1 .(B) The global path of R 2 .(C) The global path of R 3 .(D) The global path of R 4 .

FIGURE 9
FIGURE 9The paths of robots moving in different directions on the same working path at different times (the first case).(A) The path of robot R 3 at 121 seconds.(B) The path of robot R 3 at 125 seconds.(C) The path of robot R 2 at 125 seconds.(D) The path of robot R 3 at 522 seconds.

FIGURE 10
FIGURE 10The paths of robots moving in different directions on the same working path at different times (the second case).(A) The path of robot R 2 at 10 seconds.(B) The path of robot R 2 at 13 seconds.(C) The path of robot R 1 at 13 seconds.(D) The path of robot R 2 at 173 seconds.

FIGURE 11
FIGURE 11The paths of robots moving in the same direction on the same working path at different times (the first case).(A) The path of robot R 2 at 11 seconds.(B) The path of robot R 2 at 31 seconds.

FIGURE 12
FIGURE 12The paths of robots moving in the same direction on the same working path at different times (the second case).(A) The path of robot R 2 at 33 seconds.(B) The path of robot R 2 at 36 seconds.(C) The path of robot R 4 at 36 seconds.(D) The path of robot R 2 at 39 seconds.

FIGURE 13
FIGURE 13The paths of robots moving in the same direction on different working paths at different times.(A) The path of robot R 2 at 11 seconds.(B) The path of robot R 2 at 15 seconds.(C) The path of robot R 1 at 22 seconds.(D) The path of robot R 2 at 30 seconds.

FIGURE 14
FIGURE 14 The paths of robots moving in different directions on different working paths at different times.(A) The path of robot R 2 at 31 seconds.(B) The path of robot R 1 at 31 seconds.(C) The path of robot R 2 at 47 seconds.(D) The path of robot R 3 at 47 seconds.(E) The path of robot R 2 at 56 seconds.

TABLE 1
The itinerary table of robot R n .
If the direction is the same, query the real-time position of the robot with the same direction in the itinerary table H O , and calculate the distance d R n R o between R n and R O .When d R n R o ≥ 1, R n and R O maintain the current moving state.When d R n R o < 1, the robot at the rear stops moving, and when d R n R o ≥ 1, the robot at the rear resumes moving.
Xu et al. 10.3389/fpls.2024.1393541Frontiers in Plant Science frontiersin.orgp 11 , p 12 , …, p 18 f g is represented by orange, P 2 = p 29 , p 210 , …, p 216 f g is represented by black, P 3 = p 317 , p 318 , …, p 324 f g is represented by blue, and P 4 = p 424 , p 425 , …, p 435 f g is represented by purple.According to Section 3.2, use the target points and map to generate the robots' global path, as shown in Equations 42-45.
p 433 , p 432 , A 5 D show the global paths of R 1 , R 2 , R 3 , and R 4 .

TABLE 2
Experimental results (The total number of collisions avoided and the total time spent on the task for each robot).

TABLE 3
Experimental results of different collision avoidance methods.