Gzweb/install


 * 1) Server-side Installation


 * 1) Dependencies

Install gazebo or drcsim if you haven't already done so already.

gzweb depends on the follow libraries:
 * libjansson-dev
 * nodejs
 * npm
 * libboost-dev
 * libtinyxml-dev (required by sdformat)
 * g++, make, cmake (used by `deploy.sh`)
 * mercurial (used to checkout gazebo_models during `deploy.sh`)
 * imagemagick (used by `webify_models.py`)

Note: If you are not using a very recent apt repository, you will be better served by installing the current version of NodeJS (http://nodejs.org/download/) from the website and npm as instructed in the FAQ (https://www.npmjs.org/doc/faq.html) under "How do I update npm?" Then use the following command without including nodejs or npm.

sudo apt-get install libjansson-dev nodejs npm libboost-dev make cmake mercurial g++ libtinyxml-dev imagemagick

Install nodejs modules

npm config set registry http://registry.npmjs.org/ sudo npm install -g node-gyp sudo npm install -g http-server


 * 1) Download gzweb

Download the latest version of gzweb, `gzweb-1.1.X.tar.bz2`. from http://gazebosim.org/assets/distributions/:

wget http://gazebosim.org/assets/distributions/gzweb-1.1.0.tar.bz2

Extract the tarball

tar xf gzweb-1.1.0.tar.bz2

go into the gzweb directory and install nodejs websocket module.

cd gzweb-1.1.0

npm install websocket


 * 1) Build

The first time you build, you'll need to gather all the gazebo models and put them in the right directory and prepare them for the web. To do this, you'll need to source the gazebo's setup.sh file, and run a deploy script. Note: if you have drcsim then source the drcsim's setup.sh file.

. /usr/share/gazebo/setup.sh
 * 1) if you have drcsim then source /usr/share/drcsim/setup.sh

Run the deploy script, this downloads models from the web and may take a couple of minutes. ./deploy.sh -m

Note the `-m` flag tells the deploy script to grab models from the model database and any other models in your gazebo paths. For all subsequent builds, the `-m` flag will not be needed.

To skip downloading models from the model database and grab only local models in your gazebo model path, do: ./deploy.sh -m local
 * New in 1.1.0.


 * 1) Running gzserver, gzweb server, and webgl client

Start gazebo or gzserver first gzserver

Start the http and websocket servers ./start_gzweb.sh

Open a browser (Chrome works well) that has webgl and websocket support and point it to the ip address and port where the http server is started, by default it's on port 8080, e.g.

http://localhost:8080


 * 1) Stopping gzweb server

From your gzweb directory, run:

./stop_gzweb.sh

Q: When installing node package modules, I see errors along the lines of: npm ERR! Error: failed to fetch from registry: node-gyp npm config set registry http://registry.npmjs.org/
 * 1) Troubleshooting
 * A: Try setting the npm registry first then install the modules again.

Q: When installing websocket, I see errors along the lines of: sh: 1: node: not found npm ERR! error installing websocket@1.0.8 npm WARN This failure might be due to the use of legacy binary "node" Try adding a symlink to the correct name. sudo ln -s /usr/bin/nodejs /usr/bin/node You may also find that your repository is too old and you should just install recent versions of node and npm directly.
 * A: In Debian systems, the binary file "node" has been renamed to "nodejs" to avoid a name conflict.

Q: When running ./deploy.sh, it is missing a file in gz3d/build

A: You will need to install grunt and run it appropriately, as follows. You might also look here for more information. sudo npm install -g grunt-cli cd gz3d/utils sudo npm install. grunt build Proceed to Controls page to learn about user interactions in gzweb.
 * 1) User Guide