## 4 Methods
### Case Study Simulation in Unity
#### 4.2.1 Finding Trucks' Shortest Paths without Colliding with the Obstacles  
Informed-RRT* path planning is a powerful algorithm used in motion planning and robotics to find the shortest path between a start and goal configuration in a high-dimensional configuration space. It is designed to consider the cost of motion and other objective functions, such as collision avoidance and smoothness. In this case study, we used the Informed-RRT* algorithm to find the shortest path in which the trucks avoid colliding with the obstacles.  
Blue and red cubes, with the dimensions (K) and (L), represent the LargeTruck and SmallTruck, respectively. Same-size spheres with the radius (r) represent static obstacles that were randomly placed throughout the construction site. Also, bounding boxes and bounding spheres were used to enclose and define the boundaries of trucks and obstacles based on their dimensions. These 3D bounding boxes (such as shown in Figure 7) and spheres represent the minimum area completely covering the objects.  
As an Informed-RRT* path-finding parameter, the Safety Distance (sd) between the trucks and the obstacles was used to ensure that the paths generated by the algorithm safely avoid collisions with obstacles throughout the construction site. To be more specific, sd is the minimum distance that the algorithm maintains between the moving object and the obstacles during the pathfinding process. The sd parameter can be adjusted based on specific safety considerations.  
Figure 6: Earthwork operation simulation in Unity environment (red cube represents the SmallTruck and blue cube represents the LargeTruck. Same-size spheres which are randomly placed on the construction site represent static obstacles).  
We evaluated the trucks' travel paths in Equation (1) as a way to avoid conflicts between them and the obstacles (Figure 8). Here, Point C (\(\kappa_{\text{c}}\), \(y_{\text{c}}\)) and (r) are the center and the radius of the obstacles bounding sphere, respectively. P\({}_{1}\)(x\({}_{1}\), \(y_{1}\)) and P\({}_{2}\) (x\({}_{2}\), \(y_{2}\)) are the cube's center points representing the truck at the starting and the random points, respectively. P\({}_{3}\) (x\({}_{3}\), \(y_{3}\)) is a point on the line between P\({}_{1}\) and P\({}_{2}\) with the shortest distance from point C.  
\[if:|CB_{3}|\geq(r+sd+\
icefrac{{L}}{{2}})\Longrightarrow\text{Collision does not occur} \tag{1}\]  
For the line \(P_{1}P_{2}\), there are two cases to consider. 1: Line \(P_{1}P_{2}\) does not intersect and is outside of the sphere, in which case the value of \(|CB_{3}|\) will either be the same or greater than \((r+sd+\
icefrac{{L}}{{2}})\). 2: Line \(P_{1}P_{2}\) intersects the sphere, or the sd requirement is not met. Therefore, if Equation (1) is true (case 1), there is no collision between the trucks and the obstacles during travel from P\({}_{1}\) to P, and P\({}_{2}\) is added to the list of probable points along the trucks' probable path. Otherwise, if Equation (1) is false (case 2), a collision occurs, P\({}_{2}\) is removed from the list of probable points, and another random point is generated. The iteration continues until the obtained random point P\({}_{2}\) is the truck's endpoint along the path. Therefore, the shortest truck's path is found to avoid a collision with the construction site's obstacles. Figure 9 shows an example of a truck's travel path mapping obtained by Informed-RRT*.  
Figure 8: Collision evaluation between trucks and obstacles along the path obtained by the Informed-RRT* algorithm.  
Figure 7: Truck bounding box example.