# Sampling-Based Path Planning Algorithm for a Plug & Produce Environment
## 2 Implementation of Path Planning Algorithms  
To obtain collision-free paths, a Plug & Produce environment is modeled in the Robot-studio simulation environment, and a path is generated from all the algorithms mentioned. Given that the path planner is integrated into an agent-based platform, the computational time of the algorithms is also measured and evaluated during path generation. The generated path is tested to make sure that there are no robot configuration errors or other type of errors due to the target being outside of reach. While the path is generated in the Robotstudio environment, the size of the generated corner path can be varied using the zone. The position accuracy of the robot Tool Center Point (TCP) can be directly changed by the zone value in the argument of a move instruction in Robotstudio. The length of the path will be substituted for the corresponding zone specified within the zone data. The TCP of the robot can be operated with different zone values like fine, z50, z100, and z200. While choosing the zone size, the zone data cannot be larger than half the distance of the preceding or succeeding target in the path. If a larger zone is specified, the robot automatically reduces it. Here, \"fine\" specifies that the TCP of the robot will go directly to the specified position, and it will not cut any corners on its way to the next position. On the other hand, z50, z100, and z200 are the different zone values. If z50 is chosen, there will be a 50 mm distance between the target position and the TCP. Similarly, for z100, it is a 100 mm distance and for z200, it is a 200 mm distance between the TCP and the target, but choosing these values makes the path smoother when values increase [50]. Later, the generated path is tested using an ABB IRB 6700 robot and the energy is measured across the move-along time in a real manufacturing scenario. Move-along time has been calculated to find the optimum speed of the robots, and the relation between the speed and the energy consumed by each collision-free path is measured and evaluated. Table 1 outlines the algorithms evaluated in the research presented and each algorithm is explained further down. The industrial testbed environment is shown in Figure 2, which was created in Robotstudio simulation, and the algorithms are implemented. In the testbed industrial environment, there are ten process modules (number 1-10), and each module has the same configurations, thus it can be reused in another location of the testbed. These process modules can be easily plugged into the robot cell and its configuration. Initially, all the five algorithms evaluated were executed in the simulation, without any obstacles to ensure the successful execution of the algorithms to create a path. Later, the algorithms are implemented within the real environment with all the process modules, fencing, components, and the robot to create a collision-free path. The created path was tested and validated throughout to make sure that no errors were introduced due to the robot configurations and the target being outside of reach. The robot configuration error occurs when at least one of the axes of the robot cannot move from the current position to the programmed position with its configuration. This can be addressed with the \(CalcJointT\) function with the error handler in Robotstudio. Once the path validation is successful, it is saved as \(RapidLoadMode\) module in RAPID programming in Robotstudio.