SPECIAL OFFERS

system76

laptops

desktops servers

swag

Do-It-Yourself Augmented Reality Sandbox

The Augmented Reality Sandbox was developed by Oliver Kreylos at UC Davis.
In hopes of giving this awesome software wider exposer and making it easier to

consume, Sysem76 packaged this software for Ubuntu and wrote this tutorial.

Required Hardware
This tutorial focuses on insalling and calibrating the software, but wont cover the
details of the hardware setup.
For detailed information on the hardware setup, see the AR Sandbox hardware
tutorial, but in brief you'll need:
A:

A frs generation Kinect

B:

A short-throw digital projector like the BenQ MW632ST

C:

A sandbox for your sand (our sandbox is 40 inches by 30 inches by 8 inches)

D:

Roughly 200 pounds of white sand like Sandtasik White Sandbox Sand

E:

A Linux-friendly computer with a fas NVIDIA GPU, running Ubuntu 14.04 or
16.04 (any favor).
In terms of Sysem76 computers we recommend either:
Oryx Pro laptop with a 980M GPU, or
Wild Dog Pro desktop with a GTX 980 GPU

Insall Software
A:

You'll need a computer running Ubuntu 14.04 or 16.04.

B:

Add the needed PPA and insall the software by opening a terminal and
running these three commands:
sudo add-apt-repository -ys ppa:system76-dev/weekend-project
sudo apt-get update
sudo apt-get install arsandbox

C:

Find out what your user-name is by running this command in the terminal:
whoami

D:

Add yourself to the vrui-grp group with this command, replacing USERNAME
with the user-name returned by the whoami command above:
sudo adduser USERNAME vrui-grp

E:

Reboot your computer so all the above changes take efect.

Calibrate Kinect
A:

Plug in your frs-generation Kinect device, then open a terminal and run:
KinectUtil getCalib 0
This will download the intrinsic calibration parameters directly from your
Kinect's frmware and then write the result to a fle in /etc/Vrui-3.1/Kinect-2.8/ .

C: The depth view needs to cover the entire interior of your sandbox. the right is the sandard camera view: The Augmented Reality Sandbox only uses the depth view (left). but the camera view (right) is sill helpful in aligning your Kinect. It's okay if it overlaps it slightly.Align Kinect above sandbox A: Open a terminal and run: RawKinectViewer -compress 0 B: Maximize this window so it's easier to see your sandbox: The image on the left is the depth view. .

D: Hit Esc to close the RawKinectViewer. On the other hand. launch the RawKinectViewer: RawKinectViewer -compress 0 . which is what we'll do in this example: B: From a terminal. you can calculate the base plane using a region on the foor of your sandbox. you can calculate the base plane by placing a piece of poser board (or a similar fat surface) on top of your sandbox. if you've already fled your sandbox with sand. If you haven't yet flled your sandbox with sand. Calculate base plane A: There are two ways to calculate the base plane.

then release the 1 key: . then release the mouse button: E: Press and hold the 1 key. move your cursor over Extract Planes. move your cursor over Average Frames.C: Maximize this window so it's easier to see your sandbox: D: Press and hold the right mouse button.

Start with your cursor near the top-left corner of your fat surface. drag out a rectangle toward the bottom-right corner. then release the 1 key: . You want some space between your rectangle and the edges of your fat surface. Press and hold the 1 key.F: You now need to draw a rectangle that fts within the interior of your fat surface (in the depth view).

6/BoxLayout.txt J: Pase the line you jus copied over the frs line in the BoxLayout.txt fle.txt fle by running this command from the terminal: gedit /etc/SARndbox-1. You also need edit this line. H: In the terminal you'll see two lines printed. then right click and select Copy: I: Edit the BoxLayout." (comma). You should end up with a frs line something like this: . Select the portion of the 2nd line shown below.G: Hit Esc to close the RawKinectViewer. replacing the "=" (equal sign) with a ".

B: From a terminal. Measure 3D extents of sand surface A: This sep requires you to have fled your sandbox with sand. but it doesn't need to be perfectly level. again launch the RawKinectViewer: RawKinectViewer -compress 0 C: Maximize this window so it's easier to see your sandbox: . you'll need to remove it for this sep. You want the sand surface to be as level as possible.K: Save the fle and close gedit . If you placed a piece of poser board (or another fat surface) on top of your sandbox in the previous sep.

move your cursor over Average Frames. then release the mouse button: E: Press and hold the 1 key.D: Press and hold the right mouse button. then release the 1 key: . move your cursor over Measure 3D positions.

then press the 1 key: Note there is no feedback from the UI when you press the 1 key. . move your cursor to the lower-left interior corner. Firs. Position your cursor so that there's a small amount of space between the sand surface and the sides of your sandbox.You'll now measure the 3D extents of the interior of the sandbox F: Use the color-coded depth map to make sure you position your cursor over the sand surface and not over the sides of your sandbox.

G: Second. then press the 1 key: . move your cursor to the lower-right interior corner.

H: Third. then press the 1 key: . move your cursor to the upper-left interior corner.

You need to highlight these four lines as shown below. then right click and select Copy: L: Edit the BoxLayout.txt with the four lines you jus . K: In the terminal you'll see four lines printed. move your cursor to the upper-right interior corner.I: Finally.6/BoxLayout.txt fle by running this command from the terminal: gedit /etc/SARndbox-1.txt M: Replace the bottom four lines in BoxLayout. then press the 1 key: J: Hit Esc to exit RawKinectViewer .

Position projector A: If you haven't already.copied. so you end up with something like this: N: Save the fle and close gedit . turn on your projector and plug it into your computer. you'll fnd it easier if you setup the two displays to be mirrored: . B: If you have a dedicated display in addition to the projector.

we also recommend you set the Ubuntu launcher to autohide: D: Launch the XBackgroud tool from a terminal like this: .C: As the full-screen hotkey for the Augmented Reality Sandbox currently dosen't work under Unity.

It's okay if it overlaps slightly. hit Esc to close the XBackgroud application. . You want the sand surface to be as level as possible. Calibrate AR Sandbox A: As with sep 5. but it doesn't need to be perfectly level. F: After you're done positioning your projector. this sep requires you to have fled your sandbox with sand.XBackground E: You'll need to position the projector so that it flls the interior of your sandbox.

C: Launch CalibrateProjector from a terminal like this: . you'll need to capture tie-points at at leas two heights (24 total tie-points). A few rolls of tape make great spacers. Note the rolls of tape need to have a diameter smaller than the CD or DVD you're using for the alignment target. At each height. For a decent calibration. you'll capture 12 tie-points. we recommend capturing tie-points at three diferent heights (36 total tie-points). The cross-hairs should be at right angles to one-another and be centered on the CD or DVD. For an optimal calibration. you'll need an alignment target and several spacers to help you perform the alignment at multiple heights: The easies way to build an alignment target is to create a target cross-hair on a piece of paper and tape it to the top of an old CD or DVD.B: To calibrate your sandbox.

but our particular BenQ projector allows us to force a 4:3 aspect ratio even when the resolution is a 16:9 aspect ratio. The Kinect itself has a 4:3 aspect ratio. move your cursor over Capture. so a resolution like 1024x768 or 1600x1200 is bes. we launched CalibrateProjector like this: CalibrateProjector -s 1920 1080 D: Then maximize this window so it flls your entire sandbox: E: Press and hold the 1 key. we set our projector to 1920x1080. So in our case. To match the resolution of the laptop we used in this tutorial.CalibrateProjector -s WIDTH HEIGHT Replacing WIDTH and HEIGHT with the settings for your projector. then release the 1 key: .

after which you'll briefy see a uniform red color projected onto your sandbox: .F: Then press the 2 key when you see this dialog: G: Press the 2 key to capture the background image.

line-up your alignment target under the white cross-hairs projected onto the sand surface: . Using your shortes spacer. you can proceed with the calibration. you'll capture tie-points at the lowes height.After this is completed. H: Next.

After a brief moment. Repeat this process for the remaining 11 tie-points at this depth. Using a taller spacer. I: Now you'll capture tie-points at the middle height.Then press the 1 key to capture this tie-point. Once the white projected cross-hairs are back at their original position. you're ready to switch to a taller spacer. the software will automatically move the projected cross-hairs to the next tie-point. line-up your alignment target under the white cross-hairs projected onto the sand surface: .

you'll capture tie-points at highes height. you're ready to switch to a larger spacer. After a brief moment. Once the white projected cross-hairs are back at their original position. Repeat this process for the remaining 11 tie-points at this depth. J: Finally. the software will automatically move the projected cross-hairs to the next tie-point. line-up your alignment target under the white cross-hairs projected onto the sand surface: .Then press the 1 key to capture this tie-point. Using your talles spacer (or sacking two spacers on top of each other).

the software will automatically move the projected cross-hairs to the next tie-point. Once the white projected cross-hairs are back at their original position. you're done with the calibration! K: Once you've completed the calibration. Hitting Esc will automatically write the calibration fle in /etc/SARndbox-1.Then press the 1 key to capture this tie-point. After a brief moment. . hit Esc to close the CalibrateProjector application.6/ProjectorMatrix. Repeat this process for the remaining 11 tie-points at this depth.dat .

and you'll see something like this: . your sea level will be too high.Adjus the "sea level" A: Launch the main SARndbox application by searching for "sandbox" in the Ubuntu dash: B: Then maximize the application so it flls your entire sandbox: C: If in sep 4 you calculated the base plane with a piece of poser board (or a similar fat surface) on top of your sandbox.

txt by running this command from the terminal: gedit /etc/SARndbox-1.6/BoxLayout. you'll want to adjus the sea level so it's jus below the surface of your sand when it's more or less fattened out. the sea level will be too low.6/BoxLayout. Either way. edit the /etc/SARndbox-1. E: To adjus the sea level. if in sep 4 you calculated the base plane when your sandbox was empty.txt controls the sea-level: .txt The value highlighted below in BoxLayout.On the other hand. D: Hit Esc to close the AR Sandbox application.

like this: G: Save the fle and close gedit . H: Re-launch the AR Sandbox application from the Ubuntu dash. In our example -106.F: You'll want to adjus the fnal value in the frs line to be roughly the same as the smalles of the fnal value on the four lines at the end. maximize the window. and you'll see something like this: .927 is the smalles value: So we'll set the sea-level to -107 .

You can experiment with diferent values for the sea-level to suite your preferences. the projector. Note that you can adjus the sea level at any time in the future without recalibrating your sandbox. you might want to go through the calibration again in order to achieve a more accurate setup. . but our recommendations here will give you a good sarting point. and the sandbox relative to each other). Use the Sandbox! A: Whew! You made it through the setup and calibration! As long as you don't change the physical setup of your sandbox (in particular. the position of the Kinect. you never need to calibrate it again. Although now that you have the hang of it.

the Sysem76 packaging for Ubuntu includes a launcher you can search for in the Ubuntu dash: This is a shortcut to launch SARndbox with the following arguments (which you can also do directly from a terminal): . you can "make it rain": C: As a convenience.B: If you hold your hand above the sand surface (like a cloud).

Make something together Share this page with your friends and family to inspire making great things together. inspiring piece of software! Be sure to check out the Augmented Reality Sandbox website for more details.SARndbox -uhm -fpv -evr -0. the sandbox will seadily fll with more and more water as you "make it rain". D: If our recommended evaporation rate seems too fas for your tases. Without any evaporation rate set. So you typically want to set an evaporation rate. or share your own projects and photos with #WeekendProject!  TWITTER  FACEBOOK  GOOGLE+ .005 If our recommended evaporation rate seems too slow for your tases.02 Thanks! Thanks again to Oliver Kreylos for developing such an incredible.01 The -evr -0. try: SARndbox -uhm -fpv -evr -0. especially when deploying the Augmented Reality Sandbox in schools or museums.01 bit of the above command sets the evaporation rate. which eventually will cause the real-time fuid simulation to become slow. try: SARndbox -uhm -fpv -evr -0.

Contact Shipping Information Support Warranty & Returns About Us Privacy Policy Blog Disclaimer Careers Terms & Conditions     Copyright © System76 2016 * All financing prices are based on the advertised price at 10% APR paid over 12 months. the Intel Logo. Intel. and Xeon are trademarks of Intel Corporation in the U. and/or other countries. Intel Core. .S.