diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f32b4c044..839442488f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -710,7 +710,7 @@ if(CMAKE_CPACK_COMMAND AND UNIX AND OPT_BUILD_PACKAGES) set(CPACK_DEBIAN_BUILD_DEPENDS debhelper cmake python-dev libxml2-dev libboost-dev ffmpeg zlib1g-dev python-numpy "python-sympy (>=0.6.3)" desktop-file-utils libboost-filesystem-dev libboost-system-dev libboost-python-dev libboost-thread-dev libboost-date-time-dev octave3.2-headers "libcollada15dom-dev (>=2.3.1)" pkg-config) # plugins - set(CPACK_DEBIAN_BUILD_DEPENDS ${CPACK_DEBIAN_BUILD_DEPENDS} libboost-iostreams-dev libboost-regex-dev libqt4-dev qt4-dev-tools libqhull-dev libavcodec-dev libavformat-dev libswscale-dev libsimage-dev libode-dev libsoqt4-dev libassimp-dev libbullet-dev) + set(CPACK_DEBIAN_BUILD_DEPENDS ${CPACK_DEBIAN_BUILD_DEPENDS} libboost-iostreams-dev libboost-regex-dev libqt4-dev qt4-dev-tools libqhull-dev libavcodec-dev libavformat-dev libswscale-dev libsimage-dev libode-dev libsoqt4-dev libassimp-dev) # debian set(CPACK_DEBIAN_PACKAGE_PRIORITY optional) diff --git a/Makefile b/Makefile index 9cba252426..d643327879 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CMAKE_BUILD_TYPE=$(shell if [ $(DEBUG) ]; then echo Debug; else echo RelWithDebInfo; fi) all: - @mkdir -p build; rm -f build/CMakeCache.txt rave/defines.h rave/classhashes.h + @mkdir -p build; rm -f build/CMakeCache.txt @if [ $(prefix) ]; then \ cd build && cmake -DCMAKE_INSTALL_PREFIX=$(prefix) -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) ..; \ else \ diff --git a/docs/en/changelog.rst b/docs/en/changelog.rst index 5b295f799b..2a60f8f247 100644 --- a/docs/en/changelog.rst +++ b/docs/en/changelog.rst @@ -3,6 +3,29 @@ ChangeLog ######### +Version 0.3.2 +============= + +Subversion Revision: **Unreleased** + +Initial Release: **Unreleased** + +Core +---- + +* added openrave-robot.py which allows introspection into robot files. This deprecates openrave-hash.py. added bash completion for it. + +* added openrave-createplugin.py which allows new users to easily setup the plugin directories and get something running. also works on creating executables. added bash completion for it. + +* changed way of searching for collada to prepare for 2.3.1 release. + +* small changes to the way symlinks are handled on install/uninstall + +Testing +------- + +* fixed bugs in multiprocess plugin + Version 0.3.1 ============= diff --git a/docs/en/command_line_tools.rst b/docs/en/command_line_tools.rst index 51e8ca6ac6..82ded20270 100644 --- a/docs/en/command_line_tools.rst +++ b/docs/en/command_line_tools.rst @@ -3,6 +3,8 @@ Command Line Tools ================== +.. _tool-openravepy + openrave.py ----------- @@ -75,8 +77,10 @@ Command-line .. shell-block:: openrave.py --help -openrave-hash.py ----------------- +.. _tool-openrave-robot + +openrave-robot.py +----------------- Queries information about OpenRAVE-loadable robots. @@ -93,6 +97,24 @@ Command-line .. shell-block:: openrave-robot.py --help +.. _tool-openrave-createplugin + +openrave-createplugin.py +------------------------ + +Sets up a project directory and initial files for creating OpenRAVE plugins and executables. For example: + +.. code-block:: bash + + openrave-createplugin.py myplugin --problem MyNewProblem + +Command-line +~~~~~~~~~~~~ + +.. shell-block:: openrave-createplugin.py --help + +.. _tool-openrave + openrave -------- @@ -104,3 +126,15 @@ Command-line ~~~~~~~~~~~~ .. shell-block:: openrave --help + +.. _tool-openrave-config + +openrave-config +--------------- + +Used to find the openrave installation directories, used libraries, headers, and shared files. + +Command-line +~~~~~~~~~~~~ + +.. shell-block:: openrave-config --help diff --git a/docs/en/getting_started.rst b/docs/en/getting_started.rst index 7c974c31cf..5335ddc9cb 100644 --- a/docs/en/getting_started.rst +++ b/docs/en/getting_started.rst @@ -11,9 +11,7 @@ Getting Started Tutorials command_line_tools tutorials/openravepy_advanced environment_variables + writing_plugins -.. htmlonly:: - - `FindOpenRAVE.cmake`_ - searches for the OpenRAVE installation when using CMake build system. - - `Writing Plugins and Interfaces in C++ <../coreapihtml/writing_plugins.html>`_ - `Writing and Using Controllers in C++ <../coreapihtml/arch_controller.html>`_ - `Octave/MATLAB`_ Scripting diff --git a/docs/en/tutorials/writing_plugins.rst b/docs/en/tutorials/writing_plugins.rst new file mode 100644 index 0000000000..3bad2641fe --- /dev/null +++ b/docs/en/tutorials/writing_plugins.rst @@ -0,0 +1,5 @@ +Writing Plugins in C++ +====================== + +.. htmlonly:: + - `Writing Plugins and Interfaces in C++ <../coreapihtml/writing_plugins.html>`_ diff --git a/include/openrave/openrave.h b/include/openrave/openrave.h index 84d1774b0f..3b6c2388ad 100644 --- a/include/openrave/openrave.h +++ b/include/openrave/openrave.h @@ -1,5 +1,5 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2006-2011 Rosen Diankov (rosen.diankov@gmail.com) +// Copyright (C) 2006-2011 Rosen Diankov // // This file is part of OpenRAVE. // OpenRAVE is free software: you can redistribute it and/or modify @@ -591,6 +591,7 @@ enum InterfaceType PT_SensorSystem=3, ///< describes \ref SensorSystemBase interface PT_Controller=4, ///< describes \ref ControllerBase interface PT_ProblemInstance=5, ///< describes \ref ProblemInstance interface + PT_IkSolver=6, ///< describes \ref IkSolverBase interface PT_InverseKinematicsSolver=6, ///< describes \ref IkSolverBase interface PT_KinBody=7, ///< describes \ref KinBody PT_PhysicsEngine=8, ///< describes \ref PhysicsEngineBase @@ -1186,6 +1187,7 @@ OPENRAVE_API PlannerBasePtr RaveCreatePlanner(EnvironmentBasePtr penv, const std OPENRAVE_API SensorSystemBasePtr RaveCreateSensorSystem(EnvironmentBasePtr penv, const std::string& name); OPENRAVE_API ControllerBasePtr RaveCreateController(EnvironmentBasePtr penv, const std::string& name); OPENRAVE_API ProblemInstancePtr RaveCreateProblem(EnvironmentBasePtr penv, const std::string& name); +OPENRAVE_API ProblemInstancePtr RaveCreateProblemInstance(EnvironmentBasePtr penv, const std::string& name); OPENRAVE_API IkSolverBasePtr RaveCreateIkSolver(EnvironmentBasePtr penv, const std::string& name); OPENRAVE_API PhysicsEngineBasePtr RaveCreatePhysicsEngine(EnvironmentBasePtr penv, const std::string& name); OPENRAVE_API SensorBasePtr RaveCreateSensor(EnvironmentBasePtr penv, const std::string& name); diff --git a/modules-cmake/cmake_uninstall.cmake.in b/modules-cmake/cmake_uninstall.cmake.in index df95fb9d82..1670115955 100644 --- a/modules-cmake/cmake_uninstall.cmake.in +++ b/modules-cmake/cmake_uninstall.cmake.in @@ -6,16 +6,12 @@ FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) STRING(REGEX REPLACE "\n" ";" files "${files}") FOREACH(file ${files}) MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") - IF(EXISTS "$ENV{DESTDIR}${file}") - EXEC_PROGRAM( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" - OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval - ) - IF(NOT "${rm_retval}" STREQUAL 0) - MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") - ENDIF(NOT "${rm_retval}" STREQUAL 0) - ELSE(EXISTS "$ENV{DESTDIR}${file}") - MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") - ENDIF(EXISTS "$ENV{DESTDIR}${file}") + EXEC_PROGRAM( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + IF(NOT "${rm_retval}" STREQUAL 0) + MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") + ENDIF(NOT "${rm_retval}" STREQUAL 0) ENDFOREACH(file) diff --git a/openrave_completion.bash.in b/openrave_completion.bash.in index d6c3fe46bd..4ed37132f8 100644 --- a/openrave_completion.bash.in +++ b/openrave_completion.bash.in @@ -61,7 +61,7 @@ function _complete_openravepy { esac # not processing a current option, so offer all the options again - opts="--loadplugin --collision --physics --viewer --server --serverport --level --ipython --pythoncmd --listinterfaces --listplugins --listdatabases --listexamples" + opts="--loadplugin --collision --physics --viewer --server --serverport --level --ipython --pythoncmd --listinterfaces --listplugins --listdatabases --listexamples --help" if [[ $COMP_CWORD == 1 ]]; then # these options transfer the args to another program opts="$opts --database --example" @@ -116,7 +116,7 @@ function _complete_openrave_robotpy { esac # not processing a current option, so offer all the options again - opts="--manipname --sensorname --hash --info --list" + opts="--manipname --sensorname --hash --info --list --help" COMPREPLY=($(compgen -W "$opts" -- ${cur})) if [[ ${cur} != -* ]] ; then # add in xml and dae and zae files @@ -124,7 +124,15 @@ function _complete_openrave_robotpy { fi } +function _complete_openrave_createpluginpy { + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="--usecore --planner --robot --sensorsystem --controller --probleminstance --iksolver --kinbody --physicsengine --sensor --collisionchecker --trajectory --help" + COMPREPLY=($(compgen -W "$opts" -- ${cur})) +} complete -F "_complete_openravepy" -o filenames -o plusdirs "openrave.py" complete -F "_complete_openrave_robotpy" -o filenames -o plusdirs "openrave-robot.py" +complete -F "_complete_openrave_createpluginpy" "openrave-createplugin.py" complete -F "_complete_openravepy" -o filenames -o plusdirs "openrave@OPENRAVE_BIN_SUFFIX@.py" complete -F "_complete_openrave_robotpy" -o filenames -o plusdirs "openrave@OPENRAVE_BIN_SUFFIX@-robot.py" +complete -F "_complete_openrave_createpluginpy" "openrave@OPENRAVE_BIN_SUFFIX@-createplugin.py" diff --git a/plugins/ikfastsolvers/ikfastsolvers.cpp b/plugins/ikfastsolvers/ikfastsolvers.cpp index d8a918a3f1..081b39e3b1 100644 --- a/plugins/ikfastsolvers/ikfastsolvers.cpp +++ b/plugins/ikfastsolvers/ikfastsolvers.cpp @@ -36,7 +36,7 @@ namespace katana5d_trans { IkSolverBasePtr CreateIkSolver(EnvironmentBasePtr, co InterfaceBasePtr CreateInterfaceValidated(InterfaceType type, const std::string& interfacename, std::istream& sinput, EnvironmentBasePtr penv) { switch(type) { - case PT_InverseKinematicsSolver: { + case PT_IkSolver: { if( interfacename == "ikfast" ) { string ikfastname; sinput >> ikfastname; @@ -104,19 +104,19 @@ InterfaceBasePtr CreateInterfaceValidated(InterfaceType type, const std::string& void GetPluginAttributesValidated(PLUGININFO& info) { info.interfacenames[PT_ProblemInstance].push_back("ikfast"); - info.interfacenames[PT_InverseKinematicsSolver].push_back("ikfast"); - info.interfacenames[PT_InverseKinematicsSolver].push_back("wam7ikfast"); - info.interfacenames[PT_InverseKinematicsSolver].push_back("pa10ikfast"); - info.interfacenames[PT_InverseKinematicsSolver].push_back("pumaikfast"); - info.interfacenames[PT_InverseKinematicsSolver].push_back("ikfast_pr2_head"); - info.interfacenames[PT_InverseKinematicsSolver].push_back("ikfast_pr2_head_torso"); - info.interfacenames[PT_InverseKinematicsSolver].push_back("ikfast_pr2_rightarm"); - info.interfacenames[PT_InverseKinematicsSolver].push_back("ikfast_pr2_rightarm_torso"); - info.interfacenames[PT_InverseKinematicsSolver].push_back("ikfast_pr2_leftarm"); - info.interfacenames[PT_InverseKinematicsSolver].push_back("ikfast_pr2_leftarm_torso"); - info.interfacenames[PT_InverseKinematicsSolver].push_back("ikfast_schunk_lwa3"); - info.interfacenames[PT_InverseKinematicsSolver].push_back("ikfast_katana5d"); - info.interfacenames[PT_InverseKinematicsSolver].push_back("ikfast_katana5d_trans"); + info.interfacenames[PT_IkSolver].push_back("ikfast"); + info.interfacenames[PT_IkSolver].push_back("wam7ikfast"); + info.interfacenames[PT_IkSolver].push_back("pa10ikfast"); + info.interfacenames[PT_IkSolver].push_back("pumaikfast"); + info.interfacenames[PT_IkSolver].push_back("ikfast_pr2_head"); + info.interfacenames[PT_IkSolver].push_back("ikfast_pr2_head_torso"); + info.interfacenames[PT_IkSolver].push_back("ikfast_pr2_rightarm"); + info.interfacenames[PT_IkSolver].push_back("ikfast_pr2_rightarm_torso"); + info.interfacenames[PT_IkSolver].push_back("ikfast_pr2_leftarm"); + info.interfacenames[PT_IkSolver].push_back("ikfast_pr2_leftarm_torso"); + info.interfacenames[PT_IkSolver].push_back("ikfast_schunk_lwa3"); + info.interfacenames[PT_IkSolver].push_back("ikfast_katana5d"); + info.interfacenames[PT_IkSolver].push_back("ikfast_katana5d_trans"); } OPENRAVE_PLUGIN_API void DestroyPlugin() diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index c0030e821a..0141f0caf4 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -10,6 +10,11 @@ install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink openrav install(FILES openrave-robot.py DESTINATION bin PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ COMPONENT ${COMPONENT_PREFIX}python RENAME openrave${OPENRAVE_BIN_SUFFIX}-robot.py) install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink openrave${OPENRAVE_BIN_SUFFIX}-robot.py openrave-robot.py WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/bin)" COMPONENT ${COMPONENT_PREFIX}python) +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../src/cppexamples/FindOpenRAVE.cmake" FindOpenRAVE) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/openrave-createplugin.py.in" "${CMAKE_CURRENT_BINARY_DIR}/openrave${OPENRAVE_BIN_SUFFIX}-createplugin.py" IMMEDIATE @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/openrave${OPENRAVE_BIN_SUFFIX}-createplugin.py" DESTINATION bin PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ COMPONENT ${COMPONENT_PREFIX}python) +install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink openrave${OPENRAVE_BIN_SUFFIX}-createplugin.py openrave-createplugin.py WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/bin)" COMPONENT ${COMPONENT_PREFIX}python) + # install rest python files install(FILES __init__.py metaclass.py openravepy_ext.py DESTINATION ${OPENRAVEPY_INSTALL_DIR} COMPONENT ${COMPONENT_PREFIX}python) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/examples" DESTINATION ${OPENRAVEPY_INSTALL_DIR} FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ COMPONENT ${COMPONENT_PREFIX}python PATTERN ".svn" EXCLUDE PATTERN ".pyc" EXCLUDE) diff --git a/python/bindings/openravepy_int.cpp b/python/bindings/openravepy_int.cpp index ae6408ce03..8b2bcb2934 100644 --- a/python/bindings/openravepy_int.cpp +++ b/python/bindings/openravepy_int.cpp @@ -2583,7 +2583,7 @@ class PyEnvironmentBase : public boost::enable_shared_from_this(pinterface),shared_from_this())); case PT_Controller: return PyControllerBasePtr(new PyControllerBase(boost::static_pointer_cast(pinterface),shared_from_this())); case PT_ProblemInstance: return PyProblemInstancePtr(new PyProblemInstance(boost::static_pointer_cast(pinterface),shared_from_this())); - case PT_InverseKinematicsSolver: return PyIkSolverBasePtr(new PyIkSolverBase(boost::static_pointer_cast(pinterface),shared_from_this())); + case PT_IkSolver: return PyIkSolverBasePtr(new PyIkSolverBase(boost::static_pointer_cast(pinterface),shared_from_this())); case PT_KinBody: return PyKinBodyPtr(new PyKinBody(boost::static_pointer_cast(pinterface),shared_from_this())); case PT_PhysicsEngine: return PyPhysicsEngineBasePtr(new PyPhysicsEngineBase(boost::static_pointer_cast(pinterface),shared_from_this())); case PT_Sensor: return PySensorBasePtr(new PySensorBase(boost::static_pointer_cast(pinterface),shared_from_this())); @@ -2723,7 +2723,7 @@ class PyEnvironmentBase : public boost::enable_shared_from_thisGetEnv(), name); + ProblemInstancePtr p = OpenRAVE::RaveCreateProblemInstance(pyenv->GetEnv(), name); if( !p ) { return PyProblemInstancePtr(); } @@ -3783,7 +3783,7 @@ BOOST_PYTHON_MODULE(openravepy_int) .value(RaveGetInterfaceName(PT_SensorSystem).c_str(),PT_SensorSystem) .value(RaveGetInterfaceName(PT_Controller).c_str(),PT_Controller) .value(RaveGetInterfaceName(PT_ProblemInstance).c_str(),PT_ProblemInstance) - .value(RaveGetInterfaceName(PT_InverseKinematicsSolver).c_str(),PT_InverseKinematicsSolver) + .value(RaveGetInterfaceName(PT_IkSolver).c_str(),PT_IkSolver) .value(RaveGetInterfaceName(PT_KinBody).c_str(),PT_KinBody) .value(RaveGetInterfaceName(PT_PhysicsEngine).c_str(),PT_PhysicsEngine) .value(RaveGetInterfaceName(PT_Sensor).c_str(),PT_Sensor) @@ -4833,7 +4833,8 @@ In python, the syntax is::\n\n\ def("RaveCreatePlanner",openravepy::RaveCreatePlanner,args("env","name"),DOXY_FN1(RaveCreatePlanner)); def("RaveCreateSensorSystem",openravepy::RaveCreateSensorSystem,args("env","name"),DOXY_FN1(RaveCreateSensorSystem)); def("RaveCreateController",openravepy::RaveCreateController,args("env","name"),DOXY_FN1(RaveCreateController)); - def("RaveCreateProblem",openravepy::RaveCreateProblem,args("env","name"),DOXY_FN1(RaveCreateProblem)); + def("RaveCreateProblem",openravepy::RaveCreateProblemInstance,args("env","name"),DOXY_FN1(RaveCreateProblemInstance)); + def("RaveCreateProblemInstance",openravepy::RaveCreateProblemInstance,args("env","name"),DOXY_FN1(RaveCreateProblemInstance)); def("RaveCreateIkSolver",openravepy::RaveCreateIkSolver,args("env","name"),DOXY_FN1(RaveCreateIkSolver)); def("RaveCreatePhysicsEngine",openravepy::RaveCreatePhysicsEngine,args("env","name"),DOXY_FN1(RaveCreatePhysicsEngine)); def("RaveCreateSensor",openravepy::RaveCreateSensor,args("env","name"),DOXY_FN1(RaveCreateSensor)); diff --git a/python/bindings/openravepy_int.h b/python/bindings/openravepy_int.h index dd3ce3661d..411a2ee0d1 100644 --- a/python/bindings/openravepy_int.h +++ b/python/bindings/openravepy_int.h @@ -354,7 +354,7 @@ namespace openravepy PyPlannerBasePtr RaveCreatePlanner(PyEnvironmentBasePtr pyenv, const std::string& name); PySensorSystemBasePtr RaveCreateSensorSystem(PyEnvironmentBasePtr pyenv, const std::string& name); PyControllerBasePtr RaveCreateController(PyEnvironmentBasePtr pyenv, const std::string& name); - PyProblemInstancePtr RaveCreateProblem(PyEnvironmentBasePtr pyenv, const std::string& name); + PyProblemInstancePtr RaveCreateProblemInstance(PyEnvironmentBasePtr pyenv, const std::string& name); PyIkSolverBasePtr RaveCreateIkSolver(PyEnvironmentBasePtr pyenv, const std::string& name); PyPhysicsEngineBasePtr RaveCreatePhysicsEngine(PyEnvironmentBasePtr pyenv, const std::string& name); PySensorBasePtr RaveCreateSensor(PyEnvironmentBasePtr pyenv, const std::string& name); diff --git a/python/openrave-createplugin.py.in b/python/openrave-createplugin.py.in new file mode 100644 index 0000000000..6e5443213c --- /dev/null +++ b/python/openrave-createplugin.py.in @@ -0,0 +1,217 @@ +#!/usr/bin/env python +# Copyright (C) 2011 Rosen Diankov +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from optparse import OptionParser + +import os, sys, platform +from subprocess import Popen, PIPE + +try: + from openravepy import * +except ImportError: + print "openravepy is not set into PYTHONPATH env variable, attempting to add" + # use openrave-config to get the correct install path + from subprocess import Popen, PIPE + try: + openrave_config = Popen(['openrave-config','--python-dir'],stdout=PIPE) + openravepy_path = openrave_config.communicate() + if openrave_config.returncode != 0: + raise OSError('bad args') + + sys.path.append(openravepy_path[0].strip()) + except OSError: + from distutils.sysconfig import get_python_lib + if sys.platform.startswith('win') or platform.system().lower() == 'windows': + # in windows so add the default openravepy installation + allnames = os.listdir('C:\\Program Files') + possibledirs = [os.path.join('C:\\Program Files',name) for name in allnames if name.startswith('openrave')] + if len(possibledirs) > 0: + sys.path.append(get_python_lib(1,prefix=possibledirs[0])) + from openravepy import * + +if __name__ == "__main__": + parser = OptionParser(usage='usage: %prog pluginname [options] ', description='Sets up a project directory and initial files for creating OpenRAVE plugins and executables.') + parser.add_option('--usecore', action='store_true',dest='usecore',default=False, help='If set, will create an executable that links to the core instead of creating a plugin.') + for type in InterfaceType.values.values(): + name = str(type).lower() + parser.add_option('--'+name, action='append',type='string',dest=name,default=[], help='create a %s interface'%name) + (options, args) = parser.parse_args() + plugindir = args[0] + pluginname = os.path.split(plugindir)[1] + mkdir_recursive(plugindir) + + args = {'pluginname':pluginname} + + interface_classmapping = {InterfaceType.planner:['PT_Planner','PlannerBase'],InterfaceType.robot:['PT_Robot','RobotBase'],InterfaceType.sensorsystem:['PT_SensorSystem','SensorSystemBase'],InterfaceType.controller:['PT_Controller','ControllerBase'],InterfaceType.probleminstance:['PT_ProblemInstance','ProblemInstance'],InterfaceType.iksolver:['PT_IkSolver','IkSolverBase'],InterfaceType.kinbody:['PT_KinBody','KinBody'],InterfaceType.physicsengine:['PT_PhysicsEngine','PhysicsEngineBase'],InterfaceType.sensor:['PT_Sensor','SensorBase'],InterfaceType.collisionchecker:['PT_CollisionChecker','CollisionCheckerBase'],InterfaceType.trajectory:['PT_Trajectory','TrajectoryBase'],InterfaceType.viewer:['PT_Viewer','ViewerBase']} + interface_contents = '' + interface_tests_py = '' + CreateInterfaceValidated = '' + GetPluginAttributesValidated = '' + for type in InterfaceType.values.values(): + name = str(type).lower() + typename = interface_classmapping[type][0] + classname = interface_classmapping[type][1] + for interfacename in getattr(options,name): + interface_args = {'name':interfacename,'lowername':interfacename.lower(),'typename':typename,'classname':classname,'createname':typename[3:]} + interface_contents += """class %(name)s : public %(classname)s +{ +public: + %(name)s(EnvironmentBasePtr penv, std::istream& ss) : %(classname)s(penv) { + RegisterCommand("MyCommand",boost::bind(&%(name)s::MyCommand,this,_1,_2), + "This is an example command"); + } + bool MyCommand(std::ostream& sout, std::istream& sinput) + { + std::string input; + sinput >> input; + sout << "output"; + return true; + } +}; + +"""%interface_args + CreateInterfaceValidated += """ if( type == %(typename)s && interfacename == "%(lowername)s" ) { + return InterfaceBasePtr(new %(name)s(penv,sinput)); + } +"""%interface_args + GetPluginAttributesValidated += 'info.interfacenames[%(typename)s].push_back("%(name)s");\n'%interface_args + interface_tests_py += " %(name)s = RaveCreate%(createname)s(env,'%(name)s')\n print %(name)s.SendCommand('help')"%interface_args + if options.usecore: + code_cpp = """#include +using namespace OpenRAVE; + +int main() +{ + RaveInitialize(true); // start openrave core + EnvironmentBasePtr penv = RaveCreateEnvironment(); // create the main environment + + // do work + penv->Load("scenes/myscene.env.xml"); + + RaveDestroy(); // make sure to destroy the OpenRAVE runtime + return 0; +} +""" + else: + code_cpp = """#include +#include +using namespace OpenRAVE; + +%s +// called to create a new plugin +InterfaceBasePtr CreateInterfaceValidated(InterfaceType type, const std::string& interfacename, std::istream& sinput, EnvironmentBasePtr penv) +{ +%s + return InterfaceBasePtr(); +} + +// called to query available plugins +void GetPluginAttributesValidated(PLUGININFO& info) +{ +%s +} + +// called before plugin is terminated +OPENRAVE_PLUGIN_API void DestroyPlugin() +{ +} + +"""%(interface_contents,CreateInterfaceValidated,GetPluginAttributesValidated) + + CMakeLists_txt = """cmake_minimum_required (VERSION 2.6.0) +project(%(pluginname)s) +find_package(OpenRAVE REQUIRED) + +if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX ) + add_definitions("-fno-strict-aliasing -Wall") +endif( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX ) + +# optional in case boost is used +find_package(Boost ${OpenRAVE_Boost_VERSION} EXACT) + +include_directories(${OpenRAVE_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) +link_directories(${OpenRAVE_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS}) +"""%args + if options.usecore: + CMakeLists_txt += """add_executable(%(pluginname)s %(pluginname)s.cpp) +set_target_properties(%(pluginname)s PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}" LINK_FLAGS "${OpenRAVE_LINK_FLAGS}") +target_link_libraries(%(pluginname)s ${OpenRAVE_CORE_LIBRARIES}) +install(TARGETS %(pluginname)s DESTINATION .) +"""%args + else: + CMakeLists_txt += """add_library(%(pluginname)s SHARED %(pluginname)s.cpp) +set_target_properties(%(pluginname)s PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}" LINK_FLAGS "${OpenRAVE_LINK_FLAGS}") +target_link_libraries(%(pluginname)s ${OpenRAVE_LIBRARIES}) +install(TARGETS %(pluginname)s DESTINATION .) +"""%args + + Makefile = """ +all: + @mkdir -p build; rm -f build/CMakeCache.txt + cd build && cmake .. && $(MAKE) $(PARALLEL_JOBS) + +install: + cd build && $(MAKE) $(PARALLEL_JOBS) install + +uninstall: + cd build && $(MAKE) uninstall + +clean: + -cd build && $(MAKE) clean + +"""%args + robot_xml = """ + +""" + scene_xml = """ + + +""" + if sys.platform.startswith('win') or platform.system().lower() == 'windows': + README = """Use your favorite generator. For example: + +mkdir build +cd build +cmake -G "Visual Studio 10" .. + +This will produce a *.sln file +""" + else: + README = """For linux users: + +make +python testplugin.py +""" + + open(os.path.join(plugindir,pluginname.lower()+'.cpp'),'w').write(code_cpp) + open(os.path.join(plugindir,'CMakeLists.txt'),'w').write(CMakeLists_txt) + open(os.path.join(plugindir,'Makefile'),'w').write(Makefile) + mkdir_recursive(os.path.join(plugindir,'scenes')) + open(os.path.join(plugindir,'scenes','myscene.env.xml'),'w').write(scene_xml) + mkdir_recursive(os.path.join(plugindir,'robots')) + open(os.path.join(plugindir,'robots','myrobot.robot.xml'),'w').write(robot_xml) + open(os.path.join(plugindir,'FindOpenRAVE.cmake'),'w').write("""@FindOpenRAVE@""") + + if not options.usecore: + testplugin_py="""#!/usr/bin/env python +from openravepy import * +RaveInitialize() +RaveLoadPlugin('build/%s') +try: + env=Environment() + env.Load('scenes/myscene.env.xml') +%s +finally: + RaveDestroy() +"""%(pluginname,interface_tests_py) + open(os.path.join(plugindir,'testplugin.py'),'w').write(testplugin_py) diff --git a/src/cppexamples/CMakeLists.txt b/src/cppexamples/CMakeLists.txt index 8b7ccbafc5..3512b227b4 100644 --- a/src/cppexamples/CMakeLists.txt +++ b/src/cppexamples/CMakeLists.txt @@ -18,73 +18,73 @@ endif() link_directories(${OpenRAVE_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS}) add_library(plugincpp SHARED plugincpp.cpp) -set_target_properties(plugincpp PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXXFLAGS}") +set_target_properties(plugincpp PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}") set_target_properties(plugincpp PROPERTIES LINK_FLAGS "${OpenRAVE_LINK_FLAGS}") target_link_libraries(plugincpp ${OpenRAVE_LIBRARIES}) install(TARGETS plugincpp DESTINATION . ) add_library(customreader SHARED customreader.cpp) -set_target_properties(customreader PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXXFLAGS}") +set_target_properties(customreader PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}") set_target_properties(customreader PROPERTIES LINK_FLAGS "${OpenRAVE_LINK_FLAGS}") target_link_libraries(customreader ${OpenRAVE_LIBRARIES}) install(TARGETS customreader DESTINATION . ) add_executable(orcollision orcollision.cpp) -set_target_properties(orcollision PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXXFLAGS}") +set_target_properties(orcollision PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}") set_target_properties(orcollision PROPERTIES LINK_FLAGS "${OpenRAVE_LINK_FLAGS}") target_link_libraries(orcollision ${OpenRAVE_LIBRARIES} ${OpenRAVE_CORE_LIBRARIES}) install(TARGETS orcollision DESTINATION . ) add_executable(orloadviewer orloadviewer.cpp) -set_target_properties(orloadviewer PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXXFLAGS}") +set_target_properties(orloadviewer PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}") set_target_properties(orloadviewer PROPERTIES LINK_FLAGS "${OpenRAVE_LINK_FLAGS}") target_link_libraries(orloadviewer ${OpenRAVE_LIBRARIES} ${OpenRAVE_CORE_LIBRARIES}) install(TARGETS orloadviewer DESTINATION . ) add_executable(orshowsensors orshowsensors.cpp) -set_target_properties(orshowsensors PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXXFLAGS}") +set_target_properties(orshowsensors PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}") set_target_properties(orshowsensors PROPERTIES LINK_FLAGS "${OpenRAVE_LINK_FLAGS}") target_link_libraries(orshowsensors ${OpenRAVE_LIBRARIES} ${OpenRAVE_CORE_LIBRARIES}) install(TARGETS orshowsensors DESTINATION . ) add_executable(ikfastloader ikfastloader.cpp) -set_target_properties(ikfastloader PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXXFLAGS}") +set_target_properties(ikfastloader PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}") set_target_properties(ikfastloader PROPERTIES LINK_FLAGS "${OpenRAVE_LINK_FLAGS}") target_link_libraries(ikfastloader ${OpenRAVE_LIBRARIES} ${OpenRAVE_CORE_LIBRARIES}) install(TARGETS ikfastloader DESTINATION . ) add_executable(ortrajectory ortrajectory.cpp) -set_target_properties(ortrajectory PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXXFLAGS}") +set_target_properties(ortrajectory PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}") set_target_properties(ortrajectory PROPERTIES LINK_FLAGS "${OpenRAVE_LINK_FLAGS}") target_link_libraries(ortrajectory ${OpenRAVE_LIBRARIES} ${OpenRAVE_CORE_LIBRARIES}) install(TARGETS ortrajectory DESTINATION . ) add_executable(orplanning_problem orplanning_problem.cpp) -set_target_properties(orplanning_problem PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXXFLAGS}") +set_target_properties(orplanning_problem PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}") set_target_properties(orplanning_problem PROPERTIES LINK_FLAGS "${OpenRAVE_LINK_FLAGS}") target_link_libraries(orplanning_problem ${OpenRAVE_LIBRARIES} ${OpenRAVE_CORE_LIBRARIES}) install(TARGETS orplanning_problem DESTINATION . ) add_executable(orplanning_planner orplanning_planner.cpp) -set_target_properties(orplanning_planner PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXXFLAGS}") +set_target_properties(orplanning_planner PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}") set_target_properties(orplanning_planner PROPERTIES LINK_FLAGS "${OpenRAVE_LINK_FLAGS}") target_link_libraries(orplanning_planner ${OpenRAVE_LIBRARIES} ${OpenRAVE_CORE_LIBRARIES}) install(TARGETS orplanning_planner DESTINATION . ) add_executable(orplanning_ik orplanning_ik.cpp) -set_target_properties(orplanning_ik PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXXFLAGS}") +set_target_properties(orplanning_ik PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}") set_target_properties(orplanning_ik PROPERTIES LINK_FLAGS "${OpenRAVE_LINK_FLAGS}") target_link_libraries(orplanning_ik ${OpenRAVE_LIBRARIES} ${OpenRAVE_CORE_LIBRARIES}) install(TARGETS orplanning_ik DESTINATION . ) add_executable(ormulticontrol ormulticontrol.cpp) -set_target_properties(ormulticontrol PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXXFLAGS}") +set_target_properties(ormulticontrol PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}") set_target_properties(ormulticontrol PROPERTIES LINK_FLAGS "${OpenRAVE_LINK_FLAGS}") target_link_libraries(ormulticontrol ${OpenRAVE_LIBRARIES} ${OpenRAVE_CORE_LIBRARIES}) install(TARGETS ormulticontrol DESTINATION . ) add_executable(orconveyormovement orconveyormovement.cpp) -set_target_properties(orconveyormovement PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXXFLAGS}") +set_target_properties(orconveyormovement PROPERTIES COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}") set_target_properties(orconveyormovement PROPERTIES LINK_FLAGS "${OpenRAVE_LINK_FLAGS}") target_link_libraries(orconveyormovement ${OpenRAVE_LIBRARIES} ${OpenRAVE_CORE_LIBRARIES}) install(TARGETS orconveyormovement DESTINATION . ) @@ -110,7 +110,7 @@ if( Boost_PYTHON_FOUND AND Boost_THREAD_FOUND ) include_directories(${PYTHON_INCLUDE_PATH} ${OpenRAVE_INCLUDE_DIRS}) add_library(orpythonbinding SHARED orpythonbinding.cpp) target_link_libraries(orpythonbinding ${OpenRAVE_LIBRARIES} ${PYTHON_LIBRARIES} ${Boost_PYTHON_LIBRARY} ${Boost_THREAD_LIBRARY}) - set_target_properties(orpythonbinding PROPERTIES PREFIX "" COMPILE_FLAGS "${OpenRAVE_CXXFLAGS}") + set_target_properties(orpythonbinding PROPERTIES PREFIX "" COMPILE_FLAGS "${OpenRAVE_CXX_FLAGS}") if( WIN32 ) set_target_properties(orpythonbinding PROPERTIES SUFFIX ".pyd") endif() diff --git a/src/cppexamples/FindOpenRAVE.cmake b/src/cppexamples/FindOpenRAVE.cmake index 7ec58e7fd0..e03bca106d 100644 --- a/src/cppexamples/FindOpenRAVE.cmake +++ b/src/cppexamples/FindOpenRAVE.cmake @@ -3,7 +3,7 @@ # # OpenRAVE provides an environment for testing, developing, and deploying motion planning algorithms # in real-world robotics applications. The main focus is on simulation and analysis of kinematic and -# geometric information related to motion planning. OpenRAVEā€™s stand-alone nature allows is to be easily +# geometric information related to motion planning. OpenRAVE's stand-alone nature allows is to be easily # integrated into existing robotics systems. An important target application is industrial robotics automation. #================================================================================== diff --git a/src/cppexamples/customreader.cpp b/src/cppexamples/customreader.cpp index 4af322abac..4467fa0897 100644 --- a/src/cppexamples/customreader.cpp +++ b/src/cppexamples/customreader.cpp @@ -142,7 +142,7 @@ void GetPluginAttributesValidated(PLUGININFO& info) info.interfacenames[PT_Controller].push_back("CustomController"); } -RAVE_PLUGIN_API void DestroyPlugin() +OPENRAVE_PLUGIN_API void DestroyPlugin() { s_RegisteredReader.reset(); // unregister the reader } diff --git a/src/cppexamples/plugincpp.cpp b/src/cppexamples/plugincpp.cpp index 905fbf2f70..0039cf73ff 100644 --- a/src/cppexamples/plugincpp.cpp +++ b/src/cppexamples/plugincpp.cpp @@ -62,7 +62,7 @@ void GetPluginAttributesValidated(PLUGININFO& info) info.interfacenames[PT_ProblemInstance].push_back("MyProblem"); } -RAVE_PLUGIN_API void DestroyPlugin() +OPENRAVE_PLUGIN_API void DestroyPlugin() { RAVELOG_INFO("destroying plugin\n"); } diff --git a/src/libopenrave-core/xmlreaders.cpp b/src/libopenrave-core/xmlreaders.cpp index 8b05fbb953..a990fac51d 100644 --- a/src/libopenrave-core/xmlreaders.cpp +++ b/src/libopenrave-core/xmlreaders.cpp @@ -2341,12 +2341,12 @@ namespace OpenRAVEXMLParser string iklibraryname = _ss.str(); IkSolverBasePtr piksolver; - if( RaveHasInterface(PT_InverseKinematicsSolver,iklibraryname) ) { + if( RaveHasInterface(PT_IkSolver,iklibraryname) ) { piksolver = RaveCreateIkSolver(_probot->GetEnv(), iklibraryname); } if( !piksolver ) { // try adding the current directory - if( RaveHasInterface(PT_InverseKinematicsSolver,GetParseDirectory()+s_filesep+iklibraryname)) { + if( RaveHasInterface(PT_IkSolver,GetParseDirectory()+s_filesep+iklibraryname)) { string fullname = GetParseDirectory(); fullname.push_back(s_filesep); fullname += iklibraryname; piksolver = RaveCreateIkSolver(_probot->GetEnv(), fullname); } @@ -3195,7 +3195,7 @@ namespace OpenRAVEXMLParser case PT_SensorSystem: return InterfaceXMLReaderPtr(new DummyInterfaceXMLReader(penv,pinterface,xmltag,atts)); case PT_Controller: return InterfaceXMLReaderPtr(new ControllerXMLReader(penv,pinterface,atts)); case PT_ProblemInstance: return InterfaceXMLReaderPtr(new ProblemXMLReader(penv,pinterface,atts)); - case PT_InverseKinematicsSolver: return InterfaceXMLReaderPtr(new DummyInterfaceXMLReader(penv,pinterface,xmltag,atts)); + case PT_IkSolver: return InterfaceXMLReaderPtr(new DummyInterfaceXMLReader(penv,pinterface,xmltag,atts)); case PT_KinBody: { KinBodyPtr pbody = RaveInterfaceCast(pinterface); int rootoffset = 0; diff --git a/src/libopenrave/libopenrave.cpp b/src/libopenrave/libopenrave.cpp index 3ac128d796..8f8291dd42 100644 --- a/src/libopenrave/libopenrave.cpp +++ b/src/libopenrave/libopenrave.cpp @@ -200,7 +200,7 @@ class RaveGlobal : private boost::noncopyable, public boost::enable_shared_from_ _mapinterfacenames[PT_SensorSystem] = "sensorsystem"; _mapinterfacenames[PT_Controller] = "controller"; _mapinterfacenames[PT_ProblemInstance] = "probleminstance"; - _mapinterfacenames[PT_InverseKinematicsSolver] = "inversekinematicssolver"; + _mapinterfacenames[PT_IkSolver] = "iksolver"; _mapinterfacenames[PT_KinBody] = "kinbody"; _mapinterfacenames[PT_PhysicsEngine] = "physicsengine"; _mapinterfacenames[PT_Sensor] = "sensor"; @@ -596,7 +596,12 @@ ControllerBasePtr RaveCreateController(EnvironmentBasePtr penv, const std::strin ProblemInstancePtr RaveCreateProblem(EnvironmentBasePtr penv, const std::string& name) { - return RaveGlobal::instance()->GetDatabase()->CreateProblem(penv, name); + return RaveGlobal::instance()->GetDatabase()->CreateProblemInstance(penv, name); +} + +ProblemInstancePtr RaveCreateProblemInstance(EnvironmentBasePtr penv, const std::string& name) +{ + return RaveGlobal::instance()->GetDatabase()->CreateProblemInstance(penv, name); } IkSolverBasePtr RaveCreateIkSolver(EnvironmentBasePtr penv, const std::string& name) diff --git a/src/libopenrave/plugindatabase.h b/src/libopenrave/plugindatabase.h index 6875f06e81..efea1115c8 100644 --- a/src/libopenrave/plugindatabase.h +++ b/src/libopenrave/plugindatabase.h @@ -286,8 +286,8 @@ class RaveDatabase : public boost::enable_shared_from_this PlannerBasePtr CreatePlanner(EnvironmentBasePtr penv, const std::string& name) { return RaveInterfaceCast(Create(penv, PT_Planner, name)); } SensorSystemBasePtr CreateSensorSystem(EnvironmentBasePtr penv, const std::string& name) { return RaveInterfaceCast(Create(penv, PT_SensorSystem, name)); } ControllerBasePtr CreateController(EnvironmentBasePtr penv, const std::string& name) { return RaveInterfaceCast(Create(penv, PT_Controller, name)); } - ProblemInstancePtr CreateProblem(EnvironmentBasePtr penv, const std::string& name) { return RaveInterfaceCast(Create(penv, PT_ProblemInstance, name)); } - IkSolverBasePtr CreateIkSolver(EnvironmentBasePtr penv, const std::string& name) { return RaveInterfaceCast(Create(penv, PT_InverseKinematicsSolver, name)); } + ProblemInstancePtr CreateProblemInstance(EnvironmentBasePtr penv, const std::string& name) { return RaveInterfaceCast(Create(penv, PT_ProblemInstance, name)); } + IkSolverBasePtr CreateIkSolver(EnvironmentBasePtr penv, const std::string& name) { return RaveInterfaceCast(Create(penv, PT_IkSolver, name)); } PhysicsEngineBasePtr CreatePhysicsEngine(EnvironmentBasePtr penv, const std::string& name) { return RaveInterfaceCast(Create(penv, PT_PhysicsEngine, name)); } SensorBasePtr CreateSensor(EnvironmentBasePtr penv, const std::string& name) { return RaveInterfaceCast(Create(penv, PT_Sensor, name)); } CollisionCheckerBasePtr CreateCollisionChecker(EnvironmentBasePtr penv, const std::string& name) { return RaveInterfaceCast(Create(penv, PT_CollisionChecker, name)); } @@ -721,11 +721,23 @@ class RaveDatabase : public boost::enable_shared_from_this } #ifndef _WIN32 if( plibrary == NULL ) { - // unix libraries are prefixed with 'lib' - if( libraryname.size() > 3 && libraryname.substr(0,3) != string("lib") ) { - libraryname = string("lib") + libraryname; + // unix libraries are prefixed with 'lib', first have to split +#if defined(HAVE_BOOST_FILESYSTEM) && BOOST_VERSION >= 103600 // stem() was introduced in 1.36 + boost::filesystem::path _librarypath(libraryname, boost::filesystem::native); + string librarypath = _librarypath.parent_path().string(); +#if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + string libraryfilename = _librarypath.filename().string(); +#else + string libraryfilename = _librarypath.filename(); +#endif + if( libraryfilename.size() > 3 && libraryfilename.substr(0,3) != string("lib") ) { + libraryname = librarypath; + libraryname += s_filesep; + libraryname += string("lib"); + libraryname += libraryfilename; plibrary = _SysLoadLibrary(libraryname.c_str(),OPENRAVE_LAZY_LOADING); } +#endif } #endif