diff --git a/gzbridge.init.d.sh b/gzbridge.init.d.sh new file mode 100755 index 0000000000000000000000000000000000000000..f71794b1282bff0e81068fb03fb4f3cf5a94f1cf --- /dev/null +++ b/gzbridge.init.d.sh @@ -0,0 +1,138 @@ +#!/bin/sh +# +# gzbridge Communication bridge for accessing Gazebo via the web +# +# chkconfig: 2345 20 80 +# description: Handles the gzbridge component which bridges the communication \ +# between Gazebo (protobuf) and the web (JSON) + +### BEGIN INIT INFO +# Provides: gzbridge +# Required-Start: $remote_fs gzserver +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start and stop gzbridge +# Description: gzbridge is the communication bridge for the Gazebo robot simulator. +### END INIT INFO + +# Source function library. +. /etc/rc.d/init.d/functions + +GZBRIDGE_BIN_DIR=/nfs4/bbp.epfl.ch/sw/neurorobotics/gzweb/2014.10.15/rhel-6.5-x86_64/gcc-4.8.2/x86_64/gzweb/gzbridge + +if [ -z $GZBRIDGE_BIN_DIR ]; then + echo "Necessary environment variable GZBRIDGE_BIN_DIR not set!" + exit 1 +fi + +exec="$GZBRIDGE_BIN_DIR/ws_server.js" +prog="node" + +lockfile=/var/lock/subsys/$prog + +start() { + # loading the environment modules configuration files + export MODULEPATH=$MODULEPATH:/nfs4/bbp.epfl.ch/sw/neurorobotics/modulefiles + export MODULEPATH=$MODULEPATH:/nfs4/bbp.epfl.ch/sw/module/modulefiles + + # source environment modules init file + . /usr/share/Modules/init/bash 2> /dev/null + + # load the modules + module load gazebo/4.0-rhel6-x86_64-gcc4.8.2 && + module load sdf/2.0-rhel6-x86_64-gcc4.4 && + module load ogre/1.8.1-rhel6-x86_64-gcc4.8.2 && + module load boost/1.55zlib-rhel6-x86_64-gcc4.4 + retval=$? + if [ $retval -ne 0 ]; then + echo "Loading the environment modules was not successful!" + exit 1 + fi + + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nfs4/bbp.epfl.ch/sw/neurorobotics/staging/lib64/ + + # test if the exec file exists and execute permission is granted + # exit with exit code 5 (program not installed) if conditions do not hold + [ -x $exec ] || exit 5 + + # we have to change to the directory, otherwise loading of materials + # does not work properly :( + cd $GZBRIDGE_BIN_DIR + + echo -n $"Starting $prog: " + # if not running, start gzbridge up here + $exec &>/dev/null & + retval=$? + if [ $retval -eq 0 ]; then + echo_success + fi + echo + [ $retval -eq 0 ] && touch $lockfile + return $retval +} + +stop() { + echo -n $"Stopping $prog: " + # stop gzserver here with the help of the killproc function + killproc $prog + retval=$? + echo + [ $retval -eq 0 ] && rm -f $lockfile + return $retval +} + +restart() { + stop + start +} + +reload() { + restart +} + +force_reload() { + restart +} + +rh_status() { + # run checks to determine if the service is running or use generic status + status $prog +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + + +case "$1" in + start) + rh_status_q && exit 0 + $1 + ;; + stop) + rh_status_q || exit 0 + $1 + ;; + restart) + $1 + ;; + reload) + rh_status_q || exit 7 + $1 + ;; + force-reload) + force_reload + ;; + status) + rh_status + ;; + condrestart|try-restart) + rh_status_q || exit 0 + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 +esac +exit $? diff --git a/gzbridge/binding.gyp b/gzbridge/binding.gyp index 53d0cad3d144cbbb815f9a3bbfc11b16a9afe316..434db95c2c220b718030aa85d97c9a6525671644 100644 --- a/gzbridge/binding.gyp +++ b/gzbridge/binding.gyp @@ -9,6 +9,9 @@ "OgreMaterialParser.cc", "OgreMaterialParser.hh"], 'cflags_cc!': [ '-fno-rtti', '-fno-exceptions' ], 'cflags!': [ '-fno-exceptions' ], + "include_dirs": [ + "/nfs4/bbp.epfl.ch/sw/neurorobotics/tbb/4.0.5/rhel-6.5-x86_64/gcc-4.4.7/x86_64/include" + ], "conditions": [ ['OS=="linux"', { 'cflags': [ diff --git a/http/client/assets/materials/blue.material b/http/client/assets/materials/blue.material new file mode 100644 index 0000000000000000000000000000000000000000..2e771ef6119fc0d793cc7a96b5843f7547329a5e --- /dev/null +++ b/http/client/assets/materials/blue.material @@ -0,0 +1,13 @@ +material Gazebo/Blue +{ + technique + { + pass ambient + { + ambient 0 0 1 + diffuse 0 0 1 + specular 0.1 0.1 0.1 1 1 + } + } +} + diff --git a/http/client/assets/materials/red.material b/http/client/assets/materials/red.material new file mode 100644 index 0000000000000000000000000000000000000000..34e626fcbb800e345f921f4e1076473374ef7524 --- /dev/null +++ b/http/client/assets/materials/red.material @@ -0,0 +1,13 @@ +material Gazebo/Red +{ + technique + { + pass ambient + { + ambient 1 0 0 + diffuse 1 0 0 + specular 0.1 0.1 0.1 1 1 + } + } +} +