#!/bin/csh

#####################################################################
#
# $Id: setvars.csh,v 1.6 2004/09/01 19:54:34 ulucs Exp $
#
#  This script should be sourced by .cshrc, to set up all of the
# standard environment variables needed by RHexLib.  The following
# lines are needed within your .cshrc before your source this file.
#
# To use this script, uncomment the following lines and add them to
# your .cshrc file, with appropriate modifications.
# 
# # optional : will default to $USER if you do not define here
# setenv ROBODEVEL_USER gch
#
# # required : where local copy will reside
# setenv ROBODEVEL_DIR ~/RoboDevel
#
# # you can individually choose robot hardware types
# # if you do not specify, that robot is not compiled
# setenv RHEX_HARDWARE _ARACHI_
# setenv RISE_HARDWARE _ARACHI_
#
# # for each robot you have a hardware set, you must have a name
# setenv RHEX_ROBOTNAME arachi
# setenv RISE_ROBOTNAME arachi
#
# # last line - required to source this file
# source $ROBODEVEL_DIR/setvars.csh
#
#####################################################################

# temporary variables to allow easy modification of cvs source
set ROBODEVEL_CVS=geeveegie.msl.ri.cmu.edu
set ROBODEVEL_CVSROOT=/home/rhex/cvsroot

# set the rhexlib username if necessary
if ( ! $?ROBODEVEL_USER ) then 
    setenv ROBODEVEL_USER $USER
endif

# set the default cvs location
setenv CVS_RSH ssh
setenv CVSROOT \:ext\:$ROBODEVEL_USER@$ROBODEVEL_CVS\:$ROBODEVEL_CVSROOT

# check for required variables, produce warnings if not defined
if ( ! $?ROBODEVEL_DIR ) then
    echo "warning: you must define ROBODEVEL_DIR"
    setenv ROBODEVEL_DIR ""
endif

if ( $?RHEX_HARDWARE && ! $?RHEX_ROBOTNAME ) then
    echo "warning: you must select a rhex robot in RHEX_ROBOTNAME"
    setenv RHEX_ROBOTNAME ""
endif

if ( $?RISE_HARDWARE && ! $?RISE_ROBOTNAME ) then
    echo "warning: you must select a rise robot in RISE_ROBOTNAME"
    setenv RISE_ROBOTNAME ""
endif

# set common top level directories
setenv LIBS_TOPDIR $ROBODEVEL_DIR/Libraries
setenv RHEX_TOPDIR $ROBODEVEL_DIR/RHex
setenv RISE_TOPDIR $ROBODEVEL_DIR/RiSE

# set directories 
setenv RHEX_DIR $LIBS_TOPDIR/RHexLib
setenv LIBUTILS_DIR $RHEX_DIR/libutils
setenv SIMSECT_DIR $RHEX_TOPDIR/Simulation/SimSect++
setenv SIMLIB_DIR $LIBS_TOPDIR/SimLib
setenv ARACHI_DIR $LIBS_TOPDIR/arachi
setenv DMV_DIR $LIBS_TOPDIR/DoubMatVec
setenv VISLIB_DIR $LIBS_TOPDIR/VisLib
setenv FLTK_DIR $LIBS_TOPDIR

# the following is only necessary to be able to run supervisor
# without using the start.sh scripts.  It defaults to RiSE.
# if you are not using RiSE, it will default to RHex.
if ( $?RISE_HARDWARE ) then
setenv ROBOT_DIR $RISE_TOPDIR/Supervisor/Config/robots/$RISE_ROBOTNAME
setenv CONFIG_DIR $RISE_TOPDIR/Supervisor/Config/default
else if ( $?RHEX_HARDWARE ) then
setenv ROBOT_DIR $RHEX_TOPDIR/Supervisor/Config/robots/$RHEX_ROBOTNAME
setenv CONFIG_DIR $RHEX_TOPDIR/Supervisor/Config/default
endif
