[openrtm-commit:00896] r357 - trunk/rtmtools
openrtm @ openrtm.org
openrtm @ openrtm.org
2012年 10月 8日 (月) 23:11:31 JST
Author:
Date: 2012-10-08 23:11:31 +0900 (Mon, 08 Oct 2012)
New Revision: 357
Added:
trunk/rtmtools/openrtp
Log:
eclipse boot script openrtp has been added.
Added: trunk/rtmtools/openrtp
===================================================================
--- trunk/rtmtools/openrtp (rev 0)
+++ trunk/rtmtools/openrtp 2012-10-08 14:11:31 UTC (rev 357)
@@ -0,0 +1,236 @@
+#!/bin/sh
+
+# RTM_ROOT
+#
+# This is used to find IDL files. Default IDL file directory is
+# $RTM_ROOT/rtm/idl (in Windows)
+# In the generic Linux environment, IDL directory is
+# $prefix/include/openrtm-x.y/rtm/idl
+# Therefore RTM_ROOT should be $prefix/include/openrtm-x.y
+#
+# RTM_JAVA_ROOT
+#
+# This is used to find OpenRTM-aist-Java jar files. No generic
+# rules exist.
+#
+
+
+#============================================================
+# functions
+#============================================================
+SCRIPT_NAME=$(basename $0)
+SCRIPT_DIR=$(dirname $0)
+DEBUG=""
+debug_echo () {
+ if test "x$DEBUG" = "xTRUE"; then
+ echo $*
+ fi
+}
+
+#------------------------------------------------------------
+# Usage
+#------------------------------------------------------------
+usage()
+{
+ echo "Usage: $script_name [Eclipse options]"
+ echo ""
+}
+
+#------------------------------------------------------------
+# set_RTM_ROOT
+#
+# This functions set RTM_ROOT environmental variable
+# 1. If RTM_ROOT is set, it checks RTM_ROOT validity.
+# 2. If it is not set, find IDL file by using rtm-config
+# and set valid RTM_ROOT.
+#------------------------------------------------------------
+set_RTM_ROOT()
+{
+ if test "x$RTM_ROOT" = "x"; then
+ debug_echo "RTM_ROOT is not set."
+ if ! find_RTM_ROOT ; then
+ echo "No OpenRTM-aist (C++) installed found."
+ echo "Please install OpenRTM-aist (C++) and set RTM_ROOT"
+ echo " ex. export RTM_ROOT=/usr/include/openrtm-1.1/"
+ echo ""
+ exit 1
+ fi
+ fi
+
+ # Now RTM_ROOT is set
+
+ if ! check_RTM_ROOT ; then
+ echo "Environmental variable RTM_ROOT = $RTM_ROOT is invalid."
+ echo "Please check RTM_JAVA_ROOT and OpenRTM-aist C++ installation."
+ echo ""
+ echo " ex."
+ echo " If /usr/include/openrtm-1.1/rtm/idl/BasicDataType.idl exists,"
+ echo " RTM_ROOT should be /usr/include/openrtm-1.1"
+ echo ""
+ exit 1
+ fi
+ debug_echo "Result: RTM_ROOT = " $RTM_ROOT
+ export RTM_ROOT=$RTM_ROOT
+}
+
+#------------------------------------------------------------
+# find_RTM_ROOT
+#------------------------------------------------------------
+find_RTM_ROOT()
+{
+ debug_echo "TRACE: find_RTM_ROOT"
+ # find RTM_ROOT by rtm-config
+ rtm_config=`which rtm-config`
+ debug_echo "rtm_config: " $rtm_config
+ if test ! "x$rtm_config" = "x" ; then
+ RTM_ROOT=`rtm-config --rtm-idldir | sed -e 's/\/rtm\/idl$//'`
+ debug_echo "RTM_ROOT: " $RTM_ROOT
+ return 0
+ fi
+}
+
+#------------------------------------------------------------
+# check_RTM_ROOT
+#
+# This function check if RTM_ROOT environmental variable is valid.
+#
+#------------------------------------------------------------
+check_RTM_ROOT()
+{
+ debug_echo "TRACE: check_RTM_ROOT"
+ idl_files="BasicDataType.idl ExtendedDataTypes.idl InterfaceDataTypes.idl"
+ idl_dir=$RTM_ROOT/
+
+ debug_echo "Finding IDL files under: " $idl_dir
+ for idl in $idl_files; do
+ idl_path=`find $RTM_ROOT -name $idl`
+ debug_echo "idl_path: " $idl_path
+ if test "x$idl_path" = "x" ; then
+ echo "IDL file: " $idl " not found under \$RTM_ROOT"
+ echo "\$RTM_ROOT = " $RTM_ROOT
+ return 1
+ fi
+ done
+ return 0
+}
+
+#------------------------------------------------------------
+# set_RTM_JAVA_ROOT
+#
+# This functions set RTM_JAVA_ROOT environmental variable
+# 1. If RTM_JAVA_ROOT is set, it checks RTM_ROOT validity.
+# 2. If it is not set, find jar file and set valid RTM_JAVA_ROOT.
+#------------------------------------------------------------
+set_RTM_JAVA_ROOT ()
+{
+ if test "x$RTM_JAVA_ROOT" = "x"; then
+ debug_echo "RTM_JAVA_ROOT is not set."
+ if ! find_RTM_JAVA_ROOT ; then
+ echo "No OpenRTM-aist (Java) installed found."
+ echo "Please install OpenRTM-aist (Java) and set RTM_JAVA_ROOT"
+ echo " ex. export RTM_JAVA_ROOT=/usr/include/openrtm-1.1/"
+ echo ""
+ exit 1
+ fi
+ fi
+
+ # Now RTM_JAVA_ROOT is set
+
+ if ! check_RTM_JAVA_ROOT ; then
+ echo "env RTM_JAVA_ROOT is invalid"
+ echo "Please set RTM_JAVA_ROOT correctly."
+ echo " ex. export RTM_JAVA_ROOT=/usr/include/openrtm-1.1/"
+ echo ""
+ exit 1
+ fi
+ debug_echo "Result: RTM_JAVA_ROOT = " $RTM_JAVA_ROOT
+ export RTM_JAVA_ROOT=$RTM_JAVA_ROOT
+}
+
+#------------------------------------------------------------
+# get_openrtm_dirs
+#
+# This function gets possible OpenRTM-aist-Java installation
+# directories.
+#------------------------------------------------------------
+get_openrtm_dirs()
+{
+ usr_lib=`ls -d /usr/lib/[oO]pen[rR][tT][mM]* 2> /dev/null`
+ usr_local_lib=`ls -d /usr/local/lib/[oO]pen[rR][tT][mM]* 2> /dev/null`
+ opt_lib=`ls -d /opt/lib/[oO]pen[rR][tT][mM]* 2> /dev/null`
+ opt_local_lib=`ls -d /opt/local/lib/[oO]pen[rR][tT][mM]* 2> /dev/null`
+
+ echo $usr_lib $usr_local_lib $opt_lib $opt_local_lib
+}
+
+
+#------------------------------------------------------------
+# find_RTM_JAVA_ROOT
+#------------------------------------------------------------
+find_RTM_JAVA_ROOT()
+{
+ debug_echo "TRACE: find_RTM_JAVA_ROOT"
+ # find RTM_JAVA_ROOT
+ openrtm_dirs=`get_openrtm_dirs`
+ debug_echo "OpenRTM dirs: " $openrtm_dirs
+
+ for d in $openrtm_dirs ; do
+ openrtm_jar=`find $d -name '[oO]pen[rR][tT][mM]*.jar'`
+ if test ! "x$openrtm_jar" = "x" ; then
+ break
+ fi
+ done
+
+ if test "x$openrtm_jar" = "x" ; then
+ debug_echo "jar file not found"
+ echo "No OpenRTM-aist installation found. Aborting."
+ exit 1
+ fi
+ debug_echo "jar file found: " $openrtm_jar
+
+ RTM_JAVA_ROOT=`dirname $openrtm_jar | sed -e 's/\/jar$//'`
+ debug_echo "RTM_JAVA_ROOT: " $RTM_JAVA_ROOT
+
+}
+
+#------------------------------------------------------------
+# check_RTM_JAVA_ROOT
+#
+# This function check if RTM_JAVA_ROOT environmental variable is valid.
+#
+#------------------------------------------------------------
+check_RTM_JAVA_ROOT()
+{
+ debug_echo "TRACE: check_RTM_JAVA_ROOT"
+ jar_file=`ls $RTM_JAVA_ROOT/jar/[oO]pen[rR][tT][mM]-*.jar 2> /dev/null`
+ debug_echo "jar_file: " $jar_file
+
+ if test "x$jar_file" = "x" ; then
+ echo "Environmental variable RTM_JAVA_ROOT = $RTM_JAVA_ROOT is invalid."
+ echo "Please check RTM_JAVA_ROOT and OpenRTM-aist Java installation."
+ echo ""
+ echo "ex."
+ echo "If /usr/lib/OpenRTM-aist/1.0/jar/OpenRTM-1.0.0.jar exists,"
+ echo "RTM_JAVA_ROOT should be /usr/lib/OpenRTM-aist/1.0"
+ echo ""
+ exit 1
+ fi
+ return 0
+}
+
+#------------------------------
+# main
+#------------------------------
+set_RTM_ROOT
+set_RTM_JAVA_ROOT
+
+echo "Launching eclipse with the following environmental variables."
+echo " RTM_ROOT : " $RTM_ROOT
+echo " RTM_JAVA_ROOT: " $RTM_JAVA_ROOT
+
+if test ! -x $SCRIPT_DIR/eclipse ; then
+ echo "No eclipse executable found. Aborting."
+ exit 1
+fi
+export GDK_NATIVE_WINDOWS=1
+$SCRIPT_DIR/eclipse $*
Property changes on: trunk/rtmtools/openrtp
___________________________________________________________________
Added: svn:executable
+ *
More information about the openrtm-commit
mailing list