From: <na...@us...> - 2009-05-05 01:24:57
|
Revision: 7619 http://playerstage.svn.sourceforge.net/playerstage/?rev=7619&view=rev Author: natepak Date: 2009-05-05 01:24:49 +0000 (Tue, 05 May 2009) Log Message: ----------- Added creation of gazeborc to cmake Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/cmake/SearchForStuff.cmake code/gazebo/trunk/server/CMakeLists.txt Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-05 00:12:13 UTC (rev 7618) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-05 01:24:49 UTC (rev 7619) @@ -23,7 +23,7 @@ SET (ODE_VERSION 0.10.1 CACHE INTERNAL "ODE Version Requirement") SET (gazebo_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH "Location of CMake scripts") -set (gazebo_cflags "-ggdb -g2 -Wall -fPIC" CACHE INTERNAL "Gazebo CFlags") +SET (gazebo_cflags "-ggdb -g2 -Wall -fPIC" CACHE INTERNAL "Gazebo CFlags") ADD_SUBDIRECTORY(libgazebo) ADD_SUBDIRECTORY(server) Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake =================================================================== --- code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-05 00:12:13 UTC (rev 7618) +++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-05 01:24:49 UTC (rev 7619) @@ -5,6 +5,7 @@ INCLUDE (FindPkgConfig) SET (INCLUDE_AV ON CACHE BOOL "Include audio/video functionality" FORCE) +SET (OGRE_LIBRARY_PATH "/usr/local/lib" CACHE INTERNAL "Ogre library path") ######################################## # Find packages @@ -13,6 +14,8 @@ IF (NOT OGRE_FOUND) MESSAGE (SEND_ERROR "\nError: Ogre3d and development files not found. See the following website: http://www.orge3d.org") ELSE (NOT OGRE_FOUND) + + SET (OGRE_LIBRARY_PATH ${OGRE_LIBRARY_DIRS} CACHE INTERNAL "Ogre library path") APPEND_TO_CACHED_LIST(gazeboserver_include_dirs "Include dirs" ${OGRE_INCLUDE_DIRS}) APPEND_TO_CACHED_LIST(gazeboserver_link_dirs "Link dirs" @@ -112,15 +115,17 @@ ######################################## # Find avformat and avcodec -SET (libavformat_search_path - /usr/include /usr/include/libavformat /usr/local/include - /usr/local/include/libavformat -) - -SET (libavcodec_search_path - /usr/include /usr/include/libavcodec /usr/local/include - /usr/local/include/libavcodec -) - -FIND_PATH(LIBAVFORMAT_PATH avformat.h ${libavformat_search_path}) -FIND_PATH(LIBAVCODEC_PATH avcodec.h ${libavcodec_search_path}) +IF (INCLUDE_AV) + SET (libavformat_search_path + /usr/include /usr/include/libavformat /usr/local/include + /usr/local/include/libavformat + ) + + SET (libavcodec_search_path + /usr/include /usr/include/libavcodec /usr/local/include + /usr/local/include/libavcodec + ) + + FIND_PATH(LIBAVFORMAT_PATH avformat.h ${libavformat_search_path}) + FIND_PATH(LIBAVCODEC_PATH avcodec.h ${libavcodec_search_path}) +ENDIF (INCLUDE_AV) Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-05 00:12:13 UTC (rev 7618) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-05 01:24:49 UTC (rev 7619) @@ -96,4 +96,9 @@ INSTALL (TARGETS gazebo DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) INSTALL (FILES ${headers} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/gazebo COMPONENT headers) +######################################## +# Make the gazebo rc file +CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/gazeborc.cmake ${CMAKE_CURRENT_BINARY_DIR}/.gazeborc @ONLY) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/.gazeborc DESTINATION ~/) + GAZEBOSERVER_RESET_LISTS() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-05 02:29:29
|
Revision: 7621 http://playerstage.svn.sourceforge.net/playerstage/?rev=7621&view=rev Author: natepak Date: 2009-05-05 02:29:25 +0000 (Tue, 05 May 2009) Log Message: ----------- Added more functionality to cmake Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/cmake/GazeboUtils.cmake code/gazebo/trunk/cmake/SearchForStuff.cmake code/gazebo/trunk/server/CMakeLists.txt Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-05 02:25:57 UTC (rev 7620) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-05 02:29:25 UTC (rev 7621) @@ -1,4 +1,3 @@ - CMAKE_MINIMUM_REQUIRED( VERSION 2.6 FATAL_ERROR ) IF(COMMAND CMAKE_POLICY) @@ -17,15 +16,31 @@ SET (gazeboserver_link_dirs_desc "List of server link directories" CACHE INTERNAL "Link dirs description" FORCE) SET (gazeboserver_link_libs_desc "List of server link libraries" - CACHE INTERNAL "Link libs" FORCE) + CACHE INTERNAL "Link libs description" FORCE) +SET (gazeboserver_cflags_desc "List of server cflags" + CACHE INTERNAL "Server cflags description" FORCE) SET (OGRE_VERSION 1.6.0 CACHE INTERNAL "Ogre Version Requirement") SET (ODE_VERSION 0.10.1 CACHE INTERNAL "ODE Version Requirement") -SET (gazebo_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH "Location of CMake scripts") -SET (gazebo_cflags "-ggdb -g2 -Wall -fPIC" CACHE INTERNAL "Gazebo CFlags") +SET (gazebo_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH + "Location of CMake scripts") +MESSAGE (STATUS "====== Finding 3rd Party Packages ======") +INCLUDE (${gazebo_cmake_dir}/SearchForStuff.cmake) +MESSAGE (STATUS "----------------------------------------") + + + ADD_SUBDIRECTORY(libgazebo) ADD_SUBDIRECTORY(server) -#ADD_SUBDIRECTORY(player) +IF (INCLUDE_PLAYER) + ADD_SUBDIRECTORY(player) +ENDIF (INCLUDE_PLAYER) + +IF (INCLUDE_WEBGAZEBO) + Add_SUBDIRECTORY(webgazebo) +ENDIF (INCLUDE_WEBGAZEBO) + + Modified: code/gazebo/trunk/cmake/GazeboUtils.cmake =================================================================== --- code/gazebo/trunk/cmake/GazeboUtils.cmake 2009-05-05 02:25:57 UTC (rev 7620) +++ code/gazebo/trunk/cmake/GazeboUtils.cmake 2009-05-05 02:29:25 UTC (rev 7621) @@ -21,6 +21,15 @@ ENDMACRO (APPEND_TO_SERVER_SOURCES) ############################################################################### +# Macro to turn a list into a string (why doesn't CMake have this built-in?) +MACRO (LIST_TO_STRING _string _list) + SET (${_string}) + FOREACH (_item ${_list}) + SET (${_string} "${${_string}} ${_item}") + ENDFOREACH (_item) +ENDMACRO (LIST_TO_STRING) + +############################################################################### # Reset lists MACRO (GAZEBOSERVER_RESET_LISTS) SET (gazeboserver_sources "" CACHE INTERNAL @@ -31,4 +40,6 @@ ${gazeboserver_link_dirs_desc} FORCE) SET (gazeboserver_link_libs "" CACHE INTERNAL ${gazeboserver_link_libs_desc} FORCE) + SET (gazeboserver_cflags "" CACHE INTERNAL + ${gazeboserver_cflags_desc} FORCE) ENDMACRO (GAZEBOSERVER_RESET_LISTS) Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake =================================================================== --- code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-05 02:25:57 UTC (rev 7620) +++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-05 02:29:25 UTC (rev 7621) @@ -5,6 +5,7 @@ INCLUDE (FindPkgConfig) SET (INCLUDE_AV ON CACHE BOOL "Include audio/video functionality" FORCE) +SET (INCLUDE_WEBGAZEBO ON CACHE BOOL "Build webgazebo" FORCE) SET (OGRE_LIBRARY_PATH "/usr/local/lib" CACHE INTERNAL "Ogre library path") ######################################## @@ -16,48 +17,72 @@ ELSE (NOT OGRE_FOUND) SET (OGRE_LIBRARY_PATH ${OGRE_LIBRARY_DIRS} CACHE INTERNAL "Ogre library path") - APPEND_TO_CACHED_LIST(gazeboserver_include_dirs "Include dirs" + APPEND_TO_CACHED_LIST(gazeboserver_include_dirs + ${gazeboserver_include_dirs_desc} ${OGRE_INCLUDE_DIRS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_dirs "Link dirs" + APPEND_TO_CACHED_LIST(gazeboserver_link_dirs + ${gazeboserver_link_dirs_desc} ${OGRE_LIBRARY_DIRS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_libs "Link libs" ${OGRE_LINK_LIBS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_libs "Link libs" ${OGRE_LIBRARIES}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${OGRE_LINK_LIBS}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${OGRE_LIBRARIES}) ENDIF (NOT OGRE_FOUND) pkg_check_modules(ODE ode>=${ODE_VERSION}) IF (NOT ODE_FOUND) MESSAGE (SEND_ERROR "\nError: ODE and development files not found. See the following website: http://www.ode.org") ELSE (NOT ODE_FOUND) - APPEND_TO_CACHED_LIST(gazeboserver_include_dirs "Include dirs" + APPEND_TO_CACHED_LIST(gazeboserver_include_dirs + ${gazeboserver_include_dirs_desc} ${ODE_INCLUDE_DIRS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_dirs "Link dirs" + APPEND_TO_CACHED_LIST(gazeboserver_link_dirs + ${gazeboserver_link_dirs_desc} ${ODE_LIBRARY_DIRS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_libs "Link libs" ${ODE_LINK_LIBS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_libs "Link libs" ${ODE_LIBRARIES}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${ODE_LINK_LIBS}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${ODE_LIBRARIES}) ENDIF (NOT ODE_FOUND) pkg_check_modules(XML libxml-2.0) IF (NOT XML_FOUND) MESSAGE (SEND_ERROR "\nError: libxml2 and development files not found. See the following website: http://www.xmlsoft.org") ELSE (NOT XML_FOUND) - APPEND_TO_CACHED_LIST(gazeboserver_include_dirs "Include dirs" + APPEND_TO_CACHED_LIST(gazeboserver_include_dirs + ${gazeboserver_include_dirs_desc} ${XML_INCLUDE_DIRS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_dirs "Link dirs" + APPEND_TO_CACHED_LIST(gazeboserver_link_dirs + ${gazeboserver_link_dirs_desc} ${XML_LIBRARY_DIRS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_libs "Link libs" ${XML_LINK_LIBS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_libs "Link libs" ${XML_LIBRARIES}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${XML_LINK_LIBS}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${XML_LIBRARIES}) ENDIF (NOT XML_FOUND) pkg_check_modules(XFT xft) IF (NOT XFT_FOUND) MESSAGE (SEND_ERROR "\nError: XFT and development files not found. See the following website: http://www.fontconfig.org") ELSE (NOT XFT_FOUND) - APPEND_TO_CACHED_LIST(gazeboserver_include_dirs "Include dirs" + APPEND_TO_CACHED_LIST(gazeboserver_include_dirs + ${gazeboserver_include_dirs_desc} ${XFT_INCLUDE_DIRS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_dirs "Link dirs" + APPEND_TO_CACHED_LIST(gazeboserver_link_dirs + ${gazeboserver_link_dirs_desc} ${XFT_LIBRARY_DIRS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_libs "Link libs" ${XFT_LINK_LIBS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_libs "Link libs" ${XFT_LIBRARIES}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${XFT_LINK_LIBS}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${XFT_LIBRARIES}) ENDIF (NOT XFT_FOUND) pkg_check_modules(OAL openal) @@ -65,12 +90,20 @@ SET (INCLUDE_AV OFF CACHE BOOL "Include audio/video functionality" FORCE) MESSAGE (STATUS "Warning: Openal and development files not found. Audio capabilities will be disabled. See the following website: http://connect.creativelabs.com/openal/default.aspx") ELSE (NOT OAL_FOUND) - APPEND_TO_CACHED_LIST(gazeboserver_include_dirs "Include dirs" + APPEND_TO_CACHED_LIST(gazeboserver_cflags + ${gazeboserver_cflags_desc} "-DHAVE_OPENAL" ) + APPEND_TO_CACHED_LIST(gazeboserver_include_dirs + ${gazeboserver_include_dirs_desc} ${OAL_INCLUDE_DIRS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_dirs "Link dirs" + APPEND_TO_CACHED_LIST(gazeboserver_link_dirs + ${gazeboserver_link_dirs_desc} ${OAL_LIBRARY_DIRS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_libs "Link libs" ${OAL_LINK_LIBS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_libs "Link libs" ${OAL_LIBRARIES}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${OAL_LINK_LIBS}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${OAL_LIBRARIES}) ENDIF (NOT OAL_FOUND) pkg_check_modules(AVF libavformat) @@ -78,12 +111,18 @@ SET (INCLUDE_AV OFF CACHE BOOL "Include audio/video functionality" FORCE) MESSAGE (STATUS "Warning: libavformat and development files not found. Audio capabilities will be disabled.") ELSE (NOT AVF_FOUND) - APPEND_TO_CACHED_LIST(gazeboserver_include_dirs "Include dirs" + APPEND_TO_CACHED_LIST(gazeboserver_include_dirs + ${gazeboserver_include_dirs_desc} ${AVF_INCLUDE_DIRS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_dirs "Link dirs" + APPEND_TO_CACHED_LIST(gazeboserver_link_dirs + ${gazeboserver_link_dirs_desc} ${AVF_LIBRARY_DIRS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_libs "Link libs" ${AVF_LINK_LIBS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_libs "Link libs" ${AVF_LIBRARIES}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${AVF_LINK_LIBS}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${AVF_LIBRARIES}) ENDIF (NOT AVF_FOUND) pkg_check_modules(AVC libavcodec) @@ -91,14 +130,42 @@ SET (INCLUDE_AV OFF CACHE BOOL "Include audio/video functionality" FORCE) MESSAGE (STATUS "Warning: libavcodec and development files not found. Audio capabilities will be disabled.") ELSE (NOT AVC_FOUND) - APPEND_TO_CACHED_LIST(gazeboserver_include_dirs "Include dirs" + APPEND_TO_CACHED_LIST(gazeboserver_include_dirs + ${gazeboserver_include_dirs_desc} ${AVC_INCLUDE_DIRS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_dirs "Link dirs" + APPEND_TO_CACHED_LIST(gazeboserver_link_dirs + ${gazeboserver_link_dirs_desc} ${AVC_LIBRARY_DIRS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_libs "Link libs" ${AVC_LINK_LIBS}) - APPEND_TO_CACHED_LIST(gazeboserver_link_libs "Link libs" ${AVC_LIBRARIES}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${AVC_LINK_LIBS}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${AVC_LIBRARIES}) ENDIF (NOT AVC_FOUND) + pkg_check_modules(PLAYER playerc++) + IF (NOT PLAYER_FOUND) + SET (INCLUDE_PLAYER OFF CACHE BOOL "Build gazebo plugin for player" FORCE) + MESSAGE (STATUS "Warning: Player not found. The gazebo plugin for player will not be built. See the following website: http://playerstage.sourceforge.net") + ELSE (NOT PLAYER_FOUND) + SET (INCLUDE_PLAYER ON CACHE BOOL "Build gazebo plugin for player" FORCE) + SET (PLAYER_INCLUDE_DIRS ${PLAYER_INCLUDE_DIRS} CACHE INTERNAL + "Player include directory") + SET (PLAYER_LINK_DIRS ${PLAYER_LINK_DIRS} CACHE INTERNAL + "Player link directory") + SET (PLAYER_LINK_LIBS ${PLAYER_LIBRARIES} CACHE INTERNAL + "Player libraries") + ENDIF (NOT PLAYER_FOUND) + + pkg_check_modules(WEBSIM websim) + IF (NOT WEBSIM_FOUND) + SET (INCLUDE_WEBGAZEBO OFF CACHE BOOL "Build webgazebo" FORCE) + MESSAGE (STATUS "Warning: Websim not found. Webgazebo will not be built") + ELSE (NOT WEBSIM_FOUND) + ENDIF (NOT WEBSIM_FOUND) + + ELSE (PKG_CONFIG_FOUND) MESSAGE (FATAL_ERROR "\nError: pkg-config not found") SET (BUILD_GAZEBO OFF CACHE BOOL "Build Gazebo" FORCE) @@ -127,5 +194,47 @@ ) FIND_PATH(LIBAVFORMAT_PATH avformat.h ${libavformat_search_path}) + IF (NOT LIBAVFORMAT_PATH) + MESSAGE (STATUS "Looking for avformat.h - not found") + MESSAGE (STATUS " Warning: audio/video will not be built") + ELSE (NOT LIBAVFORMAT_PATH) + MESSAGE (STATUS "Looking for avformat.h - found") + ENDIF (NOT LIBAVFORMAT_PATH) + FIND_PATH(LIBAVCODEC_PATH avcodec.h ${libavcodec_search_path}) + IF (NOT LIBAVCODEC_PATH) + MESSAGE (STATUS "Looking for avcodec.h - not found") + MESSAGE (STATUS " Warning: audio/video will not be built") + ELSE (NOT LIBAVCODEC_PATH) + MESSAGE (STATUS "Looking for avcodec.h - found") + ENDIF (NOT LIBAVCODEC_PATH) + ENDIF (INCLUDE_AV) + + +######################################## +# Find libevent +SET (libevent_search_path /usr/include /usr/local/include) +FIND_PATH(LIBEVENT_PATH event.h ${libevent_search_path}) +IF (NOT LIBEVENT_PATH) + MESSAGE (STATUS "Looking for event.h - not found") + MESSAGE (STATUS " Warning: webgazebo will not be built") + SET (INCLUDE_WEBGAZEBO OFF CACHE BOOL "Found libevent" FORCE) +ELSE (NOT LIBEVENT_PATH) + MESSAGE (STATUS "Looking for event.h - found") +ENDIF (NOT LIBEVENT_PATH) + +######################################## +# Find yaml +SET (libyaml_search_path /usr/include /usr/local/include) +FIND_PATH(LIBYAML_PATH yaml.h ${libyaml_search_path}) +IF (NOT LIBYAML_PATH) + MESSAGE (STATUS "Looking for yaml.h - not found") + MESSAGE (STATUS " Warning: webgazebo will not be built") + SET (INCLUDE_WEBGAZEBO OFF CACHE BOOL "Found libevent" FORCE) +ELSE (NOT LIBYAML_PATH) + MESSAGE (STATUS "Looking for yaml.h - found") +ENDIF (NOT LIBYAML_PATH) + +## TODO: Finish webgazebo....needs list for directories and libs. Add in glib + Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-05 02:25:57 UTC (rev 7620) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-05 02:29:25 UTC (rev 7621) @@ -1,5 +1,4 @@ INCLUDE (${gazebo_cmake_dir}/GazeboUtils.cmake) -INCLUDE (${gazebo_cmake_dir}/SearchForStuff.cmake) ######################################## # Include all the search paths for headers @@ -90,7 +89,10 @@ ADD_EXECUTABLE(gazebo ${gazeboserver_sources} main.cc) -SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES COMPILE_FLAGS ${gazebo_cflags}) +APPEND_TO_CACHED_LIST(gazeboserver_cflags ${gazeboserver_cflags_desc} "-fPIC;-WAll") +LIST_TO_STRING(GAZEBO_CFLAGS "${gazeboserver_cflags}") + +SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES COMPILE_FLAGS ${GAZEBO_CFLAGS}) TARGET_LINK_LIBRARIES( gazebo ${gazeboserver_link_libs} ${FLTK_LIBRARIES} ${Boost_LIBRARIES} gazeboshm) INSTALL (TARGETS gazebo DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-05 02:33:22
|
Revision: 7623 http://playerstage.svn.sourceforge.net/playerstage/?rev=7623&view=rev Author: natepak Date: 2009-05-05 02:33:12 +0000 (Tue, 05 May 2009) Log Message: ----------- Added more CMakeLists.txt Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/cmake/SearchForStuff.cmake code/gazebo/trunk/server/CMakeLists.txt Added Paths: ----------- code/gazebo/trunk/Media/CMakeLists.txt code/gazebo/trunk/Media/audio/CMakeLists.txt code/gazebo/trunk/Media/fonts/CMakeLists.txt code/gazebo/trunk/Media/materials/CMakeLists.txt code/gazebo/trunk/Media/materials/programs/CMakeLists.txt code/gazebo/trunk/Media/materials/scripts/CMakeLists.txt code/gazebo/trunk/Media/materials/textures/CMakeLists.txt code/gazebo/trunk/Media/packs/CMakeLists.txt code/gazebo/trunk/worlds/CMakeLists.txt code/gazebo/trunk/worlds/models/CMakeLists.txt Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-05 02:30:06 UTC (rev 7622) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) @@ -6,8 +6,9 @@ ENDIF(COMMAND CMAKE_POLICY) PROJECT (Gazebo) -SET (GAZEBO_VERSION 0.9) STRING (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) +SET (GAZEBO_VERSION 0.9.0) +MESSAGE (STATUS "${PROJECT_NAME} version ${GAZEBO_VERSION}") SET (gazeboserver_sources_desc "List of server sources" CACHE INTERNAL "Gazebo server sources list description" FORCE) @@ -34,6 +35,8 @@ ADD_SUBDIRECTORY(libgazebo) ADD_SUBDIRECTORY(server) +ADD_SUBDIRECTORY(worlds) +ADD_SUBDIRECTORY(Media) IF (INCLUDE_PLAYER) ADD_SUBDIRECTORY(player) @@ -42,5 +45,3 @@ IF (INCLUDE_WEBGAZEBO) Add_SUBDIRECTORY(webgazebo) ENDIF (INCLUDE_WEBGAZEBO) - - Added: code/gazebo/trunk/Media/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) @@ -0,0 +1,4 @@ +ADD_SUBDIRECTORY(audio) +ADD_SUBDIRECTORY(fonts) +ADD_SUBDIRECTORY(materials) +ADD_SUBDIRECTORY(packs) Added: code/gazebo/trunk/Media/audio/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/audio/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/audio/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) @@ -0,0 +1,2 @@ +SET(files test.mp3) +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/Media/audio) Added: code/gazebo/trunk/Media/fonts/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/fonts/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/fonts/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) @@ -0,0 +1,11 @@ +SET (files arial.ttf + console.ttf + font_arial.png + font_matisse_itc.png + Gazebo.fontdef + maiden.ttf + sample.fontdef + solo5.ttf +) + +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/Media/fonts/) Added: code/gazebo/trunk/Media/materials/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/materials/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/materials/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) @@ -0,0 +1,3 @@ +ADD_SUBDIRECTORY(programs) +ADD_SUBDIRECTORY(scripts) +ADD_SUBDIRECTORY(textures) Added: code/gazebo/trunk/Media/materials/programs/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/materials/programs/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/materials/programs/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) @@ -0,0 +1,13 @@ +SET (files AmbientOneTexture.frag + AmbientOneTexture.vert + DepthMap.frag + DepthMap.vert + DirectionalLight.frag + DirectionalLight.vert + PointLight.frag + PointLight.vert + SpotLight.frag + SpotLight.vert +) + +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/Media/materials/programs/) Added: code/gazebo/trunk/Media/materials/scripts/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/materials/scripts/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/materials/scripts/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) @@ -0,0 +1,3 @@ +SET (files Gazebo.material) + +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/Media/materials/scripts/) Added: code/gazebo/trunk/Media/materials/textures/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/materials/textures/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/materials/textures/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) @@ -0,0 +1,89 @@ +SET (files 10points.png + 1D_Noise2.png + 1D_Noise.png + 8x8PagesSplotches2.png + aureola.png + basic_droplet.png + BeachStones.jpg + black.jpg + blue_jaiqua.jpg + BumpyMetal.jpg + cave.png + ceiling_tiled.jpg + cel_shading_diffuse.png + cel_shading_edge.png + cel_shading_specular.png + Chrome.jpg + clouds.jpg + cursor.png + dirt01.jpg + Dirt.jpg + droplet.png + egyptrockyfull.jpg + flare.png + flaretrail.png + floor.png + fw12b.jpg + gras_02.png + grass_1024.jpg + GreenSkin.jpg + hardwood_floor.jpg + heartpsg.png + HeatNoise.tga + lightwood.png + logo.png + map.png + MtlPlat2.jpg + NMBalls.png + nm_bk.png + NMBumpsOut.png + nm_dn.png + nm_fr.png + NMHollyBumps.png + nm_lf.png + nm_rt.png + NMStripes.png + nm_up.png + normalNoiseColor.png + NPRMetallic.tga + ogreborderUp.png + paintedWall.jpg + pioneerBody.jpg + plate1.png + plate.png + r2skin.jpg + Random3D.dds + ribbonband.png + rockwall_NH.tga + rockwall.tga + rough_plaster.jpg + RustedMetal.jpg + RustyBarrel.png + RustySteel.jpg + Sepia1D.tga + smokecolors.png + smoke.png + snow_1024.jpg + spacesky.jpg + stone-2.png + terrain_detail.jpg + terrain.png + terrain_texture.jpg + terr_dirt-grass.jpg + terr_rock6.jpg + terr_rock-dirt.jpg + texmap2.jpg + turret_new.png + turret.png + Water01.jpg + Water02.jpg + WaterNormal1.tga + WaterNormal2.tga + waveNM.png + waves2.dds + WeirdEye.png + willowMap.png + WoodPallet.png +) + +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/Media/materials/textures/) Added: code/gazebo/trunk/Media/packs/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/packs/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/packs/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) @@ -0,0 +1,7 @@ +cubemapsJS.zip +cubemap.zip +dragon.zip +fresneldemo.zip +OgreCore.zip +ogretestmap.zip +skybox.zip Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake =================================================================== --- code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-05 02:30:06 UTC (rev 7622) +++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-05 02:33:12 UTC (rev 7623) @@ -165,7 +165,6 @@ ELSE (NOT WEBSIM_FOUND) ENDIF (NOT WEBSIM_FOUND) - ELSE (PKG_CONFIG_FOUND) MESSAGE (FATAL_ERROR "\nError: pkg-config not found") SET (BUILD_GAZEBO OFF CACHE BOOL "Build Gazebo" FORCE) Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-05 02:30:06 UTC (rev 7622) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) @@ -85,7 +85,6 @@ APPEND_TO_SERVER_SOURCES(${sources}) -INCLUDE_DIRECTORIES( ${gazeboserver_include_dirs} ) ADD_EXECUTABLE(gazebo ${gazeboserver_sources} main.cc) Added: code/gazebo/trunk/worlds/CMakeLists.txt =================================================================== --- code/gazebo/trunk/worlds/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/worlds/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) @@ -0,0 +1,29 @@ +ADD_SUBDIRECTORY(models) + +SET (files audio.world + bandit.world + bsp.world + bumper.world + epuck_single.world + epuck.world + factory.world + federation.world + laser.world + lights.world + map.world + openal.world + pioneer2at.world + pioneer2dx_camera.world + pioneer2dx_gripper.world + pioneer2dx.world + simplecar.world + simpleshapes.world + stereocamera.world + terrain.world + test.world + trimesh.world + wizbot.world +) + +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/worlds/) + Added: code/gazebo/trunk/worlds/models/CMakeLists.txt =================================================================== --- code/gazebo/trunk/worlds/models/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/worlds/models/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) @@ -0,0 +1,17 @@ +SET (files athene.model + bandit.model + epuck_new.model + generalshop.model + hokuyo-urg-04l.model + imu.model + pioneer2at.model + pioneer2dx.model + pioneer2gripper.model + RZR-002.model + sicklms200.model + simplecar.model + sonyvid30.model + wizbot.model +) + +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/worlds/models) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-05 20:27:54
|
Revision: 7624 http://playerstage.svn.sourceforge.net/playerstage/?rev=7624&view=rev Author: natepak Date: 2009-05-05 20:27:48 +0000 (Tue, 05 May 2009) Log Message: ----------- Added more cmake files Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/Media/CMakeLists.txt code/gazebo/trunk/Media/packs/CMakeLists.txt code/gazebo/trunk/cmake/SearchForStuff.cmake code/gazebo/trunk/libgazebo/CMakeLists.txt code/gazebo/trunk/server/CMakeLists.txt code/gazebo/trunk/webgazebo/WebGazebo.cc code/gazebo/trunk/webgazebo/WebGazebo.hh code/gazebo/trunk/webgazebo/main.cc Added Paths: ----------- code/gazebo/trunk/Media/models/CMakeLists.txt code/gazebo/trunk/Media/models/PioneerArm/CMakeLists.txt code/gazebo/trunk/Media/models/bandit/CMakeLists.txt code/gazebo/trunk/Media/models/blender/CMakeLists.txt code/gazebo/trunk/Media/models/epuck/CMakeLists.txt code/gazebo/trunk/Media/models/sonyvid30/CMakeLists.txt code/gazebo/trunk/Media/sets/CMakeLists.txt code/gazebo/trunk/Media/sets/pioneer2at/Pioneer2at/CMakeLists.txt code/gazebo/trunk/Media/sets/pioneer2dx/Pioneer2dx/CMakeLists.txt code/gazebo/trunk/webgazebo/CMakeLists.txt Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-05 20:27:48 UTC (rev 7624) @@ -32,7 +32,6 @@ MESSAGE (STATUS "----------------------------------------") - ADD_SUBDIRECTORY(libgazebo) ADD_SUBDIRECTORY(server) ADD_SUBDIRECTORY(worlds) Modified: code/gazebo/trunk/Media/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) +++ code/gazebo/trunk/Media/CMakeLists.txt 2009-05-05 20:27:48 UTC (rev 7624) @@ -2,3 +2,5 @@ ADD_SUBDIRECTORY(fonts) ADD_SUBDIRECTORY(materials) ADD_SUBDIRECTORY(packs) +ADD_SUBDIRECTORY(models) +ADD_SUBDIRECTORY(sets) Added: code/gazebo/trunk/Media/models/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/models/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/models/CMakeLists.txt 2009-05-05 20:27:48 UTC (rev 7624) @@ -0,0 +1,21 @@ +ADD_SUBDIRECTORY(bandit) +ADD_SUBDIRECTORY(blender) +ADD_SUBDIRECTORY(epuck) +ADD_SUBDIRECTORY(PioneerArm) +ADD_SUBDIRECTORY(sonyvid30) + +SET (files column.mesh + geosphere4500.mesh + geosphere8000.mesh + kitchen.mesh + knot.mesh + razor.mesh + robot.mesh + sicklms200.mesh + sphere.mesh + unitpyramid.mesh + wheel.mesh + WoodPallet.mesh +) + +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/Media/models) Added: code/gazebo/trunk/Media/models/PioneerArm/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/models/PioneerArm/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/models/PioneerArm/CMakeLists.txt 2009-05-05 20:27:48 UTC (rev 7624) @@ -0,0 +1,20 @@ +SET (files Base.mesh + Base.mesh.xml + Gripper.mesh + Gripper.mesh.xml + Link01.mesh + Link01.mesh.xml + Link02.mesh + Link02.mesh.xml + Link03.mesh + Link03.mesh.xml + Link04.mesh + Link04.mesh.xml + Link05.mesh + Link05.mesh.xml + OgreXMLConverter.log + PioneerArm.blend + Scene.material +) + +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/Media/models/PioneerArm) Added: code/gazebo/trunk/Media/models/bandit/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/models/bandit/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/models/bandit/CMakeLists.txt 2009-05-05 20:27:48 UTC (rev 7624) @@ -0,0 +1,19 @@ +SET (files bicep.mesh + body_model_1.mesh + eyebrow.mesh + head_1.mesh + left_forearm.mesh + left_hand.mesh + left_shoulder.mesh + lowerlip.mesh + neck_1.mesh + right_forearm.mesh + right_hand.mesh + right_shoulder.mesh + shoulder_mounting_1.mesh + thumb.mesh + upperlip.mesh + wrist.mesh +) + +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/Media/models/bandit) Added: code/gazebo/trunk/Media/models/blender/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/models/blender/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/models/blender/CMakeLists.txt 2009-05-05 20:27:48 UTC (rev 7624) @@ -0,0 +1,2 @@ +SET (files sick_lms200.blend) +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/Media/models/blender) Added: code/gazebo/trunk/Media/models/epuck/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/models/epuck/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/models/epuck/CMakeLists.txt 2009-05-05 20:27:48 UTC (rev 7624) @@ -0,0 +1,15 @@ +SET (files camera.material + camera.mesh + chassis.material + chassis.mesh + epuck_chassis.mesh + new_epuck.mesh + plate.material + plate.mesh + ring.material + ring.mesh + turret.material + turret.mesh +) + +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/Media/models/epuck) Added: code/gazebo/trunk/Media/models/sonyvid30/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/models/sonyvid30/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/models/sonyvid30/CMakeLists.txt 2009-05-05 20:27:48 UTC (rev 7624) @@ -0,0 +1,6 @@ +SET (files sonyvid30_bottom.mesh + sonyvid30_mid.mesh + sonyvid30_top.mesh +) + +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/Media/models/sonyvid30) Modified: code/gazebo/trunk/Media/packs/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/packs/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) +++ code/gazebo/trunk/Media/packs/CMakeLists.txt 2009-05-05 20:27:48 UTC (rev 7624) @@ -1,7 +1,10 @@ -cubemapsJS.zip -cubemap.zip -dragon.zip -fresneldemo.zip -OgreCore.zip -ogretestmap.zip -skybox.zip +SET (files cubemapsJS.zip + cubemap.zip + dragon.zip + fresneldemo.zip + OgreCore.zip + ogretestmap.zip + skybox.zip +) + +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/Media/packs) Added: code/gazebo/trunk/Media/sets/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/sets/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/sets/CMakeLists.txt 2009-05-05 20:27:48 UTC (rev 7624) @@ -0,0 +1,2 @@ +ADD_SUBDIRECTORY(pioneer2at/Pioneer2at) +ADD_SUBDIRECTORY(pioneer2dx/Pioneer2dx) Added: code/gazebo/trunk/Media/sets/pioneer2at/Pioneer2at/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/sets/pioneer2at/Pioneer2at/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/sets/pioneer2at/Pioneer2at/CMakeLists.txt 2009-05-05 20:27:48 UTC (rev 7624) @@ -0,0 +1,13 @@ +SET (files chassis.mesh + chassis_top.mesh + Cylinder.012.mesh.xml + hub.mesh + OgreXMLConverter.log + Scene.material + sonarbank.mesh + sonar.mesh + tire.mesh + wheel.mesh +) + +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/Media/sets/pioneer2at/Pioneer2at) Added: code/gazebo/trunk/Media/sets/pioneer2dx/Pioneer2dx/CMakeLists.txt =================================================================== --- code/gazebo/trunk/Media/sets/pioneer2dx/Pioneer2dx/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/Media/sets/pioneer2dx/Pioneer2dx/CMakeLists.txt 2009-05-05 20:27:48 UTC (rev 7624) @@ -0,0 +1,11 @@ +SET (files chassis.mesh + chassis_top.mesh + hub.mesh + Scene.material + sonarbank.mesh + sonar.mesh + tire.mesh + wheel.mesh +) + +INSTALL(FILES ${files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gazebo/Media/sets/pioneer2dx/Pioneer2dx) Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake =================================================================== --- code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-05 02:33:12 UTC (rev 7623) +++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-05 20:27:48 UTC (rev 7624) @@ -163,6 +163,12 @@ SET (INCLUDE_WEBGAZEBO OFF CACHE BOOL "Build webgazebo" FORCE) MESSAGE (STATUS "Warning: Websim not found. Webgazebo will not be built") ELSE (NOT WEBSIM_FOUND) + SET (WEBSIM_INCLUDE_DIRS ${WEBSIM_INCLUDE_DIRS} CACHE INTERNAL + "Websim include directory") + SET (WEBSIM_LINK_DIRS ${WEBSIM_LINK_DIRS} CACHE INTERNAL + "Websim link directory") + SET (WEBSIM_LINK_LIBS ${WEBSIM_LIBRARIES} CACHE INTERNAL + "Websim libraries") ENDIF (NOT WEBSIM_FOUND) ELSE (PKG_CONFIG_FOUND) @@ -234,6 +240,3 @@ ELSE (NOT LIBYAML_PATH) MESSAGE (STATUS "Looking for yaml.h - found") ENDIF (NOT LIBYAML_PATH) - -## TODO: Finish webgazebo....needs list for directories and libs. Add in glib - Modified: code/gazebo/trunk/libgazebo/CMakeLists.txt =================================================================== --- code/gazebo/trunk/libgazebo/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) +++ code/gazebo/trunk/libgazebo/CMakeLists.txt 2009-05-05 20:27:48 UTC (rev 7624) @@ -1,6 +1,6 @@ INCLUDE (FindBoost) -FIND_PACKAGE( Boost 1.34.1 COMPONENTS thread) +FIND_PACKAGE( Boost 1.34.1 COMPONENTS thread signals) SET (sources Server.cc Client.cc @@ -10,8 +10,13 @@ Graphics3dIface.cc ) +SET (headers gazebo.h IfaceFactory.hh) + ADD_LIBRARY(gazeboshm SHARED ${sources}) +TARGET_LINK_LIBRARIES( gazeboshm ${Boost_LIBRARIES}) + INSTALL (TARGETS gazeboshm DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) +INSTALL (FILES ${headers} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/gazebo) CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/libgazeboshm_pkgconfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/libgazeboshm.pc @ONLY) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgazeboshm.pc DESTINATION lib/pkgconfig COMPONENT pkgconfig) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgazeboshm.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig COMPONENT pkgconfig) Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-05 02:33:12 UTC (rev 7623) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-05 20:27:48 UTC (rev 7624) @@ -88,11 +88,11 @@ ADD_EXECUTABLE(gazebo ${gazeboserver_sources} main.cc) -APPEND_TO_CACHED_LIST(gazeboserver_cflags ${gazeboserver_cflags_desc} "-fPIC;-WAll") +APPEND_TO_CACHED_LIST(gazeboserver_cflags ${gazeboserver_cflags_desc} "-fPIC;-Wall") LIST_TO_STRING(GAZEBO_CFLAGS "${gazeboserver_cflags}") SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES COMPILE_FLAGS ${GAZEBO_CFLAGS}) -TARGET_LINK_LIBRARIES( gazebo ${gazeboserver_link_libs} ${FLTK_LIBRARIES} ${Boost_LIBRARIES} gazeboshm) +TARGET_LINK_LIBRARIES( gazebo gazeboshm ${gazeboserver_link_libs} ${FLTK_LIBRARIES} ${Boost_LIBRARIES}) INSTALL (TARGETS gazebo DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) INSTALL (FILES ${headers} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/gazebo COMPONENT headers) Added: code/gazebo/trunk/webgazebo/CMakeLists.txt =================================================================== --- code/gazebo/trunk/webgazebo/CMakeLists.txt (rev 0) +++ code/gazebo/trunk/webgazebo/CMakeLists.txt 2009-05-05 20:27:48 UTC (rev 7624) @@ -0,0 +1,18 @@ +SET (sources WebGazebo.cc ../server/Quatern.cc ../server/Vector3.cc ../server/Angle.cc) + +INCLUDE_DIRECTORIES( .. ../server ${WEBSIM_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/libgazebo ) +LINK_DIRECTORIES( ${WEBSIM_LINK_DIRS} gazeboshm) + +SET_SOURCE_FILES_PROPERTIES(${sources} PROPERTIES COMPILE_FLAGS + '-DINSTALL_PREFIX="/usr/local/"') +ADD_LIBRARY(webgz ${sources}) + +ADD_EXECUTABLE(webgazebo main.cc) +ADD_EXECUTABLE(client client.cc) + +TARGET_LINK_LIBRARIES( webgz yaml event ${WEBSIM_LINK_LIBS}) +TARGET_LINK_LIBRARIES( webgazebo gazeboshm yaml event ${WEBSIM_LINK_LIBS} ${Boost_LIBRARIES} webgz) +TARGET_LINK_LIBRARIES( client gazeboshm yaml event ${WEBSIM_LINK_LIBS} ${Boost_LIBRARIES} webgz) + +INSTALL(TARGETS webgazebo DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) +INSTALL(TARGETS webgz DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) Modified: code/gazebo/trunk/webgazebo/WebGazebo.cc =================================================================== --- code/gazebo/trunk/webgazebo/WebGazebo.cc 2009-05-05 02:33:12 UTC (rev 7623) +++ code/gazebo/trunk/webgazebo/WebGazebo.cc 2009-05-05 20:27:48 UTC (rev 7624) @@ -35,7 +35,7 @@ #include <time.h> #include <string.h> -#include "../server/Quatern.hh" +#include "Quatern.hh" // TODO: // - make ghost models not collide, fall, etc. @@ -43,7 +43,7 @@ WebGazebo::WebGazebo(const std::string& fedfile, const std::string& host, unsigned short port, double dtol, double atol) : - websim::WebSim(fedfile, host, port), + websim::WebSim(host, port), sq_dist_tol(dtol*dtol), sq_ang_tol(atol*atol) { // Hook up to Gazebo @@ -69,6 +69,7 @@ bool WebGazebo::GetModelPVA(const std::string& name, + websim::Time &t, websim::Pose& p, websim::Velocity& v, websim::Acceleration& a, @@ -108,6 +109,19 @@ return true; } +/** Get the current simulation time */ +websim::Time +WebGazebo::GetTime() +{ + websim::Time t; + + t.sec = (unsigned long)this->simIface->data->simTime; + t.usec = (this->simIface->data->simTime - t.sec) * 1e6; + + return t; +} + + bool WebGazebo::SetModelPVA(const std::string& name, const websim::Pose& p, Modified: code/gazebo/trunk/webgazebo/WebGazebo.hh =================================================================== --- code/gazebo/trunk/webgazebo/WebGazebo.hh 2009-05-05 02:33:12 UTC (rev 7623) +++ code/gazebo/trunk/webgazebo/WebGazebo.hh 2009-05-05 20:27:48 UTC (rev 7624) @@ -60,11 +60,15 @@ const websim::Acceleration& a, std::string& error); virtual bool GetModelPVA(const std::string& name, + websim::Time &t, websim::Pose& p, websim::Velocity& v, websim::Acceleration& a, std::string& error); + /** Get the current simulation time */ + virtual websim::Time GetTime(); + private: double sq_dist_tol, sq_ang_tol; boost::mutex goMutex; Modified: code/gazebo/trunk/webgazebo/main.cc =================================================================== --- code/gazebo/trunk/webgazebo/main.cc 2009-05-05 02:33:12 UTC (rev 7623) +++ code/gazebo/trunk/webgazebo/main.cc 2009-05-05 20:27:48 UTC (rev 7624) @@ -54,7 +54,7 @@ for(;;) { - wg.Update(); + //wg.Update(); wg.Go(1.0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-08 16:55:57
|
Revision: 7627 http://playerstage.svn.sourceforge.net/playerstage/?rev=7627&view=rev Author: natepak Date: 2009-05-08 16:55:50 +0000 (Fri, 08 May 2009) Log Message: ----------- Added ability to build gazebo for release, debug, or profile Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/server/CMakeLists.txt Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-08 00:23:57 UTC (rev 7626) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-08 16:55:50 UTC (rev 7627) @@ -27,11 +27,42 @@ SET (gazebo_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH "Location of CMake scripts") +# Build type cflags +SET (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -fPIC -Wall " CACHE INTERNAL "C Flags for release" FORCE) +SET (CMAKE_C_FLAGS_DEBUG " -ggdb -fPIC " CACHE INTERNAL "C Flags fro debug" FORCE) +SET (CMAKE_C_FLAGS_PROFILE " -ggdb -pg -fPIC " CACHE INTERNAL "C Flags for profile" FORCE) + +# Build type link flags +SET (CMAKE_LINK_FLAGS_RELEASE "" CACHE INTERNAL "Link flags fro release" FORCE) +SET (CMAKE_LINK_FLAGS_DEBUG "" CACHE INTERNAL "Link flags for debug" FORCE) +SET (CMAKE_LINK_FLAGS_PROFILE "" CACHE INTERNAL "Link flags for profile" FORCE) + +FIND_LIBRARY(PROFILER "profiler") +IF (PROFILER) + SET (CMAKE_LINK_FLAGS_PROFILE "${CMAKE_LINK_FLAGS_PROFILE} -lprofiler" + CACHE INTERNAL "Link flags for profile" FORCE) +ENDIF (PROFILER) + +FIND_LIBRARY(TCMALLOC "tcmalloc") +IF (TCMALLOC) + SET (CMAKE_LINK_FLAGS_PROFILE "${CMAKE_LINK_FLAGS_PROFILE} -ltcmalloc" + CACHE INTERNAL "Link flags for profile" FORCE) +ENDIF (TCMALLOC) + +IF (NOT CMAKE_BUILD_TYPE) + SET (CMAKE_BUILD_TYPE "release" CACHE STRING + "Choose the type of build, options are: debug release profile" FORCE) +ENDIF (NOT CMAKE_BUILD_TYPE) + +STRING(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE) + +MESSAGE (STATUS "Build Type: ${CMAKE_BUILD_TYPE}") + + MESSAGE (STATUS "====== Finding 3rd Party Packages ======") INCLUDE (${gazebo_cmake_dir}/SearchForStuff.cmake) MESSAGE (STATUS "----------------------------------------") - ADD_SUBDIRECTORY(libgazebo) ADD_SUBDIRECTORY(server) ADD_SUBDIRECTORY(worlds) Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-08 00:23:57 UTC (rev 7626) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-08 16:55:50 UTC (rev 7627) @@ -91,7 +91,10 @@ APPEND_TO_CACHED_LIST(gazeboserver_cflags ${gazeboserver_cflags_desc} "-fPIC;-Wall") LIST_TO_STRING(GAZEBO_CFLAGS "${gazeboserver_cflags}") -SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES COMPILE_FLAGS ${GAZEBO_CFLAGS}) +SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES COMPILE_FLAGS "${GAZEBO_CFLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}") + +SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}}) + TARGET_LINK_LIBRARIES( gazebo gazeboshm ${gazeboserver_link_libs} ${FLTK_LIBRARIES} ${Boost_LIBRARIES}) INSTALL (TARGETS gazebo DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-08 21:10:07
|
Revision: 7629 http://playerstage.svn.sourceforge.net/playerstage/?rev=7629&view=rev Author: natepak Date: 2009-05-08 21:09:56 +0000 (Fri, 08 May 2009) Log Message: ----------- Added options to manually specify boost paths Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/cmake/SearchForStuff.cmake code/gazebo/trunk/libgazebo/CMakeLists.txt code/gazebo/trunk/server/CMakeLists.txt Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-08 18:34:57 UTC (rev 7628) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-08 21:09:56 UTC (rev 7629) @@ -27,38 +27,31 @@ SET (gazebo_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH "Location of CMake scripts") +SET (boost_include_dirs "" CACHE STRING "Boost include paths. Use this to override automatic detection.") +SET (boost_library_dirs "" CACHE STRING "Boost library paths. Use this to override automatic detection.") +SET (boost_libraries "" CACHE STRING "Boost libraries. Use this to override automatic detection.") + + +##################################### # Build type cflags SET (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -fPIC -Wall " CACHE INTERNAL "C Flags for release" FORCE) SET (CMAKE_C_FLAGS_DEBUG " -ggdb -fPIC " CACHE INTERNAL "C Flags fro debug" FORCE) SET (CMAKE_C_FLAGS_PROFILE " -ggdb -pg -fPIC " CACHE INTERNAL "C Flags for profile" FORCE) +##################################### # Build type link flags SET (CMAKE_LINK_FLAGS_RELEASE "" CACHE INTERNAL "Link flags fro release" FORCE) SET (CMAKE_LINK_FLAGS_DEBUG "" CACHE INTERNAL "Link flags for debug" FORCE) SET (CMAKE_LINK_FLAGS_PROFILE "" CACHE INTERNAL "Link flags for profile" FORCE) -FIND_LIBRARY(PROFILER "profiler") -IF (PROFILER) - SET (CMAKE_LINK_FLAGS_PROFILE "${CMAKE_LINK_FLAGS_PROFILE} -lprofiler" - CACHE INTERNAL "Link flags for profile" FORCE) -ENDIF (PROFILER) - -FIND_LIBRARY(TCMALLOC "tcmalloc") -IF (TCMALLOC) - SET (CMAKE_LINK_FLAGS_PROFILE "${CMAKE_LINK_FLAGS_PROFILE} -ltcmalloc" - CACHE INTERNAL "Link flags for profile" FORCE) -ENDIF (TCMALLOC) - +##################################### +# Set the default build type IF (NOT CMAKE_BUILD_TYPE) SET (CMAKE_BUILD_TYPE "release" CACHE STRING "Choose the type of build, options are: debug release profile" FORCE) ENDIF (NOT CMAKE_BUILD_TYPE) - STRING(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE) -MESSAGE (STATUS "Build Type: ${CMAKE_BUILD_TYPE}") - - MESSAGE (STATUS "====== Finding 3rd Party Packages ======") INCLUDE (${gazebo_cmake_dir}/SearchForStuff.cmake) MESSAGE (STATUS "----------------------------------------") @@ -75,3 +68,6 @@ IF (INCLUDE_WEBGAZEBO) Add_SUBDIRECTORY(webgazebo) ENDIF (INCLUDE_WEBGAZEBO) + +MESSAGE (STATUS "Build Type: ${CMAKE_BUILD_TYPE}") +MESSAGE (STATUS "Install path: ${CMAKE_INSTALL_PREFIX}") Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake =================================================================== --- code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-08 18:34:57 UTC (rev 7628) +++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-08 21:09:56 UTC (rev 7629) @@ -1,7 +1,6 @@ INCLUDE (${gazebo_cmake_dir}/GazeboUtils.cmake) INCLUDE (FindFLTK) -INCLUDE (FindBoost) INCLUDE (FindPkgConfig) SET (INCLUDE_AV ON CACHE BOOL "Include audio/video functionality" FORCE) @@ -178,13 +177,34 @@ ######################################## -# Find Boost -FIND_PACKAGE( Boost 1.34.1 COMPONENTS thread signals) -IF (NOT Boost_FOUND) - MESSAGE (FATAL_ERROR "Boost thread and signals not found") - SET (BUILD_GAZEBO OFF CACHE BOOL "Build Gazebo" FORCE) -ENDIF (NOT Boost_FOUND) +# Find Boost, if not specified manually +IF (NOT boost_include_dirs AND NOT boost_library_dirs AND NOT boost_libraries ) + MESSAGE(STATUS "HERE") + INCLUDE (FindBoost) + FIND_PACKAGE( Boost 1.34.1 COMPONENTS thread signals) + IF (NOT Boost_FOUND) + MESSAGE (FATAL_ERROR "Boost thread and signals not found") + SET (BUILD_GAZEBO OFF CACHE BOOL "Build Gazebo" FORCE) + ENDIF (NOT Boost_FOUND) + + LIST_TO_STRING(tmp "${Boost_INCLUDE_DIRS}") + SET (boost_include_dirs ${Boost_INCLUDE_DIRS} CACHE STRING + "Boost include paths. Use this to override automatic detection." FORCE) + + LIST_TO_STRING(tmp "${Boost_LIBRARY_DIRS}") + SET (boost_library_dirs ${Boost_LIBRARY_DIRS} CACHE STRING + "Boost library paths. Use this to override automatic detection." FORCE) + + LIST_TO_STRING(tmp "${Boost_LIBRARIES}") + SET (boost_libraries ${Boost_LIBRARIES} CACHE STRING + "Boost libraries. Use this to override automatic detection." FORCE) +ENDIF (NOT boost_include_dirs AND NOT boost_library_dirs AND NOT boost_libraries ) + +MESSAGE (STATUS "Boost IDIRS ${boost_include_dirs}") +MESSAGE (STATUS "Boost LDIRS ${boost_library_dirs}") +MESSAGE (STATUS "Boost LIBS ${boost_libraries}") + ######################################## # Find avformat and avcodec IF (INCLUDE_AV) @@ -240,3 +260,21 @@ ELSE (NOT LIBYAML_PATH) MESSAGE (STATUS "Looking for yaml.h - found") ENDIF (NOT LIBYAML_PATH) + +######################################## +# Find profiler library, optional +FIND_LIBRARY(PROFILER "profiler") +IF (PROFILER) + SET (CMAKE_LINK_FLAGS_PROFILE "${CMAKE_LINK_FLAGS_PROFILE} -lprofiler" + CACHE INTERNAL "Link flags for profile" FORCE) +ENDIF (PROFILER) + +######################################## +# Find tcmalloc library, optional +FIND_LIBRARY(TCMALLOC "tcmalloc") +IF (TCMALLOC) + SET (CMAKE_LINK_FLAGS_PROFILE "${CMAKE_LINK_FLAGS_PROFILE} -ltcmalloc" + CACHE INTERNAL "Link flags for profile" FORCE) +ENDIF (TCMALLOC) + + Modified: code/gazebo/trunk/libgazebo/CMakeLists.txt =================================================================== --- code/gazebo/trunk/libgazebo/CMakeLists.txt 2009-05-08 18:34:57 UTC (rev 7628) +++ code/gazebo/trunk/libgazebo/CMakeLists.txt 2009-05-08 21:09:56 UTC (rev 7629) @@ -1,7 +1,29 @@ -INCLUDE (FindBoost) +######################################## +# Find Boost, if not specified manually +IF (NOT boost_include_dirs AND NOT boost_library_dirs AND NOT boost_libraries ) + MESSAGE(STATUS "HERE") + INCLUDE (FindBoost) + FIND_PACKAGE( Boost 1.34.1 COMPONENTS thread signals) + IF (NOT Boost_FOUND) + MESSAGE (FATAL_ERROR "Boost thread and signals not found") + SET (BUILD_GAZEBO OFF CACHE BOOL "Build Gazebo" FORCE) + ENDIF (NOT Boost_FOUND) -FIND_PACKAGE( Boost 1.34.1 COMPONENTS thread signals) + LIST_TO_STRING(tmp "${Boost_INCLUDE_DIRS}") + SET (boost_include_dirs ${Boost_INCLUDE_DIRS} CACHE STRING + "Boost include paths. Use this to override automatic detection." FORCE) + + LIST_TO_STRING(tmp "${Boost_LIBRARY_DIRS}") + SET (boost_library_dirs ${Boost_LIBRARY_DIRS} CACHE STRING + "Boost library paths. Use this to override automatic detection." FORCE) + + LIST_TO_STRING(tmp "${Boost_LIBRARIES}") + SET (boost_libraries ${Boost_LIBRARIES} CACHE STRING + "Boost libraries. Use this to override automatic detection." FORCE) +ENDIF (NOT boost_include_dirs AND NOT boost_library_dirs AND NOT boost_libraries ) + + SET (sources Server.cc Client.cc Iface.cc @@ -13,7 +35,7 @@ SET (headers gazebo.h IfaceFactory.hh) ADD_LIBRARY(gazeboshm SHARED ${sources}) -TARGET_LINK_LIBRARIES( gazeboshm ${Boost_LIBRARIES}) +TARGET_LINK_LIBRARIES( gazeboshm ${boost_libraries}) INSTALL (TARGETS gazeboshm DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) INSTALL (FILES ${headers} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/gazebo) Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-08 18:34:57 UTC (rev 7628) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-08 21:09:56 UTC (rev 7629) @@ -20,14 +20,14 @@ ${LIBAVCODEC_PATH} ${LIBAVFORMAT_PATH} ${FLTK_INCLUDE_DIR} - ${Boost_INCLUDE_DIRS} + ${boost_include_dirs} ) ######################################## # All the library search paths LINK_DIRECTORIES( ${CMAKE_SOURCE_DIR}/libgazebo - ${Boost_LIBRARY_DIRS} + ${boost_library_dirs} ${gazeboserver_link_dirs} ) @@ -88,7 +88,6 @@ ADD_EXECUTABLE(gazebo ${gazeboserver_sources} main.cc) -APPEND_TO_CACHED_LIST(gazeboserver_cflags ${gazeboserver_cflags_desc} "-fPIC;-Wall") LIST_TO_STRING(GAZEBO_CFLAGS "${gazeboserver_cflags}") SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES COMPILE_FLAGS "${GAZEBO_CFLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}") @@ -97,7 +96,7 @@ SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}}) ENDIF (${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}}) -TARGET_LINK_LIBRARIES( gazebo gazeboshm ${gazeboserver_link_libs} ${FLTK_LIBRARIES} ${Boost_LIBRARIES}) +TARGET_LINK_LIBRARIES( gazebo gazeboshm ${gazeboserver_link_libs} ${FLTK_LIBRARIES} ${boost_libraries}) INSTALL (TARGETS gazebo DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) INSTALL (FILES ${headers} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/gazebo COMPONENT headers) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-08 21:41:57
|
Revision: 7630 http://playerstage.svn.sourceforge.net/playerstage/?rev=7630&view=rev Author: natepak Date: 2009-05-08 21:41:48 +0000 (Fri, 08 May 2009) Log Message: ----------- Fixed manual boost flags Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/cmake/GazeboUtils.cmake code/gazebo/trunk/cmake/SearchForStuff.cmake code/gazebo/trunk/server/CMakeLists.txt Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-08 21:09:56 UTC (rev 7629) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-08 21:41:48 UTC (rev 7630) @@ -28,8 +28,9 @@ "Location of CMake scripts") SET (boost_include_dirs "" CACHE STRING "Boost include paths. Use this to override automatic detection.") -SET (boost_library_dirs "" CACHE STRING "Boost library paths. Use this to override automatic detection.") -SET (boost_libraries "" CACHE STRING "Boost libraries. Use this to override automatic detection.") +SET (boost_link_flags "" CACHE STRING "Boost link flags. Use this to override automatic detection.") +#SET (boost_library_dirs "" CACHE STRING "Boost library paths. Use this to override automatic detection.") +#SET (boost_libraries "" CACHE STRING "Boost libraries. Use this to override automatic detection.") ##################################### Modified: code/gazebo/trunk/cmake/GazeboUtils.cmake =================================================================== --- code/gazebo/trunk/cmake/GazeboUtils.cmake 2009-05-08 21:09:56 UTC (rev 7629) +++ code/gazebo/trunk/cmake/GazeboUtils.cmake 2009-05-08 21:41:48 UTC (rev 7630) @@ -1,5 +1,14 @@ ################################################################################ +#APPEND_TO_CACHED_STRING(_string _cacheDesc [items...]) +# Appends items to a cached list. +MACRO (APPEND_TO_CACHED_STRING _string _cacheDesc) + FOREACH (newItem ${ARGN}) + SET (${_string} "${${_string}} ${newItem}" CACHE INTERNAL ${_cacheDesc} FORCE) + ENDFOREACH (newItem ${ARGN}) +ENDMACRO (APPEND_TO_CACHED_STRING) + +################################################################################ # APPEND_TO_CACHED_LIST (_list _cacheDesc [items...] # Appends items to a cached list. MACRO (APPEND_TO_CACHED_LIST _list _cacheDesc) Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake =================================================================== --- code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-08 21:09:56 UTC (rev 7629) +++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-08 21:41:48 UTC (rev 7630) @@ -179,7 +179,6 @@ ######################################## # Find Boost, if not specified manually IF (NOT boost_include_dirs AND NOT boost_library_dirs AND NOT boost_libraries ) - MESSAGE(STATUS "HERE") INCLUDE (FindBoost) FIND_PACKAGE( Boost 1.34.1 COMPONENTS thread signals) IF (NOT Boost_FOUND) @@ -187,23 +186,24 @@ SET (BUILD_GAZEBO OFF CACHE BOOL "Build Gazebo" FORCE) ENDIF (NOT Boost_FOUND) - LIST_TO_STRING(tmp "${Boost_INCLUDE_DIRS}") SET (boost_include_dirs ${Boost_INCLUDE_DIRS} CACHE STRING "Boost include paths. Use this to override automatic detection." FORCE) - LIST_TO_STRING(tmp "${Boost_LIBRARY_DIRS}") - SET (boost_library_dirs ${Boost_LIBRARY_DIRS} CACHE STRING - "Boost library paths. Use this to override automatic detection." FORCE) + FOREACH (dir ${Boost_LIBRARY_DIRS}) + APPEND_TO_CACHED_STRING(boost_link_flags + "Boost link flags. Use this to override automatic detection." "-L${dir}" ) + ENDFOREACH (dir Boost_LIBRARY_DIRS) - LIST_TO_STRING(tmp "${Boost_LIBRARIES}") - SET (boost_libraries ${Boost_LIBRARIES} CACHE STRING - "Boost libraries. Use this to override automatic detection." FORCE) + FOREACH (lib ${Boost_LIBRARIES}) + APPEND_TO_CACHED_STRING (boost_link_flags + "Boost link flags. Use this to override automatic detection." "-l${lib}" ) + ENDFOREACH (lib Boost_LIBRARIES) + ENDIF (NOT boost_include_dirs AND NOT boost_library_dirs AND NOT boost_libraries ) MESSAGE (STATUS "Boost IDIRS ${boost_include_dirs}") -MESSAGE (STATUS "Boost LDIRS ${boost_library_dirs}") -MESSAGE (STATUS "Boost LIBS ${boost_libraries}") +MESSAGE (STATUS "Boost LFLAGS ${boost_link_flags}") ######################################## # Find avformat and avcodec Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-08 21:09:56 UTC (rev 7629) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-08 21:41:48 UTC (rev 7630) @@ -92,10 +92,14 @@ SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES COMPILE_FLAGS "${GAZEBO_CFLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}") -IF (${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}}) - SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}}) -ENDIF (${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}}) +# Construct the aggregate link flags +APPEND_TO_CACHED_STRING(GAZEBO_LFLAGS "gazebo link flags" ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}}) +APPEND_TO_CACHED_STRING(GAZEBO_LFLAGS "gazebo link flags" ${boost_link_flags}) +MESSAGE (STATUS "GAZEBO LINK FLAGS|${GAZEBO_LFLAGS}|") +SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES LINK_FLAGS + ${GAZEBO_LFLAGS}) + TARGET_LINK_LIBRARIES( gazebo gazeboshm ${gazeboserver_link_libs} ${FLTK_LIBRARIES} ${boost_libraries}) INSTALL (TARGETS gazebo DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-09 16:04:15
|
Revision: 7632 http://playerstage.svn.sourceforge.net/playerstage/?rev=7632&view=rev Author: natepak Date: 2009-05-09 16:04:05 +0000 (Sat, 09 May 2009) Log Message: ----------- Fixed warning messages Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/cmake/GazeboUtils.cmake code/gazebo/trunk/cmake/SearchForStuff.cmake code/gazebo/trunk/libgazebo/CMakeLists.txt code/gazebo/trunk/server/CMakeLists.txt code/gazebo/trunk/server/Simulator.cc code/gazebo/trunk/server/gui/GLFrameManager.cc code/gazebo/trunk/server/rendering/OgreCamera.cc code/gazebo/trunk/server/rendering/OgreMovableText.cc code/gazebo/trunk/server/rendering/OgreVisual.cc code/gazebo/trunk/webgazebo/CMakeLists.txt Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-09 15:16:57 UTC (rev 7631) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-09 16:04:05 UTC (rev 7632) @@ -28,11 +28,9 @@ "Location of CMake scripts") SET (boost_include_dirs "" CACHE STRING "Boost include paths. Use this to override automatic detection.") -SET (boost_link_flags "" CACHE STRING "Boost link flags. Use this to override automatic detection.") -#SET (boost_library_dirs "" CACHE STRING "Boost library paths. Use this to override automatic detection.") -#SET (boost_libraries "" CACHE STRING "Boost libraries. Use this to override automatic detection.") +SET (boost_library_dirs "" CACHE STRING "Boost library paths. Use this to override automatic detection.") +SET (boost_libraries "" CACHE STRING "Boost libraries. Use this to override automatic detection.") - ##################################### # Build type cflags SET (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -fPIC -Wall " CACHE INTERNAL "C Flags for release" FORCE) Modified: code/gazebo/trunk/cmake/GazeboUtils.cmake =================================================================== --- code/gazebo/trunk/cmake/GazeboUtils.cmake 2009-05-09 15:16:57 UTC (rev 7631) +++ code/gazebo/trunk/cmake/GazeboUtils.cmake 2009-05-09 16:04:05 UTC (rev 7632) @@ -4,8 +4,9 @@ # Appends items to a cached list. MACRO (APPEND_TO_CACHED_STRING _string _cacheDesc) FOREACH (newItem ${ARGN}) - SET (${_string} "${${_string}} ${newItem}" CACHE INTERNAL ${_cacheDesc} FORCE) + SET (${_string} "${${_string}} ${newItem}" CACHE STRING ${_cacheDesc} FORCE) ENDFOREACH (newItem ${ARGN}) + STRING(STRIP ${${_string}} ${_string}) ENDMACRO (APPEND_TO_CACHED_STRING) ################################################################################ @@ -34,8 +35,9 @@ MACRO (LIST_TO_STRING _string _list) SET (${_string}) FOREACH (_item ${_list}) - SET (${_string} "${${_string}} ${_item}") + SET (${_string} "${${_string}} ${_item}") ENDFOREACH (_item) + STRING(STRIP ${${_string}} ${_string}) ENDMACRO (LIST_TO_STRING) ############################################################################### Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake =================================================================== --- code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-09 15:16:57 UTC (rev 7631) +++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-09 16:04:05 UTC (rev 7632) @@ -180,31 +180,35 @@ # Find Boost, if not specified manually IF (NOT boost_include_dirs AND NOT boost_library_dirs AND NOT boost_libraries ) INCLUDE (FindBoost) - FIND_PACKAGE( Boost 1.34.1 COMPONENTS thread signals) + SET(Boost_ADDITIONAL_VERSIONS "1.37.0") + FIND_PACKAGE( Boost 1.37.0 COMPONENTS thread signals) IF (NOT Boost_FOUND) MESSAGE (FATAL_ERROR "Boost thread and signals not found") SET (BUILD_GAZEBO OFF CACHE BOOL "Build Gazebo" FORCE) ENDIF (NOT Boost_FOUND) - LIST_TO_STRING(tmp "${Boost_INCLUDE_DIRS}") SET (boost_include_dirs ${Boost_INCLUDE_DIRS} CACHE STRING "Boost include paths. Use this to override automatic detection." FORCE) - FOREACH (dir ${Boost_LIBRARY_DIRS}) - APPEND_TO_CACHED_STRING(boost_link_flags - "Boost link flags. Use this to override automatic detection." "-L${dir}" ) - ENDFOREACH (dir Boost_LIBRARY_DIRS) + SET (boost_library_dirs ${Boost_LIBRARY_DIRS} CACHE STRING + "Boost link dirs. Use this to override automatic detection." FORCE) - FOREACH (lib ${Boost_LIBRARIES}) - APPEND_TO_CACHED_STRING (boost_link_flags - "Boost link flags. Use this to override automatic detection." "-l${lib}" ) - ENDFOREACH (lib Boost_LIBRARIES) + LIST_TO_STRING(tmp "${Boost_LIBRARIES}") + SET (boost_libraries ${tmp} CACHE STRING + "Boost libraries. Use this to override automatic detection." FORCE ) -ENDIF (NOT boost_include_dirs AND NOT boost_library_dirs AND NOT boost_libraries ) +ENDIF (NOT boost_include_dirs AND NOT boost_library_dirs AND NOT boost_libraries ) -MESSAGE (STATUS "Boost IDIRS ${boost_include_dirs}") -MESSAGE (STATUS "Boost LFLAGS ${boost_link_flags}") +STRING(REGEX REPLACE "(^| )-L" " " boost_library_dirs "${boost_library_dirs}") +STRING(REGEX REPLACE "(^| )-l" " " boost_libraries "${boost_libraries}") +STRING(STRIP ${boost_library_dirs} boost_library_dirs) +STRING(STRIP ${boost_libraries} boost_libraries) +STRING(REGEX REPLACE " " ";" boost_libraries "${boost_libraries}") +MESSAGE (STATUS "Boost Include Path: ${boost_include_dirs}") +MESSAGE (STATUS "Boost Library Path: ${boost_library_dirs}") +MESSAGE (STATUS "Boost Libraries: ${boost_libraries}") + ######################################## # Find avformat and avcodec IF (INCLUDE_AV) Modified: code/gazebo/trunk/libgazebo/CMakeLists.txt =================================================================== --- code/gazebo/trunk/libgazebo/CMakeLists.txt 2009-05-09 15:16:57 UTC (rev 7631) +++ code/gazebo/trunk/libgazebo/CMakeLists.txt 2009-05-09 16:04:05 UTC (rev 7632) @@ -1,29 +1,3 @@ -######################################## -# Find Boost, if not specified manually -IF (NOT boost_include_dirs AND NOT boost_library_dirs AND NOT boost_libraries ) - MESSAGE(STATUS "HERE") - INCLUDE (FindBoost) - FIND_PACKAGE( Boost 1.34.1 COMPONENTS thread signals) - IF (NOT Boost_FOUND) - MESSAGE (FATAL_ERROR "Boost thread and signals not found") - SET (BUILD_GAZEBO OFF CACHE BOOL "Build Gazebo" FORCE) - ENDIF (NOT Boost_FOUND) - - - LIST_TO_STRING(tmp "${Boost_INCLUDE_DIRS}") - SET (boost_include_dirs ${Boost_INCLUDE_DIRS} CACHE STRING - "Boost include paths. Use this to override automatic detection." FORCE) - - LIST_TO_STRING(tmp "${Boost_LIBRARY_DIRS}") - SET (boost_library_dirs ${Boost_LIBRARY_DIRS} CACHE STRING - "Boost library paths. Use this to override automatic detection." FORCE) - - LIST_TO_STRING(tmp "${Boost_LIBRARIES}") - SET (boost_libraries ${Boost_LIBRARIES} CACHE STRING - "Boost libraries. Use this to override automatic detection." FORCE) -ENDIF (NOT boost_include_dirs AND NOT boost_library_dirs AND NOT boost_libraries ) - - SET (sources Server.cc Client.cc Iface.cc @@ -34,7 +8,10 @@ SET (headers gazebo.h IfaceFactory.hh) +LINK_DIRECTORIES(${boost_library_dirs}) + ADD_LIBRARY(gazeboshm SHARED ${sources}) + TARGET_LINK_LIBRARIES( gazeboshm ${boost_libraries}) INSTALL (TARGETS gazeboshm DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-09 15:16:57 UTC (rev 7631) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-09 16:04:05 UTC (rev 7632) @@ -26,9 +26,7 @@ ######################################## # All the library search paths LINK_DIRECTORIES( - ${CMAKE_SOURCE_DIR}/libgazebo - ${boost_library_dirs} - ${gazeboserver_link_dirs} + ${CMAKE_SOURCE_DIR}/libgazebo ${boost_library_dirs} ${gazeboserver_link_dirs} ) ######################################## @@ -85,23 +83,19 @@ APPEND_TO_SERVER_SOURCES(${sources}) - ADD_EXECUTABLE(gazebo ${gazeboserver_sources} main.cc) LIST_TO_STRING(GAZEBO_CFLAGS "${gazeboserver_cflags}") SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES COMPILE_FLAGS "${GAZEBO_CFLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}") -# Construct the aggregate link flags -APPEND_TO_CACHED_STRING(GAZEBO_LFLAGS "gazebo link flags" ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}}) -APPEND_TO_CACHED_STRING(GAZEBO_LFLAGS "gazebo link flags" ${boost_link_flags}) -MESSAGE (STATUS "GAZEBO LINK FLAGS|${GAZEBO_LFLAGS}|") +IF (CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}) + SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES LINK_FLAGS + ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}}) +ENDIF (CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}) -SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES LINK_FLAGS - ${GAZEBO_LFLAGS}) +TARGET_LINK_LIBRARIES( gazebo ${gazeboserver_link_libs} ${FLTK_LIBRARIES} ${boost_libraries} gazeboshm ) -TARGET_LINK_LIBRARIES( gazebo gazeboshm ${gazeboserver_link_libs} ${FLTK_LIBRARIES} ${boost_libraries}) - INSTALL (TARGETS gazebo DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) INSTALL (FILES ${headers} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/gazebo COMPONENT headers) Modified: code/gazebo/trunk/server/Simulator.cc =================================================================== --- code/gazebo/trunk/server/Simulator.cc 2009-05-09 15:16:57 UTC (rev 7631) +++ code/gazebo/trunk/server/Simulator.cc 2009-05-09 16:04:05 UTC (rev 7632) @@ -317,7 +317,8 @@ /// Main simulation loop, when this loop ends the simulation finish void Simulator::MainLoop() { - double currTime, lastTime; + double currTime = 0; + double lastTime = 0; double freq = 30.0; this->physicsThread = new boost::thread( boost::bind(&Simulator::PhysicsLoop, this)); Modified: code/gazebo/trunk/server/gui/GLFrameManager.cc =================================================================== --- code/gazebo/trunk/server/gui/GLFrameManager.cc 2009-05-09 15:16:57 UTC (rev 7631) +++ code/gazebo/trunk/server/gui/GLFrameManager.cc 2009-05-09 16:04:05 UTC (rev 7632) @@ -197,7 +197,10 @@ GLFrame *glFrame = NULL; unsigned int origWidth = parent->w(); unsigned int origHeight = parent->h(); - unsigned int newWidth, newHeight, originX, originY; + unsigned int newWidth = 0; + unsigned int newHeight = 0; + unsigned int originX = 0; + unsigned int originY = 0; int windowCount = this->children(); if (type == "horz") Modified: code/gazebo/trunk/server/rendering/OgreCamera.cc =================================================================== --- code/gazebo/trunk/server/rendering/OgreCamera.cc 2009-05-09 15:16:57 UTC (rev 7631) +++ code/gazebo/trunk/server/rendering/OgreCamera.cc 2009-05-09 16:04:05 UTC (rev 7632) @@ -128,7 +128,8 @@ { std::string command; command = "mkdir " + this->savePathnameP->GetValue() + " 2>>/dev/null"; - system(command.c_str()); + if (system(command.c_str()) < 0) + std::cerr << "Error making directory\n"; } if (this->hfovP->GetValue() < Angle(0.01) || @@ -392,7 +393,8 @@ { std::string command; command = "mkdir " + this->savePathnameP->GetValue() + " 2>>/dev/null"; - system(command.c_str()); + if (system(command.c_str()) <0) + std::cerr << "Error making directory\n"; } } @@ -523,7 +525,8 @@ { std::string command; command = "mkdir " + this->savePathnameP->GetValue() + " 2>>/dev/null"; - system(command.c_str()); + if (system(command.c_str()) < 0) + std::cerr << "Error making directory\n"; } // Get access to the buffer and make an image and write it to file Modified: code/gazebo/trunk/server/rendering/OgreMovableText.cc =================================================================== --- code/gazebo/trunk/server/rendering/OgreMovableText.cc 2009-05-09 15:16:57 UTC (rev 7631) +++ code/gazebo/trunk/server/rendering/OgreMovableText.cc 2009-05-09 16:04:05 UTC (rev 7632) @@ -281,7 +281,9 @@ float len = 0.0f; // for calculation of AABB - Ogre::Vector3 min, max, currPos; + Ogre::Vector3 min(0,0,0); + Ogre::Vector3 max(0,0,0); + Ogre::Vector3 currPos(0,0,0); unsigned int vertexCount = static_cast<unsigned int>(this->text.size() * 6); Modified: code/gazebo/trunk/server/rendering/OgreVisual.cc =================================================================== --- code/gazebo/trunk/server/rendering/OgreVisual.cc 2009-05-09 15:16:57 UTC (rev 7631) +++ code/gazebo/trunk/server/rendering/OgreVisual.cc 2009-05-09 16:04:05 UTC (rev 7632) @@ -125,8 +125,8 @@ std::ostringstream stream; Pose3d pose; - Vector3 size; - Ogre::Vector3 meshSize; + Vector3 size(0,0,0); + Ogre::Vector3 meshSize(0,0,0); Ogre::MovableObject *obj = NULL; this->xyzP->Load(node); Modified: code/gazebo/trunk/webgazebo/CMakeLists.txt =================================================================== --- code/gazebo/trunk/webgazebo/CMakeLists.txt 2009-05-09 15:16:57 UTC (rev 7631) +++ code/gazebo/trunk/webgazebo/CMakeLists.txt 2009-05-09 16:04:05 UTC (rev 7632) @@ -1,8 +1,9 @@ SET (sources WebGazebo.cc ../server/Quatern.cc ../server/Vector3.cc ../server/Angle.cc) INCLUDE_DIRECTORIES( .. ../server ${WEBSIM_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/libgazebo ) -LINK_DIRECTORIES( ${WEBSIM_LINK_DIRS} gazeboshm) +LINK_DIRECTORIES( ${WEBSIM_LINK_DIRS} ${boost_library_dirs} gazeboshm) + SET_SOURCE_FILES_PROPERTIES(${sources} PROPERTIES COMPILE_FLAGS '-DINSTALL_PREFIX="/usr/local/"') ADD_LIBRARY(webgz ${sources}) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-11 02:14:34
|
Revision: 7634 http://playerstage.svn.sourceforge.net/playerstage/?rev=7634&view=rev Author: natepak Date: 2009-05-11 01:43:31 +0000 (Mon, 11 May 2009) Log Message: ----------- Added Image and Color classes Modified Paths: -------------- code/gazebo/trunk/libgazebo/gazebo.h code/gazebo/trunk/server/Entity.cc code/gazebo/trunk/server/Global.hh code/gazebo/trunk/server/controllers/actarray/bandit/Bandit_Actarray.cc code/gazebo/trunk/server/gui/Gui.cc code/gazebo/trunk/server/gui/StatusBar.cc code/gazebo/trunk/server/gui/StatusBar.hh code/gazebo/trunk/server/physics/Body.cc code/gazebo/trunk/server/physics/Geom.cc code/gazebo/trunk/server/physics/MapGeom.cc code/gazebo/trunk/server/physics/MapGeom.hh code/gazebo/trunk/server/physics/ode/ODEPhysics.cc code/gazebo/trunk/server/rendering/CMakeLists.txt code/gazebo/trunk/server/rendering/OgreAdaptor.cc code/gazebo/trunk/server/rendering/OgreHUD.cc code/gazebo/trunk/worlds/map.world Added Paths: ----------- code/gazebo/trunk/server/rendering/Color.cc code/gazebo/trunk/server/rendering/Color.hh code/gazebo/trunk/server/rendering/Image.cc code/gazebo/trunk/server/rendering/Image.hh Modified: code/gazebo/trunk/libgazebo/gazebo.h =================================================================== --- code/gazebo/trunk/libgazebo/gazebo.h 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/libgazebo/gazebo.h 2009-05-11 01:43:31 UTC (rev 7634) @@ -647,7 +647,7 @@ /// Maximum image pixels (width x height) -#define GAZEBO_CAMERA_MAX_IMAGE_SIZE 640 * 480 * 3 +#define GAZEBO_CAMERA_MAX_IMAGE_SIZE 1024 * 1024 * 3 /// \brief Camera interface data class CameraData @@ -1503,7 +1503,7 @@ \{ */ -#define GAZEBO_STEREO_CAMERA_MAX_RGB_SIZE 640 * 480 * 3 +#define GAZEBO_STEREO_CAMERA_MAX_RGB_SIZE 640 * 480 * 9 #define GAZEBO_STEREO_CAMERA_MAX_DISPARITY_SIZE 640 * 480 /// \brief Stereo data Modified: code/gazebo/trunk/server/Entity.cc =================================================================== --- code/gazebo/trunk/server/Entity.cc 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/server/Entity.cc 2009-05-11 01:43:31 UTC (rev 7634) @@ -78,7 +78,6 @@ World::Instance()->GetPhysicsEngine()->RemoveEntity(this); OgreCreator::Instance()->DeleteVisual(this->visualNode); - //GZ_DELETE(this->visualNode); } //////////////////////////////////////////////////////////////////////////////// Modified: code/gazebo/trunk/server/Global.hh =================================================================== --- code/gazebo/trunk/server/Global.hh 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/server/Global.hh 2009-05-11 01:43:31 UTC (rev 7634) @@ -81,12 +81,6 @@ #define ISEVEN(x) ( ((x) % 2) == 0) #define ISODD(x) ( ((x) % 2) != 0) -// Min and Max macros -#define MAX(x,y) ( (x) > (y) ? (x) : (y) ) -#define MIN(x,y) ( (x) < (y) ? (x) : (y) ) - #define ROUND(x) ( (int)( floor((x)+0.5) ) ) -#define GZ_DELETE(p) { if(p) { delete (p); (p)=NULL; } } - #endif Modified: code/gazebo/trunk/server/controllers/actarray/bandit/Bandit_Actarray.cc =================================================================== --- code/gazebo/trunk/server/controllers/actarray/bandit/Bandit_Actarray.cc 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/server/controllers/actarray/bandit/Bandit_Actarray.cc 2009-05-11 01:43:31 UTC (rev 7634) @@ -57,9 +57,17 @@ { for (int i=0; i<JOINTCNT; i++) { - GZ_DELETE(this->jointNamesP[i]); - GZ_DELETE(this->forcesP[i]); - GZ_DELETE(this->gainsP[i]); + if (this->jointNamesP[i]) + delete this->jointNamesP[i]; + this->jointNamesP[i] = NULL; + + if(this->forcesP[i]) + delete this->forcesP[i]; + this->forcesP[i] = NULL; + + if(this->gainsP[i]) + delete this->gainsP[i]; + this->gainsP[i] = NULL; } } Modified: code/gazebo/trunk/server/gui/Gui.cc =================================================================== --- code/gazebo/trunk/server/gui/Gui.cc 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/server/gui/Gui.cc 2009-05-11 01:43:31 UTC (rev 7634) @@ -108,7 +108,6 @@ delete this->sizeP; delete this->posP; - //GZ_DELETE (this->toolbar) //delete this->statusbar; } Modified: code/gazebo/trunk/server/gui/StatusBar.cc =================================================================== --- code/gazebo/trunk/server/gui/StatusBar.cc 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/server/gui/StatusBar.cc 2009-05-11 01:43:31 UTC (rev 7634) @@ -44,23 +44,33 @@ y += 5; this->box(FL_UP_BOX); - this->fps = new Fl_Value_Output(x,y,35,20,"FPS"); + this->fps = new Fl_Value_Output(x,y,25,20,"FPS"); + this->fps->labelsize(11); + this->fps->textsize(11); this->fps->precision(0); - x = this->fps->x() + this->fps->w() + 95; - this->percent = new Fl_Value_Output(x,y,65,20,"% Real Time"); - this->percent->precision(2); + x = this->fps->x() + this->fps->w() + 75; + this->percentOutput = new Fl_Value_Output(x,y,40,20,"Sim speed"); + this->percentOutput->labelsize(11); + this->percentOutput->textsize(11); + this->percentOutput->precision(2); - x = this->percent->x() + this->percent->w() + 120; - this->realTime = new Fl_Value_Output(x,y,55,20,"Real Time (sec)"); + x = this->percentOutput->x() + this->percentOutput->w() + 100; + this->realTime = new Fl_Value_Output(x,y,45,20,"Real Time (sec)"); + this->realTime->labelsize(11); + this->realTime->textsize(11); this->realTime->precision(2); - x = this->realTime->x() + this->realTime->w() + 120; - this->simTime = new Fl_Value_Output(x,y,65,20,"Sim Time (sec)"); + x = this->realTime->x() + this->realTime->w() + 100; + this->simTime = new Fl_Value_Output(x,y,45,20,"Sim Time (sec)"); + this->simTime->labelsize(11); + this->simTime->textsize(11); this->simTime->precision(2); - x = this->simTime->x() + this->simTime->w() + 100; - this->pauseTime = new Fl_Value_Output(x,y,55,20,"Pause Time"); + x = this->simTime->x() + this->simTime->w() + 80; + this->pauseTime = new Fl_Value_Output(x,y,45,20,"Pause Time"); + this->pauseTime->labelsize(11); + this->pauseTime->textsize(11); this->pauseTime->precision(2); x = this->pauseTime->x() + this->pauseTime->w() + 20; @@ -90,11 +100,12 @@ float avgFPS = 0; float percent = 0; float sim = 0; + float real = 0; if (Simulator::Instance()->GetRealTime() - this->lastUpdateTime > 0.05) { avgFPS = this->gui->GetAvgFPS(); - percent = 100. * (Simulator::Instance()->GetSimTime() / Simulator::Instance()->GetRealTime()); + percent = (Simulator::Instance()->GetSimTime() / Simulator::Instance()->GetRealTime()); sim = Simulator::Instance()->GetSimTime(); if (sim > 99999) @@ -113,15 +124,30 @@ this->simTime->label("Sim Time (min)"); } + real = Simulator::Instance()->GetRealTime(); + if (sim > 99999) + { + real /= (120*24); + this->realTime->label("Real Time (dys)"); + } + else if (real > 9999) + { + real /= 120; + this->realTime->label("Real Time (hrs)"); + } + else if (real > 999) + { + real /= 60; + this->realTime->label("Real Time (min)"); + } + //this->iterations->value(Simulator::Instance()->GetIterations()); this->fps->value(avgFPS); - this->percent->value(percent); + this->percentOutput->value(percent); - if (Simulator::Instance()->GetRealTime() - this->realTime->value() > 0.1) - { - this->realTime->value(Simulator::Instance()->GetRealTime()); - } + //if (Simulator::Instance()->GetRealTime() - this->realTime->value() > 0.1) + this->realTime->value(real); this->simTime->value(sim); this->pauseTime->value(Simulator::Instance()->GetPauseTime()); Modified: code/gazebo/trunk/server/gui/StatusBar.hh =================================================================== --- code/gazebo/trunk/server/gui/StatusBar.hh 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/server/gui/StatusBar.hh 2009-05-11 01:43:31 UTC (rev 7634) @@ -54,7 +54,7 @@ public: static void StepButtonCB( Fl_Widget *w, void *data ); private: Fl_Value_Output *iterations; - private: Fl_Value_Output *percent; + private: Fl_Value_Output *percentOutput; private: Fl_Value_Output *fps; private: Fl_Value_Output *realTime; private: Fl_Value_Output *pauseTime; Modified: code/gazebo/trunk/server/physics/Body.cc =================================================================== --- code/gazebo/trunk/server/physics/Body.cc 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/server/physics/Body.cc 2009-05-11 01:43:31 UTC (rev 7634) @@ -90,13 +90,17 @@ for (giter = this->geoms.begin(); giter != this->geoms.end(); giter++) { - GZ_DELETE (giter->second); + if (giter->second) + delete giter->second; + giter->second = NULL; } this->geoms.clear(); for (siter = this->sensors.begin(); siter != this->sensors.end(); siter++) { - GZ_DELETE (*siter); + if (*siter) + delete (*siter); + (*siter) = NULL; } this->sensors.clear(); Modified: code/gazebo/trunk/server/physics/Geom.cc =================================================================== --- code/gazebo/trunk/server/physics/Geom.cc 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/server/physics/Geom.cc 2009-05-11 01:43:31 UTC (rev 7634) @@ -98,7 +98,9 @@ /*for (iter = this->visuals.begin(); iter != this->visuals.end(); iter++) { - GZ_DELETE (*iter) + if (*iter) + delete *iter; + *iter = NULL; } this->visuals.clear(); */ Modified: code/gazebo/trunk/server/physics/MapGeom.cc =================================================================== --- code/gazebo/trunk/server/physics/MapGeom.cc 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/server/physics/MapGeom.cc 2009-05-11 01:43:31 UTC (rev 7634) @@ -24,18 +24,18 @@ * CVS: $Id$ */ + #include <ode/ode.h> -#include <Ogre.h> #include <iostream> #include <string.h> #include <math.h> +#include "GazeboConfig.hh" +#include "OgreVisual.hh" +#include "Image.hh" #include "BoxGeom.hh" #include "GazeboError.hh" -#include "OgreAdaptor.hh" #include "Simulator.hh" -#include "OgreAdaptor.hh" -#include "OgreVisual.hh" #include "Global.hh" #include "Body.hh" #include "MapGeom.hh" @@ -70,6 +70,10 @@ if (this->root) delete this->root; + if (this->mapImage) + delete this->mapImage; + this->mapImage = NULL; + delete this->negativeP; delete this->thresholdP; delete this->wallHeightP; @@ -88,10 +92,7 @@ /// Load the heightmap void MapGeom::LoadChild(XMLConfigNode *node) { - OgreAdaptor *ogreAdaptor; - ogreAdaptor = Simulator::Instance()->GetRenderEngine(); - std::string imageFilename = node->GetString("image","",1); this->negativeP->Load(node); @@ -107,14 +108,31 @@ if (this->wallHeightP->GetValue() <= 0) this->wallHeightP->SetValue( 1.0 ); // Load the image - this->mapImage.load(imageFilename, - Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); + this->mapImage = new Image(); + std::list<std::string>::iterator iter; + GazeboConfig *gzcfg = Simulator::Instance()->GetGazeboConfig(); + std::string filename; + + for (iter = gzcfg->GetGazeboPaths().begin(); + iter != gzcfg->GetGazeboPaths().end(); iter++) + { + filename = (*iter) + "/Media/materials/textures/" + imageFilename; + if (this->mapImage->Load(filename) >= 0) + { + break; + } + } + + if (!this->mapImage->Valid()) + gzthrow(std::string("Unable to open image file[") + imageFilename + "]" ); + this->root->x = 0; this->root->y = 0; - this->root->width = this->mapImage.getWidth(); - this->root->height = this->mapImage.getHeight(); + this->root->width = this->mapImage->GetWidth(); + this->root->height = this->mapImage->GetHeight(); + this->BuildTree(this->root); this->merged = true; @@ -376,7 +394,7 @@ unsigned int &freePixels, unsigned int &occPixels ) { - Ogre::ColourValue pixColor; + Color pixColor; unsigned char v; unsigned int x,y; @@ -386,8 +404,9 @@ { for (x = xStart; x < xStart + width; x++) { - pixColor = this->mapImage.getColourAt(x, y, 0); - v = (unsigned char)(255 * ((pixColor[0] + pixColor[1] + pixColor[2]) / 3.0)); + pixColor = this->mapImage->GetPixel(x, y); + + v = (unsigned char)(255 * ((pixColor.R() + pixColor.G() + pixColor.B()) / 3.0)); if (this->negativeP->GetValue()) v = 255 - v; Modified: code/gazebo/trunk/server/physics/MapGeom.hh =================================================================== --- code/gazebo/trunk/server/physics/MapGeom.hh 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/server/physics/MapGeom.hh 2009-05-11 01:43:31 UTC (rev 7634) @@ -27,7 +27,6 @@ #ifndef MAPGEOM_HH #define MAPGEOM_HH -#include <Ogre.h> #include <deque> #include "Vector2.hh" @@ -36,6 +35,8 @@ namespace gazebo { + class Image; + /// \addtogroup gazebo_physics_geom /// \{ /** \defgroup gazebo_map_geom Map geom @@ -141,7 +142,7 @@ private: ParamT<double> *wallHeightP; - private: Ogre::Image mapImage; + private: Image *mapImage; private: QuadNode *root; Modified: code/gazebo/trunk/server/physics/ode/ODEPhysics.cc =================================================================== --- code/gazebo/trunk/server/physics/ode/ODEPhysics.cc 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/server/physics/ode/ODEPhysics.cc 2009-05-11 01:43:31 UTC (rev 7634) @@ -275,15 +275,15 @@ contact.surface.soft_erp = h * kp / (h * kp + kd); contact.surface.soft_cfm = 1 / (h * kp + kd); - contact.surface.mu = MIN(geom1->contact->mu1, geom2->contact->mu1); - contact.surface.mu2 = MIN(geom1->contact->mu2, geom2->contact->mu2); - contact.surface.bounce = MIN(geom1->contact->bounce, + contact.surface.mu = std::min(geom1->contact->mu1, geom2->contact->mu1); + contact.surface.mu2 = std::min(geom1->contact->mu2, geom2->contact->mu2); + contact.surface.bounce = std::min(geom1->contact->bounce, geom2->contact->bounce); - contact.surface.bounce_vel = MIN(geom1->contact->bounceVel, + contact.surface.bounce_vel = std::min(geom1->contact->bounceVel, geom2->contact->bounceVel); - contact.surface.slip1 = MIN(geom1->contact->slip1, + contact.surface.slip1 = std::min(geom1->contact->slip1, geom2->contact->slip1); - contact.surface.slip2 = MIN(geom1->contact->slip2, + contact.surface.slip2 = std::min(geom1->contact->slip2, geom2->contact->slip2); dJointID c = dJointCreateContact (self->worldId, @@ -387,7 +387,7 @@ // Compute friction effects; this is standard Coulomb friction contactInfo.surface.mode |= dContactApprox1; - contactInfo.surface.mu = MIN(geom1->contact->mu1, geom2->contact->mu1); + contactInfo.surface.mu = std::min(geom1->contact->mu1, geom2->contact->mu1); contactInfo.surface.mu2 = 0; contactInfo.surface.bounce = 0.1; contactInfo.surface.bounce_vel = 0.1; Modified: code/gazebo/trunk/server/rendering/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/rendering/CMakeLists.txt 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/server/rendering/CMakeLists.txt 2009-05-11 01:43:31 UTC (rev 7634) @@ -12,6 +12,8 @@ OgreCamera.cc CameraManager.cc UserCamera.cc + Image.cc + Color.cc ) APPEND_TO_SERVER_SOURCES(${sources}) Added: code/gazebo/trunk/server/rendering/Color.cc =================================================================== --- code/gazebo/trunk/server/rendering/Color.cc (rev 0) +++ code/gazebo/trunk/server/rendering/Color.cc 2009-05-11 01:43:31 UTC (rev 7634) @@ -0,0 +1,426 @@ +/* + * Gazebo - Outdoor Multi-Robot Simulator + * Copyright (C) 2003 + * Nate Koenig & Andrew Howard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +/* Desc: Color class + * Author: Nate Koenig + * Date: 08 May 2009 + * CVS: $Id$ + */ + +#include <algorithm> +#include <math.h> + +#include "GazeboMessage.hh" +#include "Color.hh" + +using namespace gazebo; + +//////////////////////////////////////////////////////////////////////////////// +// Constructor +Color::Color() + : r(0), g(0), b(0), a(0) +{ + this->Clamp(); +} + +//////////////////////////////////////////////////////////////////////////////// +// Constructor +Color::Color( const float &r, const float &g, const float &b ) + : r(r), g(g), b(b), a(0) +{ + this->Clamp(); +} + +//////////////////////////////////////////////////////////////////////////////// +// Constructor +Color::Color( const float &r, const float &g, const float &b, const float &a ) + : r(r), g(g), b(b), a(a) +{ + this->Clamp(); +} + +//////////////////////////////////////////////////////////////////////////////// +// Copy Constructor +Color::Color( const Color &pt ) + : r(pt.r), g(pt.g), b(pt.b), a(pt.a) +{ + this->Clamp(); +} + +//////////////////////////////////////////////////////////////////////////////// +// Destructor +Color::~Color() +{ +} + +//////////////////////////////////////////////////////////////////////////////// +// Reset the vector +void Color::Reset() +{ + this->r = this->g = this->b = this->a = 0; +} + +//////////////////////////////////////////////////////////////////////////////// +// Set the contents of the vector +void Color::Set(float r, float g, float b, float a) +{ + this->r = r; + this->g = g; + this->b = b; + this->a = a; + + this->Clamp(); +} + +//////////////////////////////////////////////////////////////////////////////// +/// Set a color based on HSV values +void Color::SetFromHSV(float h, float s, float v) +{ + int i; + float f, p , q, t; + + h = (int)(h) % 360; + + if (s==0) + { + //acromatic (grey) + this->r = this->g = this->b = v; + return; + } + + h /= 60; // sector 0 - 5 + i = (int)floor(h); + + f = h - i; + + p = v * (1-s); + q = v * (1 - s * f); + t = v * (1 - s * (1-f)); + + switch(i) + { + case 0: + this->r = v; + this->g = t; + this->b = p; + break; + case 1: + this->r = q; + this->g = v; + this->b = p; + break; + case 2: + this->r = p; + this->g = v; + this->b = t; + break; + case 3: + this->r = p; + this->g = q; + this->b = v; + break; + case 4: + this->r = t; + this->g = p; + this->b = v; + break; + case 5: + this->r = v; + this->g = p; + this->b = q; + break; + } + + this->Clamp(); +} + +//////////////////////////////////////////////////////////////////////////////// +/// Get the color in HSV colorspace +Vector3 Color::GetAsHSV() const +{ + Vector3 hsv; + float x,v, f, i; + + x = std::min(this->r, std::min(this->g, this->b)); + v = std::max(this->r, std::max(this->g, this->b)); + + if(v == x) + { + gzerr(0) << "rgb to hsv undefined\n"; + return hsv; + } + + if (r == x) + f = this->g - this->b; + else if (this->g == x) + f = this->b - this->r; + else + f = this->r - this->g; + + if (this->r == x) + i = 3; + else if (this->g == x) + i = 5; + else + i = 1; + + hsv.x = i - f /(v - x); + hsv.y = (v - x)/v; + hsv.z = v; + + return hsv; +} + + +//////////////////////////////////////////////////////////////////////////////// +/// Get the color in YUV colorspace +Vector3 Color::GetAsYUV() const +{ + Vector3 yuv; + + yuv.x = 0.299*this->r + 0.587*this->g + 0.114*this->b; + yuv.y = -0.1679*this->r - 0.332*this->g + 0.5*this->b + 0.5; + yuv.z = 0.5*this->r - 0.4189*this->g - 0.08105*this->b + 0.5; + + yuv.x = yuv.x < 0 ? 0: yuv.x; + yuv.x = yuv.x > 255 ? 255.0: yuv.x; + + yuv.y = yuv.y < 0 ? 0: yuv.y; + yuv.y = yuv.y > 255 ? 255.0: yuv.y; + + yuv.z = yuv.z < 0 ? 0: yuv.z; + yuv.z = yuv.z > 255 ? 255.0: yuv.z; + + + + /*if (yuv.x > 255) + yuv.x = 255; + if (yuv.x < 0) + yuv.x = 0; + + if (yuv.y > 255) + yuv.y = 255; + if (yuv.y < 0) + yuv.y = 0; + + if (yuv.z > 255) + yuv.z = 255; + if (yuv.z < 0) + yuv.z = 0; + */ + + return yuv; +} + +//////////////////////////////////////////////////////////////////////////////// +// Set from yuv +void Color::SetFromYUV(float y, float u, float v) +{ + this->r = y + 1.140*v; + this->g = y - 0.395*u - 0.581*v; + this->b = y + 2.032*u; + this->Clamp(); +} + +//////////////////////////////////////////////////////////////////////////////// +// Array index operator +float Color::operator[](unsigned int index) +{ + switch(index) + { + case 0: return this->R(); + case 1: return this->G(); + case 2: return this->B(); + case 3: return this->A(); + default: gzerr(0) << "Invalid color index[" << index << "]\n"; + } + + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// +// Get the red color +float Color::R() +{ + return this->r; +} + +//////////////////////////////////////////////////////////////////////////////// +// Get the green color +float Color::G() +{ + return this->g; +} + +//////////////////////////////////////////////////////////////////////////////// +// Get the blue color +float Color::B() +{ + return this->b; +} + +//////////////////////////////////////////////////////////////////////////////// +// Get the alpha color +float Color::A() +{ + return this->a; +} + +//////////////////////////////////////////////////////////////////////////////// +// Equals operator +const Color &Color::operator=( const Color &pt ) +{ + this->r = pt.r; + this->g = pt.g; + this->b = pt.b; + this->a = pt.a; + + return *this; +} + + +//////////////////////////////////////////////////////////////////////////////// +// Addition operator +Color Color::operator+( const Color &pt ) const +{ + return Color(this->r + pt.r, this->g + pt.g, this->b + pt.b, this->a + pt.a); +} + +Color Color::operator+( const float &v ) const +{ + return Color(this->r + v, this->g + v, this->b + v, this->a + v); +} + +const Color &Color::operator+=( const Color &pt ) +{ + this->r += pt.r; + this->g += pt.g; + this->b += pt.b; + this->a += pt.a; + + this->Clamp(); + + return *this; +} + +//////////////////////////////////////////////////////////////////////////////// +// Subtraction operators +Color Color::operator-( const Color &pt ) const +{ + return Color(this->r - pt.r, this->g - pt.g, this->b - pt.b, this->a - pt.a); +} + +Color Color::operator-( const float &v ) const +{ + return Color(this->r - v, this->g - v, this->b - v, this->a - v); +} + +const Color &Color::operator-=( const Color &pt ) +{ + this->r -= pt.r; + this->g -= pt.g; + this->b -= pt.b; + this->a -= pt.a; + + this->Clamp(); + + return *this; +} + + +//////////////////////////////////////////////////////////////////////////////// +// Division operators +const Color Color::operator/( const float &i ) const +{ + return Color(this->r / i, this->g / i, this->b / i, this->a / i); +} + +const Color Color::operator/( const Color &pt ) const +{ + return Color(this->r / pt.r, this->g / pt.g, this->b / pt.b, this->a / pt.a); +} + +const Color &Color::operator/=( const Color &pt ) +{ + this->r /= pt.r; + this->g /= pt.g; + this->b /= pt.b; + this->a /= pt.a; + + this->Clamp(); + + return *this; +} + + +//////////////////////////////////////////////////////////////////////////////// +// Mulitplication operators +const Color Color::operator*(const float &i) const +{ + return Color(this->r * i, this->g * i, this->b * i, this->a * i); +} + +const Color Color::operator*( const Color &pt ) const +{ + return Color(this->r * pt.r, this->g * pt.g, this->b * pt.b, this->a * pt.a); +} + +const Color &Color::operator*=( const Color &pt ) +{ + this->r *= pt.r; + this->g *= pt.g; + this->b *= pt.b; + this->a *= pt.a; + + this->Clamp(); + + return *this; +} + + +//////////////////////////////////////////////////////////////////////////////// +// Equality operator +bool Color::operator==( const Color &pt ) const +{ + return this->r == pt.r && this->g == pt.g && this->b == pt.b && this->a == pt.a; +} + +//////////////////////////////////////////////////////////////////////////////// +// Inequality operator +bool Color::operator!=( const Color &pt ) const +{ + return !(*this == pt); +} + +//////////////////////////////////////////////////////////////////////////////// +/// Clamp the color values +void Color::Clamp() +{ + this->r = this->r < 0 ? 0: this->r; + this->r = this->r > 1 ? this->r/255.0: this->r; + + this->g = this->g < 0 ? 0: this->g; + this->g = this->g > 1 ? this->g/255.0: this->g; + + this->b = this->b < 0 ? 0: this->b; + this->b = this->b > 1 ? this->b/255.0: this->b; +} + + Added: code/gazebo/trunk/server/rendering/Color.hh =================================================================== --- code/gazebo/trunk/server/rendering/Color.hh (rev 0) +++ code/gazebo/trunk/server/rendering/Color.hh 2009-05-11 01:43:31 UTC (rev 7634) @@ -0,0 +1,124 @@ +/* + * Gazebo - Outdoor Multi-Robot Simulator + * Copyright (C) 2003 + * Nate Koenig & Andrew Howard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +/* Desc: Color class + * Author: Nate Koenig + * Date: 08 May 2009 + * CVS: $Id$ + */ + +#ifndef COLOR_HH +#define COLOR_HH + +#include <iostream> +//#include <math.h> +//#include <fstream> +#include "Vector3.hh" + +namespace gazebo +{ + + class Color + { + // Constructors + public: Color(); + public: Color( const float &r, const float &g, const float &b ); + public: Color( const float &r, const float &g, const float &b, + const float &a ); + public: Color( const Color &clr ); + + // Destructor + public: virtual ~Color(); + + public: void Reset(); + + /// \brief Set the contents of the vector + public: void Set(float r = 0, float g =0 , float b = 0, float a = 0); + + /// \brief Get the color in HSV colorspace + public: Vector3 GetAsHSV() const; + + /// \brief Set a color based on HSV values + public: void SetFromHSV(float h, float s, float v); + + /// \brief Get the color in YUV colorspace + public: Vector3 GetAsYUV() const; + + /// \brief Set from yuv + public: void SetFromYUV(float y, float u, float v); + + // Equal operator + public: const Color &operator=( const Color &pt ); + + /// \brief Array index operator + public: float operator[](unsigned int index); + + /// \brief Get the red color + public: float R(); + + /// \brief Get the green color + public: float G(); + + /// \brief Get the blue color + public: float B(); + + /// \brief Get the alpha color + public: float A(); + + // Addition operators + public: Color operator+( const Color &pt ) const; + public: Color operator+( const float &v ) const; + public: const Color &operator+=( const Color &pt ); + + // Subtraction operators + public: Color operator-( const Color &pt ) const; + public: Color operator-( const float &pt ) const; + public: const Color &operator-=( const Color &pt ); + + // Division operators + public: const Color operator/( const float &i ) const; + public: const Color operator/( const Color &pt ) const; + public: const Color &operator/=( const Color &pt ); + + // Multiplication operators + public: const Color operator*(const float &i) const; + public: const Color operator*( const Color &pt ) const; + public: const Color &operator*=( const Color &pt ); + + // Equality operators + public: bool operator==( const Color &pt ) const; + public: bool operator!=( const Color &pt ) const; + + /// Clamp the color values + private: void Clamp(); + + + // Ostream operator + public: friend std::ostream &operator<< (std::ostream &out, const Color &pt) { + out << pt.r << " " << pt.g << " " << pt.b << " " << pt.a; + return out; + } + + // The values + private: float r, g, b, a; + }; +} + +#endif Added: code/gazebo/trunk/server/rendering/Image.cc =================================================================== --- code/gazebo/trunk/server/rendering/Image.cc (rev 0) +++ code/gazebo/trunk/server/rendering/Image.cc 2009-05-11 01:43:31 UTC (rev 7634) @@ -0,0 +1,309 @@ +/* + * Gazebo - Outdoor Multi-Robot Simulator + * Copyright (C) 2003 + * Nate Koenig & Andrew Howard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +/* Desc: Image class + * Author: Nate Koenig + * Date: 14 July 2008 + * SVN: $Id$ + */ + +#include <iostream> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + +//#include <GL/gl.h> + +#include "Vector3.hh" +#include "GazeboMessage.hh" +#include "Image.hh" + +using namespace gazebo; + +int Image::count = 0; + +//////////////////////////////////////////////////////////////////////////////// +/// Constructor +Image::Image() +{ + if (count == 0) + FreeImage_Initialise(); + + count++; + + this->bitmap = NULL; +} + +//////////////////////////////////////////////////////////////////////////////// +/// Destructor +Image::~Image() +{ + count--; + + if (this->bitmap) + FreeImage_Unload(this->bitmap); + this->bitmap = NULL; + + if (count == 0) + FreeImage_DeInitialise(); + +} + +//////////////////////////////////////////////////////////////////////////////// +/// Load +int Image::Load(const std::string &filename) +{ + struct stat st; + + if (stat(filename.c_str(), &st) != 0) + { + gzerr(5) << "Unable to open image file[" << filename << "]\n"; + return -1; + } + + FREE_IMAGE_FORMAT fifmt = FreeImage_GetFIFFromFilename(filename.c_str()); + + if (this->bitmap) + FreeImage_Unload(this->bitmap); + this->bitmap = NULL; + + if (fifmt == FIF_PNG) + this->bitmap = FreeImage_Load(fifmt, filename.c_str(), PNG_DEFAULT); + else if (fifmt == FIF_JPEG) + this->bitmap = FreeImage_Load(fifmt, filename.c_str(), JPEG_DEFAULT); + else if (fifmt == FIF_BMP) + this->bitmap = FreeImage_Load(fifmt, filename.c_str(), BMP_DEFAULT); + else + { + std::cerr << "Unknown image format[" << filename << "]\n"; + return -1; + } + + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// +/// Set the image from raw data (R8G8B8) +void Image::SetFromData( const unsigned char *data, unsigned int width, + unsigned int height, int scanline_bytes, unsigned int bpp) +{ + //int redmask = FI_RGBA_RED_MASK; + int redmask = 0xff0000; + + //int greenmask = FI_RGBA_GREEN_MASK; + int greenmask = 0x00ff00; + + //int bluemask = FI_RGBA_BLUE_MASK; + int bluemask = 0x0000ff; + + if (this->bitmap) + { + FreeImage_Unload(this->bitmap); + } + this->bitmap = NULL; + + this->bitmap = FreeImage_ConvertFromRawBits((BYTE*)data, width, height, scanline_bytes, bpp, redmask, greenmask, bluemask); +} + +//////////////////////////////////////////////////////////////////////////////// +/// Get the width +unsigned int Image::GetWidth() const +{ + if (!this->Valid()) + return 0; + + return FreeImage_GetWidth( this->bitmap ); +} + +//////////////////////////////////////////////////////////////////////////////// +/// Get the height +unsigned int Image::GetHeight() const +{ + if (!this->Valid()) + return 0; + + return FreeImage_GetHeight( this->bitmap ); +} + +//////////////////////////////////////////////////////////////////////////////// +/// Get the size of one pixel in bits +unsigned int Image::GetBPP() const +{ + if (!this->Valid()) + return 0; + + return FreeImage_GetBPP( this->bitmap ); +} + +//////////////////////////////////////////////////////////////////////////////// +/// Get a pixel color value +Color Image::GetPixel(unsigned int x, unsigned int y) +{ + Color clr; + + if (!this->Valid()) + return clr; + + unsigned int colorsUsed = FreeImage_GetImageType(this->bitmap); + + if (colorsUsed == 0) + { + RGBQUAD firgb; + + if (FreeImage_GetPixelColor( this->bitmap, x, y, &firgb ) == FALSE) + { + std::cerr << "Image: Coordinates out of range[" + << x << " " << y << "] \n"; + return clr; + } + + if (FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_RGB) + { + clr.Set( firgb.rgbRed, firgb.rgbGreen, firgb.rgbBlue); + } + else + { + clr.Set( firgb.rgbBlue, firgb.rgbGreen, firgb.rgbRed); + } + + } + else + { + BYTE byteValue; + if (FreeImage_GetPixelIndex(this->bitmap, x, y, &byteValue) == FALSE) + { + std::cerr << "Image: Coordinates out of range[" + << x << " " << y << "] \n"; + return clr; + } + + clr.Set( byteValue, byteValue, byteValue); + } + + return clr; +} + +//////////////////////////////////////////////////////////////////////////////// +/// Get the average color +Color Image::GetAvgColor() +{ + unsigned int x, y; + Color clrSum; + + for (y = 0; y < this->GetHeight(); y++) + { + for (x = 0; x < this->GetWidth(); x++) + { + clrSum += this->GetPixel(x,y); + } + } + + return clrSum / (this->GetWidth() * this->GetHeight()); +} + +//////////////////////////////////////////////////////////////////////////////// +/// Get the max color +Color Image::GetMaxColor() +{ + unsigned int x, y; + Color clr; + Color maxClr; + + maxClr.Set(0,0,0,0); + + for (y = 0; y < this->GetHeight(); y++) + { + for (x = 0; x < this->GetWidth(); x++) + { + clr = this->GetPixel(x,y); + + if ( clr.R() + clr.G() + clr.B() > maxClr.R() + maxClr.G() + maxClr.B()) + { + maxClr = clr; + } + } + } + + return maxClr; +} + +//////////////////////////////////////////////////////////////////////////////// +/// Rescale the image +void Image::Rescale(int width, int height) +{ + this->bitmap = FreeImage_Rescale(this->bitmap, width, height, FILTER_BICUBIC); +} + +//////////////////////////////////////////////////////////////////////////////// +/// Render this image using opengl +/*void Image::RenderOpengl(float destW, float destH) +{ + if (!this->Valid()) + { + printf("Invalid\n"); + return; + } + + FIBITMAP *resizedBitmap = FreeImage_Rescale(this->bitmap, destW, destH, + FILTER_LANCZOS3); + + Vector3d pt; + Color clr; + + unsigned int x,y; + unsigned int w = this->GetWidth(); + unsigned int h = this->GetHeight(); + + //float xRes = destW / w; + //float yRes = destH / h; + + pt.z = 0; + + glBegin(GL_TRIANGLE_STRIP); + for (y = h-1; y > 0; y--) + { + for (x=0; x < w; x++) + { + pt.x = x;// * xRes; + pt.y = (h-y);// * yRes; + + clr = this->GetPixel(x,y); + glColor3ub( clr.r, clr.g, clr.b ); + glVertex3f(pt.x, pt.y, pt.z); + + pt.y = (h-y-1);// * yRes; + clr = this->GetPixel(x,y-1); + glColor3ub( clr.r, clr.g, clr.b ); + glVertex3f(pt.x, pt.y, pt.z); + } + glVertex3f(pt.x, pt.y, pt.z); + glVertex3f(pt.x, pt.y, pt.z); + } + glEnd(); + + FreeImage_Unload(resizedBitmap); +}*/ + +//////////////////////////////////////////////////////////////////////////////// +/// Returns whether this is a valid image +bool Image::Valid() const +{ + return this->bitmap != NULL; +} Added: code/gazebo/trunk/server/rendering/Image.hh =================================================================== --- code/gazebo/trunk/server/rendering/Image.hh (rev 0) +++ code/gazebo/trunk/server/rendering/Image.hh 2009-05-11 01:43:31 UTC (rev 7634) @@ -0,0 +1,91 @@ +/* + * Gazebo - Outdoor Multi-Robot Simulator + * Copyright (C) 2003 + * Nate Koenig & Andrew Howard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +/* Desc: Image class + * Author: Nate Koenig + * Date: 14 July 2008 + * SVN: $Id$ + */ + +#ifndef IMAGE_HH +#define IMAGE_HH + +#include <string> +#include <FreeImage.h> + +#include "Color.hh" + +namespace gazebo +{ + class Image + { + /// \brief Constructor + public: Image(); + + /// \brief Destructor + public: virtual ~Image(); + + /// \brief Load an image. Return 0 on success + public: int Load(const std::string &filename); + + /// \brief Set the image from raw data (R8G8B8) + /// \param data Pointer to the raw image data + /// \param width Width in pixels + /// \param height Height in pixels + /// \param scanline_bytes Size of a image row in bytes + /// \param bpp Bits per pixels, aka depth + public: void SetFromData( const unsigned char *data, unsigned int width, + unsigned int height, int scanline_bytes, unsigned int bpp); + + /// \brief Get the width + public: unsigned int GetWidth() const; + + /// \brief Get the height + public: unsigned int GetHeight() const; + + /// \brief Get the size of one pixel in bits + public: unsigned int GetBPP() const; + + /// \brief Get a pixel color value + public: Color GetPixel(unsigned int x, unsigned int y); + + /// \brief Get the average color + public: Color GetAvgColor(); + + /// \brief Get the max color + public: Color GetMaxColor(); + + /// \brief Rescale the image + public: void Rescale(int width, int height); + + /// \brief Render this image using opengl + //public: void RenderOpengl(float destW, float destH); + + /// \brief Returns whether this is a valid image + public: bool Valid() const; + + /// Count the number of images created. Used for initialising free image + private: static int count; + + private: FIBITMAP *bitmap; + }; +} + +#endif Modified: code/gazebo/trunk/server/rendering/OgreAdaptor.cc =================================================================== --- code/gazebo/trunk/server/rendering/OgreAdaptor.cc 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/server/rendering/OgreAdaptor.cc 2009-05-11 01:43:31 UTC (rev 7634) @@ -84,14 +84,6 @@ /// Destructor OgreAdaptor::~OgreAdaptor() { - //GZ_DELETE (this->backgroundColor) - //GZ_DELETE (this->frameListener) - //GZ_DELETE (this->logManager) -// this->root->shutdown(); - //GZ_DELETE (this->root) -// GZ_DELETE (this->sceneMgr) //this objects seems to be destroyed by root -// GZ_DELETE (this->viewport) - if (this->dummyDisplay) { glXDestroyContext(this->dummyDisplay, this->dummyContext); @@ -113,10 +105,9 @@ // Closes and free void OgreAdaptor::Close() { - GZ_DELETE (this->frameListener) - - // This causes a seg fault. Need to fix - //GZ_DELETE (this->root) + if (this->frameListener) + delete this->frameListener; + this->frameListener = NULL; } //////////////////////////////////////////////////////////////////////////////// Modified: code/gazebo/trunk/server/rendering/OgreHUD.cc =================================================================== --- code/gazebo/trunk/server/rendering/OgreHUD.cc 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/server/rendering/OgreHUD.cc 2009-05-11 01:43:31 UTC (rev 7634) @@ -94,7 +94,9 @@ // Get a pointer to the text renderer void OgreHUD::Close() { - GZ_DELETE(myself) + if (myself) + delete myself; + myself = NULL; } //////////////////////////////////////////////////////////////////////////////// Modified: code/gazebo/trunk/worlds/map.world =================================================================== --- code/gazebo/trunk/worlds/map.world 2009-05-10 23:47:42 UTC (rev 7633) +++ code/gazebo/trunk/worlds/map.world 2009-05-11 01:43:31 UTC (rev 7634) @@ -19,7 +19,7 @@ <verbosity>5</verbosity> <physics:ode> - <stepTime>0.3</stepTime> + <stepTime>0.03</stepTime> <gravity>0 0 -9.8</gravity> <cfm>10e-5</cfm> <erp>0.3</erp> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-11 04:53:07
|
Revision: 7635 http://playerstage.svn.sourceforge.net/playerstage/?rev=7635&view=rev Author: natepak Date: 2009-05-11 04:52:57 +0000 (Mon, 11 May 2009) Log Message: ----------- Output better config error messsages Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/cmake/GazeboUtils.cmake code/gazebo/trunk/cmake/SearchForStuff.cmake code/gazebo/trunk/server/CMakeLists.txt Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-11 01:43:31 UTC (rev 7634) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-11 04:52:57 UTC (rev 7635) @@ -10,6 +10,9 @@ SET (GAZEBO_VERSION 0.9.0) MESSAGE (STATUS "${PROJECT_NAME} version ${GAZEBO_VERSION}") + +SET (BUILD_GAZEBO OFF CACHE INTERNAL "Build Gazebo" FORCE) + SET (gazeboserver_sources_desc "List of server sources" CACHE INTERNAL "Gazebo server sources list description" FORCE) SET (gazeboserver_include_dirs_desc "List of server include directories" @@ -33,9 +36,9 @@ ##################################### # Build type cflags -SET (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -fPIC -Wall " CACHE INTERNAL "C Flags for release" FORCE) -SET (CMAKE_C_FLAGS_DEBUG " -ggdb -fPIC " CACHE INTERNAL "C Flags fro debug" FORCE) -SET (CMAKE_C_FLAGS_PROFILE " -ggdb -pg -fPIC " CACHE INTERNAL "C Flags for profile" FORCE) +SET (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -Wall " CACHE INTERNAL "C Flags for release" FORCE) +SET (CMAKE_C_FLAGS_DEBUG " -ggdb " CACHE INTERNAL "C Flags fro debug" FORCE) +SET (CMAKE_C_FLAGS_PROFILE " -ggdb -pg " CACHE INTERNAL "C Flags for profile" FORCE) ##################################### # Build type link flags @@ -55,18 +58,22 @@ INCLUDE (${gazebo_cmake_dir}/SearchForStuff.cmake) MESSAGE (STATUS "----------------------------------------") -ADD_SUBDIRECTORY(libgazebo) -ADD_SUBDIRECTORY(server) -ADD_SUBDIRECTORY(worlds) -ADD_SUBDIRECTORY(Media) +IF (BUILD_GAZEBO) + ADD_SUBDIRECTORY(libgazebo) + ADD_SUBDIRECTORY(server) + ADD_SUBDIRECTORY(worlds) + ADD_SUBDIRECTORY(Media) + + IF (INCLUDE_PLAYER) + ADD_SUBDIRECTORY(player) + ENDIF (INCLUDE_PLAYER) + + IF (INCLUDE_WEBGAZEBO) + Add_SUBDIRECTORY(webgazebo) + ENDIF (INCLUDE_WEBGAZEBO) + + MESSAGE (STATUS "Build Type: ${CMAKE_BUILD_TYPE}") + MESSAGE (STATUS "Install path: ${CMAKE_INSTALL_PREFIX}") +ENDIF (BUILD_GAZEBO) -IF (INCLUDE_PLAYER) - ADD_SUBDIRECTORY(player) -ENDIF (INCLUDE_PLAYER) - -IF (INCLUDE_WEBGAZEBO) - Add_SUBDIRECTORY(webgazebo) -ENDIF (INCLUDE_WEBGAZEBO) - -MESSAGE (STATUS "Build Type: ${CMAKE_BUILD_TYPE}") -MESSAGE (STATUS "Install path: ${CMAKE_INSTALL_PREFIX}") +GAZEBOSERVER_RESET_LISTS() Modified: code/gazebo/trunk/cmake/GazeboUtils.cmake =================================================================== --- code/gazebo/trunk/cmake/GazeboUtils.cmake 2009-05-11 01:43:31 UTC (rev 7634) +++ code/gazebo/trunk/cmake/GazeboUtils.cmake 2009-05-11 04:52:57 UTC (rev 7635) @@ -53,4 +53,5 @@ ${gazeboserver_link_libs_desc} FORCE) SET (gazeboserver_cflags "" CACHE INTERNAL ${gazeboserver_cflags_desc} FORCE) + ENDMACRO (GAZEBOSERVER_RESET_LISTS) Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake =================================================================== --- code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-11 01:43:31 UTC (rev 7634) +++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-11 04:52:57 UTC (rev 7635) @@ -171,20 +171,32 @@ ENDIF (NOT WEBSIM_FOUND) ELSE (PKG_CONFIG_FOUND) + SET (BUILD_GAZEBO OFF CACHE INTERNAL "Build Gazebo" FORCE) MESSAGE (FATAL_ERROR "\nError: pkg-config not found") - SET (BUILD_GAZEBO OFF CACHE BOOL "Build Gazebo" FORCE) ENDIF (PKG_CONFIG_FOUND) ######################################## # Find Boost, if not specified manually IF (NOT boost_include_dirs AND NOT boost_library_dirs AND NOT boost_libraries ) + SET(Boost_ADDITIONAL_VERSIONS "1.37.0") + + # Clear some variables to ensure that the checks for boost are + # always run + SET (Boost_THREAD_FOUND OFF CACHE INTERNAL "" FORCE) + SET (Boost_SIGNALS_FOUND OFF CACHE INTERNAL "" FORCE) + SET (Boost_INCLUDE_DIR "" CACHE INTERNAL "" FORCE) + INCLUDE (FindBoost) - SET(Boost_ADDITIONAL_VERSIONS "1.37.0") + FIND_PACKAGE( Boost 1.37.0 COMPONENTS thread signals) + IF (NOT Boost_FOUND) - MESSAGE (FATAL_ERROR "Boost thread and signals not found") - SET (BUILD_GAZEBO OFF CACHE BOOL "Build Gazebo" FORCE) + SET (BUILD_GAZEBO OFF CACHE INTERNAL "Build Gazebo" FORCE) + MESSAGE (FATAL_ERROR "Boost thread and signals not found. Please install Boost threads and signals version 1.37.0 or higher.") + + ELSE (NOT Boost_FOUND) + MESSAGE (STATUS "Found Boost!") ENDIF (NOT Boost_FOUND) SET (boost_include_dirs ${Boost_INCLUDE_DIRS} CACHE STRING Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-11 01:43:31 UTC (rev 7634) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-11 04:52:57 UTC (rev 7635) @@ -104,4 +104,3 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/gazeborc.cmake ${CMAKE_CURRENT_BINARY_DIR}/.gazeborc @ONLY) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/.gazeborc DESTINATION ~/) -GAZEBOSERVER_RESET_LISTS() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-11 15:06:05
|
Revision: 7636 http://playerstage.svn.sourceforge.net/playerstage/?rev=7636&view=rev Author: natepak Date: 2009-05-11 15:05:56 +0000 (Mon, 11 May 2009) Log Message: ----------- More fixes to cmake Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/cmake/SearchForStuff.cmake code/gazebo/trunk/server/physics/MapGeom.cc Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-11 04:52:57 UTC (rev 7635) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-11 15:05:56 UTC (rev 7636) @@ -10,9 +10,8 @@ SET (GAZEBO_VERSION 0.9.0) MESSAGE (STATUS "${PROJECT_NAME} version ${GAZEBO_VERSION}") +SET (BUILD_GAZEBO ON CACHE INTERNAL "Build Gazebo" FORCE) -SET (BUILD_GAZEBO OFF CACHE INTERNAL "Build Gazebo" FORCE) - SET (gazeboserver_sources_desc "List of server sources" CACHE INTERNAL "Gazebo server sources list description" FORCE) SET (gazeboserver_include_dirs_desc "List of server include directories" @@ -24,8 +23,9 @@ SET (gazeboserver_cflags_desc "List of server cflags" CACHE INTERNAL "Server cflags description" FORCE) -SET (OGRE_VERSION 1.6.0 CACHE INTERNAL "Ogre Version Requirement") -SET (ODE_VERSION 0.10.1 CACHE INTERNAL "ODE Version Requirement") +SET (OGRE_VERSION 1.6.1 CACHE INTERNAL "Ogre version requirement" FORCE) +SET (ODE_VERSION 0.10.1 CACHE INTERNAL "ODE version requirement" FORCE) +SET (MIN_BOOST_VERSION 1.35.0 CACHE INTERNAL "Boost min version requirement" FORCE) SET (gazebo_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH "Location of CMake scripts") Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake =================================================================== --- code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-11 04:52:57 UTC (rev 7635) +++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-11 15:05:56 UTC (rev 7636) @@ -179,24 +179,20 @@ ######################################## # Find Boost, if not specified manually IF (NOT boost_include_dirs AND NOT boost_library_dirs AND NOT boost_libraries ) - SET(Boost_ADDITIONAL_VERSIONS "1.37.0") # Clear some variables to ensure that the checks for boost are # always run SET (Boost_THREAD_FOUND OFF CACHE INTERNAL "" FORCE) SET (Boost_SIGNALS_FOUND OFF CACHE INTERNAL "" FORCE) - SET (Boost_INCLUDE_DIR "" CACHE INTERNAL "" FORCE) + SET(Boost_ADDITIONAL_VERSIONS "1.35" "1.35.0" "1.36" "1.36.1" "1.37.0" CACHE INTERNAL "Boost Additional versions" FORCE) INCLUDE (FindBoost) - FIND_PACKAGE( Boost 1.37.0 COMPONENTS thread signals) + FIND_PACKAGE( Boost ${MIN_BOOST_VERSION} REQUIRED thread signals ) IF (NOT Boost_FOUND) SET (BUILD_GAZEBO OFF CACHE INTERNAL "Build Gazebo" FORCE) - MESSAGE (FATAL_ERROR "Boost thread and signals not found. Please install Boost threads and signals version 1.37.0 or higher.") - - ELSE (NOT Boost_FOUND) - MESSAGE (STATUS "Found Boost!") + MESSAGE (FATAL_ERROR "Boost thread and signals not found. Please install Boost threads and signals version ${MIN_BOOST_VERSION} or higher.") ENDIF (NOT Boost_FOUND) SET (boost_include_dirs ${Boost_INCLUDE_DIRS} CACHE STRING Modified: code/gazebo/trunk/server/physics/MapGeom.cc =================================================================== --- code/gazebo/trunk/server/physics/MapGeom.cc 2009-05-11 04:52:57 UTC (rev 7635) +++ code/gazebo/trunk/server/physics/MapGeom.cc 2009-05-11 15:05:56 UTC (rev 7636) @@ -144,7 +144,8 @@ this->CreateBoxes(this->root); - this->visualNode->MakeStatic(); + if (this->visualNode) + this->visualNode->MakeStatic(); } @@ -371,7 +372,8 @@ newY += ceil(newH); } - node->occupied = true; + //node->occupied = true; + node->occupied = false; node->leaf = false; } else if (occPixels == 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-13 02:06:22
|
Revision: 7640 http://playerstage.svn.sourceforge.net/playerstage/?rev=7640&view=rev Author: natepak Date: 2009-05-13 02:06:08 +0000 (Wed, 13 May 2009) Log Message: ----------- Added more thread safety. Improved build process. Removed sconscript files Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/SConstruct code/gazebo/trunk/cmake/GazeboUtils.cmake code/gazebo/trunk/libgazebo/CMakeLists.txt code/gazebo/trunk/libgazebo/Client.cc code/gazebo/trunk/libgazebo/Iface.cc code/gazebo/trunk/libgazebo/SConscript code/gazebo/trunk/libgazebo/gazebo.h code/gazebo/trunk/player/SConscript code/gazebo/trunk/server/CMakeLists.txt code/gazebo/trunk/server/Entity.cc code/gazebo/trunk/server/Entity.hh code/gazebo/trunk/server/GazeboConfig.cc code/gazebo/trunk/server/Model.cc code/gazebo/trunk/server/Model.hh code/gazebo/trunk/server/Pose3d.cc code/gazebo/trunk/server/Pose3d.hh code/gazebo/trunk/server/Simulator.cc code/gazebo/trunk/server/Simulator.hh code/gazebo/trunk/server/World.cc code/gazebo/trunk/server/World.hh code/gazebo/trunk/server/XMLConfig.cc code/gazebo/trunk/server/audio_video/CMakeLists.txt code/gazebo/trunk/server/controllers/CMakeLists.txt code/gazebo/trunk/server/controllers/Controller.cc code/gazebo/trunk/server/controllers/Controller.hh code/gazebo/trunk/server/controllers/camera/generic/Generic_Camera.cc code/gazebo/trunk/server/controllers/factory/Factory.cc code/gazebo/trunk/server/controllers/ptz/generic/Generic_PTZ.cc code/gazebo/trunk/server/gui/CMakeLists.txt code/gazebo/trunk/server/gui/GLFrame.cc code/gazebo/trunk/server/gui/GLWindow.cc code/gazebo/trunk/server/gui/GLWindow.hh code/gazebo/trunk/server/gui/StatusBar.cc code/gazebo/trunk/server/gui/Toolbar.cc code/gazebo/trunk/server/main.cc code/gazebo/trunk/server/physics/Body.cc code/gazebo/trunk/server/physics/Body.hh code/gazebo/trunk/server/physics/CMakeLists.txt code/gazebo/trunk/server/physics/ContactParams.cc code/gazebo/trunk/server/physics/Geom.cc code/gazebo/trunk/server/physics/Geom.hh code/gazebo/trunk/server/physics/HeightmapGeom.cc code/gazebo/trunk/server/physics/HeightmapGeom.hh code/gazebo/trunk/server/physics/HingeJoint.cc code/gazebo/trunk/server/physics/Joint.cc code/gazebo/trunk/server/physics/Joint.hh code/gazebo/trunk/server/physics/MapGeom.cc code/gazebo/trunk/server/physics/PhysicsEngine.cc code/gazebo/trunk/server/physics/PhysicsEngine.hh code/gazebo/trunk/server/physics/PlaneGeom.cc code/gazebo/trunk/server/physics/RayGeom.cc code/gazebo/trunk/server/physics/TrimeshGeom.cc code/gazebo/trunk/server/physics/ode/CMakeLists.txt code/gazebo/trunk/server/physics/ode/ODEPhysics.cc code/gazebo/trunk/server/physics/ode/ODEPhysics.hh code/gazebo/trunk/server/rendering/CMakeLists.txt code/gazebo/trunk/server/rendering/OgreAdaptor.cc code/gazebo/trunk/server/rendering/OgreAdaptor.hh code/gazebo/trunk/server/rendering/OgreCamera.cc code/gazebo/trunk/server/rendering/OgreCamera.hh code/gazebo/trunk/server/rendering/OgreCreator.cc code/gazebo/trunk/server/rendering/OgreCreator.hh code/gazebo/trunk/server/rendering/OgreSimpleShape.cc code/gazebo/trunk/server/rendering/OgreVisual.cc code/gazebo/trunk/server/rendering/OgreVisual.hh code/gazebo/trunk/server/sensors/CMakeLists.txt code/gazebo/trunk/server/sensors/Sensor.cc code/gazebo/trunk/server/sensors/Sensor.hh code/gazebo/trunk/server/sensors/camera/CMakeLists.txt code/gazebo/trunk/server/sensors/camera/MonoCameraSensor.cc code/gazebo/trunk/server/sensors/contact/CMakeLists.txt code/gazebo/trunk/server/sensors/contact/ContactSensor.cc code/gazebo/trunk/server/sensors/contact/ContactSensor.hh code/gazebo/trunk/server/sensors/imu/CMakeLists.txt code/gazebo/trunk/server/sensors/imu/ImuSensor.cc code/gazebo/trunk/server/sensors/ir/CMakeLists.txt code/gazebo/trunk/server/sensors/ray/CMakeLists.txt code/gazebo/trunk/server/sensors/ray/RaySensor.cc code/gazebo/trunk/server/sensors/ray/RaySensor.hh code/gazebo/trunk/worlds/simpleshapes.world code/gazebo/trunk/worlds/trimesh.world Added Paths: ----------- code/gazebo/trunk/cmake/libgazebo_pkgconfig.cmake Removed Paths: ------------- code/gazebo/trunk/cmake/libgazeboshm_pkgconfig.cmake code/gazebo/trunk/examples/SConscript code/gazebo/trunk/examples/libgazebo/SConscript code/gazebo/trunk/server/SConscript code/gazebo/trunk/server/audio_video/SConscript code/gazebo/trunk/server/bindings/SConscript code/gazebo/trunk/server/bindings/python/SConscript code/gazebo/trunk/server/controllers/SConscript code/gazebo/trunk/server/controllers/actarray/SConscript code/gazebo/trunk/server/controllers/actarray/bandit/SConscript code/gazebo/trunk/server/controllers/actarray/generic/SConscript code/gazebo/trunk/server/controllers/audio/SConscript code/gazebo/trunk/server/controllers/bumper/SConscript code/gazebo/trunk/server/controllers/bumper/generic/SConscript code/gazebo/trunk/server/controllers/camera/SConscript code/gazebo/trunk/server/controllers/camera/generic/SConscript code/gazebo/trunk/server/controllers/camera/stereo/SConscript code/gazebo/trunk/server/controllers/factory/SConscript code/gazebo/trunk/server/controllers/gripper/SConscript code/gazebo/trunk/server/controllers/gripper/pioneer2/SConscript code/gazebo/trunk/server/controllers/imu/SConscript code/gazebo/trunk/server/controllers/irarray/SConscript code/gazebo/trunk/server/controllers/laser/SConscript code/gazebo/trunk/server/controllers/laser/sicklms200/SConscript code/gazebo/trunk/server/controllers/opaque/SConscript code/gazebo/trunk/server/controllers/opaque/jointforce/SConscript code/gazebo/trunk/server/controllers/position2d/SConscript code/gazebo/trunk/server/controllers/position2d/differential/SConscript code/gazebo/trunk/server/controllers/position2d/holonome3sw/SConscript code/gazebo/trunk/server/controllers/position2d/steering/SConscript code/gazebo/trunk/server/controllers/ptz/SConscript code/gazebo/trunk/server/controllers/ptz/generic/SConscript code/gazebo/trunk/server/gui/SConscript code/gazebo/trunk/server/physics/SConscript code/gazebo/trunk/server/physics/ode/SConscript code/gazebo/trunk/server/rendering/SConscript code/gazebo/trunk/server/sensors/SConscript code/gazebo/trunk/server/sensors/camera/SConscript code/gazebo/trunk/server/sensors/contact/SConscript code/gazebo/trunk/server/sensors/imu/SConscript code/gazebo/trunk/server/sensors/ir/SConscript code/gazebo/trunk/server/sensors/ray/SConscript code/gazebo/trunk/webgazebo/SConscript Property Changed: ---------------- code/gazebo/trunk/ Property changes on: code/gazebo/trunk ___________________________________________________________________ Modified: svn:mergeinfo - /code/branches/federation/gazebo:7371-7550 + /code/branches/federation/gazebo:7371-7550 /code/gazebo/branches/ogre-1.4.9:7137-7636 Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-13 02:06:08 UTC (rev 7640) @@ -22,6 +22,10 @@ CACHE INTERNAL "Link libs description" FORCE) SET (gazeboserver_cflags_desc "List of server cflags" CACHE INTERNAL "Server cflags description" FORCE) +SET (gazebosensor_sources_desc "List of sensor sources" + CACHE INTERNAL "Gazebo sensor sources list description" FORCE) +SET (gazebocontroller_sources_desc "List of controller sources" + CACHE INTERNAL "Gazebo controller sources list description" FORCE) SET (OGRE_VERSION 1.6.1 CACHE INTERNAL "Ogre version requirement" FORCE) SET (ODE_VERSION 0.10.1 CACHE INTERNAL "ODE version requirement" FORCE) Modified: code/gazebo/trunk/SConstruct =================================================================== --- code/gazebo/trunk/SConstruct 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/SConstruct 2009-05-13 02:06:08 UTC (rev 7640) @@ -5,8 +5,8 @@ exec(open('build.py')) -PKG_CONFIG_VERSION = '0.22' -OGRE_VERSION = '>= 1.6.0' +PKG_CONFIG_VERSION = '0.23' +OGRE_VERSION = '>= 1.6.1' ODE_VERSION = '>= 0.10.1' Modified: code/gazebo/trunk/cmake/GazeboUtils.cmake =================================================================== --- code/gazebo/trunk/cmake/GazeboUtils.cmake 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/cmake/GazeboUtils.cmake 2009-05-13 02:06:08 UTC (rev 7640) @@ -21,7 +21,7 @@ ENDMACRO(APPEND_TO_CACHED_LIST) ############################################################################### -# Append sources to the server sources +# Append sources to the server sources list MACRO (APPEND_TO_SERVER_SOURCES) FOREACH (src ${ARGN}) APPEND_TO_CACHED_LIST(gazeboserver_sources @@ -31,6 +31,27 @@ ENDMACRO (APPEND_TO_SERVER_SOURCES) ############################################################################### +# Append sources to the sensor sources list +MACRO (APPEND_TO_SENSOR_SOURCES) + FOREACH (src ${ARGN}) + APPEND_TO_CACHED_LIST(gazebosensor_sources + ${gazebosensor_sources_desc} + ${CMAKE_CURRENT_SOURCE_DIR}/${src}) + ENDFOREACH (src ${ARGN}) +ENDMACRO (APPEND_TO_SENSOR_SOURCES) + +############################################################################### +# Append sources to the controller sources list +MACRO (APPEND_TO_CONTROLLER_SOURCES) + FOREACH (src ${ARGN}) + APPEND_TO_CACHED_LIST(gazebocontroller_sources + ${gazebocontroller_sources_desc} + ${CMAKE_CURRENT_SOURCE_DIR}/${src}) + ENDFOREACH (src ${ARGN}) +ENDMACRO (APPEND_TO_CONTROLLER_SOURCES) + + +############################################################################### # Macro to turn a list into a string (why doesn't CMake have this built-in?) MACRO (LIST_TO_STRING _string _list) SET (${_string}) @@ -53,5 +74,8 @@ ${gazeboserver_link_libs_desc} FORCE) SET (gazeboserver_cflags "" CACHE INTERNAL ${gazeboserver_cflags_desc} FORCE) - + SET (gazebosensor_sources "" CACHE INTERNAL + ${gazebosensor_sources_desc} FORCE) + SET (gazebocontroller_sources "" CACHE INTERNAL + ${gazebocontroller_sources_desc} FORCE) ENDMACRO (GAZEBOSERVER_RESET_LISTS) Copied: code/gazebo/trunk/cmake/libgazebo_pkgconfig.cmake (from rev 7635, code/gazebo/trunk/cmake/libgazeboshm_pkgconfig.cmake) =================================================================== --- code/gazebo/trunk/cmake/libgazebo_pkgconfig.cmake (rev 0) +++ code/gazebo/trunk/cmake/libgazebo_pkgconfig.cmake 2009-05-13 02:06:08 UTC (rev 7640) @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: libgazeboshm +Description: Shared memory interface to Gazebo +Version: @GAZEBO_VERSION@ +Requires: +Libs: -L${libdir} -lgazeboshm +CFlags: -I${includedir} Property changes on: code/gazebo/trunk/cmake/libgazebo_pkgconfig.cmake ___________________________________________________________________ Added: svn:mergeinfo + /code/branches/federation/gazebo/cmake/libgazeboshm_pkgconfig.cmake:7371-7550 /code/gazebo/branches/ogre-1.4.9/cmake/libgazeboshm_pkgconfig.cmake:7137-7636 Deleted: code/gazebo/trunk/cmake/libgazeboshm_pkgconfig.cmake =================================================================== --- code/gazebo/trunk/cmake/libgazeboshm_pkgconfig.cmake 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/cmake/libgazeboshm_pkgconfig.cmake 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,10 +0,0 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: libgazeboshm -Description: Shared memory interface to Gazebo -Version: @GAZEBO_VERSION@ -Requires: -Libs: -L${libdir} -lgazeboshm -CFlags: -I${includedir} Deleted: code/gazebo/trunk/examples/SConscript =================================================================== --- code/gazebo/trunk/examples/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/examples/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,4 +0,0 @@ -dirs = Split('libgazebo') - -for subdir in dirs: - SConscript('%s/SConscript' % subdir) Deleted: code/gazebo/trunk/examples/libgazebo/SConscript =================================================================== --- code/gazebo/trunk/examples/libgazebo/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/examples/libgazebo/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,4 +0,0 @@ -dirs = Split('audio camera position factory simiface stereo') - -for subdir in dirs: - SConscript('%s/SConscript' % subdir) Modified: code/gazebo/trunk/libgazebo/CMakeLists.txt =================================================================== --- code/gazebo/trunk/libgazebo/CMakeLists.txt 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/libgazebo/CMakeLists.txt 2009-05-13 02:06:08 UTC (rev 7640) @@ -11,11 +11,13 @@ LINK_DIRECTORIES(${boost_library_dirs}) ADD_LIBRARY(gazeboshm SHARED ${sources}) +SET_TARGET_PROPERTIES(gazeboshm PROPERTIES OUTPUT_NAME "gazebo") TARGET_LINK_LIBRARIES( gazeboshm ${boost_libraries}) INSTALL (TARGETS gazeboshm DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) INSTALL (FILES ${headers} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/gazebo) -CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/libgazeboshm_pkgconfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/libgazeboshm.pc @ONLY) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgazeboshm.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig COMPONENT pkgconfig) +CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/libgazebo_pkgconfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/libgazebo.pc @ONLY) + +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgazebo.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig COMPONENT pkgconfig) Modified: code/gazebo/trunk/libgazebo/Client.cc =================================================================== --- code/gazebo/trunk/libgazebo/Client.cc 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/libgazebo/Client.cc 2009-05-13 02:06:08 UTC (rev 7640) @@ -189,8 +189,14 @@ { this->semKey = GZ_SEM_KEY + this->serverId; - // Get the client semaphore group - this->semId = semget(this->semKey, 0, S_IRWXU); + // While loop to wait for directory + this->semId = -1; + while(this->semId < 0) + { + // Get the client semaphore group + this->semId = semget(this->semKey, 0, S_IRWXU); + usleep(1000000); + } if (this->semId < 0) { Modified: code/gazebo/trunk/libgazebo/Iface.cc =================================================================== --- code/gazebo/trunk/libgazebo/Iface.cc 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/libgazebo/Iface.cc 2009-05-13 02:06:08 UTC (rev 7640) @@ -265,6 +265,15 @@ // Open the mmap file this->mmapFd = open(this->filename.c_str(), O_RDWR); + + // this patch is needed so Gazebo sits and waits for Iface to open when + // spawning robot dynamically + while (this->mmapFd <= 0) + { + this->mmapFd = open(this->filename.c_str(), O_RDWR); + usleep(1000000); // wait and try again + } + if (this->mmapFd <= 0) { stream << "error opening device file " << this->filename.c_str() << " : " Modified: code/gazebo/trunk/libgazebo/SConscript =================================================================== --- code/gazebo/trunk/libgazebo/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/libgazebo/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -22,7 +22,10 @@ # setup a special build environment for libgazebo. Do this so we can control # what libgazebo depends upon # -myEnv = Environment ( +# CC = '/opt/intel/cc/10.1.008/bin/icc', +# CXX = '/opt/intel/cc/10.1.008/bin/icpc', +# LD = '/opt/intel/cc/10.1.008/bin/xild', +env = Environment ( CC = 'g++', CCFLAGS = Split ('-pthread -pipe -W -Wall -O2'), LIBS=Split('boost_signals boost_thread'), Modified: code/gazebo/trunk/libgazebo/gazebo.h =================================================================== --- code/gazebo/trunk/libgazebo/gazebo.h 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/libgazebo/gazebo.h 2009-05-13 02:06:08 UTC (rev 7640) @@ -1111,7 +1111,7 @@ public: GazeboData head; /// String describing the model to be initiated - public: uint8_t newModel[4096*4]; + public: uint8_t newModel[409600]; /// Delete a model by name public: uint8_t deleteModel[512]; Modified: code/gazebo/trunk/player/SConscript =================================================================== --- code/gazebo/trunk/player/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/player/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,6 +1,9 @@ import os Import('*') +parseConfigs = ['pkg-config --cflags --libs playerc++', + 'pkg-config --cflags --libs playerc'] + sources = ['GazeboDriver.cc', 'GazeboClient.cc', 'GazeboInterface.cc', Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,45 +1,49 @@ INCLUDE (${gazebo_cmake_dir}/GazeboUtils.cmake) + ######################################## +# All the library search paths +ADD_SUBDIRECTORY(rendering) +ADD_SUBDIRECTORY(physics) +ADD_SUBDIRECTORY(sensors) +ADD_SUBDIRECTORY(gui) +ADD_SUBDIRECTORY(controllers) +IF (INCLUDE_AV) + ADD_SUBDIRECTORY(audio_video) +ENDIF (INCLUDE_AV) + +#${FLTK_INCLUDE_DIR} +######################################## # Include all the search paths for headers -INCLUDE_DIRECTORIES( . +INCLUDE_DIRECTORIES( + . ${CMAKE_SOURCE_DIR}/libgazebo - audio_video gui - rendering physics physics/ode + audio_video + controllers + rendering sensors sensors/camera sensors/contact sensors/imu sensors/ir sensors/ray - controllers ${gazeboserver_include_dirs} - ${LIBAVCODEC_PATH} - ${LIBAVFORMAT_PATH} - ${FLTK_INCLUDE_DIR} ${boost_include_dirs} ) -######################################## -# All the library search paths LINK_DIRECTORIES( - ${CMAKE_SOURCE_DIR}/libgazebo ${boost_library_dirs} ${gazeboserver_link_dirs} + ${CMAKE_BINARY_DIR}/libgazebo + ${boost_library_dirs} + ${gazeboserver_link_dirs} + sensors + controllers ) ######################################## # Process all the subdirectories -ADD_SUBDIRECTORY(rendering) -ADD_SUBDIRECTORY(sensors) -ADD_SUBDIRECTORY(physics) -ADD_SUBDIRECTORY(controllers) -ADD_SUBDIRECTORY(gui) -IF (INCLUDE_AV) - ADD_SUBDIRECTORY(audio_video) -ENDIF (INCLUDE_AV) - SET (sources Common.cc Vector3.cc Vector4.cc @@ -83,8 +87,11 @@ APPEND_TO_SERVER_SOURCES(${sources}) -ADD_EXECUTABLE(gazebo ${gazeboserver_sources} main.cc) +#ADD_LIBRARY(gazeboserver STATIC ${gazeboserver_sources}) +ADD_EXECUTABLE(gazebo-exec ${gazeboserver_sources} main.cc) +SET_TARGET_PROPERTIES(gazebo-exec PROPERTIES OUTPUT_NAME "gazebo") + LIST_TO_STRING(GAZEBO_CFLAGS "${gazeboserver_cflags}") SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES COMPILE_FLAGS "${GAZEBO_CFLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}") @@ -94,9 +101,9 @@ ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}}) ENDIF (CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}) -TARGET_LINK_LIBRARIES( gazebo ${gazeboserver_link_libs} ${FLTK_LIBRARIES} ${boost_libraries} gazeboshm ) +TARGET_LINK_LIBRARIES( gazebo-exec gazebo_gui gazebo_sensors gazebo_physics gazebo_rendering gazebo_controllers gazebo_av ${gazeboserver_link_libs} ${FLTK_LIBRARIES} ${boost_libraries} gazebo ) -INSTALL (TARGETS gazebo DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) +INSTALL (TARGETS gazebo-exec DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) INSTALL (FILES ${headers} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/gazebo COMPONENT headers) ######################################## Modified: code/gazebo/trunk/server/Entity.cc =================================================================== --- code/gazebo/trunk/server/Entity.cc 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/Entity.cc 2009-05-13 02:06:08 UTC (rev 7640) @@ -25,6 +25,8 @@ * SVN: $Id$ */ +#include "Geom.hh" +#include "Model.hh" #include "Body.hh" #include "GazeboError.hh" #include "Global.hh" @@ -33,6 +35,7 @@ #include "World.hh" #include "PhysicsEngine.hh" #include "Entity.hh" +#include "Simulator.hh" using namespace gazebo; @@ -55,14 +58,17 @@ if (this->parent) { this->parent->AddChild(this); - this->visualNode = OgreCreator::Instance()->CreateVisual( - visname.str(), this->parent->GetVisualNode(), this); + +// if (Simulator::Instance()->GetRenderEngineEnabled()) + this->visualNode = OgreCreator::Instance()->CreateVisual( + visname.str(), this->parent->GetVisualNode(), this); this->SetStatic(parent->IsStatic()); } else { + //if (Simulator::Instance()->GetRenderEngineEnabled()) this->visualNode = OgreCreator::Instance()->CreateVisual( - visname.str(), NULL, this ); + visname.str(), NULL, this ); } // Add this to the phyic's engine @@ -167,13 +173,17 @@ Body *body = NULL; this->selected = s; + //std::cout << " SetSelected Entity : " << this->GetName() << " selected(" << s << ")" << std::endl; for (iter = this->children.begin(); iter != this->children.end(); iter++) { + //std::cout << " SetSelected Entity Children: " << (*iter)->GetName() << std::endl; (*iter)->SetSelected(s); body = dynamic_cast<Body*>(*iter); - if (body) - body->SetEnabled(!s); + + //enabling SetEnabled(!s) makes body unstabel upon unselection + //if (body) + //body->SetEnabled(!s); } return true; @@ -207,6 +217,29 @@ return ent.GetName() == this->GetName(); } +//////////////////////////////////////////////////////////////////////////////// +/// Return true if the entity is a geom +bool Entity::IsGeom() +{ + return dynamic_cast<Geom*>(this) != NULL; +} + +//////////////////////////////////////////////////////////////////////////////// +/// Return true if the entity is a body +bool Entity::IsBody() +{ + return dynamic_cast<Body*>(this) != NULL; +} + +//////////////////////////////////////////////////////////////////////////////// +/// Return true if the entity is a model +bool Entity::IsModel() +{ + return dynamic_cast<Model*>(this) != NULL; +} + +//////////////////////////////////////////////////////////////////////////////// +// Get the pose of the entity relative to its parent Pose3d Entity::GetPoseRelative() const { if (this->parent) Modified: code/gazebo/trunk/server/Entity.hh =================================================================== --- code/gazebo/trunk/server/Entity.hh 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/Entity.hh 2009-05-13 02:06:08 UTC (rev 7640) @@ -37,7 +37,11 @@ namespace gazebo { - + + class Geom; + class Body; + class Model; + class OgreVisual; /// \addtogroup gazebo_server /// \{ @@ -107,11 +111,22 @@ /// \brief Get the pose of the entity public: virtual Pose3d GetPose() const = 0;// { return Pose3d(); } + + /// \brief Get the pose of the entity relative to its parent public: Pose3d GetPoseRelative() const; /// \brief Returns true if the entities are the same. Checks only the name public: bool operator==(const Entity &ent) const; + /// \brief Return true if the entity is a geom + public: bool IsGeom(); + + /// \brief Return true if the entity is a body + public: bool IsBody(); + + /// \brief Return true if the entity is a model + public: bool IsModel(); + /// \brief Parent of this entity protected: Entity *parent; Modified: code/gazebo/trunk/server/GazeboConfig.cc =================================================================== --- code/gazebo/trunk/server/GazeboConfig.cc 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/GazeboConfig.cc 2009-05-13 02:06:08 UTC (rev 7640) @@ -67,31 +67,34 @@ this->gazeboPaths.push_back(gazebo_resource_path); } - // if both paths are set, don't check the config file or use the defaults. - if(ogre_resource_path && gazebo_resource_path) - return; - - if (cfgFile) { XMLConfig rc; XMLConfigNode *node; rc.Load(rcFilename); - node = rc.GetRootNode()->GetChild("gazeboPath"); - while (node) + // if gazebo path is set, skip reading from .gazeborc + if(!gazebo_resource_path) { - gzmsg(1) << "Gazebo Path[" << node->GetValue() << "]\n"; - this->gazeboPaths.push_back(node->GetValue()); - node = node->GetNext("gazeboPath"); + node = rc.GetRootNode()->GetChild("gazeboPath"); + while (node) + { + gzmsg(1) << "Gazebo Path[" << node->GetValue() << "]\n"; + this->gazeboPaths.push_back(node->GetValue()); + node = node->GetNext("gazeboPath"); + } } - node = rc.GetRootNode()->GetChild("ogrePath"); - while (node) + // if ogre path is set, skip reading from .gazeborc + if(!ogre_resource_path) { - gzmsg(1) << "Ogre Path[" << node->GetValue() << "]\n"; - this->ogrePaths.push_back( node->GetValue() ); - node = node->GetNext("ogrePath"); + node = rc.GetRootNode()->GetChild("ogrePath"); + while (node) + { + gzmsg(1) << "Ogre Path[" << node->GetValue() << "]\n"; + this->ogrePaths.push_back( node->GetValue() ); + node = node->GetNext("ogrePath"); + } } this->RTTMode = rc.GetRootNode()->GetString("RTTMode", "PBuffer"); @@ -99,9 +102,18 @@ else { gzmsg(0) << "Unable to find the file ~/.gazeborc. Using default paths. This may cause OGRE to fail.\n"; - this->gazeboPaths.push_back("/usr/local/share/gazebo"); - this->ogrePaths.push_back("/usr/local/lib/OGRE"); - this->ogrePaths.push_back("/usr/lib/OGRE"); + + if ( !gazebo_resource_path ) + { + this->gazeboPaths.push_back("/usr/local/share/gazebo"); + } + + if ( !ogre_resource_path ) + { + this->ogrePaths.push_back("/usr/local/lib/OGRE"); + this->ogrePaths.push_back("/usr/lib/OGRE"); + } + this->RTTMode="PBuffer"; } } Modified: code/gazebo/trunk/server/Model.cc =================================================================== --- code/gazebo/trunk/server/Model.cc 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/Model.cc 2009-05-13 02:06:08 UTC (rev 7640) @@ -49,6 +49,10 @@ #include "IfaceFactory.hh" #include "Model.hh" +#ifdef TIMING +#include "Simulator.hh" +#endif + using namespace gazebo; uint Model::lightNumber = 0; @@ -394,6 +398,10 @@ Pose3d bodyPose, newPose, oldPose; +#ifdef TIMING + double tmpT1 = Simulator::Instance()->GetWallTime(); +#endif + for (bodyIter=this->bodies.begin(); bodyIter!=this->bodies.end(); bodyIter++) { if (bodyIter->second) @@ -402,6 +410,11 @@ } } +#ifdef TIMING + double tmpT2 = Simulator::Instance()->GetWallTime(); + std::cout << " ALL Bodies DT (" << this->GetName() << ") (" << tmpT2-tmpT1 << ")" << std::endl; +#endif + for (contIter=this->controllers.begin(); contIter!=this->controllers.end(); contIter++) { @@ -410,11 +423,23 @@ contIter->second->Update(); } +#ifdef TIMING + double tmpT3 = Simulator::Instance()->GetWallTime(); + std::cout << " ALL Controllers DT (" << this->GetName() << ") (" << tmpT3-tmpT2 << ")" << std::endl; +#endif + for (jointIter = this->joints.begin(); jointIter != this->joints.end(); jointIter++) { jointIter->second->Update(); } +#ifdef TIMING + double tmpT4 = Simulator::Instance()->GetWallTime(); + std::cout << " ALL Joints/canonical body (" << this->GetName() << ") DT (" << tmpT4-tmpT3 << ")" << std::endl; +#endif + + + // Call the model's python update function, if one exists /*if (this->pFuncUpdate) { @@ -432,6 +457,24 @@ { this->graphicsHandler->Update(); } + + +#ifdef TIMING + int update_error = this->UpdateChild(); + double tmpT5 = Simulator::Instance()->GetWallTime(); + std::cout << " ALL child (" << this->GetName() << ") update DT (" + << tmpT5-tmpT4 << ")" << std::endl; + std::cout << " Models::Update() (" << this->GetName() + << ") Total DT (" << tmpT5-tmpT1 << ")" << std::endl; + return update_error; +#else + return this->UpdateChild(); +#endif + + + + + return this->UpdateChild(); } @@ -555,7 +598,6 @@ childModel->SetPose(newPose); } } - } //////////////////////////////////////////////////////////////////////////////// @@ -644,7 +686,6 @@ return this->pose; } - //////////////////////////////////////////////////////////////////////////////// // Create and return a new body Body *Model::CreateBody() Modified: code/gazebo/trunk/server/Model.hh =================================================================== --- code/gazebo/trunk/server/Model.hh 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/Model.hh 2009-05-13 02:06:08 UTC (rev 7640) @@ -39,6 +39,10 @@ #include "Entity.hh" #include "gazebo.h" +namespace boost +{ + class recursive_mutex; +} namespace gazebo { @@ -228,6 +232,7 @@ private: ParamT<bool> *enableFrictionP; private: ParamT<std::string> *collideP; + // Name of a light (if the model is renderable:light) private: std::string lightName; Modified: code/gazebo/trunk/server/Pose3d.cc =================================================================== --- code/gazebo/trunk/server/Pose3d.cc 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/Pose3d.cc 2009-05-13 02:06:08 UTC (rev 7640) @@ -213,3 +213,20 @@ return a; } + +////////////////////////////////////////////////////////////////////////////// +// Rotate a vector by a quaternion, added for computing CG location for the Body +Pose3d Pose3d::RotatePositionAboutOrigin(const Quatern &rot) const +{ + Pose3d a = *this; + a.pos.x = (1.0 - 2.0*rot.y*rot.y - 2.0*rot.z*rot.z) * this->pos.x + +(2.0*(rot.x*rot.y+rot.u*rot.z) ) * this->pos.y + +(2.0*(rot.x*rot.z-rot.u*rot.y) ) * this->pos.z; + a.pos.y = (2.0*(rot.x*rot.y-rot.u*rot.z) ) * this->pos.x + +(1.0 - 2.0*rot.x*rot.x - 2.0*rot.z*rot.z) * this->pos.y + +(2.0*(rot.y*rot.z+rot.u*rot.x) ) * this->pos.z; + a.pos.z = (2.0*(rot.x*rot.z+rot.u*rot.y) ) * this->pos.x + +(2.0*(rot.y*rot.z-rot.u*rot.x) ) * this->pos.y + +(1.0 - 2.0*rot.x*rot.x - 2.0*rot.y*rot.y) * this->pos.z; + return a; +} Modified: code/gazebo/trunk/server/Pose3d.hh =================================================================== --- code/gazebo/trunk/server/Pose3d.hh 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/Pose3d.hh 2009-05-13 02:06:08 UTC (rev 7640) @@ -114,6 +114,9 @@ /// \brief Reset the pose public: void Reset(); + /// \brief Rotate vector part of a pose about the origin + public: Pose3d RotatePositionAboutOrigin(const Quatern &rot) const; + /// \brief The position public: Vector3 pos; Deleted: code/gazebo/trunk/server/SConscript =================================================================== --- code/gazebo/trunk/server/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,62 +0,0 @@ -#Import variables -Import('*') - -env.Append(CPPPATH = '#server') - -dirs = Split('physics rendering sensors controllers gui')# bindings') - -try: - env["CCFLAGS"].index('-DHAVE_OPENAL') - dirs.append("audio_video") -except ValueError,e: - garbage = 1 - -for subdir in dirs: - print 'Parsing sub directory ' + subdir - SConscript('%s/SConscript' % subdir) - -sources = ['main.cc', - 'Common.cc', - 'Vector3.cc', - 'Vector4.cc', - 'Quatern.cc', - 'Pose3d.cc', - 'World.cc', - 'XMLConfig.cc', - 'GazeboConfig.cc', - 'Time.cc', - 'Entity.cc', - 'GazeboError.cc', - 'GazeboMessage.cc', - 'Model.cc', - 'Simulator.cc', - 'Angle.cc', - 'Param.cc', - 'GraphicsIfaceHandler.cc' - ] - -headers.append( - ['#/server/Entity.hh', - '#/server/GazeboError.hh', - '#/server/GazeboMessage.hh', - '#/server/Global.hh', - '#/server/Model.hh', - '#/server/Pose3d.hh', - '#/server/Quatern.hh', - '#/server/Simulator.hh', - '#/server/SingletonT.hh', - '#/server/StaticPluginRegister.hh', - '#/server/Time.hh', - '#/server/Vector2.hh', - '#/server/Vector3.hh', - '#/server/Vector4.hh', - '#/server/World.hh', - '#/server/XMLConfig.hh', - '#/server/GazeboConfig.hh', - '#/server/Angle.hh', - '#/server/Param.hh', - '#/server/GraphicsIfaceHandler.hh' - ] ) - -#staticObjs.append( env.StaticObject(sources) ) -sharedObjs.append( env.SharedObject(sources) ) Modified: code/gazebo/trunk/server/Simulator.cc =================================================================== --- code/gazebo/trunk/server/Simulator.cc 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/Simulator.cc 2009-05-13 02:06:08 UTC (rev 7640) @@ -72,11 +72,12 @@ userStepInc(false), userQuit(false), guiEnabled(true), + renderEngineEnabled(true), physicsEnabled(true), timeout(-1), - selectedEntity(NULL) + selectedEntity(NULL), + selectedBody(NULL) { - this->mutex = new boost::recursive_mutex(); } @@ -130,7 +131,8 @@ return; gazebo::World::Instance()->Close(); - gazebo::OgreAdaptor::Instance()->Close(); + if (this->renderEngineEnabled) + gazebo::OgreAdaptor::Instance()->Close(); } //////////////////////////////////////////////////////////////////////////////// @@ -172,10 +174,11 @@ } // Load the Ogre rendering system - OgreAdaptor::Instance()->Load(rootNode); + if (this->renderEngineEnabled) + OgreAdaptor::Instance()->Load(rootNode); // Create and initialize the Gui - if (this->guiEnabled) + if (this->renderEngineEnabled && this->guiEnabled) { try { @@ -208,15 +211,18 @@ } //Initialize RenderEngine - try + if (this->renderEngineEnabled) { - OgreAdaptor::Instance()->Init(rootNode); - this->renderEngine = OgreAdaptor::Instance(); + try + { + OgreAdaptor::Instance()->Init(rootNode); + this->renderEngine = OgreAdaptor::Instance(); + } + catch (gazebo::GazeboError e) + { + gzthrow("Failed to Initialize the Rendering engine subsystem\n" << e ); + } } - catch (gazebo::GazeboError e) - { - gzthrow("Failed to Initialize the Rendering engine subsystem\n" << e ); - } // Initialize the GUI if (this->gui) @@ -286,8 +292,11 @@ World::Instance()->GetPhysicsEngine()->Save(prefix, output); output << "\n"; - this->GetRenderEngine()->Save(prefix, output); - output << "\n"; + if (this->renderEngineEnabled) + { + this->GetRenderEngine()->Save(prefix, output); + output << "\n"; + } this->gui->Save(prefix, output); output << "\n"; @@ -321,8 +330,15 @@ double lastTime = 0; double freq = 30.0; - this->physicsThread = new boost::thread( boost::bind(&Simulator::PhysicsLoop, this)); +#ifdef TIMING + double tmpT1 = this->GetWallTime(); + std::cout << "--------------------------- START Simulator::MainLoop() --------------------------" << std::endl; + std::cout << "Simulator::MainLoop() simTime(" << this->simTime << ") world time (" << tmpT1 << ")" << std::endl; +#endif + this->physicsThread = new boost::thread( + boost::bind(&Simulator::PhysicsLoop, this)); + // Update the gui while (!this->userQuit) { @@ -352,6 +368,11 @@ } this->physicsThread->join(); + +#ifdef TIMING + std::cout << "--------------------------- END Simulator::MainLoop() --------------------------" << std::endl; +#endif + } //////////////////////////////////////////////////////////////////////////////// @@ -370,7 +391,10 @@ OgreAdaptor *Simulator::GetRenderEngine() const { - return this->renderEngine; + if (this->renderEngineEnabled) + return this->renderEngine; + else + return NULL; } //////////////////////////////////////////////////////////////////////////////// @@ -477,6 +501,20 @@ } //////////////////////////////////////////////////////////////////////////////// +// True if the gui is to be used +void Simulator::SetRenderEngineEnabled( bool enabled ) +{ + this->renderEngineEnabled = enabled; +} + +//////////////////////////////////////////////////////////////////////////////// +/// Return true if the gui is enabled +bool Simulator::GetRenderEngineEnabled() const +{ + return this->renderEngineEnabled; +} + +//////////////////////////////////////////////////////////////////////////////// /// Set the length of time the simulation should run. void Simulator::SetTimeout(double time) { @@ -501,17 +539,29 @@ /// Set the selected entity void Simulator::SetSelectedEntity( Entity *ent ) { + // unselect selectedEntity if (this->selectedEntity) { this->selectedEntity->GetVisualNode()->ShowSelectionBox(false); this->selectedEntity->SetSelected(false); + this->selectedEntity = NULL; } + // if a different entity is selected, show bounding box and SetSelected(true) if (this->selectedEntity != ent) { + // set selected entity to ent this->selectedEntity = ent; this->selectedEntity->GetVisualNode()->ShowSelectionBox(true); this->selectedEntity->SetSelected(true); + //std::cout << " SetSelected Entity : " << this->selectedEntity->GetName() + // << std::endl; + //std::cout << " ------------------------------------------------------- " + // << std::endl; + //std::cout << " Drag with left mouse button to rotate in the plane of the + // camera view port." << std::endl; + //std::cout << " Drag with right mouse button to reposition object in the + // plane of the camera view port." << std::endl; } else this->selectedEntity = NULL; @@ -526,32 +576,42 @@ } //////////////////////////////////////////////////////////////////////////////// -/// Get the model that currently selected -Model *Simulator::GetSelectedModel() const +/// Get the model that contains the entity +Model *Simulator::GetParentModel( Entity *entity ) const { Model *model = NULL; - Body *body = NULL; - Geom *geom = NULL; - if (!this->selectedEntity) + if (entity == NULL) return NULL; - if ( (model = dynamic_cast<Model*>(this->selectedEntity)) != NULL ) - return model; - else + do { - if ( (body = dynamic_cast<Body*>(this->selectedEntity)) != NULL ) - model = body->GetModel(); - else if ( (geom = dynamic_cast<Geom*>(this->selectedEntity)) != NULL ) - model = geom->GetModel(); - else - gzerr(0) << "Unknown type\n"; - } + model = dynamic_cast<Model*>(entity); + entity = entity->GetParent(); + } while (model == NULL); return model; } //////////////////////////////////////////////////////////////////////////////// +/// Get the body that contains the entity +Body *Simulator::GetParentBody( Entity *entity ) const +{ + Body *body = NULL; + + if (entity == NULL) + return NULL; + + do + { + body = dynamic_cast<Body*>(entity); + entity = entity->GetParent(); + } while (body == NULL); + + return body; +} + +//////////////////////////////////////////////////////////////////////////////// /// Function to run physics. Used by physicsThread void Simulator::PhysicsLoop() { Modified: code/gazebo/trunk/server/Simulator.hh =================================================================== --- code/gazebo/trunk/server/Simulator.hh 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/Simulator.hh 2009-05-13 02:06:08 UTC (rev 7640) @@ -51,6 +51,7 @@ class GazeboConfig; class OgreAdaptor; class Entity; + class Body; class Model; /// \brief The World @@ -150,6 +151,12 @@ /// \brief Return true if the gui is enabled public: bool GetGuiEnabled() const; + /// \brief True if the gui is to be used + public: void SetRenderEngineEnabled( bool enabled ); + + /// \brief Return true if the gui is enabled + public: bool GetRenderEngineEnabled() const; + /// \brief Set the length of time the simulation should run. public: void SetTimeout(double time); @@ -162,12 +169,18 @@ /// \brief Set the selected entity public: void SetSelectedEntity( Entity *ent ); + /// \brief Set the selected body + public: void SetSelectedBody( Body *bod ); + /// \brief Get the selected entity public: Entity *GetSelectedEntity() const; - /// \brief Get the model that currently selected - public: Model *GetSelectedModel() const; + /// \brief Get the model that contains the entity + public: Model *GetParentModel( Entity *entity ) const; + /// \brief Get the body that contains the entity + public: Body *GetParentBody( Entity *entity ) const; + /// \brief Get the simulator mutex public:boost::recursive_mutex *GetMutex(); @@ -222,6 +235,9 @@ /// True if the GUI is enabled private: bool guiEnabled; + /// True if the Rendering Engine is enabled + private: bool renderEngineEnabled; + /// True if physics is enabled private: bool physicsEnabled; @@ -233,6 +249,7 @@ /// The entity currently selected by the user private: Entity *selectedEntity; + private: Body *selectedBody; /// Thread in which to run the gui private: boost::thread *physicsThread; Modified: code/gazebo/trunk/server/World.cc =================================================================== --- code/gazebo/trunk/server/World.cc 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/World.cc 2009-05-13 02:06:08 UTC (rev 7640) @@ -27,6 +27,7 @@ #include <assert.h> #include <sstream> #include <fstream> +#include <sys/time.h> //gettimeofday #include "GraphicsIfaceHandler.hh" #include "Global.hh" @@ -218,8 +219,6 @@ // Update the world int World::Update() { - std::vector< Model* >::iterator miter; - std::vector< Model* >::iterator miter2; if (this->simPauseTime > 0) { @@ -239,7 +238,12 @@ } } +#ifdef TIMING + double tmpT1 = Simulator::Instance()->GetWallTime(); +#endif + // Update all the models + std::vector< Model* >::iterator miter; for (miter=this->models.begin(); miter!=this->models.end(); miter++) { if (*miter) @@ -248,23 +252,34 @@ } } +#ifdef TIMING + double tmpT2 = Simulator::Instance()->GetWallTime(); + std::cout << " World::Update() ALL Models update DT(" << tmpT2-tmpT1 << ")" << std::endl; +#endif + if (!Simulator::Instance()->IsPaused() && Simulator::Instance()->GetPhysicsEnabled()) { - this->physicsEngine->Update(); + this->physicsEngine->UpdatePhysics(); } this->graphics->Update(); +#ifdef TIMING + double tmpT4 = Simulator::Instance()->GetWallTime(); + std::cout << " World::Update() Physics engine DT(" << tmpT4-tmpT2 << ")" << std::endl; +#endif + return 0; } +//////////////////////////////////////////////////////////////////////////////// +// Process messages void World::ProcessMessages() { this->UpdateSimulationIface(); } - //////////////////////////////////////////////////////////////////////////////// // Finilize the world int World::Fini() Modified: code/gazebo/trunk/server/World.hh =================================================================== --- code/gazebo/trunk/server/World.hh 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/World.hh 2009-05-13 02:06:08 UTC (rev 7640) @@ -93,6 +93,26 @@ /// \return Pointer to the physics engine public: PhysicsEngine *GetPhysicsEngine() const; + /// Get the simulation time + /// \return The simulation time + public: double GetSimTime() const; + + /// Get the pause time + /// \return The pause time + public: double GetPauseTime() const; + + /// Get the start time + /// \return The start time + public: double GetStartTime() const; + + /// Get the real time (elapsed time) + /// \return The real time + public: double GetRealTime() const; + + /// \brief Get the wall clock time + /// \return The wall clock time + public: double GetWallTime() const; + /// \brief Load all entities /// \param node XMLConfg node pointer /// \param parent Parent of the model to load @@ -197,6 +217,7 @@ private: friend class DestroyerT<World>; private: friend class SingletonT<World>; + }; Modified: code/gazebo/trunk/server/XMLConfig.cc =================================================================== --- code/gazebo/trunk/server/XMLConfig.cc 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/XMLConfig.cc 2009-05-13 02:06:08 UTC (rev 7640) @@ -515,29 +515,59 @@ /////////////////////////////////////////////////////////////////////////// // Get a file name. Always returns an absolute path. If the filename // is entered as a relative path, we prepend the world file path. +// std::string XMLConfigNode::GetFilename( const std::string &key, const std::string &def, int require) const +// { +// std::string filename = this->GetString( key, def, require ); +// +// if (filename.empty()) +// return ""; +// +// if (filename[0] == '/' || filename[0] == '~') +// return filename; +// else +// { +// std::string result; +// +// if (this->config->filename[0] != '/' && this->config->filename[0] != '~') +// result = "/"; +// +// unsigned int last = this->config->filename.rfind("/"); +// if (last==0 || last+1 != this->config->filename.size()) +// result += this->config->filename + "/" + filename; +// else +// result += this->config->filename.substr(0,last) + "/" + filename; +// +// return result; +// } +// } +/////////////////////////////////////////////////////////////////////////// +// Get a file name. Always returns an absolute path. If the filename +// is entered as a relative path, we prepend the world file path. +// +// patch by stu to do relative path. FIXME: what was the original implementation that's broken? +// sglaser: Was completely broken. Now returns a path relative to the +// (original) working directory. std::string XMLConfigNode::GetFilename( const std::string &key, const std::string &def, int require) const { std::string filename = this->GetString( key, def, require ); - if (filename.empty()) - return ""; + if (filename.empty() && require) + { + gzthrow("unable to find required filename attribute[" << key << "] in world file node[" + << this->GetName() << "]"); + } + else if (filename.empty()) + return def; - if (filename[0] == '/' || filename[0] == '~') + if (filename[0] == '/') return filename; else { - std::string result; - - if (this->config->filename[0] != '/' && this->config->filename[0] != '~') - result = "/"; - - unsigned int last = this->config->filename.rfind("/"); - if (last==0 || last+1 != this->config->filename.size()) - result += this->config->filename + "/" + filename; + int last_slash = this->config->filename.rfind("/"); + if (last_slash < 0) + return filename; else - result += this->config->filename.substr(0,last) + "/" + filename; - - return result; + return this->config->filename.substr(0,last_slash) + "/" + filename; } } Modified: code/gazebo/trunk/server/audio_video/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/audio_video/CMakeLists.txt 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/audio_video/CMakeLists.txt 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,3 +1,10 @@ +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR}/server + ${LIBAVCODEC_PATH} + ${LIBAVFORMAT_PATH} + ${gazeboserver_include_dirs} +) + SET (sources AudioDecoder.cc OpenAL.cc ) @@ -2,2 +9,2 @@ -APPEND_TO_SERVER_SOURCES(${sources}) +ADD_LIBRARY(gazebo_av STATIC ${sources}) Deleted: code/gazebo/trunk/server/audio_video/SConscript =================================================================== --- code/gazebo/trunk/server/audio_video/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/audio_video/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,15 +0,0 @@ -#Import variable -Import('*') - -env.Append(CPPPATH = '#server/audio_video') - -sources = ['AudioDecoder.cc', - 'OpenAL.cc' - ] - -headers.append( - ['server/audio_video/AudioDecoder.hh', - 'server/audio_video/OpenAL.hh', - ] ) - -sharedObjs.append( env.SharedObject(sources) ) Deleted: code/gazebo/trunk/server/bindings/SConscript =================================================================== --- code/gazebo/trunk/server/bindings/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/bindings/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,4 +0,0 @@ -dirs = Split('python') - -for subdir in dirs : - SConscript('%s/SConscript' % subdir) Deleted: code/gazebo/trunk/server/bindings/python/SConscript =================================================================== --- code/gazebo/trunk/server/bindings/python/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/bindings/python/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,30 +0,0 @@ -#Import variable -Import('env prefix staticObjs sharedObjs') -install_prefix = env['DESTDIR'] + '/' + prefix - -#env = Environment ( -# CC = 'g++', -# CCFLAGS = Split ('-pthread -pipe -O2'), -# LINKFLAGS=Split(''), -# -# CPPPATH = [ -# '#.', -# '#server', -# '#models', -# '#libgazebo', -# '#rendering', -# '#sensors', -# '#sensors/camera', -# '#physics', -# '#physics/ode', -# '/usr/include/python2.4' -# ], -#) -sources = Split('mygazebo.cc') - -objs = sharedObjs -objs.append(env.SharedObject(sources)) - -lib = env.SharedLibrary('mygazebo', objs, LIBS=['gazebo', 'boost_python'], LIBPATH=['#/libgazebo']) - -env.Install(install_prefix+'lib/python2.4/site-packages',lib) Modified: code/gazebo/trunk/server/controllers/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/CMakeLists.txt 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/controllers/CMakeLists.txt 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,5 +1,21 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) +INCLUDE_DIRECTORIES( + . + ${CMAKE_SOURCE_DIR}/libgazebo + ${CMAKE_SOURCE_DIR}/server + ${CMAKE_SOURCE_DIR}/server/audio_video + ${CMAKE_SOURCE_DIR}/server/physics + ${CMAKE_SOURCE_DIR}/server/rendering + ${CMAKE_SOURCE_DIR}/server/sensors + ${CMAKE_SOURCE_DIR}/server/sensors/camera + ${CMAKE_SOURCE_DIR}/server/sensors/contact + ${CMAKE_SOURCE_DIR}/server/sensors/imu + ${CMAKE_SOURCE_DIR}/server/sensors/ir + ${CMAKE_SOURCE_DIR}/server/sensors/ray + ${gazeboserver_include_dirs} +) + ADD_SUBDIRECTORY(actarray) ADD_SUBDIRECTORY(bumper) ADD_SUBDIRECTORY(camera) Modified: code/gazebo/trunk/server/controllers/Controller.cc =================================================================== --- code/gazebo/trunk/server/controllers/Controller.cc 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/controllers/Controller.cc 2009-05-13 02:06:08 UTC (rev 7640) @@ -34,6 +34,8 @@ #include "World.hh" #include "Controller.hh" #include "Simulator.hh" +#include "PhysicsEngine.hh" +#include "Global.hh" using namespace gazebo; @@ -43,6 +45,7 @@ { Param::Begin(&this->parameters); this->nameP = new ParamT<std::string>("name","",1); + this->alwaysOnP = new ParamT<bool>("alwaysOn", false, 0); this->updatePeriodP = new ParamT<double>("updateRate", 10, 0); Param::End(); @@ -58,8 +61,8 @@ /// Destructor Controller::~Controller() { - std::cout << "Deleting Controller[" << **this->nameP << "]\n"; delete this->nameP; + delete this->alwaysOnP; delete this->updatePeriodP; } @@ -75,10 +78,17 @@ this->typeName = node->GetName(); this->nameP->Load(node); + + this->alwaysOnP->Load(node); + this->updatePeriodP->Load(node); - this->updatePeriod = 1.0 / (this->updatePeriodP->GetValue() + 1e-6); - this->lastUpdate = -1e6; + double updateRate = this->updatePeriodP->GetValue(); + if (updateRate == 0) + this->updatePeriod = 0.0; // no throttling if updateRate is 0 + else + this->updatePeriod = 1.0 / updateRate; + this->lastUpdate = Simulator::Instance()->GetSimTime(); childNode = node->GetChildByNSPrefix("interface"); @@ -178,12 +188,30 @@ /// Update the controller. Called every cycle. void Controller::Update() { - if (this->IsConnected()) + if (this->IsConnected() || this->alwaysOnP->GetValue()) { - if (lastUpdate + updatePeriod <= Simulator::Instance()->GetSimTime()) + // round time difference to this->physicsEngine->GetStepTime() + double physics_dt = World::Instance()->GetPhysicsEngine()->GetStepTime(); + + // if (this->GetName() == std::string("p3d_base_controller")) + // std::cout << " sim update: " << this->GetName() + // << " , " << Simulator::Instance()->GetSimTime() - lastUpdate + // << " , " << lastUpdate + // << " , " << updatePeriod + // << " i1 " << round((Simulator::Instance()->GetSimTime()-lastUpdate)/physics_dt) + // << " i2 " << round(updatePeriod/physics_dt) + // << std::endl; +#ifdef TIMING + double tmpT1 = Simulator::Instance()->GetWallTime(); +#endif + if (round((Simulator::Instance()->GetSimTime()-lastUpdate-updatePeriod)/physics_dt) >= 0) { this->UpdateChild(); lastUpdate = Simulator::Instance()->GetSimTime(); +#ifdef TIMING + double tmpT2 = Simulator::Instance()->GetWallTime(); + std::cout << " Controller::Update() Name (" << this->GetName() << ") dt (" << tmpT2-tmpT1 << ")" << std::endl; +#endif } } } @@ -209,6 +237,10 @@ { std::vector<Iface*>::const_iterator iter; + // if the alwaysOn flag is true, this controller is connected + if (this->alwaysOnP->GetValue()) + return true; + for (iter=this->ifaces.begin(); iter!=this->ifaces.end(); iter++) { if ((*iter)->GetOpenCount() > 0) Modified: code/gazebo/trunk/server/controllers/Controller.hh =================================================================== --- code/gazebo/trunk/server/controllers/Controller.hh 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/controllers/Controller.hh 2009-05-13 02:06:08 UTC (rev 7640) @@ -105,6 +105,9 @@ /// \brief The entity that owns this controller protected: Entity *parent; + /// \breif flag to keep controllers updating continuously + protected: ParamT<bool> *alwaysOnP; + /// \brief Update period protected: double updatePeriod; protected: ParamT<double> *updatePeriodP; Deleted: code/gazebo/trunk/server/controllers/SConscript =================================================================== --- code/gazebo/trunk/server/controllers/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/controllers/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,37 +0,0 @@ -#Import variable -Import('*') - -env.Append(CPPPATH = '#server/controllers') - -dirs = ['position2d', - 'laser', - 'camera', - 'factory', - 'gripper', - 'actarray', - 'ptz', - 'opaque', - 'bumper', - 'imu', - 'irarray' - ] - -try: - env["CCFLAGS"].index('-DHAVE_OPENAL') - dirs.append("audio") -except ValueError,e: - garbage = 1 - -for subdir in dirs : - SConscript('%s/SConscript' % subdir) - -sources = Split('Controller.cc ControllerFactory.cc') - -headers.append( - ['#/server/controllers/ControllerFactory.hh', - '#/server/controllers/ControllerStub.hh', - '#/server/controllers/Controller.hh' - ] ) - -#staticObjs.append(env.StaticObject(sources)) -sharedObjs.append(env.SharedObject(sources)) Deleted: code/gazebo/trunk/server/controllers/actarray/SConscript =================================================================== --- code/gazebo/trunk/server/controllers/actarray/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/controllers/actarray/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,7 +0,0 @@ -#Import variable -Import('env sharedObjs') - -dirs = Split('bandit generic') - -for subdir in dirs : - SConscript('%s/SConscript' % subdir) Deleted: code/gazebo/trunk/server/controllers/actarray/bandit/SConscript =================================================================== --- code/gazebo/trunk/server/controllers/actarray/bandit/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/controllers/actarray/bandit/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,7 +0,0 @@ -#Import variable -Import('env sharedObjs') - -sources = Split('Bandit_Actarray.cc') - -#staticObjs.append(env.StaticObject(sources)) -sharedObjs.append(env.SharedObject(sources)) Deleted: code/gazebo/trunk/server/controllers/actarray/generic/SConscript =================================================================== --- code/gazebo/trunk/server/controllers/actarray/generic/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/controllers/actarray/generic/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,7 +0,0 @@ -#Import variable -Import('env sharedObjs') - -sources = Split('Generic_Actarray.cc') - -#staticObjs.append(env.StaticObject(sources)) -sharedObjs.append(env.SharedObject(sources)) Deleted: code/gazebo/trunk/server/controllers/audio/SConscript =================================================================== --- code/gazebo/trunk/server/controllers/audio/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/controllers/audio/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,7 +0,0 @@ -#Import variable -Import('env sharedObjs') - -sources = Split('Audio.cc') - -#staticObjs.append(env.StaticObject(sources)) -sharedObjs.append(env.SharedObject(sources)) Deleted: code/gazebo/trunk/server/controllers/bumper/SConscript =================================================================== --- code/gazebo/trunk/server/controllers/bumper/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/controllers/bumper/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,7 +0,0 @@ -#Import variable -Import('env sharedObjs') - -dirs = Split('generic') - -for subdir in dirs : - SConscript('%s/SConscript' % subdir) Deleted: code/gazebo/trunk/server/controllers/bumper/generic/SConscript =================================================================== --- code/gazebo/trunk/server/controllers/bumper/generic/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/controllers/bumper/generic/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,6 +0,0 @@ -#Import variable -Import('env sharedObjs') - -sources = Split('Generic_Bumper.cc') - -sharedObjs.append(env.SharedObject(sources)) Deleted: code/gazebo/trunk/server/controllers/camera/SConscript =================================================================== --- code/gazebo/trunk/server/controllers/camera/SConscript 2009-05-12 23:48:06 UTC (rev 7639) +++ code/gazebo/trunk/server/controllers/camera/SConscript 2009-05-13 02:06:08 UTC (rev 7640) @@ -1,12 +0,0 @@ -#Import variable -Import('env sharedObjs') - -dirs = [ - 'generic', - 'stereo' - ] - -for subdir in dirs : - SConscript('%s/SConscript' % subdir) - - Modified: code/gazebo/trunk/server/controllers/camera/generic/Generic_Camera.cc ==============================================================... [truncated message content] |
From: <na...@us...> - 2009-05-13 15:41:50
|
Revision: 7644 http://playerstage.svn.sourceforge.net/playerstage/?rev=7644&view=rev Author: natepak Date: 2009-05-13 15:41:40 +0000 (Wed, 13 May 2009) Log Message: ----------- More tweaks to the cmake build Modified Paths: -------------- code/gazebo/trunk/libgazebo/CMakeLists.txt code/gazebo/trunk/player/CMakeLists.txt code/gazebo/trunk/server/audio_video/CMakeLists.txt code/gazebo/trunk/server/gui/CMakeLists.txt code/gazebo/trunk/server/physics/CMakeLists.txt code/gazebo/trunk/server/rendering/CMakeLists.txt code/gazebo/trunk/server/sensors/CMakeLists.txt code/gazebo/trunk/webgazebo/CMakeLists.txt code/gazebo/trunk/webgazebo/WebGazebo.hh code/gazebo/trunk/webgazebo/main.cc Modified: code/gazebo/trunk/libgazebo/CMakeLists.txt =================================================================== --- code/gazebo/trunk/libgazebo/CMakeLists.txt 2009-05-13 13:18:38 UTC (rev 7643) +++ code/gazebo/trunk/libgazebo/CMakeLists.txt 2009-05-13 15:41:40 UTC (rev 7644) @@ -8,6 +8,10 @@ SET (headers gazebo.h IfaceFactory.hh) +INCLUDE_DIRECTORIES( + ${boost_include_dirs} +) + LINK_DIRECTORIES(${boost_library_dirs}) ADD_LIBRARY(gazeboshm SHARED ${sources}) Modified: code/gazebo/trunk/player/CMakeLists.txt =================================================================== --- code/gazebo/trunk/player/CMakeLists.txt 2009-05-13 13:18:38 UTC (rev 7643) +++ code/gazebo/trunk/player/CMakeLists.txt 2009-05-13 15:41:40 UTC (rev 7644) @@ -17,7 +17,12 @@ IRInterface.cc ) -INCLUDE_DIRECTORIES( ${PLAYER_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/libgazebo ) +INCLUDE_DIRECTORIES( + ${PLAYER_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/libgazebo + ${boost_include_dirs} +) + LINK_DIRECTORIES( ${PLAYER_LINK_DIRS} gazeboshm) ADD_LIBRARY(gazeboplugin SHARED ${sources}) Modified: code/gazebo/trunk/server/audio_video/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/audio_video/CMakeLists.txt 2009-05-13 13:18:38 UTC (rev 7643) +++ code/gazebo/trunk/server/audio_video/CMakeLists.txt 2009-05-13 15:41:40 UTC (rev 7644) @@ -3,6 +3,7 @@ ${LIBAVCODEC_PATH} ${LIBAVFORMAT_PATH} ${gazeboserver_include_dirs} + ${boost_include_dirs} ) SET (sources AudioDecoder.cc Modified: code/gazebo/trunk/server/gui/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/gui/CMakeLists.txt 2009-05-13 13:18:38 UTC (rev 7643) +++ code/gazebo/trunk/server/gui/CMakeLists.txt 2009-05-13 15:41:40 UTC (rev 7644) @@ -4,6 +4,7 @@ ${CMAKE_SOURCE_DIR}/server/rendering ${CMAKE_SOURCE_DIR}/server/physics ${gazeboserver_include_dirs} + ${boost_include_dirs} ) SET (sources Gui.cc Modified: code/gazebo/trunk/server/physics/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/physics/CMakeLists.txt 2009-05-13 13:18:38 UTC (rev 7643) +++ code/gazebo/trunk/server/physics/CMakeLists.txt 2009-05-13 15:41:40 UTC (rev 7644) @@ -7,6 +7,7 @@ ${CMAKE_SOURCE_DIR}/server/rendering ${CMAKE_SOURCE_DIR}/server/sensors ${gazeboserver_include_dirs} + ${boost_include_dirs} ) SET (sources BallJoint.cc Modified: code/gazebo/trunk/server/rendering/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/rendering/CMakeLists.txt 2009-05-13 13:18:38 UTC (rev 7643) +++ code/gazebo/trunk/server/rendering/CMakeLists.txt 2009-05-13 15:41:40 UTC (rev 7644) @@ -4,6 +4,7 @@ ${CMAKE_SOURCE_DIR}/server ${CMAKE_SOURCE_DIR}/server/gui ${gazeboserver_include_dirs} + ${boost_include_dirs} ) SET (sources OgreMovableText.cc Modified: code/gazebo/trunk/server/sensors/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/sensors/CMakeLists.txt 2009-05-13 13:18:38 UTC (rev 7643) +++ code/gazebo/trunk/server/sensors/CMakeLists.txt 2009-05-13 15:41:40 UTC (rev 7644) @@ -9,6 +9,7 @@ ${CMAKE_SOURCE_DIR}/server/physics/ode ${CMAKE_SOURCE_DIR}/server/rendering ${gazeboserver_include_dirs} + ${boost_include_dirs} ) LINK_DIRECTORIES( Modified: code/gazebo/trunk/webgazebo/CMakeLists.txt =================================================================== --- code/gazebo/trunk/webgazebo/CMakeLists.txt 2009-05-13 13:18:38 UTC (rev 7643) +++ code/gazebo/trunk/webgazebo/CMakeLists.txt 2009-05-13 15:41:40 UTC (rev 7644) @@ -1,8 +1,21 @@ -SET (sources WebGazebo.cc ../server/Quatern.cc ../server/Vector3.cc ../server/Angle.cc) +SET (sources WebGazebo.cc + ../server/Quatern.cc + ../server/Vector3.cc + ../server/Angle.cc +) -INCLUDE_DIRECTORIES( .. ../server ${WEBSIM_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/libgazebo ) +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR}/server + ${CMAKE_SOURCE_DIR}/libgazebo + ${WEBSIM_INCLUDE_DIRS} + ${boost_include_dirs} +) -LINK_DIRECTORIES( ${WEBSIM_LINK_DIRS} ${boost_library_dirs} gazeboshm) +LINK_DIRECTORIES( + ${WEBSIM_LINK_DIRS} + ${boost_library_dirs} + ${CMAKE_BINARY_DIR}/libgazebo +) SET_SOURCE_FILES_PROPERTIES(${sources} PROPERTIES COMPILE_FLAGS '-DINSTALL_PREFIX="/usr/local/"') @@ -12,8 +25,8 @@ ADD_EXECUTABLE(client client.cc) TARGET_LINK_LIBRARIES( webgz yaml event ${WEBSIM_LINK_LIBS}) -TARGET_LINK_LIBRARIES( webgazebo gazeboshm yaml event ${WEBSIM_LINK_LIBS} ${Boost_LIBRARIES} webgz) -TARGET_LINK_LIBRARIES( client gazeboshm yaml event ${WEBSIM_LINK_LIBS} ${Boost_LIBRARIES} webgz) +TARGET_LINK_LIBRARIES( webgazebo gazebo yaml event ${WEBSIM_LINK_LIBS} ${boost_libraries} webgz) +TARGET_LINK_LIBRARIES( client gazebo yaml event ${WEBSIM_LINK_LIBS} ${boost_libraries} webgz) INSTALL(TARGETS webgazebo DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) INSTALL(TARGETS webgz DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) Modified: code/gazebo/trunk/webgazebo/WebGazebo.hh =================================================================== --- code/gazebo/trunk/webgazebo/WebGazebo.hh 2009-05-13 13:18:38 UTC (rev 7643) +++ code/gazebo/trunk/webgazebo/WebGazebo.hh 2009-05-13 15:41:40 UTC (rev 7644) @@ -32,9 +32,8 @@ #include <sys/types.h> #include <sys/queue.h> -// libgazebo; the libgazebo directory is used because we're building -// against the source tree -#include <libgazebo/gazebo.h> +// libgazebo; +#include "gazebo.h" #include "websim/websim.hh" Modified: code/gazebo/trunk/webgazebo/main.cc =================================================================== --- code/gazebo/trunk/webgazebo/main.cc 2009-05-13 13:18:38 UTC (rev 7643) +++ code/gazebo/trunk/webgazebo/main.cc 2009-05-13 15:41:40 UTC (rev 7644) @@ -25,7 +25,7 @@ * SVN: $Id: gazebo.h 7398 2009-03-09 07:21:49Z natepak $ */ -#include "webgazebo/WebGazebo.hh" +#include "WebGazebo.hh" #include <stdlib.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-13 17:57:55
|
Revision: 7646 http://playerstage.svn.sourceforge.net/playerstage/?rev=7646&view=rev Author: natepak Date: 2009-05-13 17:57:48 +0000 (Wed, 13 May 2009) Log Message: ----------- Changed Cmake required version to 2.4.6 Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/server/Global.hh code/gazebo/trunk/server/main.cc Removed Paths: ------------- code/gazebo/trunk/SConstruct Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-13 17:57:36 UTC (rev 7645) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-13 17:57:48 UTC (rev 7646) @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED( VERSION 2.6 FATAL_ERROR ) +CMAKE_MINIMUM_REQUIRED( VERSION 2.4.6 FATAL_ERROR ) IF(COMMAND CMAKE_POLICY) CMAKE_POLICY(SET CMP0003 NEW) @@ -31,6 +31,10 @@ SET (ODE_VERSION 0.10.1 CACHE INTERNAL "ODE version requirement" FORCE) SET (MIN_BOOST_VERSION 1.35.0 CACHE INTERNAL "Boost min version requirement" FORCE) +# Write the config.h file +CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h) + + SET (gazebo_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH "Location of CMake scripts") Deleted: code/gazebo/trunk/SConstruct =================================================================== --- code/gazebo/trunk/SConstruct 2009-05-13 17:57:36 UTC (rev 7645) +++ code/gazebo/trunk/SConstruct 2009-05-13 17:57:48 UTC (rev 7646) @@ -1,293 +0,0 @@ -import os -import sys -import time -import commands - -exec(open('build.py')) - -PKG_CONFIG_VERSION = '0.23' -OGRE_VERSION = '>= 1.6.1' -ODE_VERSION = '>= 0.10.1' - - -####### -# Create a release -####### -if 'release' in COMMAND_LINE_TARGETS: - CreateRelease() - exit() - - -####### -# Setup the Options -####### -opts = Variables() -opts.Add('prefix', 'The install path "prefix"', '/usr/local') -opts.Add('destdir', 'The root directory to install into. Useful mainly for binary package building', '/') -opts.Add('mode','Defines how Gazebo will be built, options available: optimized, profile, debug','debug') - - -####### -# List of all the required packages -####### -packages = { - 'OGRE' : { - 'pkgcfg': 'pkg-config --cflags --libs OGRE', - 'check' : 'OGRE ' + OGRE_VERSION, - 'msg' : 'Error: Ogre3d and development files are required, but not\ - found. ', - 'flags' : '', - 'web' : 'http://www.ogre3d.org', - 'required' : True - }, - - 'ODE' : { - 'pkgcfg' : 'pkg-config --cflags --libs ode', - 'check' : 'ode ' + ODE_VERSION, - 'msg' : 'Error: ODE and development files are required, but not\ - found.', - 'flags' : '', - 'web' : 'http://www.ode.org', - 'required' : True - }, - - 'OpenAL' : { - 'pkgcfg' : 'pkg-config --cflags --libs openal', - 'check' : 'openal', - 'msg' : 'Warning: OpenAL not found. 3D audio will be disbled', - 'flags' : '-DHAVE_OPENAL', - 'web' : 'http://www.openal.org', - 'required' : False - }, - - 'XFT' : { - 'pkgcfg' : 'pkg-config --cflags --libs xft', - 'check' : 'xft', - 'msg' : 'Error: ', - 'flags' : '', - 'web' : 'http://www.xft.org', - 'required' : True - }, - - 'avformat' : { - 'pkgcfg' : 'pkg-config --cflags --libs libavformat', - 'check' : 'libavformat', - 'msg' : 'Warning: FFMpeg pkg-config not found. MP3 decoding\ - is disabled', - 'flags' : '', - 'web' : 'http://ffmpeg.mplayerhq.hu/', - 'required' : False - }, - - 'avcodec' : { - 'pkgcfg' : 'pkg-config --cflags --libs libavcodec', - 'check' : 'libavcodec', - 'msg' : 'Warning: FFMpeg pkg-config not found. MP3 decoding is\ - disabled', - 'flags' : '', - 'web' : 'http://ffmpeg.mplayerhq.hu/', - 'required' : False - }, - - 'XML2' : { - 'pkgcfg' : 'xml2-config --cflags --libs', - 'check' : '', - 'msg' : 'Error: libxml2 and development files are required, but\ - not found.', - 'flags' : '', - 'web' : 'http://www.xmlsoft.org', - 'required' : True - }, - - 'FLTK' : { - 'pkgcfg' : 'fltk-config --cflags --libs --ldflags --use-gl\ - --use-images', - 'check' : '', - 'msg' : 'Error: libfltk & development files are required, but not\ - found.', - 'flags' : '', - 'web' : 'http://www.fltk.org', - 'required' : True - }, - 'Player' : { - 'pkgcfg' : 'pkg-config --cflags --libs playerc++', - 'check' : 'playerc++', - 'msg' : 'Warning: Player not found, bindings will not be built.', - 'flags' : '-DHAVE_PLAYER', - 'web' : 'http://playerstage.sourceforge.net', - 'required' : False - }, - 'event' : { - 'header' : 'event.h', - 'lib' : 'event', - 'msg' : 'Warning: libevent not found. Webgazebo will no be built.', - 'flags' : '-DHAVE_EVENT', - 'web' : 'http://www.monkey.org/~provos/libevent/', - 'required' : False - }, - 'yaml' : { - 'header' : 'yaml.h', - 'lib' : 'yaml', - 'msg' : 'Warning: yaml not found. Webgazebo will not be built.', - 'flags' : '-DHAVE_YAML', - 'web' : 'http://www.yaml.org', - 'required' : False - }, - 'websim' : { - 'pkgcfg' : 'pkg-config --cflags --libs websim', - 'check' : 'websim', - 'msg' : 'Warning: websim not found. Webgazebo will not be built.', - 'flags' : '-DHAVE_WEBSIM', - 'web' : 'http://www.playerstage.sourceforge.net', - 'required' : False - }, - 'glib' : { - 'pkgcfg' : 'pkg-config --cflags --libs glib-2.0', - 'check' : 'glib-2.0', - 'msg' : 'Warning: glib not found. Webgazebo will not be built.', - 'flags' : '', - 'web' : 'http://www.gtk.org', - 'required' : False - }, -} - -####### -# setup the build environment -####### -env = Environment ( - CC = 'gcc', - CXX = 'g++', - CPPPATH = [ '#.' ], - LIBPATH=Split('#libgazebo #server/audio_video'), - - #LIBS=Split('gazebo boost_python') - LIBS=Split('gazebo boost_signals'), - LINKFLAGS=Split('-export-dynamic'), - - TARFLAGS = '-c -z', - TARSUFFIX = '.tar.gz', - - options = opts, - - # Static object compile string - CXXCOMSTR = 'Compiling $TARGET', - CCCOMSTR = 'Compiling $TARGET', - LINKCOMSTR = 'Linking $TARGET', - ARCOMSTR = 'Linking $TARGET', - - # Shared object compile strings - SHCXXCOMSTR = 'Compiling $TARGET', - SHCCCOMSTR = 'Compiling $TARGET', - SHLINKCOMSTR = 'Linking $TARGET', - SHARCOMSTR = 'Linking $TARGET', - - HAS_ERROR = False, -) - - -####### -# DEFAULT list of subdirectories to build -####### -subdirs = ['libgazebo','server', 'player'] -# Need test for <event.h> -try: - env["CCFLAGS"].index("-DHAVE_WEBSIM") - env["CCFLAGS"].index("-DHAVE_YAML") - env["CCFLAGS"].index("-DHAVE_EVENT") - subdirs.append('webgazebo') -except ValueError, e: - garbage = 1 - -####### -# Generate help text -####### -Help(opts.GenerateHelpText(env)) - - -####### -# Setup default install destination -####### -if env['destdir'] != '/': - install_prefix = env['destdir'] + '/' + env['prefix'] -else: - install_prefix = env['prefix'] - - -####### -# Create the custom builder -####### -env['BUILDERS']['PkgConfig'] = Builder(action = createPkgConfig) -pkgconfig = env.PkgConfig(target='libgazeboServer.pc', source=Value(install_prefix)) -env.Install(dir=install_prefix+'/lib/pkgconfig', source=pkgconfig) - -env['BUILDERS']['RCConfig'] = Builder(action = createGazeborc) -rcconfig = env.RCConfig(target='gazeborc', source=Value(install_prefix)) - -####### -# Set the compile mode -####### -if env['mode'] == 'debug': - env['CCFLAGS'] += Split('-ggdb -g2 -Wall -Wno-deprecated -fPIC') -elif env['mode'] == 'profile': - env['CCFLAGS'] += Split('-ggdb -g2 -pg -fPIC') - env['LINKFLAGS'] += Split('-pg') -elif env['mode'] == 'optimized': - env['CCFLAGS'] += Split('-O3 -fPIC') - -optimize_for_cpu(env) - -####### -# Conifgure the system -####### -Config(env, packages) - - -if env['HAS_ERROR'] == True: - print "Build failed due to missing packages. See above errors" - Exit() - -####### -# Export the environment -####### -#staticObjs = [] -sharedObjs = [] -headers = [] -Export('env install_prefix version sharedObjs headers subdirs') - - -####### -# Parse subdirectories -####### -for subdir in subdirs: - print 'Parsing sub directory ' + subdir - SConscript('%s/SConscript' % subdir) - -print '' - - -####### -# Create the gazebo executable and libraries -####### -if not 'configure' in COMMAND_LINE_TARGETS: - #Progress('Evaluating $TARGET\n') - - gazebo = env.Program('gazebo',sharedObjs) - Depends(gazebo, 'libgazebo/libgazebo.so') - - #libgazeboServerStatic = env.StaticLibrary('gazeboServer', staticObjs) - libgazeboServerShared = env.SharedLibrary('gazeboServer', sharedObjs) - - # - # Install gazebo - # - env.Alias('install', install_prefix) - env.Install(install_prefix+'/bin',gazebo) - env.Install(install_prefix+'/include/gazebo',headers) - #env.Install(install_prefix+'/lib',libgazeboServerStatic ) - env.Install(install_prefix+'/lib',libgazeboServerShared ) - env.Install(install_prefix+'/share/gazebo','worlds') - env.Install(install_prefix+'/share/gazebo','Media') -else: - print 'Configure done' - Exit() - Modified: code/gazebo/trunk/server/Global.hh =================================================================== --- code/gazebo/trunk/server/Global.hh 2009-05-13 17:57:36 UTC (rev 7645) +++ code/gazebo/trunk/server/Global.hh 2009-05-13 17:57:48 UTC (rev 7646) @@ -44,9 +44,6 @@ #define NULL 0 #endif -// TODO: Fix the version number -#define GAZEBO_VERSION "0.8-pre3" - #ifndef GZ_COLLIDE_BITS #define GZ_ALL_COLLIDE 0x0FFFFFFF Modified: code/gazebo/trunk/server/main.cc =================================================================== --- code/gazebo/trunk/server/main.cc 2009-05-13 17:57:36 UTC (rev 7645) +++ code/gazebo/trunk/server/main.cc 2009-05-13 17:57:48 UTC (rev 7646) @@ -105,6 +105,8 @@ #include <signal.h> #include <errno.h> #include <iostream> + +#include "config.h" #include "Simulator.hh" #include "GazeboError.hh" #include "Global.hh" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-13 20:18:15
|
Revision: 7647 http://playerstage.svn.sourceforge.net/playerstage/?rev=7647&view=rev Author: natepak Date: 2009-05-13 20:18:10 +0000 (Wed, 13 May 2009) Log Message: ----------- Added configuration for freeimage Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/cmake/SearchForStuff.cmake code/gazebo/trunk/server/CMakeLists.txt code/gazebo/trunk/server/main.cc Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-13 17:57:48 UTC (rev 7646) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-13 20:18:10 UTC (rev 7647) @@ -33,15 +33,11 @@ # Write the config.h file CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h) +INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}) - SET (gazebo_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH "Location of CMake scripts") -SET (boost_include_dirs "" CACHE STRING "Boost include paths. Use this to override automatic detection.") -SET (boost_library_dirs "" CACHE STRING "Boost library paths. Use this to override automatic detection.") -SET (boost_libraries "" CACHE STRING "Boost libraries. Use this to override automatic detection.") - ##################################### # Build type cflags SET (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -Wall " CACHE INTERNAL "C Flags for release" FORCE) Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake =================================================================== --- code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-13 17:57:48 UTC (rev 7646) +++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-13 20:18:10 UTC (rev 7647) @@ -7,9 +7,18 @@ SET (INCLUDE_WEBGAZEBO ON CACHE BOOL "Build webgazebo" FORCE) SET (OGRE_LIBRARY_PATH "/usr/local/lib" CACHE INTERNAL "Ogre library path") +SET (freeimage_include_dir "/usr/include/" CACHE STRING "FreeImage include paths") +SET (freeimage_library_dir "/usr/lib" CACHE STRING "FreeImage library paths") +SET (freeimage_library "freeimage" CACHE STRING "FreeImage library") + +SET (boost_include_dirs "" CACHE STRING "Boost include paths. Use this to override automatic detection.") +SET (boost_library_dirs "" CACHE STRING "Boost library paths. Use this to override automatic detection.") +SET (boost_libraries "" CACHE STRING "Boost libraries. Use this to override automatic detection.") + ######################################## # Find packages IF (PKG_CONFIG_FOUND) + pkg_check_modules(OGRE OGRE>=${OGRE_VERSION}) IF (NOT OGRE_FOUND) MESSAGE (SEND_ERROR "\nError: Ogre3d and development files not found. See the following website: http://www.orge3d.org") @@ -209,8 +218,8 @@ STRING(REGEX REPLACE "(^| )-L" " " boost_library_dirs "${boost_library_dirs}") STRING(REGEX REPLACE "(^| )-l" " " boost_libraries "${boost_libraries}") -STRING(STRIP ${boost_library_dirs} boost_library_dirs) -STRING(STRIP ${boost_libraries} boost_libraries) +#STRING(STRIP ${boost_library_dirs} boost_library_dirs) +#STRING(STRIP ${boost_libraries} boost_libraries) STRING(REGEX REPLACE " " ";" boost_libraries "${boost_libraries}") MESSAGE (STATUS "Boost Include Path: ${boost_include_dirs}") @@ -218,6 +227,24 @@ MESSAGE (STATUS "Boost Libraries: ${boost_libraries}") ######################################## +# Find freeimage +FIND_PATH(freeimage_include_dir FreeImage.h ${freeimage_include_dir}) +IF (NOT freeimage_include_dir) + MESSAGE (STATUS "Looking for FreeImage.h - not found") + MESSAGE (FATAL_ERROR "Unable to find FreeImage.h") +ELSE (NOT freeimage_include_dir) + MESSAGE (STATUS "Looking for FreeImage.h - found") +ENDIF (NOT freeimage_include_dir) + +FIND_LIBRARY(freeimage_library freeimage ${freeimage_library_dir}) +IF (NOT freeimage_library) + MESSAGE (STATUS "Looking for libfreeimage - not found") + MESSAGE (FATAL_ERROR "Unable to find libfreeimage") +ELSE (NOT freeimage_library) + MESSAGE (STATUS "Looking for libfreeimage - found") +ENDIF (NOT freeimage_library) + +######################################## # Find avformat and avcodec IF (INCLUDE_AV) SET (libavformat_search_path Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-13 17:57:48 UTC (rev 7646) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-13 20:18:10 UTC (rev 7647) @@ -1,17 +1,6 @@ INCLUDE (${gazebo_cmake_dir}/GazeboUtils.cmake) -######################################## -# All the library search paths -ADD_SUBDIRECTORY(rendering) -ADD_SUBDIRECTORY(physics) -ADD_SUBDIRECTORY(sensors) -ADD_SUBDIRECTORY(gui) -ADD_SUBDIRECTORY(controllers) -IF (INCLUDE_AV) - ADD_SUBDIRECTORY(audio_video) -ENDIF (INCLUDE_AV) - #${FLTK_INCLUDE_DIR} ######################################## # Include all the search paths for headers @@ -32,17 +21,30 @@ sensors/ray ${gazeboserver_include_dirs} ${boost_include_dirs} + ${freeimage_include_dir} ) LINK_DIRECTORIES( ${CMAKE_BINARY_DIR}/libgazebo ${boost_library_dirs} + ${freeimage_library_dir} ${gazeboserver_link_dirs} sensors controllers ) ######################################## +# All the library search paths +ADD_SUBDIRECTORY(rendering) +ADD_SUBDIRECTORY(physics) +ADD_SUBDIRECTORY(sensors) +ADD_SUBDIRECTORY(gui) +ADD_SUBDIRECTORY(controllers) +IF (INCLUDE_AV) + ADD_SUBDIRECTORY(audio_video) +ENDIF (INCLUDE_AV) + +######################################## # Process all the subdirectories SET (sources Common.cc Vector3.cc @@ -101,7 +103,7 @@ ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}}) ENDIF (CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}) -TARGET_LINK_LIBRARIES( gazebo-exec gazebo_gui gazebo_sensors gazebo_physics gazebo_rendering gazebo_controllers gazebo_av ${gazeboserver_link_libs} ${FLTK_LIBRARIES} ${boost_libraries} gazebo ) +TARGET_LINK_LIBRARIES( gazebo-exec gazebo_gui gazebo_sensors gazebo_physics gazebo_rendering gazebo_controllers gazebo_av ${gazeboserver_link_libs} ${FLTK_LIBRARIES} ${boost_libraries} ${freeimage_library} gazebo ) INSTALL (TARGETS gazebo-exec DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) INSTALL (FILES ${headers} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/gazebo COMPONENT headers) Modified: code/gazebo/trunk/server/main.cc =================================================================== --- code/gazebo/trunk/server/main.cc 2009-05-13 17:57:48 UTC (rev 7646) +++ code/gazebo/trunk/server/main.cc 2009-05-13 20:18:10 UTC (rev 7647) @@ -106,7 +106,7 @@ #include <errno.h> #include <iostream> -#include "config.h" +#include <config.h> #include "Simulator.hh" #include "GazeboError.hh" #include "Global.hh" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-13 23:02:25
|
Revision: 7651 http://playerstage.svn.sourceforge.net/playerstage/?rev=7651&view=rev Author: natepak Date: 2009-05-13 23:02:19 +0000 (Wed, 13 May 2009) Log Message: ----------- Added header files to CMakeLists.txt Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/cmake/GazeboUtils.cmake code/gazebo/trunk/server/CMakeLists.txt code/gazebo/trunk/server/audio_video/CMakeLists.txt code/gazebo/trunk/server/controllers/CMakeLists.txt code/gazebo/trunk/server/controllers/actarray/bandit/CMakeLists.txt code/gazebo/trunk/server/controllers/actarray/generic/CMakeLists.txt code/gazebo/trunk/server/controllers/audio/CMakeLists.txt code/gazebo/trunk/server/controllers/bumper/generic/CMakeLists.txt code/gazebo/trunk/server/controllers/camera/generic/CMakeLists.txt code/gazebo/trunk/server/controllers/camera/stereo/CMakeLists.txt code/gazebo/trunk/server/controllers/factory/CMakeLists.txt code/gazebo/trunk/server/controllers/gripper/pioneer2/CMakeLists.txt code/gazebo/trunk/server/controllers/imu/CMakeLists.txt code/gazebo/trunk/server/controllers/irarray/CMakeLists.txt code/gazebo/trunk/server/controllers/laser/sicklms200/CMakeLists.txt code/gazebo/trunk/server/controllers/opaque/jointforce/CMakeLists.txt code/gazebo/trunk/server/controllers/position2d/differential/CMakeLists.txt code/gazebo/trunk/server/controllers/position2d/holonome3sw/CMakeLists.txt code/gazebo/trunk/server/controllers/position2d/steering/CMakeLists.txt code/gazebo/trunk/server/controllers/ptz/generic/CMakeLists.txt code/gazebo/trunk/server/gui/CMakeLists.txt code/gazebo/trunk/server/physics/CMakeLists.txt code/gazebo/trunk/server/rendering/CMakeLists.txt code/gazebo/trunk/server/sensors/CMakeLists.txt code/gazebo/trunk/server/sensors/camera/CMakeLists.txt code/gazebo/trunk/server/sensors/contact/CMakeLists.txt code/gazebo/trunk/server/sensors/imu/CMakeLists.txt code/gazebo/trunk/server/sensors/ir/CMakeLists.txt code/gazebo/trunk/server/sensors/ray/CMakeLists.txt Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -14,6 +14,8 @@ SET (gazeboserver_sources_desc "List of server sources" CACHE INTERNAL "Gazebo server sources list description" FORCE) +SET (gazeboserver_headers_desc "List of server headers" + CACHE INTERNAL "Gazebo server headers list description" FORCE) SET (gazeboserver_include_dirs_desc "List of server include directories" CACHE INTERNAL "Include dirs description") SET (gazeboserver_link_dirs_desc "List of server link directories" Modified: code/gazebo/trunk/cmake/GazeboUtils.cmake =================================================================== --- code/gazebo/trunk/cmake/GazeboUtils.cmake 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/cmake/GazeboUtils.cmake 2009-05-13 23:02:19 UTC (rev 7651) @@ -31,6 +31,16 @@ ENDMACRO (APPEND_TO_SERVER_SOURCES) ############################################################################### +# Append headers to the server headers list +MACRO (APPEND_TO_SERVER_HEADERS) + FOREACH (src ${ARGN}) + APPEND_TO_CACHED_LIST(gazeboserver_headers + ${gazeboserver_headers_desc} + ${CMAKE_CURRENT_SOURCE_DIR}/${src}) + ENDFOREACH (src ${ARGN}) +ENDMACRO (APPEND_TO_SERVER_HEADERS) + +############################################################################### # Append sources to the sensor sources list MACRO (APPEND_TO_SENSOR_SOURCES) FOREACH (src ${ARGN}) @@ -66,6 +76,8 @@ MACRO (GAZEBOSERVER_RESET_LISTS) SET (gazeboserver_sources "" CACHE INTERNAL ${gazeboserver_sources_desc} FORCE) + SET (gazeboserver_headers "" CACHE INTERNAL + ${gazeboserver_sources_desc} FORCE) SET (gazeboserver_include_dirs "" CACHE INTERNAL ${gazeboserver_include_dirs_desc} FORCE) SET (gazeboserver_link_dirs "" CACHE INTERNAL Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -65,28 +65,30 @@ GraphicsIfaceHandler.cc ) -SET (headers Entity.hh - GazeboError.hh - GazeboMessage.hh - Global.hh - Model.hh - Pose3d.hh - Quatern.hh - Simulator.hh - SingletonT.hh - StaticPluginRegister.hh - Time.hh - Vector2.hh - Vector3.hh - Vector4.hh - World.hh - XMLConfig.hh - GazeboConfig.hh - Angle.hh - Param.hh - GraphicsIfaceHandler.hh +SET (headers Common.hh + Entity.hh + GazeboError.hh + GazeboMessage.hh + Global.hh + Model.hh + Pose3d.hh + Quatern.hh + Simulator.hh + SingletonT.hh + StaticPluginRegister.hh + Time.hh + Vector2.hh + Vector3.hh + Vector4.hh + World.hh + XMLConfig.hh + GazeboConfig.hh + Angle.hh + Param.hh + GraphicsIfaceHandler.hh ) +APPEND_TO_SERVER_HEADERS(${headers}) APPEND_TO_SERVER_SOURCES(${sources}) #ADD_LIBRARY(gazeboserver STATIC ${gazeboserver_sources}) @@ -106,7 +108,7 @@ TARGET_LINK_LIBRARIES( gazebo-exec gazebo_gui gazebo_sensors gazebo_physics gazebo_rendering gazebo_controllers gazebo_av ${gazeboserver_link_libs} ${FLTK_LIBRARIES} ${boost_libraries} ${freeimage_library} gazebo ) INSTALL (TARGETS gazebo-exec DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) -INSTALL (FILES ${headers} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/gazebo COMPONENT headers) +INSTALL (FILES ${gazeboserver_headers} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/gazebo COMPONENT headers) ######################################## # Make the gazebo rc file Modified: code/gazebo/trunk/server/audio_video/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/audio_video/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/audio_video/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -10,4 +10,10 @@ OpenAL.cc ) +SET (headers AudioDecoder.hh + OpenAL.hh +) + +APPEND_TO_SERVER_HEADERS(${headers}) + ADD_LIBRARY(gazebo_av STATIC ${sources}) Modified: code/gazebo/trunk/server/controllers/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -36,4 +36,10 @@ ControllerFactory.cc ) +SET (headers Controller.hh + ControllerFactory.hh +) + + +APPEND_TO_SERVER_HEADERS(${headers}) APPEND_TO_SERVER_SOURCES(${sources}) Modified: code/gazebo/trunk/server/controllers/actarray/bandit/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/actarray/bandit/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/actarray/bandit/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources Bandit_Actarray.cc) +SET (headers Bandit_Actarray.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/controllers/actarray/generic/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/actarray/generic/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/actarray/generic/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources Generic_Actarray.cc) +SET (headers Generic_Actarray.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/controllers/audio/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/audio/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/audio/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources Audio.cc) +SET (headers Audio.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/controllers/bumper/generic/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/bumper/generic/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/bumper/generic/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources Generic_Bumper.cc) +SET (headers Generic_Bumper.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/controllers/camera/generic/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/camera/generic/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/camera/generic/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources Generic_Camera.cc) +SET (headers Generic_Camera.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/controllers/camera/stereo/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/camera/stereo/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/camera/stereo/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources Stereo_Camera.cc) +SET (headers Stereo_Camera.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/controllers/factory/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/factory/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/factory/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources Factory.cc) +SET (headers Factory.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/controllers/gripper/pioneer2/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/gripper/pioneer2/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/gripper/pioneer2/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources Pioneer2_Gripper.cc) +SET (headers Pioneer2_Gripper.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/controllers/imu/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/imu/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/imu/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources Generic_Imu.cc) +SET (headers Generic_Imu.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/controllers/irarray/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/irarray/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/irarray/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources IR_Array.cc) +SET (headers IR_Array.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/controllers/laser/sicklms200/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/laser/sicklms200/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/laser/sicklms200/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources SickLMS200_Laser.cc) +SET (headers SickLMS200_Laser.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/controllers/opaque/jointforce/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/opaque/jointforce/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/opaque/jointforce/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources JointForce.cc) +SET (headers JointForce.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/controllers/position2d/differential/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/position2d/differential/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/position2d/differential/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources Differential_Position2d.cc) +SET (headers Differential_Position2d.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/controllers/position2d/holonome3sw/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/position2d/holonome3sw/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/position2d/holonome3sw/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources Holonome3Sw_Position2d.cc) +SET (headers Holonome3Sw_Position2d.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/controllers/position2d/steering/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/position2d/steering/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/position2d/steering/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources Steering_Position2d.cc Wheel.cc DriveWheel.cc FullWheel.cc) +SET (headers Steering_Position2d.hh Wheel.hh DriveWheel.hh FullWheel.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/controllers/ptz/generic/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/controllers/ptz/generic/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/controllers/ptz/generic/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) SET (sources Generic_PTZ.cc) +SET (headers Generic_PTZ.hh) APPEND_TO_SERVER_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/gui/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/gui/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/gui/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -16,4 +16,14 @@ GLFrame.cc ) +SET (headers Gui.hh + GLWindow.hh + MainMenu.hh + Toolbar.hh + StatusBar.hh + GLFrameManager.hh + GLFrame.hh +) ADD_LIBRARY(gazebo_gui STATIC ${sources}) + +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/physics/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/physics/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/physics/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -31,4 +31,26 @@ ode/ODEPhysics.cc ) +SET (headers BallJoint.hh + Body.hh + BoxGeom.hh + ContactParams.hh + CylinderGeom.hh + Geom.hh + Hinge2Joint.hh + HingeJoint.hh + Joint.hh + PhysicsEngine.hh + PlaneGeom.hh + SliderJoint.hh + SphereGeom.hh + UniversalJoint.hh + RayGeom.hh + TrimeshGeom.hh + HeightmapGeom.hh + MapGeom.hh + ode/ODEPhysics.hh +) + ADD_LIBRARY(gazebo_physics STATIC ${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/rendering/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/rendering/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/rendering/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -24,4 +24,22 @@ OgreHeightmap.cc ) +SET (headers OgreMovableText.hh + OgreCreator.hh + OgreAdaptor.hh + OgreFrameListener.hh + OgreDynamicRenderable.hh + OgreDynamicLines.hh + OgreSimpleShape.hh + OgreHUD.hh + OgreVisual.hh + OgreCamera.hh + CameraManager.hh + UserCamera.hh + Image.hh + Color.hh + OgreHeightmap.hh +) + ADD_LIBRARY(gazebo_rendering ${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/sensors/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/sensors/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/sensors/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -27,4 +27,9 @@ SensorFactory.cc ) +SET (headers Sensor.hh + SensorFactory.hh +) + ADD_LIBRARY(gazebo_sensors STATIC ${gazebosensor_sources} ${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/sensors/camera/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/sensors/camera/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/sensors/camera/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -4,4 +4,10 @@ StereoCameraSensor.cc ) +set (headers MonoCameraSensor.hh + StereoCameraSensor.hh +) + + APPEND_TO_SENSOR_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/sensors/contact/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/sensors/contact/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/sensors/contact/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) set (sources ContactSensor.cc) +set (headers ContactSensor.hh) APPEND_TO_SENSOR_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/sensors/imu/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/sensors/imu/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/sensors/imu/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) set (sources ImuSensor.cc) +set (headers ImuSensor.hh) APPEND_TO_SENSOR_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/sensors/ir/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/sensors/ir/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/sensors/ir/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) set (sources IRSensor.cc) +set (headers IRSensor.hh) APPEND_TO_SENSOR_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) Modified: code/gazebo/trunk/server/sensors/ray/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/sensors/ray/CMakeLists.txt 2009-05-13 22:55:12 UTC (rev 7650) +++ code/gazebo/trunk/server/sensors/ray/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) @@ -1,5 +1,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) set (sources RaySensor.cc) +set (headers RaySensor.hh) APPEND_TO_SENSOR_SOURCES(${sources}) +APPEND_TO_SERVER_HEADERS(${headers}) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-14 00:34:44
|
Revision: 7652 http://playerstage.svn.sourceforge.net/playerstage/?rev=7652&view=rev Author: natepak Date: 2009-05-14 00:34:36 +0000 (Thu, 14 May 2009) Log Message: ----------- More updates to cmakelists Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/server/CMakeLists.txt Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-14 00:34:36 UTC (rev 7652) @@ -35,7 +35,7 @@ # Write the config.h file CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h) -INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}) +INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}) SET (gazebo_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH "Location of CMake scripts") Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-13 23:02:19 UTC (rev 7651) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-14 00:34:36 UTC (rev 7652) @@ -105,7 +105,17 @@ ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}}) ENDIF (CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}) -TARGET_LINK_LIBRARIES( gazebo-exec gazebo_gui gazebo_sensors gazebo_physics gazebo_rendering gazebo_controllers gazebo_av ${gazeboserver_link_libs} ${FLTK_LIBRARIES} ${boost_libraries} ${freeimage_library} gazebo ) +TARGET_LINK_LIBRARIES( gazebo-exec gazebo_gui + gazebo_sensors + gazebo_physics + gazebo_rendering + gazebo_av + ${gazeboserver_link_libs} + ${FLTK_LIBRARIES} + ${boost_libraries} + ${freeimage_library} + gazebo +) INSTALL (TARGETS gazebo-exec DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) INSTALL (FILES ${gazeboserver_headers} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/gazebo COMPONENT headers) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-14 21:12:03
|
Revision: 7669 http://playerstage.svn.sourceforge.net/playerstage/?rev=7669&view=rev Author: natepak Date: 2009-05-14 21:11:53 +0000 (Thu, 14 May 2009) Log Message: ----------- More modifications to audio library Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/cmake/SearchForStuff.cmake code/gazebo/trunk/config.h.in code/gazebo/trunk/server/CMakeLists.txt code/gazebo/trunk/server/OpenALAPI.cc code/gazebo/trunk/server/audio_video/AudioDecoder.cc code/gazebo/trunk/server/audio_video/AudioDecoder.hh code/gazebo/trunk/server/audio_video/CMakeLists.txt code/gazebo/trunk/server/audio_video/OpenAL.cc code/gazebo/trunk/server/audio_video/OpenAL.hh Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-14 20:43:01 UTC (rev 7668) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-14 21:11:53 UTC (rev 7669) @@ -33,10 +33,6 @@ SET (ODE_VERSION 0.10.1 CACHE INTERNAL "ODE version requirement" FORCE) SET (MIN_BOOST_VERSION 1.35.0 CACHE INTERNAL "Boost min version requirement" FORCE) -# Write the config.h file -CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}) - SET (gazebo_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH "Location of CMake scripts") @@ -64,6 +60,11 @@ INCLUDE (${gazebo_cmake_dir}/SearchForStuff.cmake) MESSAGE (STATUS "----------------------------------------") +# Write the config.h file +CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h) +INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}) + + IF (BUILD_GAZEBO) ADD_SUBDIRECTORY(libgazebo) ADD_SUBDIRECTORY(server) Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake =================================================================== --- code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-14 20:43:01 UTC (rev 7668) +++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-14 21:11:53 UTC (rev 7669) @@ -3,7 +3,6 @@ INCLUDE (FindFLTK) INCLUDE (FindPkgConfig) -SET (INCLUDE_AV ON CACHE BOOL "Include audio/video functionality" FORCE) SET (INCLUDE_WEBGAZEBO ON CACHE BOOL "Build webgazebo" FORCE) SET (OGRE_LIBRARY_PATH "/usr/local/lib" CACHE INTERNAL "Ogre library path") @@ -95,11 +94,9 @@ pkg_check_modules(OAL openal) IF (NOT OAL_FOUND) - SET (INCLUDE_AV OFF CACHE BOOL "Include audio/video functionality" FORCE) MESSAGE (STATUS "Warning: Openal and development files not found. Audio capabilities will be disabled. See the following website: http://connect.creativelabs.com/openal/default.aspx") ELSE (NOT OAL_FOUND) - APPEND_TO_CACHED_LIST(gazeboserver_cflags - ${gazeboserver_cflags_desc} "-DHAVE_OPENAL" ) + SET (HAVE_OPENAL TRUE) APPEND_TO_CACHED_LIST(gazeboserver_include_dirs ${gazeboserver_include_dirs_desc} ${OAL_INCLUDE_DIRS}) @@ -116,7 +113,6 @@ pkg_check_modules(AVF libavformat) IF (NOT AVF_FOUND) - SET (INCLUDE_AV OFF CACHE BOOL "Include audio/video functionality" FORCE) MESSAGE (STATUS "Warning: libavformat and development files not found. Audio capabilities will be disabled.") ELSE (NOT AVF_FOUND) APPEND_TO_CACHED_LIST(gazeboserver_include_dirs @@ -135,7 +131,6 @@ pkg_check_modules(AVC libavcodec) IF (NOT AVC_FOUND) - SET (INCLUDE_AV OFF CACHE BOOL "Include audio/video functionality" FORCE) MESSAGE (STATUS "Warning: libavcodec and development files not found. Audio capabilities will be disabled.") ELSE (NOT AVC_FOUND) APPEND_TO_CACHED_LIST(gazeboserver_include_dirs @@ -152,6 +147,10 @@ ${AVC_LIBRARIES}) ENDIF (NOT AVC_FOUND) + IF (AVF_FOUND AND AVC_FOUND) + SET (HAVE_FFMPEG TRUE) + ENDIF (AVF_FOUND AND AVC_FOUND) + pkg_check_modules(PLAYER playerc++) IF (NOT PLAYER_FOUND) SET (INCLUDE_PLAYER OFF CACHE BOOL "Build gazebo plugin for player" FORCE) @@ -246,7 +245,7 @@ ######################################## # Find avformat and avcodec -IF (INCLUDE_AV) +IF (HAVE_FFMPEG) SET (libavformat_search_path /usr/include /usr/include/libavformat /usr/local/include /usr/local/include/libavformat @@ -273,7 +272,7 @@ MESSAGE (STATUS "Looking for avcodec.h - found") ENDIF (NOT LIBAVCODEC_PATH) -ENDIF (INCLUDE_AV) +ENDIF (HAVE_FFMPEG) ######################################## Modified: code/gazebo/trunk/config.h.in =================================================================== --- code/gazebo/trunk/config.h.in 2009-05-14 20:43:01 UTC (rev 7668) +++ code/gazebo/trunk/config.h.in 2009-05-14 21:11:53 UTC (rev 7669) @@ -2,3 +2,6 @@ /* Version number */ #define GAZEBO_VERSION "${GAZEBO_VERSION}" + +#cmakedefine HAVE_OPENAL 1 +#cmakedefine HAVE_FFMPEG 1 Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-14 20:43:01 UTC (rev 7668) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-14 21:11:53 UTC (rev 7669) @@ -40,9 +40,7 @@ ADD_SUBDIRECTORY(sensors) ADD_SUBDIRECTORY(gui) ADD_SUBDIRECTORY(controllers) -IF (INCLUDE_AV) - ADD_SUBDIRECTORY(audio_video) -ENDIF (INCLUDE_AV) +ADD_SUBDIRECTORY(audio_video) ######################################## # Process all the subdirectories Modified: code/gazebo/trunk/server/OpenALAPI.cc =================================================================== --- code/gazebo/trunk/server/OpenALAPI.cc 2009-05-14 20:43:01 UTC (rev 7668) +++ code/gazebo/trunk/server/OpenALAPI.cc 2009-05-14 21:11:53 UTC (rev 7669) @@ -1,3 +1,5 @@ +#include "config.h" + #include "OpenAL.hh" #include "OpenALAPI.hh" Modified: code/gazebo/trunk/server/audio_video/AudioDecoder.cc =================================================================== --- code/gazebo/trunk/server/audio_video/AudioDecoder.cc 2009-05-14 20:43:01 UTC (rev 7668) +++ code/gazebo/trunk/server/audio_video/AudioDecoder.cc 2009-05-14 21:11:53 UTC (rev 7669) @@ -1,3 +1,32 @@ +/* + * Gazebo - Outdoor Multi-Robot Simulator + * Copyright (C) 2003 + * Nate Koenig & Andrew Howard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +/* Desc: Audio Decoder + * Author: Nathan Koenig + * Date: 20 Jan 2008 + * SVN: $Id:$ + */ + +#include "config.h" +#ifdef HAVE_FFMPEG + #include <stdlib.h> #include <string.h> @@ -3,4 +32,5 @@ #include "AudioDecoder.hh" + bool AudioDecoder::initialized = false; @@ -9,6 +39,7 @@ /// Constructor AudioDecoder::AudioDecoder() { + this->formatCtx = NULL; this->codecCtx = NULL; this->codec = NULL; @@ -171,3 +202,5 @@ return 0; } + +#endif Modified: code/gazebo/trunk/server/audio_video/AudioDecoder.hh =================================================================== --- code/gazebo/trunk/server/audio_video/AudioDecoder.hh 2009-05-14 20:43:01 UTC (rev 7668) +++ code/gazebo/trunk/server/audio_video/AudioDecoder.hh 2009-05-14 21:11:53 UTC (rev 7669) @@ -1,6 +1,36 @@ +/* + * Gazebo - Outdoor Multi-Robot Simulator + * Copyright (C) 2003 + * Nate Koenig & Andrew Howard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +/* Desc: Audio Decoder + * Author: Nathan Koenig + * Date: 20 Jan 2008 + * SVN: $Id:$ + */ + #ifndef AUDIODECODER_HH #define AUDIODECODER_HH +#include "config.h" + +#ifdef HAVE_FFMPEG + extern "C" { #include <avformat.h> @@ -39,3 +69,4 @@ }; #endif +#endif Modified: code/gazebo/trunk/server/audio_video/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/audio_video/CMakeLists.txt 2009-05-14 20:43:01 UTC (rev 7668) +++ code/gazebo/trunk/server/audio_video/CMakeLists.txt 2009-05-14 21:11:53 UTC (rev 7669) @@ -14,9 +14,6 @@ OpenAL.hh ) -#APPEND_TO_SERVER_SOURCES(${sources}) -#APPEND_TO_SERVER_HEADERS(${headers}) - ADD_LIBRARY(gazebo_av STATIC ${sources}) ADD_LIBRARY(gazebo_av-shared SHARED ${sources}) Modified: code/gazebo/trunk/server/audio_video/OpenAL.cc =================================================================== --- code/gazebo/trunk/server/audio_video/OpenAL.cc 2009-05-14 20:43:01 UTC (rev 7668) +++ code/gazebo/trunk/server/audio_video/OpenAL.cc 2009-05-14 21:11:53 UTC (rev 7669) @@ -24,6 +24,10 @@ * SVN: $Id:$ */ +#include "config.h" + +#ifdef HAVE_OPENAL + #include <stdio.h> #include <unistd.h> #include <iostream> @@ -499,6 +503,7 @@ uint8_t *dataBuffer = NULL; unsigned int dataBufferSize; +#ifdef HAVE_FFMPEG // Create an audio decoder AudioDecoder audioDecoder; @@ -511,7 +516,12 @@ // AL_FORMAT_STEREO16 this->FillBufferFromPCM( dataBuffer, dataBufferSize, audioDecoder.GetSampleRate()); +#else + std::cerr << "No FFMPEG audio decoder. Missing FFMPEG libraries.\n"; +#endif if (dataBuffer) delete [] dataBuffer; } + +#endif Modified: code/gazebo/trunk/server/audio_video/OpenAL.hh =================================================================== --- code/gazebo/trunk/server/audio_video/OpenAL.hh 2009-05-14 20:43:01 UTC (rev 7668) +++ code/gazebo/trunk/server/audio_video/OpenAL.hh 2009-05-14 21:11:53 UTC (rev 7669) @@ -30,8 +30,11 @@ #include <stdint.h> #include <string> +#include "config.h" #include "Vector3.hh" +#ifdef HAVE_OPENAL + struct ALCcontext_struct; struct ALCdevice_struct; @@ -141,3 +144,4 @@ } #endif +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-15 16:02:05
|
Revision: 7671 http://playerstage.svn.sourceforge.net/playerstage/?rev=7671&view=rev Author: natepak Date: 2009-05-15 16:01:59 +0000 (Fri, 15 May 2009) Log Message: ----------- Fixed thread safety issue with Factory controller. Fixed CMakeLists varaibles associated with avcodec and avformat Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/cmake/SearchForStuff.cmake code/gazebo/trunk/cmake/libgazebo_pkgconfig.cmake code/gazebo/trunk/examples/libgazebo/factory/SConstruct code/gazebo/trunk/server/CMakeLists.txt code/gazebo/trunk/server/Simulator.cc code/gazebo/trunk/server/World.cc code/gazebo/trunk/server/World.hh code/gazebo/trunk/server/controllers/factory/Factory.cc code/gazebo/trunk/server/gui/CMakeLists.txt code/gazebo/trunk/server/rendering/OgreVisual.cc code/gazebo/trunk/worlds/simpleshapes.world Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-05-15 15:56:54 UTC (rev 7670) +++ code/gazebo/trunk/CMakeLists.txt 2009-05-15 16:01:59 UTC (rev 7671) @@ -60,11 +60,17 @@ INCLUDE (${gazebo_cmake_dir}/SearchForStuff.cmake) MESSAGE (STATUS "----------------------------------------") +######################################## # Write the config.h file CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h) + +######################################## +# Make the gazebo rc file +CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/gazeborc.cmake ${PROJECT_BINARY_DIR}/.gazeborc @ONLY) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/.gazeborc DESTINATION $ENV{HOME}/) + INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}) - IF (BUILD_GAZEBO) ADD_SUBDIRECTORY(libgazebo) ADD_SUBDIRECTORY(server) Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake =================================================================== --- code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-15 15:56:54 UTC (rev 7670) +++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-15 16:01:59 UTC (rev 7671) @@ -272,6 +272,9 @@ MESSAGE (STATUS "Looking for avcodec.h - found") ENDIF (NOT LIBAVCODEC_PATH) +ELSE (HAVE_FFMPEG) + SET (LIBAVFORMAT_PATH /usr/include) + SET (LIBAVCODEC_PATH /usr/include) ENDIF (HAVE_FFMPEG) Modified: code/gazebo/trunk/cmake/libgazebo_pkgconfig.cmake =================================================================== --- code/gazebo/trunk/cmake/libgazebo_pkgconfig.cmake 2009-05-15 15:56:54 UTC (rev 7670) +++ code/gazebo/trunk/cmake/libgazebo_pkgconfig.cmake 2009-05-15 16:01:59 UTC (rev 7671) @@ -6,5 +6,5 @@ Description: Shared memory interface to Gazebo Version: @GAZEBO_VERSION@ Requires: -Libs: -L${libdir} -lgazeboshm +Libs: -L${libdir} -lgazebo CFlags: -I${includedir} Modified: code/gazebo/trunk/examples/libgazebo/factory/SConstruct =================================================================== --- code/gazebo/trunk/examples/libgazebo/factory/SConstruct 2009-05-15 15:56:54 UTC (rev 7670) +++ code/gazebo/trunk/examples/libgazebo/factory/SConstruct 2009-05-15 16:01:59 UTC (rev 7671) @@ -17,4 +17,4 @@ for cfg in parseConfigs: env.ParseConfig(cfg) -env.Program('factory','factory.cc') +env.Program('factory','factory2.cc') Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-15 15:56:54 UTC (rev 7670) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-15 16:01:59 UTC (rev 7671) @@ -122,9 +122,3 @@ INSTALL (TARGETS gazebo-exec DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) INSTALL (TARGETS gazebo_server DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) INSTALL (FILES ${gazeboserver_headers} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/gazebo COMPONENT headers) - -######################################## -# Make the gazebo rc file -CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/gazeborc.cmake ${CMAKE_CURRENT_BINARY_DIR}/.gazeborc @ONLY) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/.gazeborc DESTINATION $ENV{HOME}/) - Modified: code/gazebo/trunk/server/Simulator.cc =================================================================== --- code/gazebo/trunk/server/Simulator.cc 2009-05-15 15:56:54 UTC (rev 7670) +++ code/gazebo/trunk/server/Simulator.cc 2009-05-15 16:01:59 UTC (rev 7671) @@ -357,6 +357,8 @@ this->gui->Update(); } + World::Instance()->ProcessEntitiesToLoad(); + currTime = this->GetWallTime(); if (currTime - lastTime < 1/freq) Modified: code/gazebo/trunk/server/World.cc =================================================================== --- code/gazebo/trunk/server/World.cc 2009-05-15 15:56:54 UTC (rev 7670) +++ code/gazebo/trunk/server/World.cc 2009-05-15 16:01:59 UTC (rev 7671) @@ -212,6 +212,7 @@ this->toAddModels.clear(); this->toDeleteModels.clear(); + this->toLoadEntities.clear(); this->graphics->Init(); @@ -362,6 +363,43 @@ } //////////////////////////////////////////////////////////////////////////////// +// Add a new entity to the world +void World::InsertEntity( const std::string xmlString) +{ + this->toLoadEntities.push_back( xmlString ); +} + +//////////////////////////////////////////////////////////////////////////////// +// Load all the entities that have been queued +void World::ProcessEntitiesToLoad() +{ + std::vector< std::string >::iterator iter; + + for (iter = this->toLoadEntities.begin(); + iter != this->toLoadEntities.end(); iter++) + { + // Create the world file + XMLConfig *xmlConfig = new XMLConfig(); + + // Load the XML tree from the given string + try + { + xmlConfig->LoadString( *iter ); + } + catch (gazebo::GazeboError e) + { + gzerr(0) << "The world could not load the XML data [" << e << "]\n"; + continue; + } + + this->LoadEntities( xmlConfig->GetRootNode(), NULL, true); + delete xmlConfig; + } + + this->toLoadEntities.clear(); +} + +//////////////////////////////////////////////////////////////////////////////// /// Delete an entity by name void World::DeleteEntity(const char *name) { Modified: code/gazebo/trunk/server/World.hh =================================================================== --- code/gazebo/trunk/server/World.hh 2009-05-15 15:56:54 UTC (rev 7670) +++ code/gazebo/trunk/server/World.hh 2009-05-15 16:01:59 UTC (rev 7671) @@ -29,6 +29,8 @@ #include <iostream> #include <vector> +#include <boost/tuple/tuple.hpp> + #include "SingletonT.hh" #include "Vector3.hh" #include "Pose3d.hh" @@ -115,8 +117,18 @@ /// \param node XMLConfg node pointer /// \param parent Parent of the model to load /// \param removeDuplicate Remove existing model of same name - public: void LoadEntities(XMLConfigNode *node, Model *parent, bool removeDuplicate); + public: void LoadEntities(XMLConfigNode *node, Model *parent, + bool removeDuplicate); + /// \brief Insert an entity into the world. This function pushes the model + // (encoded as an XML string) onto a list. The Graphics Thread will then + // call the ProcessEntitiesToLoad function to actually make the new + // entities. This Producer-Consumer model is necessary for thread safety. + public: void InsertEntity(const std::string xmlString); + + /// \brief Load all the entities that have been queued + public: void ProcessEntitiesToLoad(); + /// \brief Delete an entity by name /// \param name The name of the entity to delete public: void DeleteEntity(const char *name); @@ -202,6 +214,8 @@ /// List of models to delete from the world private: std::vector< Model* > toDeleteModels; + private: std::vector< std::string > toLoadEntities; + /// Simulator control interface private: Server *server; Modified: code/gazebo/trunk/server/controllers/factory/Factory.cc =================================================================== --- code/gazebo/trunk/server/controllers/factory/Factory.cc 2009-05-15 15:56:54 UTC (rev 7670) +++ code/gazebo/trunk/server/controllers/factory/Factory.cc 2009-05-15 16:01:59 UTC (rev 7671) @@ -101,27 +101,9 @@ xmlString = this->xmlPrefix + xmlMiddle + this->xmlSuffix; - // Create the world file - XMLConfig *xmlConfig = new XMLConfig(); - - // Load the XML tree from the given string - try - { - xmlConfig->LoadString( xmlString ); - } - catch (gazebo::GazeboError e) - { - std::cerr << "The controlled factory could not load its XML data [" << e << "]\n"; - return; - } - // Add the new models into the World - World::Instance()->LoadEntities( xmlConfig->GetRootNode(), NULL, true ); + World::Instance()->InsertEntity( xmlString); - // Cleanup - delete xmlConfig; - xmlConfig = NULL; - strcpy((char*)this->factoryIface->data->newModel,""); } Modified: code/gazebo/trunk/server/gui/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/gui/CMakeLists.txt 2009-05-15 15:56:54 UTC (rev 7670) +++ code/gazebo/trunk/server/gui/CMakeLists.txt 2009-05-15 16:01:59 UTC (rev 7671) @@ -1,7 +1,3 @@ -INCLUDE_DIRECTORIES( - ${FLTK_INCLUDE_DIR} -) - SET (sources Gui.cc GLWindow.cc MainMenu.cc Modified: code/gazebo/trunk/server/rendering/OgreVisual.cc =================================================================== --- code/gazebo/trunk/server/rendering/OgreVisual.cc 2009-05-15 15:56:54 UTC (rev 7670) +++ code/gazebo/trunk/server/rendering/OgreVisual.cc 2009-05-15 16:01:59 UTC (rev 7671) @@ -170,6 +170,7 @@ } } + std::cout << "Creating Mesh[" << meshName << "]\n"; obj = (Ogre::MovableObject*)this->sceneNode->getCreator()->createEntity( stream.str(), meshName); } Modified: code/gazebo/trunk/worlds/simpleshapes.world =================================================================== --- code/gazebo/trunk/worlds/simpleshapes.world 2009-05-15 15:56:54 UTC (rev 7670) +++ code/gazebo/trunk/worlds/simpleshapes.world 2009-05-15 16:01:59 UTC (rev 7671) @@ -57,6 +57,7 @@ </body:sphere> </model:physical> + <!-- <model:physical name="box1_model"> <xyz>1 1.5 0.25</xyz> <canonicalBody>box1_body</canonicalBody> @@ -69,13 +70,13 @@ <visual> <size>0.5 0.5 0.5</size> - <mesh>unit_box</mesh> + <mesh>pr2/base.mesh</mesh> <material>Gazebo/Rocky</material> </visual> </geom:box> </body:box> - </model:physical> + --> <model:physical name="cylinder1_model"> <xyz>1 -1.5 0.5</xyz> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-15 17:20:42
|
Revision: 7673 http://playerstage.svn.sourceforge.net/playerstage/?rev=7673&view=rev Author: natepak Date: 2009-05-15 17:20:26 +0000 (Fri, 15 May 2009) Log Message: ----------- Added libtool search in cmake Modified Paths: -------------- code/gazebo/trunk/cmake/SearchForStuff.cmake code/gazebo/trunk/config.h.in code/gazebo/trunk/server/CMakeLists.txt code/gazebo/trunk/server/World.cc code/gazebo/trunk/server/World.hh code/gazebo/trunk/server/controllers/ControllerFactory.cc code/gazebo/trunk/server/controllers/factory/Factory.cc Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake =================================================================== --- code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-15 16:03:15 UTC (rev 7672) +++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-15 17:20:26 UTC (rev 7673) @@ -318,4 +318,25 @@ CACHE INTERNAL "Link flags for profile" FORCE) ENDIF (TCMALLOC) +######################################## +# Find libtool +FIND_PATH(libtool_include_dir ltdl.h /usr/include /usr/local/include) +IF (NOT libtool_include_dir) + MESSAGE (STATUS "Looking for ltdl.h - not found") + MESSAGE (STATUS "Warning: Unable to find libtool, plugins will not be supported.") + SET (libtool_include_dir /usr/include) +ELSE (NOT libtool_include_dir) + MESSAGE (STATUS "Looking for ltdl.h - found") +ENDIF (NOT libtool_include_dir) +FIND_LIBRARY(libtool_library ltdl /usr/lib /usr/local/lib) +IF (NOT libtool_library) + MESSAGE (STATUS "Looking for libltdl - not found") + MESSAGE (STATUS "Warning: Unable to find libtool, plugins will not be supported.") +ELSE (NOT libtool_library) + MESSAGE (STATUS "Looking for libltdl - found") +ENDIF (NOT libtool_library) + +IF (libtool_library AND libtool_include_dir) + SET (HAVE_LTDL TRUE) +ENDIF (libtool_library AND libtool_include_dir) Modified: code/gazebo/trunk/config.h.in =================================================================== --- code/gazebo/trunk/config.h.in 2009-05-15 16:03:15 UTC (rev 7672) +++ code/gazebo/trunk/config.h.in 2009-05-15 17:20:26 UTC (rev 7673) @@ -5,3 +5,4 @@ #cmakedefine HAVE_OPENAL 1 #cmakedefine HAVE_FFMPEG 1 +#cmakedefine HAVE_LTDL 1 Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2009-05-15 16:03:15 UTC (rev 7672) +++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-15 17:20:26 UTC (rev 7673) @@ -20,6 +20,7 @@ sensors/ray ${LIBAVCODEC_PATH} ${LIBAVFORMAT_PATH} + ${libtool_include_path} ${gazeboserver_include_dirs} ${boost_include_dirs} ${freeimage_include_dir} @@ -107,7 +108,7 @@ ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}}) ENDIF (CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}) -TARGET_LINK_LIBRARIES( gazebo-exec +TARGET_LINK_LIBRARIES( gazebo-exec ${libtool_library} ${gazeboserver_link_libs} ${boost_libraries} ${freeimage_library} @@ -115,9 +116,10 @@ gazebo_av gazebo_gui gazebo + ) -TARGET_LINK_LIBRARIES( gazebo_server ${ODE_LIBRARIES} gazebo) +TARGET_LINK_LIBRARIES( gazebo_server ${ODE_LIBRARIES} ${libtool_library} gazebo) INSTALL (TARGETS gazebo-exec DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) INSTALL (TARGETS gazebo_server DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) Modified: code/gazebo/trunk/server/World.cc =================================================================== --- code/gazebo/trunk/server/World.cc 2009-05-15 16:03:15 UTC (rev 7672) +++ code/gazebo/trunk/server/World.cc 2009-05-15 17:20:26 UTC (rev 7673) @@ -364,8 +364,9 @@ //////////////////////////////////////////////////////////////////////////////// // Add a new entity to the world -void World::InsertEntity( const std::string xmlString) +void World::InsertEntity( std::string xmlString) { + boost::recursive_mutex::scoped_lock lock(*Simulator::Instance()->GetMutex()); this->toLoadEntities.push_back( xmlString ); } @@ -373,6 +374,7 @@ // Load all the entities that have been queued void World::ProcessEntitiesToLoad() { + boost::recursive_mutex::scoped_lock lock(*Simulator::Instance()->GetMutex()); std::vector< std::string >::iterator iter; for (iter = this->toLoadEntities.begin(); Modified: code/gazebo/trunk/server/World.hh =================================================================== --- code/gazebo/trunk/server/World.hh 2009-05-15 16:03:15 UTC (rev 7672) +++ code/gazebo/trunk/server/World.hh 2009-05-15 17:20:26 UTC (rev 7673) @@ -124,7 +124,7 @@ // (encoded as an XML string) onto a list. The Graphics Thread will then // call the ProcessEntitiesToLoad function to actually make the new // entities. This Producer-Consumer model is necessary for thread safety. - public: void InsertEntity(const std::string xmlString); + public: void InsertEntity(std::string xmlString); /// \brief Load all the entities that have been queued public: void ProcessEntitiesToLoad(); Modified: code/gazebo/trunk/server/controllers/ControllerFactory.cc =================================================================== --- code/gazebo/trunk/server/controllers/ControllerFactory.cc 2009-05-15 16:03:15 UTC (rev 7672) +++ code/gazebo/trunk/server/controllers/ControllerFactory.cc 2009-05-15 17:20:26 UTC (rev 7673) @@ -25,11 +25,15 @@ * SVN info: $Id$ */ +#include "config.h" + #include "GazeboError.hh" #include "Entity.hh" #include "gazebo.h" #include "Controller.hh" #include "ControllerFactory.hh" + + #ifdef HAVE_LTDL #include <ltdl.h> #endif // HAVE_LTDL Modified: code/gazebo/trunk/server/controllers/factory/Factory.cc =================================================================== --- code/gazebo/trunk/server/controllers/factory/Factory.cc 2009-05-15 16:03:15 UTC (rev 7672) +++ code/gazebo/trunk/server/controllers/factory/Factory.cc 2009-05-15 17:20:26 UTC (rev 7673) @@ -108,12 +108,12 @@ } // Attempt to delete a model by name, if the string is present - if (strcmp((const char*)this->factoryIface->data->deleteModel,"")!=0) + /*if (strcmp((const char*)this->factoryIface->data->deleteModel,"")!=0) { World::Instance()->DeleteEntity((const char*)this->factoryIface->data->deleteModel); strcpy((char*)this->factoryIface->data->deleteModel,""); - } + }*/ this->factoryIface->Unlock(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-19 14:33:46
|
Revision: 7693 http://playerstage.svn.sourceforge.net/playerstage/?rev=7693&view=rev Author: natepak Date: 2009-05-19 14:33:39 +0000 (Tue, 19 May 2009) Log Message: ----------- Fixed some bugs in the GUI. Fixed visualization of static models Modified Paths: -------------- code/gazebo/trunk/server/gui/StatusBar.cc code/gazebo/trunk/server/gui/Toolbar.cc code/gazebo/trunk/server/physics/Body.cc code/gazebo/trunk/server/rendering/OgreCreator.cc code/gazebo/trunk/worlds/pioneer2dx.world Modified: code/gazebo/trunk/server/gui/StatusBar.cc =================================================================== --- code/gazebo/trunk/server/gui/StatusBar.cc 2009-05-19 03:47:34 UTC (rev 7692) +++ code/gazebo/trunk/server/gui/StatusBar.cc 2009-05-19 14:33:39 UTC (rev 7693) @@ -29,6 +29,7 @@ #include <FL/Fl_Value_Output.H> #include <FL/Fl_Output.H> #include <FL/Fl_Button.H> +#include <FL/Fl_Box.H> #include <string.h> #include "Gui.hh" @@ -79,8 +80,11 @@ this->pauseTime->align(FL_ALIGN_RIGHT); this->pauseTime->precision(2); - x = this->w() - 80; - //x = this->pauseTime->x() + this->pauseTime->w() + 80; + x = this->pauseTime->x() + this->pauseTime->w(); + int width = this->w() - (x + 90); + Fl_Box *spacingBox = new Fl_Box(x, y, width, 20); + + x = spacingBox->x() + spacingBox->w(); this->playButton = new Fl_Button(x, y, 30, 20, "@||"); this->playButton->callback( &gazebo::StatusBar::PlayPauseButtonCB, this ); @@ -89,7 +93,8 @@ this->stepButton->callback( &gazebo::StatusBar::StepButtonCB, this ); this->stepButton->deactivate(); - this->resizable(NULL); + this->resizable(spacingBox); + this->end(); this->show(); Modified: code/gazebo/trunk/server/gui/Toolbar.cc =================================================================== --- code/gazebo/trunk/server/gui/Toolbar.cc 2009-05-19 03:47:34 UTC (rev 7692) +++ code/gazebo/trunk/server/gui/Toolbar.cc 2009-05-19 14:33:39 UTC (rev 7693) @@ -157,13 +157,17 @@ { Fl_Hold_Browser *browser = (Fl_Hold_Browser*)(w); Toolbar *toolbar = (Toolbar*)(data); - int selected = browser->value(); - std::string lineText = browser->text(selected); - std::string lbl; + std::string lineText, lbl; int beginLbl = 0; int endLbl = 0; int beginValue = 0; + int selected = browser->value(); + if (selected <= 0) + return; + + lineText = browser->text(selected); + if (lineText.find("-Body") != std::string::npos) { /*beginLbl = lineText.rfind("@") + 2; @@ -220,6 +224,8 @@ Fl_Hold_Browser *browser = toolbar->paramBrowser; int selected = browser->value(); Model *model = dynamic_cast<Model*>(Simulator::Instance()->GetSelectedEntity()); + + Body *body = NULL; Geom *geom = NULL; OgreVisual *vis = NULL; @@ -288,9 +294,14 @@ void Toolbar::EntityBrowserCB( Fl_Widget *w, void *data ) { Fl_Hold_Browser *browser = (Fl_Hold_Browser*)(w); + std::string lineText; int selected = browser->value(); - std::string lineText = browser->text(selected); + if (selected <=0) + return; + + lineText = browser->text(selected); + Model *model = World::Instance()->GetModelByName(lineText); Simulator::Instance()->SetSelectedEntity(model); } Modified: code/gazebo/trunk/server/physics/Body.cc =================================================================== --- code/gazebo/trunk/server/physics/Body.cc 2009-05-19 03:47:34 UTC (rev 7692) +++ code/gazebo/trunk/server/physics/Body.cc 2009-05-19 14:33:39 UTC (rev 7693) @@ -554,11 +554,6 @@ // Return the pose of the body Pose3d Body::GetPose() const { - - /*if (this->IsStatic()) - return this->staticPose; - else - */ return this->pose; } Modified: code/gazebo/trunk/server/rendering/OgreCreator.cc =================================================================== --- code/gazebo/trunk/server/rendering/OgreCreator.cc 2009-05-19 03:47:34 UTC (rev 7692) +++ code/gazebo/trunk/server/rendering/OgreCreator.cc 2009-05-19 14:33:39 UTC (rev 7693) @@ -761,11 +761,9 @@ Pose3d pose; - if (owner->IsGeom() || !owner->GetParent()) - { + if ((owner->IsGeom() && !owner->IsStatic()) || !owner->GetParent()) vis->SetPose( owner->GetPose() ); - } - else + else vis->SetPose(owner->GetPose() - owner->GetParent()->GetPose()); } } Modified: code/gazebo/trunk/worlds/pioneer2dx.world =================================================================== --- code/gazebo/trunk/worlds/pioneer2dx.world 2009-05-19 03:47:34 UTC (rev 7692) +++ code/gazebo/trunk/worlds/pioneer2dx.world 2009-05-19 14:33:39 UTC (rev 7693) @@ -128,7 +128,7 @@ <model:physical name="box1_model"> <xyz>1 1.5 0.5</xyz> <canonicalBody>box1_body</canonicalBody> - <static>false</static> + <static>true</static> <body:box name="box1_body"> <geom:box name="box1_geom"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-20 21:06:23
|
Revision: 7704 http://playerstage.svn.sourceforge.net/playerstage/?rev=7704&view=rev Author: natepak Date: 2009-05-20 21:06:16 +0000 (Wed, 20 May 2009) Log Message: ----------- Removed more printf statements Modified Paths: -------------- code/gazebo/trunk/libgazebo/Client.cc code/gazebo/trunk/libgazebo/Iface.cc code/gazebo/trunk/server/physics/Body.cc Modified: code/gazebo/trunk/libgazebo/Client.cc =================================================================== --- code/gazebo/trunk/libgazebo/Client.cc 2009-05-20 20:54:56 UTC (rev 7703) +++ code/gazebo/trunk/libgazebo/Client.cc 2009-05-20 21:06:16 UTC (rev 7704) @@ -133,8 +133,6 @@ // Disconnect from the server void Client::Disconnect() { - std::cout << "closing " << this->filename << "\n"; - // Finalize semaphores if (this->clientId >= 0) this->SemFini(); Modified: code/gazebo/trunk/libgazebo/Iface.cc =================================================================== --- code/gazebo/trunk/libgazebo/Iface.cc 2009-05-20 20:54:56 UTC (rev 7703) +++ code/gazebo/trunk/libgazebo/Iface.cc 2009-05-20 21:06:16 UTC (rev 7704) @@ -332,7 +332,6 @@ this->mMap = NULL; // Close the file - std::cout << "closing " << this->filename << "\n"; close(this->mmapFd); } } Modified: code/gazebo/trunk/server/physics/Body.cc =================================================================== --- code/gazebo/trunk/server/physics/Body.cc 2009-05-20 20:54:56 UTC (rev 7703) +++ code/gazebo/trunk/server/physics/Body.cc 2009-05-20 21:06:16 UTC (rev 7704) @@ -867,7 +867,6 @@ */ void Body::UpdateCoM() { - std::cout << "calling UpdateCoM() " << this->GetName() << std::endl; if (!this->bodyId) return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-20 23:52:01
|
Revision: 7705 http://playerstage.svn.sourceforge.net/playerstage/?rev=7705&view=rev Author: natepak Date: 2009-05-20 23:51:46 +0000 (Wed, 20 May 2009) Log Message: ----------- Added <range> tags to lights Modified Paths: -------------- code/gazebo/trunk/server/rendering/OgreCreator.cc code/gazebo/trunk/worlds/audio.world code/gazebo/trunk/worlds/bandit.world code/gazebo/trunk/worlds/bumper.world code/gazebo/trunk/worlds/factory.world code/gazebo/trunk/worlds/federation.world code/gazebo/trunk/worlds/laser.world code/gazebo/trunk/worlds/lights.world code/gazebo/trunk/worlds/map.world code/gazebo/trunk/worlds/openal.world code/gazebo/trunk/worlds/pioneer2at.world code/gazebo/trunk/worlds/pioneer2dx.world code/gazebo/trunk/worlds/pioneer2dx_camera.world code/gazebo/trunk/worlds/pioneer2dx_gripper.world code/gazebo/trunk/worlds/simplecar.world code/gazebo/trunk/worlds/simpleshapes.world code/gazebo/trunk/worlds/test.world code/gazebo/trunk/worlds/trimesh.world code/gazebo/trunk/worlds/wizbot.world Modified: code/gazebo/trunk/server/rendering/OgreCreator.cc =================================================================== --- code/gazebo/trunk/server/rendering/OgreCreator.cc 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/server/rendering/OgreCreator.cc 2009-05-20 23:51:46 UTC (rev 7705) @@ -176,16 +176,24 @@ light->setDirection(vec.x, vec.y, vec.z); // Absolute range of light in world coordinates - range = node->GetTupleDouble("attenuation",0,1000); + range = node->GetDouble("range",0,100); // Constant factor. 1.0 means never attenuate, 0.0 is complete attenuation - constant = node->GetTupleDouble("attenuation",1,1.0); + constant = node->GetTupleDouble("attenuation",0,1.0); + if (constant < 0) + constant = 0; + else if (constant > 1.0) + constant = 1.0; // Linear factor. 1 means attenuate evenly over the distance - linear = node->GetTupleDouble("attenuation",2,0); + linear = node->GetTupleDouble("attenuation",1,0); + if (linear < 0) + linear = 0; + else if (linear > 1.0) + linear = 1.0; // Quadartic factor.adds a curvature to the attenuation formula - quad = node->GetTupleDouble("attenuation",3,0); + quad = node->GetTupleDouble("attenuation",2,0); // Set attenuation light->setAttenuation(range, constant, linear, quad); @@ -194,7 +202,7 @@ // options for spotlights if (lightType == "spot") { - vec = node->GetVector3("range", Vector3(5.0, 10.0, 1.0)); + vec = node->GetVector3("spotCone", Vector3(5.0, 10.0, 1.0)); light->setSpotlightRange(Ogre::Radian(Ogre::Degree(vec.x)), Ogre::Radian(Ogre::Degree(vec.y)), vec.z); } Modified: code/gazebo/trunk/worlds/audio.world =================================================================== --- code/gazebo/trunk/worlds/audio.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/audio.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -145,7 +145,10 @@ <type>point</type> <diffuseColor>0.8 0.8 0.8</diffuseColor> <specularColor>0.1 0.1 0.1</specularColor> - <attenuation>20 0.5 0.1 0</attenuation> + <range>20</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>0.5 0.1 0</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/bandit.world =================================================================== --- code/gazebo/trunk/worlds/bandit.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/bandit.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -166,7 +166,10 @@ <type>point</type> <diffuseColor>0.8 0.8 0.8</diffuseColor> <specularColor>0.1 0.1 0.1</specularColor> - <attenuation>10 0.8 0.1 0.0</attenuation> + <range>10</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>0.8 0.1 0.0</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/bumper.world =================================================================== --- code/gazebo/trunk/worlds/bumper.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/bumper.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -135,15 +135,17 @@ </include> </model:physical> - <!-- White Directional light --> + <!-- White Point light --> <model:renderable name="directional_white"> <enableGravity>false</enableGravity> <light> - <type>directional</type> - <direction>0 -0.6 -0.4</direction> + <type>point</type> <diffuseColor>1.0 1.0 1.0</diffuseColor> <specularColor>0.2 0.2 0.2</specularColor> - <attenuation>1000 1.0 0.0 0</attenuation> + <range>20</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>1.0 0.0 0</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/factory.world =================================================================== --- code/gazebo/trunk/worlds/factory.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/factory.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -87,15 +87,18 @@ </controller:factory> </model:empty> - <!-- White Directional light --> + <!-- White Point light --> <model:renderable name="directional_white"> <enableGravity>false</enableGravity> <light> - <type>directional</type> + <type>point</type> <direction>0 -0.5 -0.5</direction> <diffuseColor>0.4 0.4 0.4</diffuseColor> <specularColor>0.0 0.0 0.0</specularColor> - <attenuation>100 0.0 1.0 0.4</attenuation> + <range>100</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>0.0 1.0 0.4</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/federation.world =================================================================== --- code/gazebo/trunk/worlds/federation.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/federation.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -135,7 +135,10 @@ <type>point</type> <diffuseColor>0.8 0.8 0.8</diffuseColor> <specularColor>0.1 0.1 0.1</specularColor> - <attenuation>20 0.5 0.1 0</attenuation> + <range>20</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>0.5 0.1 0</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/laser.world =================================================================== --- code/gazebo/trunk/worlds/laser.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/laser.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -95,15 +95,17 @@ </body:plane> </model:physical> - <!-- White Directional light --> + <!-- White Point light --> <model:renderable name="directional_white"> <enableGravity>false</enableGravity> <light> - <type>directional</type> - <direction>0 -0.5 -0.5</direction> + <type>point</type> <diffuseColor>0.4 0.4 0.4</diffuseColor> <specularColor>0.0 0.0 0.0</specularColor> - <attenuation>100 0.0 1.0 0.4</attenuation> + <range>100</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>0.0 1.0 0.4</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/lights.world =================================================================== --- code/gazebo/trunk/worlds/lights.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/lights.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -63,7 +63,9 @@ <direction>0 -1 0</direction> <diffuseColor>0.1 0.0 0.0</diffuseColor> <specularColor>0.2 0.0 0.0</specularColor> - <attenuation>5 0.2 0.2 0.00</attenuation> + <range>5</range> + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>0.2 0.2 0.00</attenuation> </light> </model:renderable> @@ -78,7 +80,9 @@ <direction>0 -1 0</direction> <diffuseColor>0.0 0.1 0.0</diffuseColor> <specularColor>0.0 0.2 0.0</specularColor> - <attenuation>10 0.2 0.1 0.00</attenuation> + <range>10</range> + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>0.2 0.1 0.00</attenuation> </light> </model:renderable> @@ -108,7 +112,9 @@ <diffuseColor>0.0 0.0 0.1</diffuseColor> <specularColor>0.0 0.0 0.2</specularColor> <attenuation>100 0.2 0.1 0.00</attenuation> - <range>8.0, 10.0, 2.0</range> + + <!-- InnerAngle OutterAngle Falloff --> + <spotCone>8.0 10.0 2.0</spotCone> </light> </model:renderable> @@ -124,7 +130,10 @@ <type>point</type> <diffuseColor>0.1 0.1 0.0</diffuseColor> <specularColor>0.3 0.3 0.3</specularColor> - <attenuation>10 0.4 0.1 0.0</attenuation> + <range>10</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>0.4 0.1 0.0</attenuation> </light> </model:renderable> @@ -136,7 +145,10 @@ <direction>0 -1 0</direction> <diffuseColor>0.4 0.4 0.4</diffuseColor> <specularColor>0.0 0.0 0.0</specularColor> - <attenuation>100 0.0 1.0 0.4</attenuation> + <range>100</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>0.0 1.0 0.4</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/map.world =================================================================== --- code/gazebo/trunk/worlds/map.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/map.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -83,7 +83,10 @@ <direction>0 -0.6 -0.4</direction> <diffuseColor>1.0 1.0 1.0</diffuseColor> <specularColor>0.2 0.2 0.2</specularColor> - <attenuation>100 1.0 0.0 0</attenuation> + <range>100</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>1.0 0.0 0</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/openal.world =================================================================== --- code/gazebo/trunk/worlds/openal.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/openal.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -136,7 +136,10 @@ <type>point</type> <diffuseColor>0.8 0.8 0.8</diffuseColor> <specularColor>0.1 0.1 0.1</specularColor> - <attenuation>10 0.8 0.1 0.0</attenuation> + <range>10</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>0.8 0.1 0.0</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/pioneer2at.world =================================================================== --- code/gazebo/trunk/worlds/pioneer2at.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/pioneer2at.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -117,7 +117,10 @@ <direction>0 -0.8 -0.3</direction> <diffuseColor>0.9 0.9 0.9</diffuseColor> <specularColor>0.0 0.0 0.0</specularColor> - <attenuation>100 0.0 1.0 0.4</attenuation> + <range>100</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>0.0 1.0 0.4</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/pioneer2dx.world =================================================================== --- code/gazebo/trunk/worlds/pioneer2dx.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/pioneer2dx.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -153,7 +153,10 @@ <type>point</type> <diffuseColor>0.8 0.8 0.8</diffuseColor> <specularColor>0.1 0.1 0.1</specularColor> - <attenuation>20 0.5 0.1 0</attenuation> + <range>20</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>0.5 0.1 0</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/pioneer2dx_camera.world =================================================================== --- code/gazebo/trunk/worlds/pioneer2dx_camera.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/pioneer2dx_camera.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -124,11 +124,14 @@ <light> <type>spot</type> - <range>1000 1000 100</range> + <spotCone>1000 1000 100</spotCone> <direction>-0.1 0 -0.9</direction> <diffuseColor>0.8 0.8 0.8</diffuseColor> <specularColor>0.1 0.1 0.1</specularColor> - <attenuation>10 1.0 0.0 0</attenuation> + <range>10</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>1.0 0.0 0</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/pioneer2dx_gripper.world =================================================================== --- code/gazebo/trunk/worlds/pioneer2dx_gripper.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/pioneer2dx_gripper.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -110,7 +110,10 @@ <direction>0 -0.6 -0.4</direction> <diffuseColor>1.0 1.0 1.0</diffuseColor> <specularColor>0.2 0.2 0.2</specularColor> - <attenuation>1000 1.0 0.0 0</attenuation> + <range>100</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>1.0 0.0 0</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/simplecar.world =================================================================== --- code/gazebo/trunk/worlds/simplecar.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/simplecar.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -120,7 +120,10 @@ <direction>0 -0.8 -0.3</direction> <diffuseColor>0.9 0.9 0.9</diffuseColor> <specularColor>0.0 0.0 0.0</specularColor> - <attenuation>100 0.0 1.0 0.4</attenuation> + <range>100</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>0.0 1.0 0.4</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/simpleshapes.world =================================================================== --- code/gazebo/trunk/worlds/simpleshapes.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/simpleshapes.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -122,7 +122,10 @@ <type>point</type> <diffuseColor>0.9 0.9 0.9</diffuseColor> <specularColor>0.1 0.1 0.1</specularColor> - <attenuation>10 0.8 0.1 0.0</attenuation> + <range>10</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>0.8 0.1 0.0</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/test.world =================================================================== --- code/gazebo/trunk/worlds/test.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/test.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -148,7 +148,10 @@ <direction>0 -0.6 -0.4</direction> <diffuseColor>1.0 1.0 1.0</diffuseColor> <specularColor>0.2 0.2 0.2</specularColor> - <attenuation>1000 1.0 0.0 0</attenuation> + <range>100</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>1.0 0.0 0</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/trimesh.world =================================================================== --- code/gazebo/trunk/worlds/trimesh.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/trimesh.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -80,7 +80,10 @@ <direction>0 -0.5 -0.5</direction> <diffuseColor>0.4 0.4 0.4</diffuseColor> <specularColor>0.0 0.0 0.0</specularColor> - <attenuation>100 0.0 1.0 0.4</attenuation> + <range>100</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>0.0 1.0 0.4</attenuation> </light> </model:renderable> Modified: code/gazebo/trunk/worlds/wizbot.world =================================================================== --- code/gazebo/trunk/worlds/wizbot.world 2009-05-20 21:06:16 UTC (rev 7704) +++ code/gazebo/trunk/worlds/wizbot.world 2009-05-20 23:51:46 UTC (rev 7705) @@ -169,7 +169,10 @@ <direction>0 -0.6 -0.4</direction> <diffuseColor>1.0 1.0 1.0</diffuseColor> <specularColor>0.2 0.2 0.2</specularColor> - <attenuation>1000 1.0 0.0 0</attenuation> + <range>100</range> + + <!-- Constant(0-1) Linear(0-1) Quadratic --> + <attenuation>1.0 0.0 0</attenuation> </light> </model:renderable> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-06-02 20:35:03
|
Revision: 7759 http://playerstage.svn.sourceforge.net/playerstage/?rev=7759&view=rev Author: natepak Date: 2009-06-02 20:35:01 +0000 (Tue, 02 Jun 2009) Log Message: ----------- Added throttling of the physics loop Modified Paths: -------------- code/gazebo/trunk/server/Simulator.cc code/gazebo/trunk/server/Simulator.hh code/gazebo/trunk/server/World.cc code/gazebo/trunk/server/physics/PhysicsEngine.cc code/gazebo/trunk/worlds/pioneer2dx.world code/gazebo/trunk/worlds/simpleshapes.world Modified: code/gazebo/trunk/server/Simulator.cc =================================================================== --- code/gazebo/trunk/server/Simulator.cc 2009-06-02 19:46:15 UTC (rev 7758) +++ code/gazebo/trunk/server/Simulator.cc 2009-06-02 20:35:01 UTC (rev 7759) @@ -60,7 +60,6 @@ gazeboConfig(NULL), loaded(false), pause(false), - iterations(0), simTime(0.0), pauseTime(0.0), startTime(0.0), @@ -411,13 +410,6 @@ } //////////////////////////////////////////////////////////////////////////////// -/// Get the number of iterations of this simulation session -unsigned long Simulator::GetIterations() const -{ - return this->iterations; -} - -//////////////////////////////////////////////////////////////////////////////// // Get the simulation time double Simulator::GetSimTime() const { @@ -618,33 +610,31 @@ double step = world->GetPhysicsEngine()->GetStepTime(); double physicsUpdateRate = world->GetPhysicsEngine()->GetUpdateRate(); - //double renderUpdateRate = OgreAdaptor::Instance()->GetUpdateRate(); double physicsUpdatePeriod = 1.0 / physicsUpdateRate; - //double renderUpdatePeriod = 1.0 / renderUpdateRate; - + + double diffTime; double currTime; + double lastTime = this->GetRealTime(); + struct timespec req, rem; - this->prevPhysicsTime = this->GetRealTime(); - this->prevRenderTime = this->GetRealTime(); - while (!this->userQuit) { #ifdef TIMING double tmpT1 = this->GetWallTime(); #endif + currTime = this->GetRealTime(); - if (physicsUpdateRate == 0 || - currTime - this->prevPhysicsTime >= physicsUpdatePeriod) + //if (physicsUpdateRate == 0 || + //currTime - lastTime >= physicsUpdatePeriod) { // Update the physics engine //if (!this->GetUserPause() && !this->IsPaused() || - // (this->GetUserPause() && this->GetUserStepInc())) + // (this->GetUserPause() && this->GetUserStepInc())) if (!this->IsPaused()) { this->simTime += step; - this->iterations++; this->SetUserStepInc(!this->GetUserStepInc()); } else @@ -653,13 +643,42 @@ // this->pause=true; } - this->prevPhysicsTime = this->GetRealTime(); + lastTime = this->GetRealTime(); { boost::recursive_mutex::scoped_lock lock(*this->mutex); world->Update(); } - usleep(1); + + currTime = this->GetRealTime(); + + // Set a default sleep time + req.tv_sec = 0; + req.tv_nsec = 10000; + + // If the physicsUpdateRate < 0, then we should try to match the + // update rate to real time + if ( physicsUpdateRate < 0 && + (this->GetSimTime() + this->GetPauseTime()) > + this->GetRealTime()) + { + diffTime = (this->GetSimTime() + this->GetPauseTime()) - + this->GetRealTime(); + req.tv_sec = (int) floor(diffTime); + req.tv_nsec = (int) (fmod(diffTime, 1.0) * 1e9); + } + // Otherwise try to match the update rate to the one specified in + // the xml file + else if (physicsUpdateRate > 0 && + currTime - lastTime < physicsUpdatePeriod) + { + diffTime = physicsUpdatePeriod - (currTime - lastTime); + + req.tv_sec = (int) floor(diffTime); + req.tv_nsec = (int) (fmod(diffTime, 1.0) * 1e9); + } + + nanosleep(&req, &rem); } // Process all incoming messages from simiface @@ -670,9 +689,11 @@ this->userQuit = true; break; } + #ifdef TIMING double tmpT2 = this->GetWallTime(); - std::cout << " Simulator::PhysicsLoop() DT(" << tmpT2-tmpT1 << ")" << std::endl; + std::cout << " Simulator::PhysicsLoop() DT(" << tmpT2-tmpT1 + << ")" << std::endl; #endif } } Modified: code/gazebo/trunk/server/Simulator.hh =================================================================== --- code/gazebo/trunk/server/Simulator.hh 2009-06-02 19:46:15 UTC (rev 7758) +++ code/gazebo/trunk/server/Simulator.hh 2009-06-02 20:35:01 UTC (rev 7759) @@ -97,15 +97,6 @@ /// \brief Set whether the simulation is paused public: void SetPaused(bool p); - /// \brief Get the number of iterations - public: unsigned long GetIterations() const; -/* - /// \brief Set the number of iterations - public: static void SetIterations(unsigned long count); - - /// \brief Increment the number of iterations - public: static void IncIterations(); -*/ /// Get the simulation time /// \return The simulation time public: double GetSimTime() const; @@ -200,12 +191,8 @@ /// Flag set if simulation is paused private: bool pause; - /// Count of the number of iterations - private: unsigned long iterations; - /// Current simulation time private: double simTime, pauseTime, startTime; - private: double prevPhysicsTime, prevRenderTime; //upper limits on updating //how many updates we have done in this slot Modified: code/gazebo/trunk/server/World.cc =================================================================== --- code/gazebo/trunk/server/World.cc 2009-06-02 19:46:15 UTC (rev 7758) +++ code/gazebo/trunk/server/World.cc 2009-06-02 20:35:01 UTC (rev 7759) @@ -431,7 +431,7 @@ this->SetModelPose(model, model->GetInitPose()); // Add the model to our list - if (Simulator::Instance()->GetIterations() == 0) + if (Simulator::Instance()->GetSimTime() == 0) this->models.push_back(model); else { Modified: code/gazebo/trunk/server/physics/PhysicsEngine.cc =================================================================== --- code/gazebo/trunk/server/physics/PhysicsEngine.cc 2009-06-02 19:46:15 UTC (rev 7758) +++ code/gazebo/trunk/server/physics/PhysicsEngine.cc 2009-06-02 20:35:01 UTC (rev 7759) @@ -36,7 +36,7 @@ { Param::Begin(&this->parameters); this->gravityP = new ParamT<Vector3>("gravity",Vector3(0.0, -9.80665, 0.0), 0); - this->updateRateP = new ParamT<double>("maxUpdateRate", 0.0, 0); + this->updateRateP = new ParamT<double>("updateRate", 0.0, 0); this->stepTimeP = new ParamT<double>("stepTime",0.025,0); Param::End(); Modified: code/gazebo/trunk/worlds/pioneer2dx.world =================================================================== --- code/gazebo/trunk/worlds/pioneer2dx.world 2009-06-02 19:46:15 UTC (rev 7758) +++ code/gazebo/trunk/worlds/pioneer2dx.world 2009-06-02 20:35:01 UTC (rev 7759) @@ -23,6 +23,10 @@ <gravity>0 0 -9.8</gravity> <cfm>10e-5</cfm> <erp>0.3</erp> + <!-- updateRate: <0 == throttle simTime to match realTime. + 0 == No throttling + >0 == Frequency at which to throttle the sim --> + <updateRate>-1</updateRate> </physics:ode> <rendering:gui> Modified: code/gazebo/trunk/worlds/simpleshapes.world =================================================================== --- code/gazebo/trunk/worlds/simpleshapes.world 2009-06-02 19:46:15 UTC (rev 7758) +++ code/gazebo/trunk/worlds/simpleshapes.world 2009-06-02 20:35:01 UTC (rev 7759) @@ -19,6 +19,11 @@ <gravity>0 0 -9.8</gravity> <cfm>10e-2</cfm> <erp>0.2</erp> + + <!-- updateRate: <0 == throttle simTime to match realTime. + 0 == No throttling + >0 == Frequency at which to throttle the sim --> + <updateRate>-1</updateRate> </physics:ode> <rendering:gui> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hsu...@us...> - 2009-06-03 00:56:32
|
Revision: 7762 http://playerstage.svn.sourceforge.net/playerstage/?rev=7762&view=rev Author: hsujohnhsu Date: 2009-06-03 00:56:24 +0000 (Wed, 03 Jun 2009) Log Message: ----------- udpate option to perform freeimage pkg-config search first. Modified Paths: -------------- code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/cmake/SearchForStuff.cmake Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2009-06-03 00:12:24 UTC (rev 7761) +++ code/gazebo/trunk/CMakeLists.txt 2009-06-03 00:56:24 UTC (rev 7762) @@ -30,6 +30,7 @@ CACHE INTERNAL "Gazebo controller sources list description" FORCE) SET (OGRE_VERSION 1.6.1 CACHE INTERNAL "Ogre version requirement" FORCE) +SET (FREEIMAGE_VERSION 3.11.0 CACHE INTERNAL "FreeImage version requirement" FORCE) SET (ODE_VERSION 0.10.1 CACHE INTERNAL "ODE version requirement" FORCE) SET (MIN_BOOST_VERSION 1.35.0 CACHE INTERNAL "Boost min version requirement" FORCE) Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake =================================================================== --- code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-06-03 00:12:24 UTC (rev 7761) +++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-06-03 00:56:24 UTC (rev 7762) @@ -62,6 +62,41 @@ ${ODE_LDFLAGS}) ENDIF (NOT ODE_FOUND) + pkg_check_modules(FI freeimage>=${FREEIMAGE_VERSION}) + IF (NOT FI_FOUND) + MESSAGE (STATUS "freeimage.pc not found, trying freeimage_include_dir and freeimage_library_dir flags.") + FIND_PATH(freeimage_include_dir FreeImage.h ${freeimage_include_dir}) + IF (NOT freeimage_include_dir) + MESSAGE (STATUS "Looking for FreeImage.h - not found") + MESSAGE (FATAL_ERROR "Unable to find FreeImage.h") + ELSE (NOT freeimage_include_dir) + MESSAGE (STATUS "Looking for FreeImage.h - found") + ENDIF (NOT freeimage_include_dir) + FIND_LIBRARY(freeimage_library freeimage ${freeimage_library_dir}) + IF (NOT freeimage_library) + MESSAGE (STATUS "Looking for libfreeimage - not found") + MESSAGE (FATAL_ERROR "Unable to find libfreeimage") + ELSE (NOT freeimage_library) + MESSAGE (STATUS "Looking for libfreeimage - found") + ENDIF (NOT freeimage_library) + ELSE (NOT FI_FOUND) + APPEND_TO_CACHED_LIST(gazeboserver_include_dirs + ${gazeboserver_include_dirs_desc} + ${FI_INCLUDE_DIRS}) + APPEND_TO_CACHED_LIST(gazeboserver_link_dirs + ${gazeboserver_link_dirs_desc} + ${FI_LIBRARY_DIRS}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${FI_LINK_LIBS}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${FI_LIBRARIES}) + APPEND_TO_CACHED_LIST(gazeboserver_link_libs + ${gazeboserver_link_libs_desc} + ${FI_LDFLAGS}) + ENDIF (NOT FI_FOUND) + pkg_check_modules(XML libxml-2.0) IF (NOT XML_FOUND) MESSAGE (SEND_ERROR "\nError: libxml2 and development files not found. See the following website: http://www.xmlsoft.org") @@ -232,24 +267,6 @@ MESSAGE (STATUS "Boost Libraries: ${boost_libraries}") ######################################## -# Find freeimage -FIND_PATH(freeimage_include_dir FreeImage.h ${freeimage_include_dir}) -IF (NOT freeimage_include_dir) - MESSAGE (STATUS "Looking for FreeImage.h - not found") - MESSAGE (FATAL_ERROR "Unable to find FreeImage.h") -ELSE (NOT freeimage_include_dir) - MESSAGE (STATUS "Looking for FreeImage.h - found") -ENDIF (NOT freeimage_include_dir) - -FIND_LIBRARY(freeimage_library freeimage ${freeimage_library_dir}) -IF (NOT freeimage_library) - MESSAGE (STATUS "Looking for libfreeimage - not found") - MESSAGE (FATAL_ERROR "Unable to find libfreeimage") -ELSE (NOT freeimage_library) - MESSAGE (STATUS "Looking for libfreeimage - found") -ENDIF (NOT freeimage_library) - -######################################## # Find avformat and avcodec IF (HAVE_FFMPEG) SET (libavformat_search_path This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |