5.3 ACTIVIDADES ADMINISTRATIVAS
5.3.1 Análisis ingreso de estudiantes al laboratorio
We use graph search algorithms based on Dijkstra algorithm to solve the problem in (2.13). Dijkstra algorithm is a dynamic programming (DP) approach that deterministically finds the optimal solution. A* is the informed Dijkstra, which biases the search using aheuristic function. The heuristic function is a preliminary estimation of thecost-to-goalvalue. The use of the heuristic can potentially reduce the number of vertices to be expanded during the A* search as compared to the uninformed Dijkstra algorithm search. It is a critical evaluation of the output’s optimality and computational efficiency. To enable these improvements, the
(a) Configuration space. (b) Graph in free space. (c) Path from start to goal. Figure 2.3: An example of the configuration space and the corresponding graph. The graph consists of vertices and edges in free space. The path connects the startps and the goalpg.
heuristic must have the following two properties:
Admissible The heuristic function never overestimates the minimalcost-to-goal.
Consistent(monotonic) Let c(·,·) be the edge cost between two vertices, h(·) denotes the heuristic value, h satisfies
h(ui)≤c(ui, uj) +h(uj), and h(ug) = 0, (2.14)
whereug is the goal.
The admissible heuristic guarantees the optimality of the search result. A consistent
heuristic is also admissible. In general, the closer a heuristic is towards the true cost-to- goal value, the faster the algorithm finds the optimal result since it tends to expand fewer vertices.
Notation
We use following notations in the pseudo-code. For each vertex in the graph, namelyu∈ V, we define following attributes:
g(u) total cost to reachu from the start state h(u) heuristic value of u
Succ(u) one-step successors Pred(u) one-step predecessors
A priority queue Q is used to store the open set ofV. The following functions are used to manage Q:
Top() return the state with the smallest priority Pop() delete the state with the smallest priority Remove(u) remove the state ufrom Q
Insert(u, f) insert the stateu with priority f
Pseudo-code
The pseudo-code for Dijkstra and A* algorithms is illustrated in Algorithm 1. In theplan
procedure, we first initialize the state space V by setting the start-to-state value for all the vertices to infinity. The start stateus is assigned with an initialg-value (we select0, but it takes arbitrary finite value) and is pushed onto the priority queue, which is initially empty. The loop in lines 16 to 32 shows the key steps of the algorithm. The list of predecessors for every vertex that has been expanded is maintained, so that the optimal path can be recovered from the final state by recursively selecting the best predecessors. To avoid internal loops, the edge cost c(u, s) must be positive.
is the weight of heuristic and can be adjusted for different purposes. For example, Dijkstra algorithm is a special case of A* with = 0. In some cases, set > 1 is able to achieve fast computation, even though the heuristic value becomesinadmissible [48,108]. Graph Representation
As shown in Figure 2.3, the graph is a representation of the configuration space. A con- figuration space, or C-space, is the space of all configurations of the robot. For a robot with certain geometry inRm, it is represented as a single dot in the corresponding C-space. The actual world where the robot is moving is called the workspace, in which the collision
Algorithm 1 Dijkstra’s and A* algorithms. Given the start and goal vertices us, ug, the algorithm finds the optimal path for problem (2.13). The heuristic weightis equal to0 for Dijkstra and 1for A*.
1: functionRecoverPath(u)
2: P ← ∅;
3: whilePred(u)6=∅ do
4: p←argminp0∈Pred(u)(g(p0) +c(p0, u));
5: P ← hp, Pi; 6: u←p; 7: end while 8: returnP; 9: end function 10: procedurePlan(us, ug, ) 11: for all u∈ V do 12: g(u)← ∞; 13: end for 14: g(us)←0, Q.Insert(us,0); 15: 16: whileQ 6=∅ do 17: u← Q.Top(); 18: Q.Pop();
19: for all s∈Succ(u) do
20: if u6∈Pred(s) then 21: Pred(s)← {u} ∪Pred(s); 22: end if 23: gtmp←g(u) +c(u, s); 24: if gtmp< g(s) then 25: g(s)←gtmp; 26: Q.Insert(s, g(s) +·h(s)); 27: end if 28: end for 29: if u=ug then 30: returnRecoverPath(u); 31: end if 32: end while 33: returnFailure; 34: end procedure
checking between robot’s geometry and obstacles can be non-intuitive. Therefore, we plan in C-space to acquire the optimal and safe path in the workspace. It is straightforward to convert a workspace in Rm into the corresponding C-space in Rm through Minkowski dilation which is the sum of two sets of position vectors:
A⊕B ={a+b |a∈A, b∈B}, A, B⊂Rm. (2.15)
An example inR2is shown inFigure 2.4, in which the robot and obstacles are represented as polygons. In Figure 2.4b, the robot is collision-free anywhere in the white space within the bounding box. The visibility graph [57] is one technique where a graph connects start and goal is constructed in a polygonal map and a shortest path can be found usingAlgorithm 1.
(a) Workspace. (b) Configuration space. (c) Visibility graph.
Figure 2.4: An example of the workspace and the configuration space. As shown in (a), the geometry of the robot is a triangle in 2D. In (b), we dilate the obstacle using Minkowski addition to get the corresponding configurationn space. The visibility graph in (c) can be easily computed based on polygonal map in (b).
Another example is shown in Figure 2.5, in which the robot is treated as a disk and the map is represented as an occupancy grid. An occupancy grid can be constructed from real sensor data, such as scans from laser range finder or depth point clouds from stereo or RGB-D cameras. Compared to the polygonal map in Figure 2.4a, the map in Figure 2.5a is easier to acquire for the real robot. In addition, the grid implicitly indicates a graph in which each cell is connected to its neighboring cells such that we do not need another mechanism like visibility graph. Also, it is straightforward to convert the occupancy grid
into a voxel grid in R3. Thus, the occupancy grid map is often used in robotics for path planning in both 2D and 3D environments.
(a) Workspace. (b) Configuration space. (c) Free cells.
Figure 2.5: An example of the workspace and the configuration space. As shown in (a), the geometry of the robot is a disk. In (b), we dilate the obstacle using Minkowski addition to get the corresponding configurationn space. The free space is consist of cells colored in green in (c).
The map and the graph are two independent representations of the configuration space. Thus, in order to to apply Algorithm 1, a graph in Figure 2.4cor 2.5c is the prerequisite. Deterministic Shortest Path
Once the graphG(V,E)is given, we are able to applyAlgorithm 1to find the shortest path. To plan using the visibility graph in Figure 2.4c, we first connect the start and goal to the graph. The planned path in theC-space is also safe in the original workspace inFigure 2.6 In the occupancy grid map, we can find the corresponding cells for start and goal coor- dinates and further search the shortest path between those two cells usingAlgorithm 1.Fig- ure 2.7b indicates that the output path guarantees the safety in work space, thus planning in theC-space is equivalent to planning in the original work space.
So far, we have introduced the A* graph search algorithm and described its applica- tion to find the shortest path in a graph. In the following paragraphs, we discuss several performance-enhancing variations.