Skip to content

Mapping Hints and Tips

clakell edited this page Jun 24, 2014 · 20 revisions

Before You Start: This tutorial assumes you have a basic understanding of what Project Tango can do, familiarity with the Android OS and ADB, and have installed MeshLab and played with its tools. Information on ADB, how it works, and what you can do with it can be found here. MeshLab can be installed on a Windows machine or a Mac from here and the documentation for it can be found here. Helpful tutorials can be found here and here for more complex options.

tl;dr version- Retrieving the meshes: We will use adb from your console to retrieve the files. After connecting and unlocking the device, open your console. This could be Terminal on a Mac or Linux machine or CMD on a Windows machine. If you do not already have ADB installed, click here for Windows, here for Mac, or here for Linux. type:

> adb devices

Make sure you see a device on this list. If not, unplug and replug the device into your computer. Then

> adb shell opens up a new shell with root access.

Type:

> cd data/data/com.motorola.atap.tangomapper/files/octomap_meshes and then

> ls or > dir on a PC.

If your scans were successful, you should get a list of timestamped folders. Write down the names of the folders you want to download. For example, if you took 3 scans, write down the names of the last 3 folders. Type:

> exit and hit return to exit the console and go back to your local drive.

Now you will need to pick a location for your files to go. For the desktop, "/Users/clarakelley/Desktop" on Mac, "C:\Users(username)\Desktop" on Windows Vista and up, and /home/(username)/Desktop/ for most Linux systems. This path can vary, so be sure to check by typing

> cd (path chosen) and then

> ls to make sure it is what you expect.

To download the files to your drive we will use adb pull. This cannot be done with Android File Transfer, as the data folder is hidden. adb pull requires a "from" directory and a "to" directory. type:

> adb pull cd data/data/com.motorola.atap.tangomapper/files/octomap_meshes/(the name of the first folder) (the path you chose)

If you receive an error, double check that all of the paths are correct. Otherwise, run this line again with another folder name saving the files to a new folder. If you use the same destination folder the meshes will overwrite each other and you will have to download the first ones again. Repeat this process until you have saved all of the scans locally.

To Begin Scanning: To make the most accurate maps, use Project Tango's "Tango Mapper" in "Dense Mapping" mode. Pick an appropriate resolution (see the sections below), find a well-lit area, and press "Superframes Small-Peanut." Keep your scan time to the absolute minimum, and hold the device in landscape angled about 30 degrees from parallel to your body and try not to change the angle very much. If at any time the scan does not seem to be working, you want to change a setting, or you want to restart the scan, exit the app and close it by removing it from the Recent Apps menu. Do not press the back button, or attempt to go back into the app once you have hidden it.

This is what happens if you hold the device too close to a surface. Notice the path length, though the device had not moved. What happens if you get too close to a surface This is the interface for Dense Mapping. These are ideal settings. Image of the interface. These settings are for high quality scans. This is a mesh created without tilting the device around the chair: without tilting This is a mesh that was created by tilting the camera to capture all angles: with tilting Tilting the device is not a problem, but putting it parallel to the floor may cause the image to misalign.

Small Spaces: The key to small spaces is taking several short scans and choosing the best one. Using the highest resolution, cover the area completely - watch the map on the right to find holes. If you see that the image looks nothing like the area before you, start over. Use smooth motions: jarring the phone will influence accelerometer data. Do not let the device get really close to objects: stay at least 2 feet away from any surface. This is an example of a small area scan with high definition: Example of small area scan

Large Spaces: Large spaces will require you to walk out a long path. Because this scan takes longer, you may need to use a lower resolution in order to cover the space. Remember, you can take multiple scans and combine them. It is better to get several smaller clean scans that can be merged together rather than one large scan that is full of noise and will take hours to clean. If you are scanning an area with a lot of right angles, use the first 2-3 seconds of the scan to hold the device against a perfectly parallel object (See the photo below) for flatter walls and cleaner surfaces.Keep moving at a constant speed in straight lines. Turn slowly and carefully. Tilt forward and back to "paint the walls" and gather consistent data about flat surfaces. Don't forget to scan the ceiling and the floor for complete models. For clean edges, hold the device parallel to a surface as you start up the scanning. Holding the device parallel to the walls This is an example of a large high definition scan: Example of a complete larger scan This is the same area scanned in low definition: This is the same space with a smaller resolution This is a very large scan. It is very messy. It would be better to take a few smaller scans than attempt to fix this: Example of a large messy scan

Scanning Objects: The device can also be used to scan objects with mixed results. Large, simple objects (like a couch) give the best results. Avoid shiny or small objects at all costs. Use the highest resolution possible, get every angle you can, and keep the scan short. This is a scan of an office chair. It came out quite clean! Image of office chair On the other hand, a small reflective mug does not even appear in the image on the right. Screenshot: small mug scan

Important Gotchas: When possible, freeze the device beforehand. Wrap the device in some fabric to prevent freezer burn and condensation from affecting the components. The colder temperature allows scans to be larger and more complex before overheating occurs. If you press pause, or clear the map, your files may not save properly. Instead of clearing or pausing, restart the app for best results. Light sources both create holes and can disrupt the scans. For best results, do not point the camera lens at any light source (digital screens, overhead lamps, etc). The device may occasionally lose track of your location. This is called drift.If this does happen, save and restart the scan, otherwise any new data will be offset from the older points. If this happens often, leave the device on a flat surface for the first few seconds of a scan.

This is a perfect example of drift. Notice that the walls do not line up at the starting location of the scan. Drift image

When saving, leave the app open a few seconds (3-4) after pressing Save Mesh to allow the device to compile its data. If you find that the maps continually come out with "wavy walls" (see image below), hold the device against a surface parallel to a wall according to the information for large spaces. When scanning however, hold the device tilted at an angle.

This is what "wavy walls" look like: Example of wavy walls This is what clean edges look like when the device is started held to a perfectly parallel object: Clean edges (small area)

Cleaning up meshes: The most success can be found in using MeshLab - a free cross-platform 3D editing software. Be warned: there is no undo function, so make sure to save often. Select all of the meshes from a scan and open them. MeshLab should open automatically. If it does not, open it from your Applications folder or the start menu and use the File -> Import Mesh menu to locate the files. Before you do anything else, right-click (left click on a Windows machine) on a mesh in the Layer Dialog (if its hidden, go to View -> Show Layer Dialog) and select Flatten Visible Layers. Finally, save and export this file by using File -> Export Mesh, naming it, and pressing Save. For a first pass, use Filters -> Cleaning and Repairing -> Remove Isolated Pieces (wrt Diameter) to remove floating objects. However, this only removes the faces. To apply the changes, select all the faces using Edit -> Select Faces in a Rectagular Region and dragging a box over the mesh. Next, use Filters->Selection->Select Vertices from Faces, then Filters->Selection->Invert Selection and finally Filters->Selection->Delete Selected Vertices.

To combine scans into a larger area import both of the combined files, usually with the layer name "Merged Mesh," into the same project. Use File->Align to put the pieces together. Select one mesh and press "Glue Here Mesh." Select the second file, and press "Point Based Gluing." Follow the given instructions, picking four (or more) points by double clicking that are contained by both models. Press "OK" and then "Process."

For more information on modifying these meshes, continue onto the next tutorial here about modifying meshes for Unity and making them smooth or another tutorial here about using the meshes to create maps for ROS.