This depends on the type of the environment (outdoors or indoors), since when the robot is outdoors GPS can directly give an absolute location (with its error). When the robot operates indoors, many solutions to the localization problem exist, usually depending on the sensors the robot, or the environment has.
First, if the robot operates in an unknown environment, the problem to be solved is SLAM, since no map exists beforehand. If the robot is equipped with range sensors (e.g. Lidar or sonars), an occupancy grid map can be created using a metric SLAM (e.g. karto SLAM, or gmapping), which usually is the best option due to the high quality of the output map. If the robot does not have range sensors but is equipped with cameras (RGB, not Depth, since depth cameras measure range too), it can perform visual SLAM (e.g. orbSLAM2). Whatever the SLAM algorithm is, when it is executed it does two things: a) updates the map based on the sensors' measurements and b) updates the robot location within the created map.
Finally, when the map is known beforehand, the problem to be solved is Localization, which again, according to the sensors at hand, different approaches exist. The most common approach is called Monte Carlo localization, which is a solution to the global localization problem (i.e. the robot has the map but does not know its initial position in it). The two other localization problems are position tracking (the robot knows its initial pose in the map and tries to correctly update it through the navigation process) and kidnapping problem (the robot does not know its initial pose and at a random time it is "kidnapped" and placed in a new place in the map).
Of course, all the above involve localization, which the robot performs itself. There is another research field that concerns indoor localization with devices that exist in the environment (e.g. BlueTooth tags, UWB tags, and so on). Here is a review of these approaches: Article A Review of Indoor Localization Techniques and Wireless Technologies
Robots can find their location in unknown environments by using various sensors and algorithms suited to their specific settings. Underwater robots rely on sonar and inertial navigation systems to navigate despite challenges like low visibility. Aerial robots, or drones, use GPS and visual odometry to create detailed maps and maintain their position. Ground robots typically combine LIDAR with wheel odometry to detect obstacles and track their movement over different surfaces. By integrating these technologies, robots can navigate in unknown surroundings.
Scientists have leaned on the mathematics of Einstein’s general relativity for an application he likely couldn’t have envisioned: developing navigation systems for microrobots. Researchers converted a 2D maze into an ‘artificial spacetime’, where the robot behaves like a spacecraft bending toward a black hole. The robots reach their target by following projected light patterns and avoiding obstacles in the maze, without the need for heavy navigation equipment or in-flight tracking. “Just plop the robot down, leave it alone, and wait,” says physicist Marc Miskin, who designed the process...