A computer-implemented method for determining an ego pose of a mobile system and generating a 3D ellipsoid-based surfel map of an environment using an optimization problem represented by a factor graph, comprising the steps of - receiving environment sensor data, the environment sensor data having been generated by at least one environment sensor attached to the mobile system for measuring the environment of the mobile system, and the environment sensor data representing the environment of the mobile system as a point cloud in a specific time period in each case, - generating surfels by converting the point cloud of the received environment sensor data into surfel data, - identifying new surfels and previously known surfels in the generated surfels by comparing the surfel data with the surfel map, and - adding a surfel factor (14a, 14a') to the factor graph for the surfels identified as previously known and/or adding a surfel node and a surfel factor to the factor graph for surfels identified as new, wherein a node of the factor graph represents a specific ego pose of the mobile system in map coordinates or, as a surfel node, represents a specific surfel in map coordinates, wherein an edge between a node representing an ego pose and a node representing a surfel represents, as a surfel factor (14a, 14a'), a spatial restriction between the ego pose represented by the node and the surfel recognizable for the environment sensor from said specific ego pose, and comprises a probability distribution of a representability of said surfel for the environment sensor from said specific ego pose, and wherein the factor graph representing the optimization problem is created incrementally after receiving the environment sensor data of a first specific time period and the optimization problem is solved incrementally before the surfel factors (14a, 14a') of the surfels identified as previously known and/or before the surfel nodes and surfel factors of the new surfels are added to the factor graph and the steps are repeated for environment sensor data of a later specific time period than the first specific time period. - receiving environment sensor data, the environment sensor data having been generated by at least one environment sensor attached to the mobile system for measuring the environment of the mobile system, and the environment sensor data representing the environment of the mobile system as a point cloud in a specific time period in each case, - generating surfels by converting the point cloud of the received environment sensor data into surfel data, - identifying new surfels and previously known surfels in the generated surfels by comparing the surfel data with the surfel map, and - adding a surfel factor (14a, 14a') to the factor graph for the surfels identified as previously known and/or adding a surfel node and a surfel factor to the factor graph for surfels identified as new, wherein a node of the factor graph represents a specific ego pose of the mobile system in map coordinates or, as a surfel node, represents a specific surfel in map coordinates, wherein an edge between a node representing an ego pose and a node representing a surfel represents, as a surfel factor (14a, 14a'), a spatial restriction between the ego pose represented by the node and the surfel recognizable for the environment sensor from said specific ego pose, and comprises a probability distribution of a representability of said surfel for the environment sensor from said specific ego pose, and wherein the factor graph representing the optimization problem is created incrementally after receiving the environment sensor data of a first specific time period and the optimization problem is solved incrementally before the surfel factors (14a, 14a') of the surfels identified as previously known and/or before the surfel nodes and surfel factors of the new surfels are added to the factor graph and the steps are repeated for environment sensor data of a later specific time period than the first specific time period.