# Jupyter Notebooks in Undergraduate Mobile Robotics Courses: Educational Tool and Case Study
## 4 Methods
### Educational Tool
#### 4.2.2 The Collection of Jupyter Notebooks
4:_ Robot Localization  
_Problem description._ Mobile robot localization is the problem of determining the pose of a robot relative to a given map of the environment by using sensory information [13; 59]. It arises from the fact that a robot is unable to sense it directly, it ought to infer the pose from external information. Most mobile robot tasks revolve around movement, e.g., an unmanned vehicle needs to reach a destination, a vacuum cleaner has to traverse all areas of a house, etc. Therefore, it needs to know its position within the specified environment. Some of the problems faced in real world robot localization are: dynamic environments, indistinguishable locations, unreliable sensors, etc. Once again, a probabilistic approach helps to mitigate these issues to a great extent. Typical techniques addressing this problem are the Extended Kalman Filter (EKF) [66], map registration, Least Squares Localization [67], or Particle Filters [59]. _Proposed notebook._ This lesson revolves around pinpointing the pose of a robot, given a set of known landmarks (beacons), whose real-world counterpart could be WiFi or GPS signals for example. The students are meant to implement some localization algorithms to solve this problem and analyze their results. The suggested algorithms are the popular Extended Kalman Filter (EKF) and Least Squares Localization. Afterwards, they can test them in the demos provided in the notebook, which are similar to the ones in the previous _lab_ (see Figure 4a). Figure 4: The Extended Kalman Filter (EKF) in action. (**a**) Demo using the EKF algorithm for robot localization. The contents of the figure represent: the expected pose in red, the true pose in blue and the estimated pose and confidence (using EKF) in green. The cyan squares are the different landmarks to be observed. (**b**) Execution of the EKF algorithm for Mapping. The green stars represent the real pose of each landmark. The different points and ellipses are the estimated poses and their associated uncertainties in the generated map. _Lab. 5_: Mapping  
_Problem description._ Mapping is another fundamental topic in the field of mobile robots, being a prerequisite for robot localization, motion planning, etc. In the previous _labs_ it was assumed that the robot had perfect knowledge of the environment--i.e., a map is provided. However, in real world applications such a map can be missing or, if provided, it could contain obsolete information (e.g., a chair changed its location). Thus, the ability to map working environments has become a core necessity for autonomous robots [68; 69]. There exist different map representations, being the most common geometric maps, topological maps, and semantic maps [70]. The choice of the map representation ultimately depends on the application where the robot will be used. The creation of reliable maps is a complex problem, being one of the main concerns its dimensionality. The real world is a continuous space containing an infinite amount of detail. Even when trying to reduce said dimensionality (i.e., using a grid approximation) the performance of the methods can easily degrade proportionally to the environment's space. Fortunately, there are mapping methods that have proved their suitability under certain circumstances [62], including Least Squares, the Extended Kalman Filter, and Occupancy Gird Maps [71]. _Proposed notebook._ This _lab_ tasks the student to create a map of an environment composed by a number of unique landmarks, which the robot is able to distinguish (see Figure 4b). While building the map, and in contrast to the previous sessions, the location of our robot is assumed to be perfectly known during its whole operation. The selected algorithm to accomplish this endeavor is the familiar EKF algorithm, which was introduced to the students in a previous notebook. While the core concepts of the algorithm remains the same, it presents some relevant differences when it is applied to mapping.