![occupancy grid mapping vb code occupancy grid mapping vb code](https://i.ytimg.com/vi/3g5k1An_rJk/maxresdefault.jpg)
![occupancy grid mapping vb code occupancy grid mapping vb code](https://user-images.githubusercontent.com/72970001/111978505-3e858580-8b04-11eb-9726-74e98ce94b16.gif)
That’s it! You have defined all of the necessary parameters to create a virtual maze-like environment. The position (0, 0) is at the center of the maze: In the top-right corner of Figure 9-18, you can see this in the light-colored wall, which is at 45 degrees.įinally, you can select either the Pioneer 3DX robot or the LEGO NXT robot using the RobotType and specify where it should start in terms of grid cells using RobotStartCellRow and RobotStartCellCol. Lines that are at an angle or curved are approximated by a lot of separate blocks. If it is running very slowly, try to simplify your environment using only horizontal and vertical lines (East-West and North-South) in the maze bitmap.
OCCUPANCY GRID MAPPING VB CODE SIMULATOR
The final number of blocks is displayed in the console window when the Maze Simulator starts. It tries its best to combine blocks, but there might still be a serious impact on performance. It is very easy to create hundreds or thousands of blocks using the Maze Simulator. The simulator frame rate decreases as more objects are added to the simulation. The WallBoxSize is deliberately a little less than the GridSpacing so that different blocks do not overlap, although adjacent blocks of the same type are combined. The remaining parameters are used to scale the blocks so that you can get a realistic size without having to create an enormous maze bitmap. When you run the Maze Simulator you can push them around. You can see some balls in Figure 9-18 with a checkerboard texture applied to them. Note in the following example that the second block type is a sphere, and from the MassMap just shown it has a mass of 2kg and a size in the HeightMap of 1.5 meters (possibly scaled). The UseSphere flags, one per block type, enable you to create balls instead of blocks. The next few properties control the geometry. It is fun to create blocks that can be pushed around. If you specify the mass as zero, then it means infinite, and the robot will never be able to move blocks of this type. Note that there is no requirement to use the same wall colors as the pixel colors in the maze bitmap, although you will probably confuse yourself if you make them different!Įach of the block types has an associated height in the HeightMap (which is scaled as explained below) and a mass (in kilograms) in the MassMap. Cyan is only there in case the texture file is missing. In this case, however, the cyan color is overridden by the water.jpg texture. Ignore the fact that the configuration file says XYZ - that is just a side-effect of using a Vector3. The values in the following config file equate to cyan (light blue) for block type 0 (which is black pixels in the maze bitmap) and red for block type 1 (which is red pixels). To use a color, leave the corresponding texture empty, i.e. It is a good idea to have a wall enclosing the entire environment so that your robot can’t run away!įor each of the 16 pixel colors, you can specify either a texture file or a color as an RGB value for the corresponding wall blocks. In Figure 9-19, the top-left pixel is white because there is a white border around the outside wall, which is black. The floor color is always taken to be the value of the top-left pixel.