Existing computational cognitive models of spatial memory often neglect difficulties posed by the real world, such as sensory noise, uncertainty, and high spatial complexity. On the other hand, robotics is unconcerned with understanding biological cognition. This thesis takes an interdisciplinary approach towards developing cognitively plausible spatial memory models able to function in realistic environments, despite sensory noise and spatial complexity. We hypothesized that Bayesian localization and error correction accounts for how brains might maintain accurate location estimates, despite sensory errors. We argued that these mechanisms are psychologically plausible (producing human-like behaviour) as well as neurally plausible (implementable in brains). To support our hypotheses, we reported modelling results of neural recordings from rats (acquired outside this PhD), constituting the first evidence for Bayesian inference in neurons representing spatial location, as well as modelling human behaviour data. In addition to dealing with uncertainty, spatial representations have to be stored and used efficiently in realistic environments, by using structured representations such as hierarchies (which facilitate efficient retrieval and route planning). Evidence suggests that human spatial memories are structured hierarchically, but the process responsible for these structures has not been known. We investigated features influencing them using data from experiments in real-world and virtual reality environments, and proposed a computational model able to predict them in advance (based on clustering in psychological space). We have extended a general cognitive architecture, LIDA (Learning Intelligent Distribution Agent), by these probabilistic models of how brains might estimate, correct, and structure representations of spatial locations. We demonstrated the ability of the resulting model to deal with the challenges of realistic environments by running it in high-fidelity robotic simulations, modelled after participants' actual cities. Our results show that the model can deal with noise, uncertainty and complexity, and that it can reproduce the spatial accuracies of human participants.