1. A method of mapping an environment, the method comprising: estimating a first current pose of a robot driving in an environment based on parameters measured by the robot, the robot having a visual sensor and the parameters including obstacles and clear spaces; defining a first local origin that represents an estimate of the first current pose, wherein the first local origin is one of a plurality of local origins; generating a first map of the measured parameters, wherein the measured parameters are mapped relative to the first pose; after driving a determined period of time, determining an estimate of a second current pose of the robot; determining an uncertainty between the estimate of the first current robot pose and the estimate of the second current pose of the robot; and responsive to the uncertainty being greater than a first threshold, then: defining a second local origin that represents the estimate of the second current pose of the robot; and generating a second map of measured parameters mapped relative to the second current pose.