# Implementation of Robots Integration in Scaled Laboratory Environment for Factory Automation
## 2 State of the Art
### Mobile Robots for Factory Automation
Loop-closure detection and relocalization of a system is based on DBoW2 [14]. As the map grows, the time required for loop closure defections and graph optimization processes increases. This can lead to significant delay in the loop closure correction, making this approach not completely suitable for use on a real robot. RTAB-Map [15] is a graph-based SLAM approach based on an incremental appearance-based loop closure detector. RTAB-Map is capable of using an RGB-D camera, stereo camera and LiDAR to perform mapping and localization. The detection of loop closures is again done using the bag-of-words approach to determine the likelihood of a new image coming from a previous location or a new location. After loop closure detection, a graph optimizer optimizes the errors in the map. Memory management implemented in RTAB-Map enables its usage in real time on larger environment areas. RTAB-Map can be used alone, with handheld camera, a stereo camera, or a 3D LiDAR for 6 DoF mapping. The integration of RTAB-Map in ROS enables easier implementation on a robot equipped with camera and/or LiDAR. A map generated throughout SLAM is used to autonomously plan the path and navigate the mobile robot in the environment. The path planner generates the trajectory for a robot to follow in order to achieve the desired position in either known or unknown space. Planners are divided into two types, global and local planners. Global planners generate paths based on a static map, from start to the destination point. Global path calculations are, in most cases, slow, making this kind of planner not suitable for dynamic environments. This problem is solved using a local planner, which takes into account the robot motion model, together with sensor data to obtain best possible velocity commands that accomplish the global plan. One of the very popular local planners is a dynamic window approach (DWA) [16]. The DWA algorithm has a goal to maximize an objective function, which takes in account the distance to the target, obstacle proximity and robot's velocity. The result of the algorithm is a velocity pair (\(v\), \(w\)), where \(v\) is the desired linear velocity of a robot, and \(w\) the desired angular velocity. The DWA algorithm consists of several steps. Firstly, the algorithm discretely samples velocities in velocity space. The second step simulates the behavior of a robot for each sampled velocity for a short period forward in time. After simulating the velocities, the algorithm calculates the cost functions and evaluates them to determine which sampled pair gives the best trajectory score. The robot has the predefined set of admissible velocities. Velocities for which the objective function is maximal are selected. Elastic band (EBand) [17] is a real-time algorithm for collision-free motion control. Two key features are used to obtain a collision-free path, 'contraction force' and'repulsion force', respectively. The first one removes slacks in the path, while the other pushes the robot away from obstacles. This creates an elastic band, enabling the robot to smoothly follow the path. Any encountered obstacle further deforms the generated path to avoid them while keeping a smooth trajectory. In [18], the authors presented the timed elastic band (TEB) as an extension of EBand, which, during calculations, takes into consideration a short distance ahead of the global path, creating a local path consisted of multiple way-points. Each way-point represents a temporal goal for a robot to achieve. Following way-points, the robot arrives at desired location. During trajectory optimization, TEB takes into consideration robot kinematics, dynamics, acceleration limits and geometric shape. Optimizing global planner trajectory, TEB fulfills time-optimal objectives, decreasing the trajectory execution time. For the path planner in this work, we used the time elastic band algorithm.