# Robots in Partially Known and Unknown Environments:
## 4 AdaptiveRMP Framework
### OnlineRMP  
The goal of OnlineRMP is to find a feasible route for the robot to navigate from a starting point to a target point in an environment where the location of obstacles is entirely unknown. Because planning is performed in real time, it is essential to perform it in low execution times. The same representation of OfflineRMP is used for OnlineRMP. Because information about the environment is not always known, path planning in real time is closer to reality, where the robot collects information from the environment on the fly and re-plans the path if necessary. To solve the planning problem in an unknown environment, initially, the robot has the information in the map resolution and the starting and ending positions. Sensors enable the robot to discover two cells around it, as shown in Figure 9. Here, the robot is shown in black, white cells show the space that can be observed by the robot, and, in gray, those that are out of sight are shown. Figure 8: Solution generated for back_and_forth instance before post-processing in (**a**) and after post-processing in (**b**). Blue circles represent the start and target positions. Obstacles are shown in gray and the route is shown in red. Figure 7: Applying the movement of simulated annealing with obstacles. The current solution is shown in (**a**), and the new solution obtained is shown in (**b**). A greedy method is used to construct initial solutions. For the construction of a path between two positions, the surrounding strategy, the pruning of non-feasible sub-path, and the pile of directions used by the OfflineRMP are also adapted. As the robot advances, information about the environment is updated with its available vision range. In this case, it can create an unfeasible solution given the unknown obstacles. If the robot is close to colliding, it will be necessary to re-plan the path. It is important to note that the re-planning of the path will occur only on the remaining path and up to the length of the obstacle that is within the current vision range. Because the planning is performed in real time, the path already traveled cannot be modified. Moreover, since the remainder of the way is unknown, re-planning the path to the end is forbidden. Once the re-planning is performed, the robot advances until it is close to colliding with a new obstacle, generating a new re-planning. This continues until the robot reaches the ending point or it cannot continue because an obstacle is found. Given the limited vision of a robot, only a portion of the obstacle may be known when using the surrounding strategy. When new information is available, the robot will decide to go around to the object from the right or the left. This can cause the robot to become caught. For this, the normal vector for the movement direction and the obstacle is considered. Figure 10 shows the surrounding change as the robot moves around an obstacle. The black square represents the robot, the obstacle is in gray, and the path is in red. The current direction and its normal vector are shown in green and blue, respectively. At each step, the normal direction is verified pointing to the obstacle; if it is, then the previous orientation of the surrounding strategy is maintained. If the normal direction is not pointing to the obstacle at any moment, the robot is no longer circling the same obstacle. In this case, the next re-planning of a new surrounding orientation may be random. Because the flood-fill algorithm described in Section 4.1 is expensive for high-resolution instances, it is used only in the case when the robot tries to go around an obstacle and the two orientations (left or right) are unfeasible. In this case, the robot follows an unfeasible path, so flood-fill is used. It can also be used when the robot tries to go around an obstacle and reaches the same point from where it started; that is, an obstacle surrounds the target point.