Gzweb/Build

Build Environment Setup ==


 * 1) gzbridge (Server-side Communication)

The required package `node-gyp` should already be installed if you followed the Installing gzweb instructions.
 * 1) Compiling the Gazebo interface (a Nodejs Add-on).

If not, simply go to the `gzweb` root directory and run:

npm install


 * 1) Work flow

Run the `gzweb/deploy.sh` script

./deploy.sh


 * 1) gz3d (WebGL Javascript front-end)

Grunt is used for running tasks including code checking and minification.
 * 1) Grunt setup
 * Minification: Compresses all *.js code into gz3d.js and gz3d.min.js files that can be included into other projects.
 * Code check: uses JSHint for detecting potential errors in Javascript code

To install required Grunt packages:

cd gz3d/utils && npm install

1. Make changes to javascript source code in `gzweb/gz3d` 1. Minify javascript files. From the `gzweb/gz3d/utils` directory run
 * 1) Work Flow:

grunt build You should see the message `Done, without errors` if the grunt tasks ran sucessfully. This produces `gz3d.js` and `gz3d.min.js` in the `gzweb/gz3d/build` folder.

1. Copy files to `gzweb/http` where they will be served by the http server. This can just be done by going to the `gzweb/build` directory and run:

cmake ..


 * 1) Verify your changes

1. Start gzweb server from the `gzweb` directory:

./start_gzweb.sh

1. Open browser to localhost:8080, or just refresh page


 * 1) Troubleshooting

Q: I don't see anything changed after modifying the javascript code.
 * A: Sometimes you'll have to clear your browser cache to see the changes.