Skip to content
Snippets Groups Projects
Commit 729725ff authored by Daniel Peppicelli's avatar Daniel Peppicelli
Browse files

backport non versionned changes to gzbridge

Change-Id: I04b33c9f6ba19f92858e6a0edc73bf53f64b0f84
parent cc568230
No related branches found
No related tags found
No related merge requests found
#!/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 $?
......@@ -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': [
......
material Gazebo/Blue
{
technique
{
pass ambient
{
ambient 0 0 1
diffuse 0 0 1
specular 0.1 0.1 0.1 1 1
}
}
}
material Gazebo/Red
{
technique
{
pass ambient
{
ambient 1 0 0
diffuse 1 0 0
specular 0.1 0.1 0.1 1 1
}
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment