Algorithm for optimal path planning of a robotic lawnmower

Horticultural lawns include areas of land that are covered with sown grass in urban areas and require periodic mowing in order to best preserve their aesthetic and functional purpose. This activity may require significant involvement of human and material resources, especially in large public areas such as sports fields, parks and picnic areas. Thanks to the progress of computer technology, this tiresome routine work is gradually being taken over by robotic mowers that can bring significant savings in human and material resources. In this paper, the problem of robotic lawnmowers related to path planning in the working environment is presented. Commercial solutions to date are mostly based on choosing a random straight line path until the mower reaches a lawn boundary or obstacle, after which it turns in the opposite direction and continues mowing in an arbitrary direction. This paper presents a path planning method based on the Chinese postman's algorithm, which enables the planning of the most optimal path that the mower will take so that it mows the entire lawn in the most economical way.


Introduction
Green areas represent the only connection between man and nature in urban areas.Their role in urban areas is not only aesthetic, green areas contribute to improving microclimatic conditions and reducing pollution, which significantly affects the quality of life in urban areas.Green urban areas are most often horticultural lawns which represent land sown with grass that, depending on the use, can be: decorative for beautifying the appearance of parts of the city, parks, courtyards, gardens, monasteries; functional for soil erosion prevention, embankments, noise reduction, soil temperature reduction, roadside stop strips; sports and recreational as fields for sport activities (football, tennis, golf, rugby, baseball, etc.).In order to obtain a quality grass area, appropriate grassleguminous mixtures should be selected, according to the type of use, soil and climatic factors.They are sown uniformly in a dense setting, in order to avoid the appearance of empty places where weed plants would develop.
A long-lasting, high-quality, fresh, green and beautiful horticultural lawn (Lawn-Turf) with an even density of grass requires proper arrangement, foundation, care and maintenance.Lawn care and maintenance include the following agro-technical measures: mowing, fertilizing, irrigation, protection against weeds, diseases, pests and mechanical damage.In addition to these measures, specific care and maintenance measures can be applied to the lawn: aeration, rolling, raking, heating, cleaning, trimming and repairing damaged lawns.The basic, the most important, and in our case the only measure of maintenance and care of horticultural lawns is timely regular mowing.Mowing the lawn is not only esthetically arranged, but after mowing the grass grows better and is thicker, which is important for the quality of the lawn, the fight against weeds, diseases, pests and drought.In lawns that are not regularly maintained, weeds, grass laying and rotting occur, which very quickly leads to the destruction of the lawn and the loss of the functional and aesthetic value of the green area.Also, abandoned lawns are suitable habitats for insects, reptiles and rodents that can spread infectious diseases that pose a danger to the population in urban areas.
Lawn mowing is an activity in which the upper part of a grass is mechanically cut off.The time, frequency, height and method of mowing the lawn depends on the type and purpose of the lawn, the mixture of grasses, their intensity and dynamics of growth, terrain configuration, season, climatic and soil factors, etc.According to the recommendations of Eric et al. (2016) during one mowing, no more than 1/3 of the leaf mass should be mowed.Depending on the type of grass, the height of the cut part of the leaf should be up to 2.5 cm for high-quality lawns, and 2.5 to 5.0 cm for average lawns.High-quality lawns are mowed lower and more often, usually 6 to 8 days between mowing.Commercial lawns such as grass areas of residential areas and home gardens are mowed once or twice a month at a height of 1.5-2.5 cm.Ornamental and sports lawns are mowed once or twice a week, usually the day before sports events at a height of 2.5-3.5 cm.Usually, the lawn is mowed when the grass grows about 10 cm (Kantoci 2011).
When lawn are mowed frequently the grass clippings are too small to interfere with the growth of the lawn and do not need to be collected.In that case the lawnmower evenly cuts, shreds and scatters the grass clippings on the surface of the lawn, the remains of which are turned into mulch.These clippings return nitrogen-rich and potassium-rich nutrients to the lawn process under the influence of climatic factors, soil fauna and microorganisms.In case lawns are mowed infrequently, the grass clippings are larger to be left to decompose and it is necessary to collect and remove them from the lawn so that the mowing residues do not cause drying or rotting on the parts of the lawn where they remain piled up.When mowing residues are collected it is necessary to compensate the loss of nutrients by fertilizing the lawn.The frequency of mowing depends on the vegetative period in which the lawn is located, and in the case of late spring, it is necessary to carry out mowing more often than in summer and autumn when the growth of grass is much smaller.Mowing also depends on meteorological conditions.The best times for mowing are late morning, when the grass is not wet from dew, or in the early evening.It is necessary to avoid mowing the grass in strong sunlight and rain.
Based on the cutting device, mowers can be divided into four groups: oscillatory, rotary, cylindrical and trimmer mowers.The most common way of mowing lawns with rotary mowers is from the edge of the plot where mowing is done alternately in two directions and starts from one end and ends at the other end of the plot-lawn.It is mowed from the beginning of the plot in one direction and when the end of the plot is reached, the mower turns around on the headland and starts mowing when returning in the other direction, and so on until the end of the plot.Care is taken to maintain a straight line when mowing if there are no obstacles in the lawn that need to be bypassed.
The mowing of smaller areas of horticultural lawns is done using motorized and electric mowers, manual or self-propelled, and recently robotic lawnmowers.Motor mowers use single-cylinder two-stroke or fourstroke engines which drive the cutting device.Motorized lawn mowers can be self-propelled driven by an operator or manual, pushed and pulled by a human.There are a large number of different types of mowers with different engine power, working width and working speed on the market.
Bajkin ( 2005) divided mowers into the following groups according to their performance:  up to 500 m 2 -mowers with electric motor 800-1,500 W, with a mowing width of 32-40 cm;  up to 1,000 m 2 -lawnmowers with a gasoline engine, without their own drive for moving around lawn area: 3.5-4.5KS, with a mowing width of 46-53 cm;  up to 2,000 m 2 -lawnmowers with a gasoline engine and their own drive for moving around lawn area -self-propelled: 4-6 hp, with a mowing width of 48-55 cm;  over 2,000 m 2 -professional lawnmowers with a gasoline engine, self-propelled: 6-13 HP, with a mowing width of 53-84 cm and tractors for mowing parks.According to the ratio of engaged engine power, working width and mower speed, Tanasić et al. (2008) determined productivity (output m2/h) and based on that divided horticultural mowers into professional and non-professional.The average ratio of engine power to lawnmower working width is 1, and ranges from 0.9 to 1.1.Self-propelled lawnmowers, which operate in a mode below the average ratio of power and work engagement, do not belong to the category of professional machines.The authors suggest that in communal enterprises that manage green areas in urban areas, professional mowers with a ratio of engine power to working width of 1.1 are used and give an example.
In order to mow a lawn area of 266 ha with a selfpropelled lawnmower of 72 cm, which is followed by the operator at its limited average speed of 3 km/h, it takes 1231.4 hours (51.3 days) for the Novi Sad Municipal Corporation.During that time, the operator would have walked a distance of 3694.4 km (equal to the distance from Novi Sad to Paris and back to Novi Sad = 3580 km).A self-propelled lawn mower with a reach of 1.47 m (at an operating speed of 12 km/h) would mow this area in 150.7 h (6.3 days), covering a distance of 1809.52 km with the operator in a seated position.
Mowing grass, especially in large public areas, requires the engagement of significant human and material resources.Traditional mowing is based on human control of a mower that uses internal combustion engines as power units, which are noisy, pollute the environment and require frequent service intervals.
With the advancement of technology, this tiresome routine work can be taken over by robotic lawnmowers that can bring significant savings in human and material resources.Robotic lawn mowers use an electric motor as a drive unit, with energy provided by batteries, so this type of lawnmower is much more suitable for urban areas.The batteries can be removed from the case and charged or charged wirelessly.In addition, the batteries of horticultural lawn mowers can be charged and powered by solar energy via the panels, then this type of mowing can be classified as an activity with zero greenhouse gas emissions.
Robotic lawnmowers are able to completely replace human work, they can work authonomosly with high quality, on sloping terrain, even in night conditions.In order to protect the environment, it is expected that in the near future, battery-powered robotic mowers will be used more and will completely replace motorized and electric mowers for mowing smaller areas.The current shortcoming of robotic lawnmowers is the short battery life, small working width and low performance.Therefore, depending on the area of the lawn, the batteries will most likely need to be charged during operation.This paper presents a path planning method which uses most optimal path that the mower will take to conserve battery energy.

Robotic lawn mowers
Robotic lawnmowers are autonomous mobile robots that consists of a blade motor which rotates the blade disc and uses foldable cutting blades.These blades are thin and sharp and they cut the grass like a razer and can fold in case they hit some object to prevent damage.Due to blade sharpness and low cutting disk inertia robotic lawn mowers require blade motors which consume less power than traditional electric mowers.Robotic mowers also have two electric motors which are connected to drive wheels and enables movement through lawn area.Robotic lawnmowers are most commonly powered by lithiumion rechargeable batteries which offer high capacity and low weight.An entire lawnmower is controlled by the control unit, which controls mowing and movement, based on the set of various sensors (Figure 1).These sensors include area sensors which are used to detect lawn boundaries, either by detecting buried boundary wire or by detecting other surface than grass.To operate safely in urban environments robotic lawnmowers have obstacle sensor which is used to detect obstacles and lift sensor that instantly stops the blade motor if the robotic mower is lifted from the ground to prevent injuries.

Figure 1. Components of the Honda Miimo robotic lawnmower
Robotic lawnmowers are battery-operated mobile robots which are most commonly based on differential drive.This type of drive consists of two drive wheels or tracks located on either side of the robot chassis which are independently driven by two electric motors.Tracks are used for robots which operate on highgradient terrains, but due to increased traction they require higher drive power when compared with wheeled differential drive.Wheeled robots of this type require one or more castor wheels to prevent tilting.Differential drive does not require an additional steering mechanism, steering is carried by varying the relative rate of rotation of its drive wheels.In case both drive wheels rotate at same speed and in the same direction robot will move in a straight line.If there is a difference between the speed of the drive wheels, the robot will start turning in the direction of the wheel which rotates slower around the Instantaneous Center of Curvature (ICC) (Figure 2).Additionally, in case the drive wheels rotate in different directions at the same speed, the robot can perform turn which is very useful for navigation in narrow work areas.
Mobile robots represent a class of robots that have the ability to move and autonomously perform certain tasks in their environment.Mobile robots perceive the environment using built-in sensors, based on which they independently decide and act on the environment in order to achieve the set goal.The minimum level of intelligent behavior of a mobile robot includes perception of the environment using sensors, looks at the situation and makes a decision based on built-in algorithms, based on which it generates management actions that act on its environment.Navigation represents one of the most important tasks in mobile robots, and includes a set of activities that allow the robot to move from the starting point to the set goal, avoiding static or dynamic obstacles in its environment.
Navigation of mobile robots includes four interrelated activities: environment perception, localization, path planning and motion control.Perception is a set of cognitive functions by which a robot perceives objects in its environment, such as moving and stationary obstacles, people and other subjects.The robot receives information about its surroundings using built-in sensors, such as cameras, ultrasound or radar sensors, on the basis of which it creates an image of the environment.Localization is the activity of determining the position and orientation of the robot in space at any moment in time.Motion planning is the process of determining a set of free paths in the robotic environment that the robot will use to reach the desired goal.The robot's environment contains obstacles that represent an occupied part of the space through which the robot cannot move.Depending on the type of environment, we distinguish between global and local path planning.Global planning is related to planning movement in a known environment, while local planning is related to planning movement in an unknown environment.In the case of robotic lawnmowers, both of these two types of planning are necessary because mowing takes place in a known environment with static obstacles in which unknown dynamic obstacles, such as people or animals, may also appear.Choosing the optimal path depends on the set goals, and when planning the robot's movement, it is necessary to pay attention to the robot's internal limitations, which include mechanical limitations and sensory limitations, such as blocking the view of the cameras by obstacles.Motion control is a process in which the robot moves in space under the action of the robot's internal drive.Motion control uses robot geometry to calculate how to move its center of mass along planed robot trajectory.This task generates control signals which are forwarded to drive wheels in order to place the robot in the desired position.

Results and discussion
Robotic lawnmowers typically operate in defined areas of movement in the field.This area is typically bordered where the mobile platform can move freely or according to a predefined path.The second approach with the predefined movement plan is more convenient due to the possibility of getting better optimizations.The best path, among all others, obtains results in more efficiency with a reduction of energy consumption and costs.The concept of path planning is usually related to the activity of finding the best path using various algorithms for existing conditions in the environment (Patle et al., 2019;Zhang et al., 2020).Although planning considers finding a path between two points, our case with the lawnmower implies getting all paths that should cover the area intended for mowing and form an overall path or route.The entire polygon could be mapped by defined nodes in selected points, which would be connected with edges.Included edges aim to cover all segments of the area in the polygon to avoid all obstacles and connect all nodes forming a graph.Edges are bidirectional, and the goal was to find the overall path that would contain all edges at least once.This challenge could be recognized as a variant of the well-known Route Inspection Problem or Chinese Postman Problem (CPP) (van Ee and Sitters, 2020).CPP is a widely popular problem in graph theory whose application could be found in transport planning or computer network routing.CPP was proposed in the 1960s by Chinese mathematician Mei-Ko Kwan.It is called by its first study context of a postman in China who needs to deliver mail on all streets, thereby using the shortest route.Formally, CPP has the following definition: For given graph G=(V, E), where V is a set of nodes (vertices), and E is a set of edges, find the path that contains each edge at least once and finish in the start node.Graph G is undirected, and the length of the overall path needs to be minimized.
The solution of the Postman Problem depends on the graph type and could be obtained in polynomial time or could be considered as an NP-hard problem.If the graph type is an Eulerian graph, then the solution could be given in an exact and fast way.Eulerian graph characterized even degree in every node.If this is the case, solving CPP could be conducted by transforming the original graph to an equivalent Eulerian graph with a technique known as edge duplication.So, every edge that represents an odd number on a node in the initial graph is duplicated.These steps form a new graph with an even degree in every node and Eulerian circuit, which implies a solution also for the CPP in the input graph.Another way to find the solution of CPP is the usage of heuristic algorithms, which could give suitable approximate solutions for an acceptable amount of time.
In our case, the proposed concept of using a lawnmower requires the task of planning its overall path during the working process of cutting the grass.In this case, a mobile unit or lawnmower needs to go around all obstacles and over every part of the area intended for mowing.The overall path or route of the autonomous lawnmower was found by applying CPP, which then transformed the initial graph into an Eulerian graph.The first step was implied forming a polygon as an area for mowing and determining the starting point.Covering all polygon area by points with coordinates were included continually in order from the starting point.The resolution or step between points is not higher than the width of the mower's working reach.The polygon area was mapped with available points as a working area and points that were not accessible as an obstacle.The next step was forming a graph, firstly using the points in the same row so that edges could keep a straight line as much as possible.It was introduced for practical reasons because lawnmower has to keep a straight direction and avoid frequent turning, as much as possible.Also, the number of nodes and edges in the graph is smaller, which makes solving problems more efficient.Nodes with odd degrees were identified, and then every odd edge was duplicated to form an Eulerian graph.Finding a solution for a new Eulerian graph brings, at the same time, a solution for the initial graph.The form of the polygon and the defined route are shown in Figure 4. Planning the overall path or route for the lawnmower was introduced on a polygon with a dimension of 20 x 20 points and four obstacles, as shown in Figure 4. Arrows indicate the direction of the robot movement from the starting position and the path in every clear trace is a straight line.If there is an obstacle on a particular trace, then the path is changed to the next or previous trace to go around points marked as obstacles.Using the same principal overall path, which consists of connected nodes, would be finished at the end of the route to the same starting point.

Conclusions
Robotic lawnmowers are able to completely replace humans in the process of mowing grass on smaller areas.In order to protect the environment, it is expected that in the near future, battery-powered robotic mowers will be used more and will completely replace motorized and electric mowers.In order to do so, they require sofisticated path planing algorithms which will eneble them to mow th lawn in most efficient way in order to conserve battery energy.This paper presents a path planning algorithm based on the Chinese postman problem, which enables the mowing of large public lawns with the most optimal path with the least distance traveled.As a direction of further research, the implementation of the algorithm on a robotic lawnmower based on the Jetson Nano control unit is planned.This robot is based on the diferential wheeled drive which will test the effectivens of aglorithm in real test conditions.

Figure 2 .
Figure 2. Steering movement of mobile robot with differential drive,Han et al (2008)

Figure 4 .
Figure 4. Polygon with planning overall path for lawnmower