# XOR Binary Gravitational Search Algorithm with Repository: Industry 4.0 Applications
## 6 Industry 4.0 Applications
### Motion Planning of Industrial Robots Inside a Digital Twin Created by V-REP Software  
Proposed XOR BGSA with repository is used to find the optimal path for an industrial robot in its digital twin environment. The industrial robot used in this part is of a cobot type namely UR5. Cobot is a slang which refers to collaborative robot, generally accepted as any robot designed to operate in close proximity to human workers without need for a separating cage. The problem considered here is to find the shortest collision free path for the robot in 3D space while undergoing a pick and place task. Figure 7 illustrates the digital twin of the manufacturing environment simulated in V-REP software, where there exist a human worker working closely to the robot. Simulations have been carried out using V-REP software, a user-friendly software, which works under various operating systems including Windows. This software V-REP is designed around a versatile architecture with different independently working functions. The options embedded in this  
Figure 6: Evolution of total distance travelled by UR5 versus iterations. Figure 7: Movements obtained from optimization. software can be easily enabled or disabled as required. The communication with this software is possible from ROS using rostopics as well as directly from Python or Matlab using respective API developed specially for this software. A wide range of robots including industrial robots from different companies including Universal Robots are available in this software. The driver included in this software for each of these robots possesses much of real robot features including stopping movement in the case of collision with an object. Real features of robot including maximum speed, maximum joint angles and maximum torque are available in the robot and may be modified at user desire making it replicate the real robot as much as possible. Another feature which exist under V-REP software is its ability to compute the inverse kinematic of robot and find the joint angles of the robot automatically which considerably facilitates robotic simulation. The obstacles in this environment are possible obstacles in real manufacturing environments such as other machines, tools and devices. V-REP software is a robust software for simulating the physical behaviours of objects, including collision between them as well as forces such as gravity and friction that can all be included as part of the software environment. In this way, the user can easily define object positions and orientations while the V-REP software takes care of updating movement of the various other objects and collisions which may happen during motion. As the result is a game like 3D interface, examination of the movement can be easily achieved by the human expert. In this way the human expert can ascertain if there may be problems with the solution that are not specified in the programming. To perform the automated optimization, it is required that the robot movements be encoded in terms of an evolvable array which may then be translated to motions to evaluate cost function and make changes to optimize the problem. A similar approach has been previously done using Ant colony optimization in another software namely Gazebo [28]. However, the benefit of using V-REP versus Gazebo is that the former benefits from built-in inverse kinematic which makes it possible to perform the simulations in a timely manner. A comparative study has been performed previously in [29] which compared V-REP software and Gazebo. It is concluded that V-REP is a more user-friendly and intuitive software than Gazebo in which intelligent optimization can be carried out with more comfort. While Figure 8 depicts the real robot, its digital twin developed in V-REP is depicted in Figure 9. As can be seen from these figures, digital twin matches with real robot in terms of dimensions and position of robot and obstacles, respectively. As can be seen from this figure, several objects as well as the UR5 robot exist in this digital twin.