• 沒有找到結果。

Detailed Process for Security Patrolling by Vehicle Navigation

Chapter 4 Security Patrolling by Multiple Vehicle Navigation

4.3 Detailed Process for Security Patrolling by Vehicle Navigation

Patrolling by Vehicle Navigation

In the navigation phase, the vehicles navigate along assigned patrolling paths by arriving at each node orderly. The types of nodes on a path include monitoring point, turning point, and passing point. Assume that N is the set of nodes on a patrolling path and that an element ni in N means the i-th node passed by a vehicle. If a point m = (mx, my) is the current position of a vehicle, we can utilize the goal node ni= ( , )x yi i , where the vehicle wants to arrive at, to acquire a direction vector WJJKi

. The equation is shown in Eq. (4.3). The direction angle θV of a vehicle is an included angle between the current direction vector of the vehicle and the positive direction of the x-axis in the VCS, as shown in Figure 4.9.

We calculate an acute angle θ by the cosine formula and utilize the angle to obtain θV in the following way:

64

65

The acute angle θ is an included angle between the direction vector WJJKi

and the x-axis in the VCS, and the equation is shown in Eq. (4.4). If one element of WJJKi

is negative, it will be transformed into positive one. As the direction angle θV is obtained, the difference between θV and the original direction angle θodo is exactly the rotation angle θturn.

The proposed system utilizes nodes to guide the vehicles. By the current node and the goal node, we can obtain the direction vector WJJKi

and then the rotation angle θturn. The vehicles turn to the angle θturn and move forward. Such actions enable vehicles to arrive at the goal node. In the period of navigation, the vehicles must be located constantly. Therefore, we set a distance parameter d. When one vehicle has moved the distance d, it must be located. Furthermore, if the vehicle arrives at a goal node which is a monitoring point, the direction angle of the vehicle must be adjusted as one θmoni obtained in the learning phase and then performs the security monitoring task. The algorithm is shown in the following and the flowchart is shown in Figure 4.11.

Algorithm 4.4 Navigation and monitoring tasks.

Input: The current position m = (mx, my), the goal node ni= ( , )x yi i , and distance parameter d.

Output: The vehicle moves the distance d toward the goal node.

Steps:

Step 1. Locate the vehicle including correcting the position and the direction angle.

Step 2. Calculate the direction vector WJJKi

from the node m to the node niby the

66

each element of which is the absolute value with respect to the element in WJJKi

.

Step 4. Calculate the acute angle θ by the following equation:

' ( )

Step 5. Calculate the direction angle θV by the following rules.

(1) If the direction vector WJJKi

Step 8. Check whether the distance d is bigger than the distance between the current node and the goal node.

If yes, the vehicle moves the distance d forward.

Else, the vehicle moves to the goal node.

Step 9. Check whether the vehicle arrives at a monitoring point.

If no, perform this Algorithm 4.4 again.

Step 10. Read the direction angle θmoni at the monitoring point.

Step 11. Calculate the rotation angle as θturn = θmoni - θodo. Step 12. Turn the vehicle leftward for the angle θturn. Step 13. Perform the security monitoring task.

Step 14. Read the next goal node and perform this Algorithm 4.4 again.

67

Figure 4.11 Flowchart of Navigation and monitoring tasks.

68

Chapter 5

Planning of Optimal Randomized Patrolling Paths for Vehicles

5.1 Introduction

In the proposed system, patrolling paths are designed to be optimal, random, and load-balanced for all autonomous vehicles in the senses mentioned previously. All monitoring points on these paths are chosen randomly. Because some monitoring points might belong to different rectangular regions, the turning points are utilized to enable the vehicles to move between any pair of monitoring points without collisions with walls. To optimize the patrolling paths, all distances between monitoring points must be the shortest. Therefore, we calculate the distances by Dijkstra’s algorithm.

The detail is described in Section 5.2.

To patrol all monitored objects uniformly, each monitoring point appears only once in one patrolling session. With all distances between pairs of monitoring points, we utilize the idea of the traveling salesman problem to obtain the optimal patrolling paths, as mentioned previously. In such a way, all autonomous vehicles can take shorter time to accomplish the security patrolling task in each session. The detail is described in Section 5.3.

69

5.2 Calculation of Paths between Monitoring Points by Dijkstra’s Algorithm

5.2.1 Review of Dijkstra’s algorithm

Dijkstra’s algorithm can be adopted to solve a single-source shortest-paths problem on a weighted, directed graph G = (V, E), in which V is the set of vertices and E is the set of edges. The algorithm is only feasible for the case that all edge weights are nonnegative. By the algorithm, the shortest paths and weights from a source s to other vertices can be obtained. In the algorithm, there are three symbol definitions:

(1) w(u, v) represents the weight of the edge (u, v);

(2) d[v] represents the shortest-path estimate from the source s to the vertex v;

and

(3) π[v] represents the predecessor of v in the shortest path from the source s to the vertex v.

The main concept is that the all sub-paths of the shortest path are also the shortest paths. Therefore, it uses the technique of relaxation [24] by a triangle inequality. The process is to check constantly whether the shortest path to v can be improved by going through u. If yes, then update d[v] and π[v]. Dijkstra’s algorithm [24] is shown below.

70

Algorithm 5.1 Dijkstra’s algorithm.

Input: A directed graph G including vertices V and edges E, all weights with respect to edges E, a source s, and an empty set S.

Output: The shortest paths and weights from s to other vertices.

Steps:

Step 1. Set all d[v] = ∞ and all π[v] = nil.

Step 2. Set d[s] = 0.

Step 3. Find out vertex u whose shortest-path estimate d[u] is the smallest.

Step 4. Put the vertex u into the set S.

Step 5. Find out all vertices v which are adjacent to the vertex u from E and which are not in the set S.

Step 6. Check whether d[v] > d[u] + w(u, v).

If yes, update d[v] = d[u] + w(u, v) and π[v] = u.

Step 7. Repeat Step 3 if the set S do not contain all vertices V.

5.2.2 Proposed technique for

generation of partial patrolling paths

To calculate the distance between every pair of monitoring points, we adopt Dijkstra’s algorithm. At first, we check whether two monitoring points belong to an identical rectangular region. If yes, the distance between them is set equal to the straight line distance; else, we calculate the shortest path by passing through some turning points without colliding with walls.

To meet the assumptions in Dijkstra’s algorithm, the patrolling environment is taken to be a directed graph G. All turning points and monitoring points are regarded

71

as the set V of vertices in the graph G. If there is a rectangular region which two turning points belong to or which both of a turning point and a monitoring point belong to, then there exists an edge between the two and it is taken to be one element of the set E of edges in the graph G. The directions of all edges are two-way. The straight line distances of all edges in the set E are the set W of weights.

To calculate the shortest path between two monitoring points which belong to different regions, we set one of the two points as a source point and the other as an end point, at first. By Dijkstra’s algorithm, the shortest path from the source point to the end point can be obtained and its weight is exactly the distance between them. The algorithm of processing all pairs of monitoring points is described in following.

Algorithm 5.2 Computing distances between two monitoring points.

Input: Rectangular regions R, monitoring points, and turning points.

Output: All the shortest distances and paths between all pairs of monitoring points.

Steps:

Step 1. Produce the set V which is composed of all monitoring points and turning points.

Step 2. Produce the set E, in which every element means that it connects two points which belong to an identical rectangular region.

Step 3. Produce the set W, in which each element is the straightly line distance with respect to the edge in the set E.

Step 4. Check whether two monitoring points Mi and Mj belong to an identical region.

If yes, the distance between them is exactly the straightly line distance and repeat Step 4 until the distances between all pairs of monitoring points are obtained.

Else, perform Dijkstra’s algorithm with the source point Mi and the end

72

point Mj.

Step 5. Record the weight and the order of the turning points passed by from the source point Mi and the end point Mj, according to the result from Dijkstra’s algorithm.

Step 6. Repeat Step 4 until the distances between all pairs of monitoring points are obtained.

As an example, a patrolling environment is shown in Figure 5.1, in which there are five rectangular regions, five turning points N1 through N5, and two monitoring points M1 and M2.

Figure 5.1A patrolling environment.

Because M1 and M2 belong to different rectangular regions, the distance between them is calculated by Dijkstra’s algorithm. Before performing the algorithm, we transform the patrolling environment into a graph G = (V, E), as shown in Figure 5.2.

The set V contains N1 through N5 and M1 through M2; the set E includes all the black lines which are two-way. M1 is the source point and M2 is the end point.

Figure 5.2 The graph G from Figure 5.1.

The results of each process are shown in Figure 5.3 through Figure 5.9 step by

73

step. Because M1 is the source point, it has the smallest distance from the source point in the first cycle.

N1 Figure 5.3The first cycle.

In the second cycle, N1 has the smallest distance within non-chosen vertices.

Therefore, the shortest path for the source point is M1 Æ N1 and the distance is 11.

Figure 5.4The second cycle.

In the third cycle, N2 has the smallest distance within the non-chosen vertices.

Therefore, the shortest path for the source point is M1 Æ N1 Æ N2 and the distance is 15.

In the fourth cycle, N3 has the smallest distance within non-chosen vertices.

Therefore, the shortest path for the source point is M1 Æ N1 Æ N2 Æ N3 and the

74

Figure 5.5 The third cycle.

N1

Figure 5.6 The fourth cycle.

In the fifth cycle, N5 has the smallest distance within the non-chosen vertices.

Therefore, the shortest path for the source point is M1 Æ N1 Æ N2 Æ N3 Æ N5 and the distance is 29.5.

In the sixth cycle, N4 has the smallest distance within the non-chosen vertices.

Therefore, the shortest path for the source point is M1 Æ N1 Æ N2 Æ N3 Æ N4 and the distance is 30.

75

Figure 5.7The fifth cycle.

N1

Figure 5.8The sixth cycle.

In the seventh cycle, M2 has the smallest distance within the non-chosen vertices.

Therefore, the shortest path for the source point is M1 Æ N1 Æ N2 Æ N3 Æ M2 and the distance is 37. Finally, the distance between the pair of monitoring points M1 and M2

is exactly 37. Furthermore, the path from M1 to M2 is M1 Æ N1 Æ N2 Æ N3 Æ M2 and the path from M2 to M1 is M2 Æ N3 Æ N2 Æ N1 Æ M1. All results of the above derivations must be recorded.

76

Figure 5.9The seventh cycle.

5.3 Calculation of Optimal

Randomized Patrolling Paths by Finding Hamiltonian Paths

5.3.1 Review of Traveling-Salesman Problem (TSP)

The definition of the traveling-salesman problem is that a salesman must visit n cities and wishes to visit each city exactly once with the minimum cost. Furthermore, he finishes at the city where he starts from. The problem involves a complete undirected graph G = (V, E), in which the set V contains all n cities, the set E contains all edges of any pair of vertices, and there is a nonnegative cost c(u, v) associated with each edge (u, v) in the set E, and may be modeled as a search of a Hamiltonian cycle

77

within G with the minimum cost.

The traveling-salesman problem is NP-complete, so it cannot be solved by a polynomial-time algorithm. Many methods have been proposed to speed up the process, such as genetic local search [21], distributed branch-and-bound search [22], annealing-based heuristic search [23], etc. However, the number of the monitoring points in the experiment of this study is not too large. So we adopt an exhaustive search method (or called a brute-force method), whose time complexity is O(n!) with inputs of size n, to find an optimal solution in all combinatorial states.

5.3.2 Proposed technique for

generation of complete patrolling paths

Because every monitoring point is visited only once in a session, we transform the path planning proposed into the traveling-salesman problem. Some assumptions are made:

(1) all monitoring points are contained in a set V;

(2) each pair of vertices in the set V has an edge between them and all edges are contained in a set E;

(3) a complete undirected graph G is composed of the set V and the set E; and (4) a cost c(u, v) associated with the edge (u, v) is the distance between the

monitoring points u and v.

If two monitoring points belong to different rectangular regions, the distance between them is calculated by Dijkstra’s algorithm described in Section 5.2; else, it is the

78

straight line distance.

As an example, a patrolling environment is shown in Figure 5.10, in which M1

through M4 are monitoring points, and N1 through N5 are turning points. Furthermore, each black edge connects two points which are in an identical rectangular region and each blue edge connects two monitoring points which are also in the same one. All distances between pairs of monitoring points and turning points passed by them are recorded in a table, as shown in Table 5.1.

N1

Figure 5.10A patrolling environment.

Then, we transform the graph in Figure 5.10 into another, as shown in Figure 5.11.With the complete undirected graph G and all costs associated with the edges, we can find an optimal patrolling path. Because the vehicles do not return to the start position in this study, the path is exactly a Hamiltonian path with the minimum cost.

The result of Figure 5.11 starting at M1 is M1 Æ M3 Æ M4 Æ M2. And then integrating the information of Table 5.1 into the path, we get the final result as M1 Æ M3 Æ M4

Æ N4 Æ M2. The algorithm of generating an optimal patrolling path is shown below.

Table 5.1 Distances and passing turning points between every pair of monitoring points.

M1 M2 M3 M4

M1 37 13 16.5

79

Figure 5.11 A complete undirected graph G = (V, E).

Algorithm 5.3 Generation of an optimal patrolling path.

Input: All monitoring points, a table T containing all distances and passing turning points between all pairs of monitoring points, and a position P where the vehicle starts at.

Output: An optimal patrolling path from P.

Steps:

Step 1. Read the distance between each pair of monitoring points from T and each of them is exactly the cost c(u, v) associated with the edge (u, v) .

Step 2. Find a Hamiltonian path with the minimum cost from P in the patrolling environment containing all MPs.

Step 3. Merge turning points into the Hamiltonian path obtained from Step 2, by Table T.

In this study, the number of vehicles used to perform the patrolling task is more than one. Therefore, all monitoring points are divided randomly into groups for each

80

vehicle to patrol. The rule of choosing monitoring points randomly has been described in Section 4.2.1. By performing Algorithm 5.3 individually, the optimal randomized patrolling paths for all vehicles can be obtained. However, we set a threshold parameter T to restrict the differences of the patrolling distances for the property of load balancing among vehicles. If the condition is not satisfied, all monitoring points will be chosen and Algorithm 5.3 performed again.

81

Chapter 6

Collision Avoidance between Vehicles

6.1 Introduction

In this study, an assumption made is that no unexpected obstacle exists in the patrolling environment. However, the security patrolling task is performed by multiple vehicles, it is necessary to ensure no collision among vehicles. Many methods about collision avoidance among multiple vehicles have been proposed, such as by cell decomposition [18], using a probabilistic model [19], or based on multilayered cellular automata architecture [20], etc.

Because only two vehicles are used in the experiment of this study, we can solve the problem by keeping a fixed distance Dis between two vehicles. If the distance between the vehicles is smaller than Dis, their patrolling paths must be changed. By the way, it is noted that collision avoidance between the vehicles is real-time and this is good for the property of random patrolling paths. Furthermore, the calculating time is short. If the number of the vehicles is more than two, the collision avoidance technique will need more consideration and this can be one of the further works.

6.2 Detection of Collisions

Because vehicles are located constantly by the top-view omni-cameras, the odometer values are credible. Therefore, the values are utilized to compute the

82

distance between two vehicles in every cycle of a fixed time duration. If they are too close, their paths will be changed by inserting some passing points. By these points, the distance between the two vehicles can be drawn apart.

For collisions, there are two different states. We only consider the section of the assigned patrolling path from the current positions to the goals, turning points or monitoring points, where the vehicles are moving to. If the two sections have an intersection, this state is called path-intersecting; else, it is the state of non-path-intersecting. The proposed collision avoidance techniques are described in Section 6.3.

6.3 Proposed Collision Avoidance Techniques

6.3.1 Collision avoidance on intersecting paths

In the state of path-intersecting, we let the two vehicles keeping a fixed distance.

Assume that the first vehicle is at position V11 = (x11, y11) and the other is at position V21 = (x21, y21). Additionally, assume that they are moving to the goals G1 = (gx1, gy1) and G2 = (gx2, gy2), respectively. At first, we calculate the intersection I in the two paths by the parametric forms. Each parametric form with respect to the path from the current position to the goal is shown in Eq. (6.1) below:

83

The point I can be obtained by solving the simultaneous equations of “x1 = x2” and “y1

= y2”. Then, assume that the distance between V11 and I is smaller than the distance between V21 and I, as shown in Figure 6.1, and so the path of the second vehicle must be changed.

Figure 6.1 An intersection I on the paths of two vehicles.

Because the first vehicle moves along the original path, we can forecast the position V12 = (x12, y12) at the next moment. If the velocity of the vehicle is vel and the time interval of calculating the distance between vehicles is t, then V12 can be calculated by Eq. (6.2) below:

12 11 1 11

Because the vehicles must keep a distance Dis to each other, we can say that the passing point V22 of the second vehicle is on a circle C whose center is V12 and whose

84

radius is Dis. To calculate V22, we must acquire the projection point V21’ of V21 on the circle C, at first. The reason is that the distance between V21 and V22 is desired to be not too long. So we utilize an included angle θ between V21’ and V22 on C to acquire

Therefore, the projection point V21’ can be calculated by Eq. (6.4) as follows:

2 2 2

21 2 21 12 21 2 21 12

(x +(gx x s x- ) - ) +(y +(gx x s y- ) - ) =Dis . (6.4)

As long as the value s is solved, V21’ is obtained. Then, we calculate the angle θ21’ of V21’ from the positive direction of the x-axis. Because C can also be represented as Eq.

(6.5) below, we can calculate θ21’ by Eq. (6.6) below: points a or b as shown in Eq. (6.7), called candidate passing points:

12 21'

Furthermore, it is desired that the distance between V22 and G1 is bigger. The reason is that the distance between the two vehicles can be drawn apart. Therefore, if

85

point a is closer to G1 than point b, V22 will be exactly the point b. As the passing point V22 is obtained, the patrolling path of the second vehicle is changed from V21 Æ G2 to V21 Æ V22 Æ G2.

It is possible that the alternative path may exceed the walkable range. If this is the case, then the path must be changed again. In general, there are three unallowable states:

(1) the passing point P is in the outer region as shown in Figure 6.2;

V G

Walkable Region R P

P1 P2

Figure 6.2Passing point P is in the outer region.

(2) the path from the current position V to the passing point P exceeds the walkable range as shown in Figure 6.3; and

Walkable Region

V G

Walkable Region R P

P1 P2

Figure 6.3 The alternative path is not feasible.

(3) the path from the passing point P to the goal G exceeds the walkable range as shown in Figure 6.4.

86 Walkable Region

V G

Walkable Region R P

P1 P2

Figure 6.4 The alternative path is not feasible.

Figure 6.4 The alternative path is not feasible.