> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dwe.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Coverage Mapping (VSLAM)

## Overview

<Warning>
  **VSLAM is a beta product.** While we are actively refining and testing, you
  may encounter occasional bugs, performance dips, or unexpected behavior.
  Please submit bug reports and feature requests to our team at [support@dwe.ai](mailto:support@dwe.ai).
</Warning>

DeepWater Desktop can automatically create a dense reconstruction of your environment, useful for live coverage mapping and measurements.

## Requirements

* SVC Pro Module - Running dweOS Pro
* Topside Computer/Laptop - Running DeepWater Desktop

## Launch Parameters

<Steps>
  <Step title="Change network protocol">
    Open the "Add Stream" dialog, select your cameras, and switch the Network Protocol to Coverage Mapping. Check out [our quickstart guide](/dw-desktop/quickstart) for info on how to do this.

    <Frame caption="">
      <img width="400px" src="https://mintcdn.com/deepwaterexplorationinc/XQu0YI4ZP0f0zWio/dw-desktop/guides/images/vslam/dw-desktop-vslam-1.png?fit=max&auto=format&n=XQu0YI4ZP0f0zWio&q=85&s=d13d554be6d25dbf8a23f0360d013bf1" data-path="dw-desktop/guides/images/vslam/dw-desktop-vslam-1.png" />
    </Frame>
  </Step>

  <Step title="Adjust tracking and filter parameters (Optional)">
    <Info>
      Stick to the default parameters for the best out-of-the-box experience. Manual
      tuning is entirely optional and reserved for advanced performance
      optimization.
    </Info>

    VSLAM tracking performance can be optimized for your environment by adjusting the tracking and voxel filter parameters.

    <Card title="Tracking & Filter Parameters" icon="sliders" href="/dw-desktop/guides/vslam-parameters" horizontal>
      Reference for tuning VSLAM tracking and voxel filter parameters.
    </Card>
  </Step>

  <Step title="Start the Stream">
    Hit the "Start Stream" button. Once the stream initiates, DeepWater Desktop will begin processing your data.
    You should now see a 3D point cloud being generated as your camera moves around.

    If you plan on post-processing the data, start a recording here as well.

    <Frame caption="">
      <video playsinline="true" muted="muted" autoplay="autoplay" loop="loop" preload="metadata" type="video/mp4" src="https://dwe.ai/cdn/shop/videos/c/vp/ced793c107f24d01881ef1f911c640db/ced793c107f24d01881ef1f911c640db.HD-1080p-7.2Mbps-85197215.mp4?v=0" />
    </Frame>
  </Step>
</Steps>

## Loop closures

All SLAM systems accumulate error over time. To correct for this, we use the concept of loop closures-- viewing the same location from the same pose at different points in time.
DeepWater Desktop automatically recognizes loop closures and adjusts previously measured poses and point clouds accordingly.

To initiate a loop closure, simply travel back to a previous pose and face in the same direction. A message will pop up in the bottom-right corner:

<Frame caption="">
  <img width="250px" src="https://mintcdn.com/deepwaterexplorationinc/XQu0YI4ZP0f0zWio/dw-desktop/guides/images/vslam/dw-desktop-vslam-loop-closure.png?fit=max&auto=format&n=XQu0YI4ZP0f0zWio&q=85&s=a729873ad91a59c98e980d2519bf7b56" data-path="dw-desktop/guides/images/vslam/dw-desktop-vslam-loop-closure.png" />
</Frame>

indicating that a loop closure has happened, followed by
a global adjustment of the pointcloud and previous poses.

<Frame caption="Point cloud before loop closure with accumulated error">
  <img width="400px" src="https://mintcdn.com/deepwaterexplorationinc/XQu0YI4ZP0f0zWio/dw-desktop/guides/images/vslam/dw-desktop-vslam-pre-loop-closure.png?fit=max&auto=format&n=XQu0YI4ZP0f0zWio&q=85&s=fad615fd06e541445793ba14d0911256" data-path="dw-desktop/guides/images/vslam/dw-desktop-vslam-pre-loop-closure.png" />
</Frame>

<br />

<Frame caption="Point cloud after loop closure with corrected poses">
  <img width="400px" src="https://mintcdn.com/deepwaterexplorationinc/XQu0YI4ZP0f0zWio/dw-desktop/guides/images/vslam/dw-desktop-vslam-post-loop-closure.png?fit=max&auto=format&n=XQu0YI4ZP0f0zWio&q=85&s=65d7803a4e9abcca452e2212203667f7" data-path="dw-desktop/guides/images/vslam/dw-desktop-vslam-post-loop-closure.png" />
</Frame>

## Maps

Upon losing tracking for an extended period, the system will create a new map from scratch. All previous maps are saved in memory, and can be viewed
by clicking their labels in the top-right corner:

<Frame caption="The highlighted map is the one currently being added to.">
  <img width="250px" src="https://mintcdn.com/deepwaterexplorationinc/XQu0YI4ZP0f0zWio/dw-desktop/guides/images/vslam/dw-desktop-vslam-map-selection.png?fit=max&auto=format&n=XQu0YI4ZP0f0zWio&q=85&s=94f7e91e338e8955ffa17ad54619f551" data-path="dw-desktop/guides/images/vslam/dw-desktop-vslam-map-selection.png" />
</Frame>

Don't worry about losing tracking over short periods, as maps are automatically merged when possible. Upon discovery of overlapping sections, you will receive
this message:

<Frame caption="">
  <img width="250px" src="https://mintcdn.com/deepwaterexplorationinc/XQu0YI4ZP0f0zWio/dw-desktop/guides/images/vslam/dw-desktop-vslam-map-merge.png?fit=max&auto=format&n=XQu0YI4ZP0f0zWio&q=85&s=b6d1fa6a408c4f97b30caf446e75a5e9" data-path="dw-desktop/guides/images/vslam/dw-desktop-vslam-map-merge.png" />
</Frame>

and after a short wait, the point cloud will reflect the changes.

Automatic map creation can be toggled on/off by pressing <kbd>Z</kbd> or the Map button. If it's off the system will only try to locate itself relative to existing maps.

<Frame caption="">
  <img width="250px" src="https://mintcdn.com/deepwaterexplorationinc/XQu0YI4ZP0f0zWio/dw-desktop/guides/images/vslam/dw-desktop-vslam-togglemap.png?fit=max&auto=format&n=XQu0YI4ZP0f0zWio&q=85&s=02e4f48e93132e0b88bad9f76a4bf613" data-path="dw-desktop/guides/images/vslam/dw-desktop-vslam-togglemap.png" />
</Frame>

## Tools and Controls

### Navigation

When the Scene view is focused, use the following controls to move the virtual camera:

| Control                                                      | Action                  |
| ------------------------------------------------------------ | ----------------------- |
| <kbd>W</kbd> / <kbd>S</kbd>                                  | Move forward / backward |
| <kbd>A</kbd> / <kbd>D</kbd>                                  | Move left / right       |
| <kbd>E</kbd> / <kbd>Q</kbd>                                  | Move up / down          |
| <kbd><Icon icon="computer-mouse" /> Right-click</kbd> + drag | Pan the view            |

<Frame caption="Camera position can be reset by hitting this button.">
  <img width="250px" src="https://mintcdn.com/deepwaterexplorationinc/XQu0YI4ZP0f0zWio/dw-desktop/guides/images/vslam/dw-desktop-vslam-resetcamera.png?fit=max&auto=format&n=XQu0YI4ZP0f0zWio&q=85&s=5ca0ce440191a9a4d0e9f1e267545b01" data-path="dw-desktop/guides/images/vslam/dw-desktop-vslam-resetcamera.png" />
</Frame>

### Ruler

Hit <kbd>Space</kbd> to pause the stream.
Press <kbd>R</kbd> or select the Ruler icon in the bottom-right corner to activate the Ruler tool. Select two points to see the distance between them.

<Frame caption="">
  <video playsinline="true" muted="muted" autoplay="autoplay" loop="loop" preload="metadata" type="video/mp4" src="https://dwe.ai/cdn/shop/videos/c/vp/b687eeb8036540dc88ba9982ba5aa4b4/b687eeb8036540dc88ba9982ba5aa4b4.HD-1080p-7.2Mbps-85197296.mp4?v=0" />
</Frame>

### Color Mode

Press <kbd>C</kbd> or select the color palette icon in the bottom-right corner to toggle between Texture and Coverage viewing modes.

<Frame caption="Texture mode shows the average observed RGB color for each point.">
  <img width="400px" src="https://mintcdn.com/deepwaterexplorationinc/XQu0YI4ZP0f0zWio/dw-desktop/guides/images/vslam/dw-desktop-vslam-texture-mode.png?fit=max&auto=format&n=XQu0YI4ZP0f0zWio&q=85&s=7ce4cda80da8dfe376ea4ffe5d4e2342" data-path="dw-desktop/guides/images/vslam/dw-desktop-vslam-texture-mode.png" />
</Frame>

<br />

<Frame caption="Coverage mode shows the nearest distance at which each point was observed. Red is closer, blue is further. Uses the same color mapping as the depth view.">
  <img width="400px" src="https://mintcdn.com/deepwaterexplorationinc/XQu0YI4ZP0f0zWio/dw-desktop/guides/images/vslam/dw-desktop-vslam-coverage-mode.png?fit=max&auto=format&n=XQu0YI4ZP0f0zWio&q=85&s=db74254149ca6e0ecc86097f67728bff" data-path="dw-desktop/guides/images/vslam/dw-desktop-vslam-coverage-mode.png" />
</Frame>

Coverage mode makes it easier to spot which sections are lacking detail.

| Color                                                                             | Observed distance | Detail                                        |
| --------------------------------------------------------------------------------- | ----------------- | --------------------------------------------- |
| <Badge color="orange" stroke>Orange</Badge> <Badge color="red" stroke>Red</Badge> | Up close          | Good detail                                   |
| <Badge color="green" stroke>Green</Badge> <Badge color="blue" stroke>Blue</Badge> | From a distance   | Lower detail — may benefit from a closer pass |

## Troubleshooting

### Configuring UDP Receive Buffers

RTP packets can be discarded due to insufficient UDP receive buffer size. We recommend manually increasing it as the default is often insufficient for properly capturing
full frames.

<Tabs>
  <Tab title="Linux" icon="linux">
    We recommend setting the max OS receive buffer size to 8MB:

    ```bash theme={null}
    sudo sysctl -w net.core.rmem_max=8338608 
    sudo sysctl -w net.core.rmem_default=8338608 
    ```
  </Tab>

  <Tab title="Windows" icon="windows">
    <Steps>
      <Step>
        Open Device Manager and right-click on the network adapter the SVC is connected on. Open the "Properties" page.

        <Frame caption="">
          <img width="400px" src="https://mintcdn.com/deepwaterexplorationinc/XQu0YI4ZP0f0zWio/dw-desktop/guides/images/vslam/dw-desktop-vslam-device-manager.png?fit=max&auto=format&n=XQu0YI4ZP0f0zWio&q=85&s=02bd8713c60b218202cdc24e28cd38d2" data-path="dw-desktop/guides/images/vslam/dw-desktop-vslam-device-manager.png" />
        </Frame>
      </Step>

      <Step>
        Go to the "Advanced" tab and then select "Receive Buffers." Set it to either 1024 or the highest acceptable value.

        <Frame caption="">
          <img width="400px" src="https://mintcdn.com/deepwaterexplorationinc/XQu0YI4ZP0f0zWio/dw-desktop/guides/images/vslam/dw-desktop-vslam-receive-buffers.png?fit=max&auto=format&n=XQu0YI4ZP0f0zWio&q=85&s=ae6fa1b22d8b7a75f7fe6ab424a524e8" data-path="dw-desktop/guides/images/vslam/dw-desktop-vslam-receive-buffers.png" />
        </Frame>
      </Step>
    </Steps>
  </Tab>
</Tabs>
