scieee AI-readable full text Open interactive document viewer

Efficient use of 3d environment models for mobile robot simulation and localization

Corominas Murtra, Andreu,Trulls Fortuny, Eduard,Mirats Tur, Josep Maria,Sanfeliu Cortés, Alberto

Abstract

This paper provides a detailed description of a set of algorithms to efficiently manipulate 3D geometric models to compute physical constraints and range observation models, data that is usually required in real-time mobile robotics or simulation. Our approach uses a standard file format to describe the environment and processes the model using the openGL library, a widely-used programming interface for 3D scene manipulation. The paper also presents results on a test model for benchmarking, and on a model of a real urban environment, where the algorithms have been effectively used for real-time localization in a large urban setting.

Full text

Efficient Use of 3D Environment Models for Mobile Robot Simulation and Localization Andreu Corominas Murtra, Eduard Trulls, Josep M. Mirats Tur, Alberto Sanfeliu Institut de Rob`otica i Inform`atica Industrial C/Llorens i Artigas 4-6. 08028. Barcelona. Spain {acorominas,etrulls,jmirats,asanfeliu}@iri.upc.edu http://www.iri.upc.edu Abstract. This paper provides a detailed description of a set of algorithms to efficiently manipulate 3D geometric models to compute physical constraints and range observation models, data that is usually required in real-time mobile robotics or simulation. Our approach uses a standard file format to describe the environment and processes the model using the openGL library, a widely-used programming interface for 3D scene manipulation. The paper also presents results on a test model for benchmarking, and on a model of a real urban environment, where the algorithms have been effectively used for real-time localization in a large urban setting. Keywords: 3D environment models, observation models, mobile robot, 3D localization, simulation, openGL. 1 Introduction For both simulation or real-time map-based localization, the mobile robotics community needs to implement the computation of expected environment constraints and expected sensor observations, the latter also called sensor models. For all these computations, an environment model is required and its fast and accurate manipulation is a key point for successful results of upper-level applications. This is even more important since current trends on mobile robotics leads to 3D environment models, which are richer descriptions of the reality but harder models to process. Using computer accelerated graphics card for fast manipulation of 3D scenes has been addressed by robotic researchers from some yars ago, specially in the simulation domain [4, 2, 1], but it remains less explored in real-time localization. In real-time particle filter localization [8, 3], expected environment constraints and expected observations are computed massively at each iteration from each particle position, causing the software modules in charge of such computations being a key piece for the final success of the whole system. Unlike simulation 2 Corominas Murtra, A. et al. field, there exists few work reporting the use of accelerated graphics cards to implement the online computation of expected observations [5]. Moreover, detailed descriptions on processing 3D geometric models to efficiently compute physical constraints or expected observations are not common in the robotics literature. 3D geometric models have started to become an essential part of mobile robot environment models in recent years, specially for applications targeting outdoor urban environments, and thanks in part to the availability of powerful and affordable graphics cards on home computers. This paper wants to remedy the lack of a detailed description on how to efficiently manipulate such models, presenting in a detailed way the algorithms for an optimal use of the graphics card acceleration through the openGL library [7]. Thanks to their fast computation, the presented algorithms are successfully used for real-time map-based localization in a large urban pedestrian environment, demonstrating the potential of our implementation. The paper begins introducing the 3D environment model in section 2. Section 3 details the algorithms to compute the physical constraints of wheeled platforms within the environment. Section 4 presents the algorithm to compute expected range observations, minimizing the computation time while keeping sensor’s accuracy. Section 5 evaluates the performance of the algorithms and briefly describes a real application example. Finally, section 6 concludes the work. 2 Overview of the 3D Environment Model The goal of our environment model is to represent the 3D geometry of a real, urban pedestrian environment in a useful way for map-based localization and simulation. Thus, the model incorporates the most static part of the environment, such as buildings, floor, benchs, and other fixed urban furniture. Our approach uses the .obj geometry definition file format [6]. Originally developed for 3D computer animation, it has become an open format and a de facto exchange standard. We use two different maps for our intended application. One map features the full environment, M, while the other consists only of those surfaces traversable by the robot, Mfloor, leaving holes instead of modelling obstacles. Figure 1 shows a view of the full model for the UPC (Universitat Polit`ecnica de Catalunya) campus area and figure 2 shows real pictures of this environment and their approximate corresponding views in the 3D model. This environment model implicity defines a coordinate frame in which all the geometry is referenced. Therefore a 3D position can be expressed with respect to the map frame as follows: XM p= (xM p, yM p, zM p, θM p, φM p, ψM p) (1) where the xyz coordinates define the location of the position and the θφψ coordinates parametrize the position attitude by means of the three Euler angles heading, pitch and roll. Efficient Use of 3D Environment Models for Mobile Robot Sim. & Loc. 3 Fig. 1. 3D environment model of the UPC campus area. Fig. 2. Pictures of the UPC campus environment and their approximate corresponding views of the 3D map. The 3D map only models the most static part of the environment. 3 Physical Constraints Terrestrial, mobile robots have position constraints, due to gravity and the environment. Computing such physical constraints is a basic requirement for sim- 4 Corominas Murtra, A. et al. ulation but also for map-based localization, since the search space is reduced dramatically, therefore improving the performance of the localization algorithm. 3.1 Gravity constraints A wheeled robot will always lie on the floor, due to gravity. For relatively slow platforms in can be assumed as well that the whole platform is a rigid body, so that a suspension system, if present, does not modify the attitude of the vehicle. With these assumptions, gravity constraints for height, pitch and roll can be derived from the environment. The height constraint sets a height, zM, for a given coordinate pair (xM, yM). To compute it only the floor map is used. Algorithm 1 outlines the algorithm. The key idea is to renderize the 3D model from an overhead view point, setting a projection that limits the rendering volume in depth and aperture in order to renderize only the relevant part of the model. Afterwards, by means of an openGL routine, the algorithm reads the depth of the central pixel. Algorithm 1 Height constraint algorithm for 3D models INPUT: Mfloor,(xM, yM) OUTPUT: gz setW indowSize(5,5); //sets rendering window size to 5x5 pixels setP rojection(1◦,1, zmin, zmax) //1◦of aperture, aspect ratio, depth limits Xoverhead = (xM, yM, zM overhead,0, π/2,0); //sets an overhead view point, pitch= π/2 renderUpdate(Mfloor, Xoverhead); //renders the model from Xoverhead r=readZbuffer(3,3); //reads depth of central pixel gz=zM overhead −r; return gz; The pitch constraint fixes the pitch variable of the platform to a given coordinate triplet (xM p, yM p, θM p). The algorithm to compute the pitch constraint is outlined in algorithm 2. It employs the previous height constraint algorithm to compute the floor model’s difference in height between the platform’s frontmost and backmost points, gzf and gzb. The pitch angle is then computed using trivial trigonometry, while Lis the distance between the above mentioned platform points. The roll constraint can be found in a similar way but computing the height constraint for the leftmost and rightmost platform points. Please note that the roll constraint applies to all wheeled platforms, but the pitch constraint does not apply to two-wheeled, self-balancing robots, such as ours, based on Segway platforms. 3.2 Offline height map computation The constraints presented in the previous section are computed intensively in filtering applications such as map-based localization. To speed up online computations during real-time execution, a height grid is computed offline for the floor Efficient Use of 3D Environment Models for Mobile Robot Sim. & Loc. 5 Algorithm 2 Pitch constraint algorithm for 3D models INPUT: Mfloor, L, (xM p, yM p, θM p) OUTPUT: gφ xM f=xM p+L 2cos θM p; //compute the platform’s frontmost point yM f=yM p+L 2sin θM p; //likewise gzf =heightConstraint(xM f, yM f); //compute height at frontmost point xM b=xM p−L 2cos θM p; //compute the platform’s backmost point yM b=yM p−L 2sin θM p; //likewise gzb =heightConstraint(xM b, yM b); //compute height at backmost point gφ=atan2(gzf −gzb, L); return gφ; map. Gheight is then a grid containing the height value zMfor pairs (xM, yM), thus being a discrete representation of the height constraint with a xy step γ: Gheight(i, j) = gz(xM p, yM p)|i= (int)xM p−xM 0 γ, j = (int)yM p−yM 0 γ,(2) where xM 0and yM 0are the map origin xy coordinates. The zMvalue is computed offline by means of the height constraint (algorithm 1) along the grid points. Figure 3 shows the height grid for the UPC campus environment. Note that this approach is valid for maps with a single traversable z-level, such as ours, and while our algorithms can be directly applied to multi-level maps further work would be required in determining the appropiate map section to compute. Since computing the pitch and roll constraints requires several zM computations, the height grid speeds up these procedures as well. To avoid discretization problems, specially when computing pitch and roll constraints using Gheight, we use lineal interpolation on the grid. Algorithm 3 summarizes the grid version of the height constraint. Algorithm 3 Grid version of the height constraint INPUT: Gheight,(xM p, yM p) OUTPUT: gz i= (int)xM p−xM 0 γ;j= (int)yM p−yM 0 γ z1=Gheight(i, j); (i2, j2) = nearestDiagonalGridIndex(); //i2=i±1; j2=j±1; z2=Gheight(i2, j); //height of a neighbour cell z3=Gheight(i, j2); //height of a neighbour cell z4=Gheight(i2, j2); //height of a neighbour cell gz=interpolation(z1, z2, z3, z4, xM p, yM p); return gz; 6 Corominas Murtra, A. et al. Fig. 3. Height grid, Gheight, of the UPC campus environment. 4 Range Observation Model Another key factor in dealing with environment models is the computation of expected observations, also called sensor models, or simulated sensors. This is also useful for both simulation and real-time map-based localization. This section outlines how, from a given 3D position in the environment, expected 2D range scans and expected 3D point clouds are computed. A common problem in either case is the computation of range data given the sensor position and a set of sensor parameters like angular aperture, number of points and angular accuracy. To compute these observation models, we use again openGL renderization and depth buffer reading, but the approach specially focuses on minimizing the computation time without violating sensor’s accuracy and resolution. This minimization is achieved by reducing the rendering window size and the renderig volume as much as possible, while keeping the sensor accuracy. The goal of a range observation model is to find a matrix Rof ranges for a given sensor position XM s. Each element rij of the matrix Ris the range computation following the ray given by the angles αiand βj. Figure 4 shows these variables as well as coordinate frames for the map, (XYZ)M, and for the sensor, (XYZ)s. The range observation model has the following inputs: Efficient Use of 3D Environment Models for Mobile Robot Sim. & Loc. 7 Fig. 4. Model frame, sensor frame, angles αiand βj, and the output ranges rij . –A 3D geometric model, M. –A set of sensor parameters: horizontal and vertical angular apertures, ∆α and ∆β, horizontal and vertical angular accuracies, δαand δβ, the size of the range matrix, nα×nβ, and range limits, rmin, rmax. –A sensor position, XM s= (xM s, yM s, zM s, θM s, φM s, ψM s). The operations to execute in order to compute ranges rij are: 1. Set the projection to view the scene. 2. Set the rendering window size. 3. Render the scene from XM s. 4. Read the depth buffer of the graphics card and compute ranges rij . Set the Projection. Before using the openGL rendering, the projection parameters have to be set. These parameters are the vertical aperture of the scene view, which is directly the vertical aperture of the modelled sensor, ∆β, an image aspect ratio ρ, and two parameters limiting the viewing volume with two planes placed at zN(near plane) and zF(far plane)1. These two last parameters coincide respectively with rmin and rmax of the modelled sensor. The only parameter to be computed at this step is the aspect ratio ρ. To do this, first the metric dimensions of the image plane, width, w, and height, h, have to be found. The aspect ratio will be derived from them: w= 2rmintg(∆α 2); h= 2rmintg(∆β 2); ρ=w h; (3) Figure 5 depicts the horizontal cross section of the projection with the associated parameters. The vertical cross section is analogous to the horizontal one. 1zNand zFare openGL depth values defined in the screen space. 8 Corominas Murtra, A. et al. Fig. 5. Horizontal cross section of the projection with the involved parameters. Green squares represent the pixels at the image plane. Set the rendering window size. Before rendering a 3D scene, the size of the image has to be set. Choosing a size as small as possible is a key issue to speed up the proposed algorithm. Since range sensors have limited angular accuracy, we use that to limit the size of image, in order to avoid renderizing more pixels than those required. Given a sensor with angular accuracies δαand δβ, pixel dimensions of the rendering window are to: pα= (int)2tg(∆α/2) tg(δα);pβ= (int)2tg(∆β/2) tg(δβ); (4) Figure 5 shows an horizontal cross section of the projection and the related variables to compute the horizontal pixel size of the rendering window (the vertical pixel size is found analogously). Render the scene. The scene is renderized from the view point situated at sensor position XM s. Beyond computing the color for each pixel of the rendering window, the graphics card also associates to each one a depth value. Moreover, graphics card are optimized to discard parts of the model escaping from the scene, thus having limited the rendering window size and volume speeds up the rendering step. Renderization can be execute in a hidden window. Read the depth buffer. Depth values of each pixel are stored in the depth buffer of the graphics card. They can be read by means of an openGL function that returns data in a matrix Bof size pα×pβ, which is greater in size than the desired matrix R. Read depth values, bkl, are a normalized version of the renderized depth for each pixel. To obtain the desired ranges, we first have to compute the Dmatrix, which holds the non-normalized depth values, that is the depth value Efficient Use of 3D Environment Models for Mobile Robot Sim. & Loc. 9 of the pixels following the Xsdirection: k= (int)(1 2−tg(αi) 2tg(∆α 2))pα;l= (int)(1 2−tg(βj) 2tg(∆β 2))pβ dij =rminrmax (rmax −bkl)(rmax −rmin); (5) The last equation undoes the normalization computed by the graphics card to store the depth values. The Dmatrix has nα×nβsize, since we compute dij only for the pixels of interest. Finally, with basic trigonometry we can calculate the desired rij as: rij =dij cos(αi)cos(βj)(6) Figure 6 shows the variables involved on this last step, showing the meaning of the dij and rij distances in an horizontal cross section of the scene. Equation 6 presents numerical problems when αior βjget close to π/2. This will limit the aperture of our sensor model. However, section 5 explains how to overcome this limitation when modeling a real sensor with a wide aperture. Fig. 6. Horizontal cross section of the projection, with distance dij and range rij of the corresponding klth pixel. The overall procedure is outlined in algorithm 4. Inside the for loops, variables kand lare directly functions of iand jrespectively, so we can precompute expressions in equation 5 for kand l, and store values in a vector. 5 Experimental Evaluation This section presents some results that evaluate the performance of our algorithms. Two range models are presented, corresponding to real laser scanners,