Skip to content
Browse files

behaviors now get loaded and work to the best of my knowledge

  • Loading branch information...
1 parent ef4eb47 commit 04218e5cc158472be57c85d41475a76b2a9ce1b3 @oneamtu oneamtu committed Nov 16, 2011
View
4 src/CMakeLists.txt
@@ -4,6 +4,10 @@ cmake_minimum_required(VERSION 2.8.0)
# set up sub projects and includes
+set( NBITES_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
+set( MAN_SRC_DIR ${NBITES_SRC_DIR}/man )
+set( QTOOL_SRC_DIR ${NBITES_SRC_DIR}/qtool )
+
include_directories( . ) #current directory
add_subdirectory(man)
# this pulls all the include dependencies of man so that the qtool can inherit them
View
2 src/man/comm/__init__.py
@@ -1,5 +1,5 @@
try:
- from ._comm import (Comm,
+ from _comm import (Comm,
GameController,
inst,
STATE_FINISHED,
View
10 src/man/noggin/Noggin.cpp
@@ -527,14 +527,15 @@ void Noggin::modifySysPath ()
const char *cwd = test.c_str();
# else //WEBOTS
# if defined OFFLINE || defined STRAIGHT
- const char *cwd = "/usr/local/nao-1.6/modules/lib";
+ string dir1 = string(getenv("NBITES_DIR")) + "/build/qtool";
+ string dir2 = string(getenv("NBITES_DIR")) + "/build/qtool/man";
# else
const char *cwd = "/home/nao/naoqi/lib";
# endif
# endif
#ifdef DEBUG_NOGGIN_INITIALIZATION
- printf(" Adding %s to sys.path\n", cwd);
+// printf(" Adding %s to sys.path\n", cwd);
#endif
PyObject *sys_module = PyImport_ImportModule("sys");
@@ -547,7 +548,12 @@ void Noggin::modifySysPath ()
}else {
PyObject *dict = PyModule_GetDict(sys_module);
PyObject *path = PyDict_GetItemString(dict, "path");
+#ifdef OFFLINE
+ PyList_Append(path, PyString_FromString(dir1.c_str()));
+ PyList_Append(path, PyString_FromString(dir2.c_str()));
+#else
PyList_Append(path, PyString_FromString(cwd));
+#endif
Py_DECREF(sys_module);
}
}
View
2 src/man/noggin/navigator/NavStates.py
@@ -3,7 +3,7 @@
from . import NavHelper as helper
from . import WalkHelper as walker
from . import NavTransitions as navTrans
-from ..objects import RobotLocation
+from objects import RobotLocation
from math import fabs
View
27 src/qtool/offline/CMakeLists.txt
@@ -36,5 +36,28 @@ target_link_libraries(
manpreloader
${QT_LIBRARIES}
)
-
-add_dependencies( offline man )
+
+# Copy files from source directory to destination directory, substituting any
+# variables. Create destination directory if it does not exist.
+# http://stackoverflow.com/questions/697560/how-to-copy-directory-from-source-tree-to-binary-tree
+
+macro(copy_py_sources srcDir destDir)
+ message(STATUS "Configuring directory ${destDir}")
+ make_directory(${destDir})
+
+ file(GLOB_RECURSE templateFiles RELATIVE ${srcDir} ${srcDir}/*.py)
+ foreach(templateFile ${templateFiles})
+ set(srcTemplatePath ${srcDir}/${templateFile})
+ if(NOT IS_DIRECTORY ${srcTemplatePath})
+ message(STATUS "Configuring file ${templateFile}")
+ configure_file(
+ ${srcTemplatePath}
+ ${destDir}/${templateFile}
+ @ONLY)
+ endif(NOT IS_DIRECTORY ${srcTemplatePath})
+ endforeach(templateFile)
+endmacro(copy_py_sources)
+
+add_dependencies( offline man )
+
+copy_py_sources( ${MAN_SRC_DIR} ${CMAKE_BINARY_DIR}/man )

0 comments on commit 04218e5

Please sign in to comment.
Something went wrong with that request. Please try again.