Skip to content

openearth/sandbox-fm

Repository files navigation

Sandbox Delft3D Flexible Mesh

image

image

Documentation Status

Updates

Sandbox combined with a Delft3D Flexbile Mesh simulation

Install

After you have created a sandbox you can hook up the software. Before you can use the software you have to install some prerequisites. These include the following packages: * python (tested with 2.7 and 3.5)

You preferably want to install these from the package manager (tested with ubuntu and osx + macports): * libfreenect (available by default in linux and there are instructions for use with .. _macports: macports, make sure you build the python bindings, it is also available in homebrew) * opencv (available in linux and osx (macports/homebrew)

You probably want to create a virtual environment or an anaconda environment. Make sure you activate it, for example using the workon main command to activate your main environment (with virtualenvwrapper installed).

Once you are in your python environment of choice you can install the required python libraries: * pip install -r requirements.txt

Make sure your libdflowfm.so/libxbeach.so is in your path

Windows Install

  • Download anaconda (3.5)
  • Start the anaconda command window (from your start menu). If you do not have adminstrator rights you should start a command window using the following command (%windir%\system32\cmd.exe "/K" "C:\Program Files\Anaconda3\Scripts\activate.bat" "C:\Program Files\Anaconda3")
  • conda update conda
  • conda create --name main --file package-list-win.txt
  • activate main (You should now see a (main) at the start of your command line)
  • conda install opencv
  • Install the sandbox-fm software in develop mode pip install -e . (from the sandbox-fm directory)
  • pip install tqdm
  • pip install -r requirements.txt
  • pip install cmocean
  • Make sure the dflowfm.dll/xbeach.dll is somewhere in your PATH definition

Using models

To be able to run the sandbox you need to have a model and a model schematization available. The model schematizations that were tested with the sandbox are available through https://svn.oss.deltares.nl/repos/openearthmodels/trunk/deltares/sandbox. You can register for access (open source) through http://oss.deltares.nl.

You can dowload all models using the following command:

svn co https://svn.oss.deltares.nl/repos/openearthmodels/trunk/deltares/sandbox

Running

If you are using a virtual enviroment, make sure it is loaded. You can load your environment using the command workon main, assuming you have virtualenv wrapper installed.

  • sandbox-fm --help
  • sandbox-fm calibrate calibrate the sandbox by selecting a quad in the box, a quad in the model and a high and low point.
  • sandbox-fm record record 10 frames, for testing. You can use a directory with recorded images using by setting the FREENECT_RECORD_DIR directory.
  • sandbox-fm run run the sandbox program.
  • sandbox-fm anomaly store the vertical anomaly for a plane in anomaly.npy
  • sandbox-fm view view raw kinect images

Calibration

First run the command sandbox-fm anomaly with an empty sandbox to store the deviation from a plane.

Calibration transforms between the different quads.

  • Photo from kinect (video)
  • Depth from kinect (img)
  • Beamer (box, default 640x480)
  • Model extract (model)

In the top left window select the extent of the beamer. In the top right window select a corresponding extent in the model. In the bottom left model select a low and a high point. Press [ENTER]. Done.

Run

While running the simulation you can update the display using the following keys:

  • 1 - Show bed level from camera
  • 2 - Show water level in model
  • 3 - Show bed level in model
  • 4 - Show currents in model
  • B – Set bed level to current camera bed level
  • C – Currents on/off
  • P – Photo
  • F – Full screen view
  • Q – Quit (windows only)
  • R – Reset to original bathy

Possible Issues

If USB is not functioning:

  • Check sand in USB plug.
  • Make sure there is no program running in the background (ps -afx, jobs)
  • Replug the USB cable
  • Plug the USB cable in a different port
  • Check power supply of cable (is the green light on?)

Features

  • TODO

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.