diff --git a/.gitignore b/.gitignore index cbade02..defcfd1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ player-3.0.2.tar.gz +/player-3.1.0.tar.gz diff --git a/player-3.0.1.fixlibload.patch b/player-3.0.1.fixlibload.patch deleted file mode 100644 index 58c1290..0000000 --- a/player-3.0.1.fixlibload.patch +++ /dev/null @@ -1,59 +0,0 @@ -diff -up ./cmake/internal/SetupDirectories.cmake.fixlibload ./cmake/internal/SetupDirectories.cmake ---- ./cmake/internal/SetupDirectories.cmake.fixlibload 2010-01-09 22:59:16.000000000 -0500 -+++ ./cmake/internal/SetupDirectories.cmake 2010-01-09 23:03:17.000000000 -0500 -@@ -19,3 +19,8 @@ ELSE (PLAYER_PROC_64BIT) - MESSAGE (STATUS "Player libraries will be in lib") - ENDIF (PLAYER_PROC_64BIT) - -+IF (PLAYER_OS_WIN) -+ SET(PLAYER_PLUGIN_PATH "${CMAKE_INSTALL_PREFIX}\\lib") -+ELSE(PLAYER_OS_WIN) -+ SET(PLAYER_PLUGIN_PATH "${CMAKE_INSTALL_PREFIX}/${PLAYER_LIBRARY_INSTALL_DIR}/player/") -+ENDIF(PLAYER_OS_WIN) -diff -up ./config.h.in.fixlibload ./config.h.in ---- ./config.h.in.fixlibload 2010-01-09 22:57:28.000000000 -0500 -+++ ./config.h.in 2010-01-09 23:05:03.000000000 -0500 -@@ -2,6 +2,8 @@ - - /* Install prefix */ - #define PLAYER_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" -+#define PLAYER_LIBRARY_DIR "@PLAYER_LIBRARY_INSTALL_DIR@" -+#define PLAYER_PLUGIN_PATH "@PLAYER_PLUGIN_PATH@" - - /* enable TCP_NODELAY */ - #cmakedefine ENABLE_TCP_NODELAY 1 -diff -up ./libplayercore/plugins.cc.fixlibload ./libplayercore/plugins.cc ---- ./libplayercore/plugins.cc.fixlibload 2009-08-10 23:44:43.000000000 -0400 -+++ ./libplayercore/plugins.cc 2010-01-09 23:09:48.000000000 -0500 -@@ -122,13 +122,20 @@ LoadPlugin(const char* pluginname, const - PLAYER_ERROR1( "failed to add config file directory %s to the plugin path", cfgdir ); - free(tmp); - } -+ -+ // add $PLAYER_INSTALL_PREFIX/lib(64)/player/ -+ if( lt_dladdsearchdir( PLAYER_PLUGIN_PATH ) ) -+ PLAYER_ERROR1( "failed to add working directory %s to the plugin path", PLAYER_PLUGIN_PATH ); - -- // add $PLAYER_INSTALL_PREFIX/lib -+ // add $PLAYER_INSTALL_PREFIX/lib(64)/ - char installdir[ PATH_MAX ]; - strncpy( installdir, PLAYER_INSTALL_PREFIX, PATH_MAX); -- strncat( installdir, "/lib/", PATH_MAX); -+ strncat( installdir, "/", PATH_MAX); -+ strncat( installdir, PLAYER_LIBRARY_DIR, PATH_MAX); -+ strncat( installdir, "/", PATH_MAX); - if( lt_dladdsearchdir( installdir ) ) - PLAYER_ERROR1( "failed to add working directory %s to the plugin path", installdir ); -+ - } - - PLAYER_MSG1(3, "loading plugin %s", pluginname); -@@ -144,7 +151,7 @@ LoadPlugin(const char* pluginname, const - - return handle; - #elif defined (WIN32) -- std::vector paths; -+ std::vector paths; - - if(pluginname[0] == '/' || pluginname[0] == '~') - { diff --git a/player-3.0.2-cpp11.patch b/player-3.0.2-cpp11.patch deleted file mode 100644 index f90ddb1..0000000 --- a/player-3.0.2-cpp11.patch +++ /dev/null @@ -1,140 +0,0 @@ -diff -up ./client_libs/libplayerc++/bindings/ruby/playercpp.i.cpp11 ./client_libs/libplayerc++/bindings/ruby/playercpp.i ---- ./client_libs/libplayerc++/bindings/ruby/playercpp.i.cpp11 2017-03-19 18:50:04.074744694 -0400 -+++ ./client_libs/libplayerc++/bindings/ruby/playercpp.i 2017-03-19 18:50:15.532188950 -0400 -@@ -48,7 +48,7 @@ - } - catch (const PlayerCc::PlayerError &e) { - static VALUE playererror = rb_define_class("PlayerError", rb_eStandardError); -- rb_raise(playererror, e.GetErrorStr().c_str()); -+ rb_raise(playererror, "%s", e.GetErrorStr().c_str()); - } - } - -diff -up ./server/drivers/mixed/erratic/erratic.cc.cpp11 ./server/drivers/mixed/erratic/erratic.cc ---- ./server/drivers/mixed/erratic/erratic.cc.cpp11 2009-01-24 18:14:21.000000000 -0500 -+++ ./server/drivers/mixed/erratic/erratic.cc 2017-03-19 18:08:43.213289331 -0400 -@@ -555,8 +555,8 @@ int Erratic::Connect() - accel_packet = new ErraticPacket(); - accel_command[0] = (command_e)set_max_trans_acc; - accel_command[1] = (argtype_e)argnint; -- accel_command[2] = abs(this->motor_max_trans_decel) & 0x00FF; -- accel_command[3] = (abs(this->motor_max_trans_decel) & 0xFF00) >> 8; -+ accel_command[2] = abs((int)this->motor_max_trans_decel) & 0x00FF; -+ accel_command[3] = (abs((int)this->motor_max_trans_decel) & 0xFF00) >> 8; - accel_packet->Build(accel_command, 4); - this->Send(accel_packet); - } else if(this->motor_max_trans_accel != 0) { -@@ -582,8 +582,8 @@ int Erratic::Connect() - accel_packet = new ErraticPacket(); - accel_command[0] = (command_e)set_max_rot_acc; - accel_command[1] = (argtype_e)argnint; -- accel_command[2] = abs(this->motor_max_rot_decel) & 0x00FF; -- accel_command[3] = (abs(this->motor_max_rot_decel) & 0xFF00) >> 8; -+ accel_command[2] = abs((int)this->motor_max_rot_decel) & 0x00FF; -+ accel_command[3] = (abs((int)this->motor_max_rot_decel) & 0xFF00) >> 8; - accel_packet->Build(accel_command, 4); - this->Send(accel_packet); - } else if(this->motor_max_rot_accel != 0) { -diff -up ./server/drivers/mixed/p2os/p2os.cc.cpp11 ./server/drivers/mixed/p2os/p2os.cc ---- ./server/drivers/mixed/p2os/p2os.cc.cpp11 2009-08-07 04:48:58.000000000 -0400 -+++ ./server/drivers/mixed/p2os/p2os.cc 2017-03-19 18:08:43.214289370 -0400 -@@ -1193,8 +1193,8 @@ int P2OS::MainSetup() - { - accel_command[0] = SETA; - accel_command[1] = ARGNINT; -- accel_command[2] = abs(this->motor_max_trans_decel) & 0x00FF; -- accel_command[3] = (abs(this->motor_max_trans_decel) & 0xFF00) >> 8; -+ accel_command[2] = abs((int)this->motor_max_trans_decel) & 0x00FF; -+ accel_command[3] = (abs((int)this->motor_max_trans_decel) & 0xFF00) >> 8; - accel_packet.Build(accel_command, 4); - this->SendReceive(&accel_packet,false); - } -@@ -1211,8 +1211,8 @@ int P2OS::MainSetup() - { - accel_command[0] = SETRA; - accel_command[1] = ARGNINT; -- accel_command[2] = abs(this->motor_max_rot_decel) & 0x00FF; -- accel_command[3] = (abs(this->motor_max_rot_decel) & 0xFF00) >> 8; -+ accel_command[2] = abs((int)this->motor_max_rot_decel) & 0x00FF; -+ accel_command[3] = (abs((int)this->motor_max_rot_decel) & 0xFF00) >> 8; - accel_packet.Build(accel_command, 4); - this->SendReceive(&accel_packet,false); - } -diff -up ./server/drivers/mixed/p2os/robot_params.cc.cpp11 ./server/drivers/mixed/p2os/robot_params.cc ---- ./server/drivers/mixed/p2os/robot_params.cc.cpp11 2010-06-28 00:12:42.000000000 -0400 -+++ ./server/drivers/mixed/p2os/robot_params.cc 2017-03-19 18:08:43.214289370 -0400 -@@ -419,7 +419,7 @@ RobotParams_t amigo_params = - 0, - 0, - 20, -- 0.6154, -+ (int)0.6154, - 0, - { - { 76, 100, 90 }, -@@ -4897,7 +4897,7 @@ RobotParams_t pion1m_params = - 0, - 0, - 4, -- 2.5332, -+ (int)2.5332, - 0, - { - { 100, 100, 90 }, -@@ -5089,7 +5089,7 @@ RobotParams_t pion1x_params = - 0, - 0, - 4, -- 2.5332, -+ (int)2.5332, - 0, - { - { 100, 100, 90 }, -@@ -5281,7 +5281,7 @@ RobotParams_t pionat_params = - 0, - 0, - 4, -- 2.5332, -+ (int)2.5332, - 0, - { - { 100, 100, 90 }, -@@ -5906,7 +5906,7 @@ RobotParams_t psos1m_params = - 0, - 0, - 4, -- 2.5332, -+ (int)2.5332, - 0, - { - { 100, 100, 90 }, -@@ -6098,7 +6098,7 @@ RobotParams_t psos1x_params = - 0, - 0, - 4, -- 2.5332, -+ (int)2.5332, - 0, - { - { 100, 100, 90 }, -@@ -6290,7 +6290,7 @@ RobotParams_t psos43m_params = - 0, - 0, - 4, -- 2.5332, -+ (int)2.5332, - 0, - { - { 100, 100, 90 }, -diff -up ./server/drivers/position/roboteq/roboteq.cc.cpp11 ./server/drivers/position/roboteq/roboteq.cc ---- ./server/drivers/position/roboteq/roboteq.cc.cpp11 2017-03-19 18:36:24.957834025 -0400 -+++ ./server/drivers/position/roboteq/roboteq.cc 2017-03-19 18:36:30.996070068 -0400 -@@ -1263,7 +1263,7 @@ int roboteq::ProcessPosition1dCmd(int mo - } - position_value = (unsigned char) (fabs(position) / rad_per_tick); - PLAYER_MSG1(MESSAGE_DEBUG,"Setting position_value to %d",position_value); -- if (motors_enabled == false || motor_enabled[motor_index] == false) { -+ if (motors_enabled == false || *motor_enabled[motor_index] == false) { - position_value = 0; - PLAYER_MSG0(MESSAGE_INFO, "Warning, the motors are disabled! Enable them before use."); - } diff --git a/player-3.0.2-interfacetable.patch b/player-3.0.2-interfacetable.patch deleted file mode 100644 index d01259b..0000000 --- a/player-3.0.2-interfacetable.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up ./libplayerinterface/CMakeLists.txt.interfacetable ./libplayerinterface/CMakeLists.txt ---- ./libplayerinterface/CMakeLists.txt.interfacetable 2017-03-19 18:23:52.526290942 -0400 -+++ ./libplayerinterface/CMakeLists.txt 2017-03-19 18:24:20.501366791 -0400 -@@ -90,7 +90,8 @@ SET (playerinterfaceSrcs ${playerxdr_h} - functiontable.c - addr_util.c - interface_util.c -- ${functiontable_gen_h}) -+ ${functiontable_gen_h} -+ ${player_interfaces_h}) - - IF (PLAYER_OS_QNX) - SET (interfaceLibFlag -lrpc) diff --git a/player-3.0.2.64bitarchs.patch b/player-3.0.2.64bitarchs.patch deleted file mode 100644 index 8f17596..0000000 --- a/player-3.0.2.64bitarchs.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -up player-3.0.2/cmake/internal/FindOS.cmake.s390x player-3.0.2/cmake/internal/FindOS.cmake ---- player-3.0.2/cmake/internal/FindOS.cmake.s390x 2011-05-04 11:34:18.000000000 +0200 -+++ player-3.0.2/cmake/internal/FindOS.cmake 2011-05-04 11:35:21.000000000 +0200 -@@ -61,6 +61,15 @@ IF (PLAYER_OS_LINUX) - ELSEIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ppc64") - MESSAGE (STATUS "Linux ppc64 Detected") - SET (PLAYER_PROC_64BIT TRUE BOOL INTERNAL) -+ ELSEIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ppc64le") -+ MESSAGE (STATUS "Linux ppc64le Detected") -+ SET (PLAYER_PROC_64BIT TRUE BOOL INTERNAL) -+ ELSEIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") -+ MESSAGE (STATUS "Linux aarch64 Detected") -+ SET (PLAYER_PROC_64BIT TRUE BOOL INTERNAL) -+ ELSEIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "s390x") -+ MESSAGE (STATUS "Linux s390x Detected") -+ SET (PLAYER_PROC_64BIT TRUE BOOL INTERNAL) - ENDIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") - ENDIF (PLAYER_OS_LINUX) - diff --git a/player-3.0.2.boost150.patch b/player-3.0.2.boost150.patch deleted file mode 100644 index b7d7bb7..0000000 --- a/player-3.0.2.boost150.patch +++ /dev/null @@ -1,61 +0,0 @@ -diff -up ./player-3.0.2/client_libs/libplayerc++/CMakeLists.txt.boost150 ./player-3.0.2/client_libs/libplayerc++/CMakeLists.txt ---- ./player-3.0.2/client_libs/libplayerc++/CMakeLists.txt.boost150 2009-08-03 23:48:04.000000000 -0400 -+++ ./player-3.0.2/client_libs/libplayerc++/CMakeLists.txt 2012-08-12 18:42:46.656436126 -0400 -@@ -24,7 +24,7 @@ IF (BUILD_PLAYERCC) - # Look for Boost libraries - IF (BUILD_PLAYERCC_BOOST) - # There is a new, much better, FindBoost.cmake in 2.6 -- IF (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 6) -+ IF (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 5) - OPTION (Boost_USE_STATIC_LIBS "Use the static versions of the Boost libraries" OFF) - MARK_AS_ADVANCED (Boost_USE_STATIC_LIBS) - OPTION (USE_BOOST_THREAD "Use the Boost threading library" ON) -@@ -33,7 +33,7 @@ IF (BUILD_PLAYERCC) - MARK_AS_ADVANCED (USE_BOOST_SIGNALS) - - IF (USE_BOOST_THREAD) -- SET (BOOST_COMPONENTS thread) -+ SET (BOOST_COMPONENTS thread system) - ELSE (USE_BOOST_THREAD) - SET (HAVE_BOOST_THREAD FALSE CACHE INTERNAL "Is the Boost::Thread library present") - ENDIF (USE_BOOST_THREAD) -@@ -61,6 +61,21 @@ IF (BUILD_PLAYERCC) - "Boost::Thread library not found, support will not be included.") - ENDIF (Boost_THREAD_FOUND) - -+ IF (Boost_SYSTEM_FOUND) -+ GET_FILENAME_COMPONENT (boostSystemLib ${Boost_SYSTEM_LIBRARY} NAME_WE CACHE) -+ # Chop off the lib at the front, too, if present -+ STRING (REGEX REPLACE "^lib" "" boostSystemLib ${boostSystemLib}) -+ PLAYERCC_ADD_LINK_LIB (${boostSystemLib}) -+ SET (boostIncludeDir ${Boost_INCLUDE_DIR}) -+ SET (HAVE_BOOST_SYSTEM TRUE CACHE INTERNAL "Is the Boost::System library present") -+ MESSAGE (STATUS -+ "PlayerC++ client library will be built with Boost::System support.") -+ ELSE (Boost_SYSTEM_FOUND) -+ MESSAGE (STATUS -+ "Boost::System library not found, support will not be included.") -+ ENDIF (Boost_SYSTEM_FOUND) -+ -+ - IF (Boost_SIGNALS_FOUND) - GET_FILENAME_COMPONENT (boostSignalsLib ${Boost_SIGNALS_LIBRARY} NAME_WE CACHE) - STRING (REGEX REPLACE "^lib" "" boostSignalsLib ${boostSignalsLib}) -@@ -78,7 +93,7 @@ IF (BUILD_PLAYERCC) - "Boost libraries were not found. Boost::Signals and Boost::Thread support - will not be included in PlayerC++.") - ENDIF (Boost_FOUND) -- ELSE (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 6) -+ ELSE (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 5) - FIND_PACKAGE (Boost) - IF (Boost_FOUND) - # For 2.4, assume that if boost is found then both signals and threads are present -@@ -146,7 +161,7 @@ IF (BUILD_PLAYERCC) - "Boost libraries were not found. Boost::Signals and Boost::Thread support - will not be included in PlayerC++.") - ENDIF (Boost_FOUND) -- ENDIF (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 6) -+ ENDIF (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 5) - ELSE (BUILD_PLAYERCC_BOOST) - MESSAGE (STATUS - "Boost support disabled. Boost::Signals and Boost::Thread support will not be diff --git a/player-3.0.2.boost155.patch b/player-3.0.2.boost155.patch deleted file mode 100644 index 8d9d4cd..0000000 --- a/player-3.0.2.boost155.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -up player-3.0.2/client_libs/libplayerc\+\+/CMakeLists.txt\~ player-3.0.2/client_libs/libplayerc\+\+/CMakeLists.txt ---- player-3.0.2/client_libs/libplayerc++/CMakeLists.txt~ 2014-05-25 15:29:00.407677202 +0200 -+++ player-3.0.2/client_libs/libplayerc++/CMakeLists.txt 2014-05-25 15:31:23.880919221 +0200 -@@ -104,11 +104,7 @@ IF (BUILD_PLAYERCC) - OPTION (Boost_USE_MULTITHREAD "Use the multithreaded versions of the Boost libraries" OFF) - ENDIF (PLAYER_OS_OSX) - MARK_AS_ADVANCED (Boost_USE_MULTITHREAD) -- IF (Boost_USE_MULTITHREAD) -- SET (BOOST_LIB_SUFFIX "-mt" CACHE STRING "Boost library name suffix") -- ELSE (Boost_USE_MULTITHREAD) -- SET (BOOST_LIB_SUFFIX "" CACHE STRING "Boost library name suffix") -- ENDIF (Boost_USE_MULTITHREAD) -+ SET (BOOST_LIB_SUFFIX "" CACHE STRING "Boost library name suffix") - MARK_AS_ADVANCED (BOOST_LIB_SUFFIX) - - IF (HAVE_BOOST_THREAD) - -Diff finished. Sun May 25 15:31:28 2014 diff --git a/player-3.0.2.boostutc.patch b/player-3.0.2.boostutc.patch deleted file mode 100644 index 857a612..0000000 --- a/player-3.0.2.boostutc.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up ./client_libs/libplayerc++/playerclient.cc.boostutc ./client_libs/libplayerc++/playerclient.cc ---- ./client_libs/libplayerc++/playerclient.cc.boostutc 2012-06-30 13:14:02.987701081 -0400 -+++ ./client_libs/libplayerc++/playerclient.cc 2012-06-30 13:14:18.530298979 -0400 -@@ -168,7 +168,7 @@ void PlayerClient::RunThread() - Read(); - }; - boost::xtime xt; -- boost::xtime_get(&xt, boost::TIME_UTC); -+ boost::xtime_get(&xt, TIME_UTC); - // we sleep for 0 seconds - boost::thread::sleep(xt); - } diff --git a/player-3.0.2.enablephidget.patch b/player-3.0.2.enablephidget.patch deleted file mode 100644 index 090fe68..0000000 --- a/player-3.0.2.enablephidget.patch +++ /dev/null @@ -1,274 +0,0 @@ -diff -up ./cmake/internal/SearchForStuff.cmake.enablephidget ./cmake/internal/SearchForStuff.cmake ---- ./cmake/internal/SearchForStuff.cmake.enablephidget 2011-01-08 09:28:15.974551777 -0500 -+++ ./cmake/internal/SearchForStuff.cmake 2011-01-08 09:29:23.678551971 -0500 -@@ -232,3 +232,41 @@ IF (PLAYER_OS_WIN) - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/internal/setdlldirectory.c) - ENDIF (PLAYER_OS_WIN) - -+# Check for libphidget, see if we have 2.1.7 or later -+SET (PHIDGET_INCLUDE_DIR "" CACHE STRING "Directory containing the Phidget headers") -+SET (PHIDGET_LIB_DIR "" CACHE STRING "Directory containing the Phidget libraries") -+MARK_AS_ADVANCED (PHIDGET_INCLUDE_DIR) -+MARK_AS_ADVANCED (PHIDGET_LIB_DIR) -+ -+IF ("${PHIDGET_INCLUDE_DIR}" STREQUAL "") -+ SET (phidgetHeader "phidget21.h") -+ SET (phidgetCFlags "") -+ELSE ("${PHIDGET_INCLUDE_DIR}" STREQUAL "") -+ SET (phidgetHeader "${PHIDGET_INCLUDE_DIR}/phidget21.h") -+ SET (phidgetCFlags "-I${PHIDGET_INCLUDE_DIR}") -+ENDIF ("${PHIDGET_INCLUDE_DIR}" STREQUAL "") -+ -+IF ("${PHIDGET_LIB_DIR}" STREQUAL "") -+ SET (phidgetLinkFlags "-lphidget21") -+ELSE ("${PHIDGET_LIB_DIR}" STREQUAL "") -+ SET (phidgetLinkFlags " -L${PHIDGET_LIB_DIR} -lphidget21") -+ENDIF ("${PHIDGET_LIB_DIR}" STREQUAL "") -+ -+IF (HAVE_DNS_SD) -+ SET (phidgetLinkFlags "${phidgetLinkFlags} -ldns_sd") -+ENDIF(HAVE_DNS_SD) -+ -+CHECK_INCLUDE_FILES(${phidgetHeader} HAVE_PHIDGET_H) -+IF (HAVE_PHIDGET_H) -+ INCLUDE (CheckCSourceCompiles) -+ SET(CMAKE_REQUIRED_FLAGS "${phidgetCFlags} ${phidgetLinkFlags} -lphidget21") -+ SET (CHECK_PHIDGET_SOURCE_CODE "#include \n int main () -+ {CPhidgetInterfaceKitHandle ifk=0; int phidget_num_outputs=0; -+ CPhidgetInterfaceKit_create(&ifk); -+ CPhidgetInterfaceKit_getOutputCount(ifk, &phidget_num_outputs); return 0; }\n") -+ CHECK_C_SOURCE_COMPILES ("${CHECK_PHIDGET_SOURCE_CODE}" HAVE_PHIDGET_2_1_7) -+ENDIF (HAVE_PHIDGET_H) -+ -+IF (HAVE_PHIDGET_H) -+ SET(HAVE_PHIDGET true) -+ENDIF (HAVE_PHIDGET_H) -diff -up ./config.h.in.enablephidget ./config.h.in ---- ./config.h.in.enablephidget 2011-01-08 09:42:02.950551971 -0500 -+++ ./config.h.in 2011-01-08 09:42:43.419551971 -0500 -@@ -15,4 +15,5 @@ - #cmakedefine HAVE_IEEEFP_H 1 - #cmakedefine WORDS_BIGENDIAN 1 - #cmakedefine HAVE_SETDLLDIRECTORY 1 -+#cmakedefine HAVE_PHIDGET_2_1_7 1 - -diff -up ./server/drivers/mixed/phidgetIFK/CMakeLists.txt.enablephidget ./server/drivers/mixed/phidgetIFK/CMakeLists.txt ---- ./server/drivers/mixed/phidgetIFK/CMakeLists.txt.enablephidget 2011-01-08 09:30:18.492552601 -0500 -+++ ./server/drivers/mixed/phidgetIFK/CMakeLists.txt 2011-01-08 09:31:27.874551975 -0500 -@@ -1,16 +1,10 @@ --PLAYERDRIVER_OPTION (phidgetifk build_phidgetifk ON) --SET (PHIDGETIFK_DIR "" CACHE STRING "Directory containing the Phidget IFK headers and libraries") --MARK_AS_ADVANCED (PHIDGETIFK_DIR) --IF ("${PHIDGETIFK_DIR}" STREQUAL "") -- SET (phidgetReqHeader "phidget21.h") -- SET (phidgetExtraFlags "") -- SET (phidgetExtraLibs "-lphidget21") --ELSE ("${PHIDGETIFK_DIR}" STREQUAL "") -- SET (phidgetReqHeader "${PHIDGETIFK_DIR}/phidget21.h") -- SET (phidgetExtraFlags "-I${PHIDGETIFK_DIR}/include") -- SET (phidgetExtraLibs "-L${PHIDGETIFK_DIR}/lib -lphidget21") --ENDIF ("${PHIDGETIFK_DIR}" STREQUAL "") --PLAYERDRIVER_REQUIRE_HEADER (phidgetifk build_phidgetifk ${phidgetReqHeader}) -+# libphidget now discovered in SearchForStuff.cmake -+IF (HAVE_PHIDGET) -+ PLAYERDRIVER_OPTION (phidgetifk build_phidgetifk ON) -+ELSE (HAVE_PHIDGET) -+ PLAYERDRIVER_OPTION (phidgetifk build_phidgetifk OFF "Could not find libphidget") -+ENDIF (HAVE_PHIDGET) -+ - PLAYERDRIVER_ADD_DRIVER (phidgetifk build_phidgetifk -- LINKFLAGS ${phidgetExtraLibs} CFLAGS ${phidgetExtraFlags} -+ LINKFLAGS ${phidgetLinkFlags} CFLAGS ${phidgetCFlags} - SOURCES phidgetIFK.cc) -diff -up ./server/drivers/mixed/phidgetIFK/phidgetIFK.cc.enablephidget ./server/drivers/mixed/phidgetIFK/phidgetIFK.cc ---- ./server/drivers/mixed/phidgetIFK/phidgetIFK.cc.enablephidget 2011-01-08 09:43:14.839551971 -0500 -+++ ./server/drivers/mixed/phidgetIFK/phidgetIFK.cc 2011-01-08 09:44:01.493551971 -0500 -@@ -87,7 +87,6 @@ driver - /** @} */ - - -- - #include - #include - #include -@@ -97,7 +96,7 @@ driver - #include "phidget21.h" - - #include -- -+#include "config.h" - - //For nanosleep: - #include -@@ -326,8 +325,11 @@ int PhidgetIFK::ProcessMessage(QueuePoin - - //the actual ammount of digital outputs of the widget - int phidget_num_outputs(0); -+#ifdef HAVE_PHIDGET_2_1_7 -+ CPhidgetInterfaceKit_getOutputCount(ifk, &phidget_num_outputs); -+#else - CPhidgetInterfaceKit_getNumOutputs(ifk, &phidget_num_outputs); -- -+#endif - if (count > static_cast(max_do)) { - PLAYER_WARN("PhidgetIFK: Received a command with a huge ammount of digital outputs. Check the value of count.\n"); - PLAYER_WARN1("PhidgetIFK: Limiting to the maximum possible value: %d\n",max_do); -@@ -379,10 +381,14 @@ int PhidgetIFK::ProcessMessage(QueuePoin - - //Get the size of the LCD screen - int numcolumns(0); -- CPhidgetTextLCD_getNumColumns(lcd,&numcolumns); - int numrows(0); -+#ifdef HAVE_PHIDGET_2_1_7 -+ CPhidgetTextLCD_getColumnCount(lcd,&numcolumns); -+ CPhidgetTextLCD_getRowCount(lcd,&numrows); -+#else -+ CPhidgetTextLCD_getNumColumns(lcd,&numcolumns); - CPhidgetTextLCD_getNumRows(lcd,&numrows); -- -+#endif - //Copy the text to a string for easier manipulation - string completemessage; - completemessage = const_cast(cmd->string); -@@ -472,8 +478,11 @@ void PhidgetIFK::Main() { - - //Read from the device. - int numsensors(0); -+#ifdef HAVE_PHIDGET_2_1_7 -+ CPhidgetInterfaceKit_getSensorCount(ifk, &numsensors); -+#else - CPhidgetInterfaceKit_getNumSensors(ifk, &numsensors); -- -+#endif - std::vector values; - for (int i = 0 ; i != numsensors ; ++i) { - values.push_back(0.0); -@@ -502,8 +511,11 @@ void PhidgetIFK::Main() { - player_dio_data_t data_di; - //need the digital inputs as a bitfield - int num_di(0); -+#ifdef HAVE_PHIDGET_2_1_7 -+ CPhidgetInterfaceKit_getInputCount(ifk, &num_di); -+#else - CPhidgetInterfaceKit_getNumInputs(ifk, &num_di); -- -+#endif - data_di.count=num_di; - - std::vector divalues; -diff -up ./server/drivers/rfid/CMakeLists.txt.enablephidget ./server/drivers/rfid/CMakeLists.txt ---- ./server/drivers/rfid/CMakeLists.txt.enablephidget 2011-01-08 09:30:27.997551861 -0500 -+++ ./server/drivers/rfid/CMakeLists.txt 2011-01-08 09:31:54.667551970 -0500 -@@ -10,21 +10,15 @@ PLAYERDRIVER_OPTION (skyetekM1 build_sky - PLAYERDRIVER_REJECT_OS (skyetekM1 build_skyetekM1 PLAYER_OS_WIN) - PLAYERDRIVER_ADD_DRIVER (skyetekM1 build_skyetekM1 SOURCES skyetekM1.cc) - --PLAYERDRIVER_OPTION (phidgetRFID build_phidgetRFID ON) --SET (PHIDGETRFID_DIR "" CACHE STRING "Directory containing the Phidget RFID headers and libraries") --MARK_AS_ADVANCED (PHIDGETRFID_DIR) --IF ("${PHIDGETRFID_DIR}" STREQUAL "") -- SET (phidgetReqHeader "phidget21.h") -- SET (phidgetExtraFlags "") -- SET (phidgetExtraLibs "-lphidget21") --ELSE ("${PHIDGETRFID_DIR}" STREQUAL "") -- SET (phidgetReqHeader "${PHIDGETRFID_DIR}/phidget21.h") -- SET (phidgetExtraFlags "-I${PHIDGETRFID_DIR}/include") -- SET (phidgetExtraLibs "-L${PHIDGETRFID_DIR}/lib -lphidget21") --ENDIF ("${PHIDGETRFID_DIR}" STREQUAL "") --PLAYERDRIVER_REQUIRE_HEADER (phidgetRFID build_phidgetRFID ${phidgetReqHeader}) -+# libphidget now discovered in SearchForStuff.cmake -+IF (HAVE_PHIDGET) -+ PLAYERDRIVER_OPTION (phidgetAcc build_phidgetRFID ON) -+ELSE (HAVE_PHIDGET) -+ PLAYERDRIVER_OPTION (phidgetAcc build_phidgetRFID OFF "Could not find libphidget") -+ENDIF (HAVE_PHIDGET) -+ - PLAYERDRIVER_ADD_DRIVER (phidgetRFID build_phidgetRFID -- LINKFLAGS ${phidgetExtraLibs} CFLAGS "${phidgetExtraFlags}" -+ LINKFLAGS ${phidgetLinkFlags} CFLAGS "${phidgetCFlags}" - SOURCES phidgetRFID.cc) - - PLAYERDRIVER_OPTION (acr120u build_acr120u ON) -diff -up ./server/drivers/rfid/phidgetRFID.cc.enablephidget ./server/drivers/rfid/phidgetRFID.cc ---- ./server/drivers/rfid/phidgetRFID.cc.enablephidget 2011-01-08 09:43:32.178551971 -0500 -+++ ./server/drivers/rfid/phidgetRFID.cc 2011-01-08 09:44:33.501551971 -0500 -@@ -83,9 +83,9 @@ driver - /** @} */ - - -- - #include "phidget21.h" - #include -+#include "config.h" - - #include - #include -@@ -261,7 +261,11 @@ int Phidgetrfid::ProcessMessage(QueuePoi - - //the actual ammount of digital outputs of the widget - int phidget_num_outputs(0); -+#ifdef HAVE_PHIDGET_2_1_7 -+ CPhidgetRFID_getOutputCount(rfid, &phidget_num_outputs); -+#else - CPhidgetRFID_getNumOutputs(rfid, &phidget_num_outputs); -+#endif - printf("Num of outputs: %d\n", phidget_num_outputs); - - if (count > static_cast(max_do)) { -diff -up ./server/drivers/wsn/CMakeLists.txt.enablephidget ./server/drivers/wsn/CMakeLists.txt ---- ./server/drivers/wsn/CMakeLists.txt.enablephidget 2011-01-08 09:30:38.161552089 -0500 -+++ ./server/drivers/wsn/CMakeLists.txt 2011-01-08 09:32:14.870551971 -0500 -@@ -21,19 +21,12 @@ ELSE (HAVE_STL) - ENDIF (HAVE_STL) - PLAYERDRIVER_ADD_DRIVER (accel_calib build_accel_calib SOURCES accel_calib.cc) - --PLAYERDRIVER_OPTION (phidgetAcc build_phidgetAcc ON) --SET (PHIDGETACC_DIR "" CACHE STRING "Directory containing the Phidget Acc headers and libraries") --MARK_AS_ADVANCED (PHIDGETACC_DIR) --IF ("${PHIDGETACC_DIR}" STREQUAL "") -- SET (phidgetReqHeader "phidget21.h") -- SET (phidgetExtraFlags "") -- SET (phidgetExtraLibs "-lphidget21") --ELSE ("${PHIDGETACC_DIR}" STREQUAL "") -- SET (phidgetReqHeader "${PHIDGETACC_DIR}/phidget21.h") -- SET (phidgetExtraFlags "-I${PHIDGETACC_DIR}/include") -- SET (phidgetExtraLibs "-L${PHIDGETACC_DIR}/lib -lphidget21") --ENDIF ("${PHIDGETACC_DIR}" STREQUAL "") --PLAYERDRIVER_REQUIRE_HEADER (phidgetAcc build_phidgetAcc ${phidgetReqHeader}) -+# libphidget now discovered in SearchForStuff.cmake -+IF (HAVE_PHIDGET) -+ PLAYERDRIVER_OPTION (phidgetAcc build_phidgetAcc ON) -+ELSE (HAVE_PHIDGET) -+ PLAYERDRIVER_OPTION (phidgetAcc build_phidgetAcc OFF "Could not find libphidget") -+ENDIF (HAVE_PHIDGET) - PLAYERDRIVER_ADD_DRIVER (phidgetAcc build_phidgetAcc -- LINKFLAGS ${phidgetExtraLibs} CFLAGS ${phidgetExtraFlags} -+ LINKFLAGS ${phidgetLinkFlags} CFLAGS ${phidgetCFlags} - SOURCES phidgetAcc.cc) -diff -up ./server/drivers/wsn/phidgetAcc.cc.enablephidget ./server/drivers/wsn/phidgetAcc.cc ---- ./server/drivers/wsn/phidgetAcc.cc.enablephidget 2011-01-08 09:43:25.513551970 -0500 -+++ ./server/drivers/wsn/phidgetAcc.cc 2011-01-08 09:44:16.546551971 -0500 -@@ -79,10 +79,9 @@ driver - */ - /** @} */ - -- -- - #include "phidget21.h" - #include -+#include "config.h" - - #include - #include -@@ -273,7 +272,11 @@ void PhidgetAcc::Main() { - data.data_packet.temperature = -1; - data.data_packet.battery = -1; - int n_axis; -+#ifdef HAVE_PHIDGET_2_1_7 -+ if(CPhidgetAccelerometer_getAxisCount(accel,&n_axis)) return; -+#else - if(CPhidgetAccelerometer_getNumAxis(accel,&n_axis)) return; -+#endif - double *p_accel; - p_accel= new double[n_axis]; - for (int i=0;iimage_count; - playerc_camera_decompress(g_camera); -- usize = g_camera->image_count; -+ usize = g_camera->image_count; -+ - - g_print("camera: [w %d h %d d %d] [%d/%d bytes]\n", - g_camera->width, g_camera->height, g_camera->bpp, csize, usize); - - g_width = g_camera->width; - g_height = g_camera->height; -- if (allocated_size != usize) -+ -+ int buffsize = g_camera->width * g_camera->height * 3; -+ if (allocated_size != buffsize) - { -- g_img = realloc(g_img, usize); -- allocated_size = usize; -+ g_img = realloc(g_img, buffsize); -+ allocated_size = buffsize; - } - } - else // try the blobfinder -@@ -467,7 +470,7 @@ player_update() - { - // Decompress the image if necessary - playerc_camera_decompress(g_camera); -- assert(allocated_size > g_camera->image_count*3); -+ assert(allocated_size >= g_camera->image_count); - // figure out the colorspace - switch (g_camera->format) - { -@@ -485,11 +488,11 @@ player_update() - { - int j = 0; - // Transform to MONO8 -- for (i = 0; i < g_camera->image_count; i++, j+=2) -+ for (i = 0; i < g_camera->image_count/2; i++, j+=2) - { -- g_img[i*3+1] = g_img[i*3+2] = g_img[i*3+3] = -- ((unsigned char)(g_camera->image[j]) << 8) + -- (unsigned char)(g_camera->image[j+1]); -+ g_img[i*3] = g_img[i*3+1] = g_img[i*3+2] = -+ ((unsigned char)(g_camera->image[j]));// << 8) + -+// (unsigned char)(g_camera->image[j+1]); - } - break; - } diff --git a/player-3.0.2.fixunicapimage.patch b/player-3.0.2.fixunicapimage.patch deleted file mode 100644 index 885965f..0000000 --- a/player-3.0.2.fixunicapimage.patch +++ /dev/null @@ -1,58 +0,0 @@ -Index: server/drivers/camera/unicap/unicapImage.cc -=================================================================== ---- server/drivers/camera/unicap/unicapImage.cc (revision 8808) -+++ server/drivers/camera/unicap/unicapImage.cc (working copy) -@@ -92,7 +92,7 @@ - - //////////////////////////////////////////////////////////////////////////////// - // The UniCap_Image device class. --class UniCap_Image : public Driver -+class UniCap_Image : public ThreadedDriver - { - public: - // Constructor -@@ -145,7 +145,7 @@ - // Constructor. Retrieve options from the configuration file and do any - // pre-Setup() setup. - UniCap_Image::UniCap_Image (ConfigFile* cf, int section) -- : Driver (cf, section) -+ : ThreadedDriver (cf, section) - { - memset (&this->cam_id, 0, sizeof (player_devaddr_t)); - -@@ -247,8 +247,6 @@ - buffer.data = (unsigned char*)(malloc (format.size.width * format.size.height * format.bpp / 8)); - buffer.buffer_size = format.size.width * format.size.height * format.bpp / 8; - -- // Start the device thread -- StartThread (); - - return (0); - } -@@ -257,8 +255,6 @@ - // Shutdown the device - int UniCap_Image::Shutdown () - { -- // Stop the driver thread -- StopThread (); - - // Stop the device - if ( !SUCCESS (unicap_stop_capture (handle) ) ) -Index: server/drivers/camera/unicap/CMakeLists.txt -=================================================================== ---- server/drivers/camera/unicap/CMakeLists.txt (revision 8808) -+++ server/drivers/camera/unicap/CMakeLists.txt (working copy) -@@ -7,11 +7,11 @@ - SET (unicapExtraFlags "") - SET (unicapExtraLibs "-lunicap -lrt") - ELSE ("${UNICAP_DIR}" STREQUAL "") -- SET (unicapReqHeader "${UNICAP_DIR}/include/unicap/unicap.h") -+ SET (unicapReqHeader "${UNICAP_DIR}/include/unicap/unicap.h;${UNICAP_DIR}/include/unicap/unicap_status.h;${UNICAP_DIR}/include/unicap/unicap_version.h") - SET (unicapExtraFlags "-I${UNICAP_DIR}/include/unicap") - SET (unicapExtraLibs "-L${UNICAP_DIR}/lib -lcanlib -lrt") - ENDIF ("${UNICAP_DIR}" STREQUAL "") -- -+SET (CMAKE_REQUIRED_FLAGS ${unicapExtraFlags}) - PLAYERDRIVER_REQUIRE_HEADER (unicapimage build_unicapimage ${unicapReqHeader}) - - PLAYERDRIVER_ADD_DRIVER (unicapimage build_unicapimage diff --git a/player-3.0.2.gbx10.patch b/player-3.0.2.gbx10.patch deleted file mode 100644 index 10fd65e..0000000 --- a/player-3.0.2.gbx10.patch +++ /dev/null @@ -1,1330 +0,0 @@ -diff -up ./player-3.0.2/server/drivers/gps/gbxgarminacfr.cc.gbx10 ./player-3.0.2/server/drivers/gps/gbxgarminacfr.cc ---- ./player-3.0.2/server/drivers/gps/gbxgarminacfr.cc.gbx10 2010-06-28 00:12:42.000000000 -0400 -+++ ./player-3.0.2/server/drivers/gps/gbxgarminacfr.cc 2012-08-12 18:52:11.860249699 -0400 -@@ -44,7 +44,8 @@ should include most GPS devices that use - - @par Provides - --- @ref interface_gps: Output GPS interface -+- @ref interface_gps -+ - Output GPS interface - - @par Supported configuration requests - -@@ -152,10 +153,11 @@ GbxGarminAcfr::~GbxGarminAcfr (void) - int GbxGarminAcfr::MainSetup (void) - { - // Validate the configuration -- //std::string reason; -- if (!_config.isValid ()) -+ std::string reason; -+ if (!_config.isValid (reason)) - { -- PLAYER_ERROR("GbxGarminAcfr: Invalid sensor configuration.\n");//, reason.c_str()); -+ //PLAYER_ERROR1("GbxGarminAcfr: Invalid sensor configuration: %s.\n", reason.c_str()); -+ PLAYER_ERROR("GbxGarminAcfr: Invalid sensor configuration.\n"); - return -1; - } - -@@ -186,8 +188,6 @@ void GbxGarminAcfr::MainQuit (void) - - int GbxGarminAcfr::ProcessMessage (QueuePointer &resp_queue, player_msghdr *hdr, void *data) - { -- // Check for capability requests -- HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, PLAYER_MSGTYPE_REQ, PLAYER_CAPABILTIES_REQ); - return -1; - } - -diff -up ./player-3.0.2/server/drivers/opaque/CMakeLists.txt.gbx10 ./player-3.0.2/server/drivers/opaque/CMakeLists.txt ---- ./player-3.0.2/server/drivers/opaque/CMakeLists.txt.gbx10 2010-06-28 00:12:42.000000000 -0400 -+++ ./player-3.0.2/server/drivers/opaque/CMakeLists.txt 2012-08-12 18:52:11.860249699 -0400 -@@ -1,6 +1,6 @@ - PLAYERDRIVER_OPTION (flexiport build_flexiport ON) - PLAYERDRIVER_REQUIRE_PKG (flexiport build_flexiport flexiport flexiport_includeDirs -- flexiport_libDirs flexiport_linkLibs flexiport_linkFlags flexiport_cFlags =1.0.0) -+ flexiport_libDirs flexiport_linkLibs flexiport_linkFlags flexiport_cFlags >=1.0.0) - PLAYERDRIVER_ADD_DRIVER (flexiport build_flexiport - INCLUDEDIRS ${flexiport_includeDirs} LIBDIRS ${flexiport_libDirs} - LINKLIBS ${flexiport_linkLibs} LINKFLAGS ${flexiport_linkFlags} CFLAGS ${flexiport_cFlags} -diff -up ./player-3.0.2/server/drivers/opaque/flexiport.cc.gbx10 ./player-3.0.2/server/drivers/opaque/flexiport.cc ---- ./player-3.0.2/server/drivers/opaque/flexiport.cc.gbx10 2009-01-24 18:14:21.000000000 -0500 -+++ ./player-3.0.2/server/drivers/opaque/flexiport.cc 2012-08-12 18:52:11.860249699 -0400 -@@ -88,7 +88,7 @@ driver - #include - #include - #include -- -+#include "unistd.h" - const int DEFAULT_OPAQUE_BUFFER_SIZE = 4096; - - //////////////////////////////////////////////////////////////////////////////////////////////////// -diff -up ./player-3.0.2/server/drivers/ranger/CMakeLists.txt.gbx10 ./player-3.0.2/server/drivers/ranger/CMakeLists.txt ---- ./player-3.0.2/server/drivers/ranger/CMakeLists.txt.gbx10 2009-12-15 19:51:26.000000000 -0500 -+++ ./player-3.0.2/server/drivers/ranger/CMakeLists.txt 2012-08-12 18:52:11.860249699 -0400 -@@ -7,14 +7,14 @@ PLAYERDRIVER_ADD_DRIVER (gbxsickacfr bui - LINKLIBS ${gbxsickacfr_linkLibs} LINKFLAGS ${gbxsickacfr_linkFlags} - CFLAGS ${gbxsickacfr_cFlags} SOURCES gbxsickacfr.cc) - --PLAYERDRIVER_OPTION (hokuyo_aist build_hokuyo_aist ON) --PLAYERDRIVER_REQUIRE_PKG (hokuyo_aist build_hokuyo_aist hokuyo_aist -- hokuyo_aist_includeDirs hokuyo_aist_libDirs hokuyo_aist_linkLibs -- hokuyo_aist_linkFlags hokuyo_aist_cFlags =1.0.0) --PLAYERDRIVER_ADD_DRIVER (hokuyo_aist build_hokuyo_aist -- INCLUDEDIRS ${hokuyo_aist_includeDirs} LIBDIRS ${hokuyo_aist_libDirs} -- LINKLIBS ${hokuyo_aist_linkLibs} LINKFLAGS ${hokuyo_aist_linkFlags} -- CFLAGS ${hokuyo_aist_cFlags} SOURCES hokuyo_aist.cc) -+PLAYERDRIVER_OPTION (hokuyoaist build_hokuyoaist ON) -+PLAYERDRIVER_REQUIRE_PKG (hokuyoaist build_hokuyoaist hokuyoaist -+ hokuyoaist_includeDirs hokuyoaist_libDirs hokuyoaist_linkLibs -+ hokuyoaist_linkFlags hokuyoaist_cFlags >=3.0.0) -+PLAYERDRIVER_ADD_DRIVER (hokuyoaist build_hokuyoaist -+ INCLUDEDIRS ${hokuyoaist_includeDirs} LIBDIRS ${hokuyoaist_libDirs} -+ LINKLIBS ${hokuyoaist_linkLibs} LINKFLAGS ${hokuyoaist_linkFlags} -+ CFLAGS ${hokuyoaist_cFlags} SOURCES hokuyo_aist.cc) - - PLAYERDRIVER_OPTION (lasertoranger build_lasertoranger ON) - PLAYERDRIVER_ADD_DRIVER (lasertoranger build_lasertoranger SOURCES toranger.cc lasertoranger.cc) -diff -up ./player-3.0.2/server/drivers/ranger/hokuyo_aist.cc.gbx10 ./player-3.0.2/server/drivers/ranger/hokuyo_aist.cc ---- ./player-3.0.2/server/drivers/ranger/hokuyo_aist.cc.gbx10 2009-09-06 22:04:21.000000000 -0400 -+++ ./player-3.0.2/server/drivers/ranger/hokuyo_aist.cc 2012-08-12 18:59:12.308477434 -0400 -@@ -17,25 +17,25 @@ - */ - - /* -- Desc: Wrapper driver around the Gearbox hokuyo_aist library (see http://gearbox.sourceforge.net) -+ Desc: Wrapper driver around the HokuyoAIST library (see https://github.com/gbiggs/hokuyoaist) - Author: Geoffrey Biggs - Date: 20 June 2008 -- CVS: $Id: hokuyo_aist.cc 8243 2009-09-07 02:04:21Z gbiggs $ -+ CVS: $Id: hokuyo_aist.cc 9071 2011-08-11 01:31:19Z gbiggs $ - */ - - /** @ingroup drivers */ - /** @{ */ --/** @defgroup driver_hokuyo_aist hokuyo_aist -- * @brief Gearbox hokuyo_aist Hokuyo laser scanner driver library -+/** @defgroup driver_hokuyoaist hokuyoaist -+ * @brief HokuyoAIST Hokuyo laser scanner driver library - -- This driver provides a @ref interface_ranger interface to the hokuyo_aist Hokuyo laser scanner -- driver provided by Gearbox. Communication with the laser is via the Gearbox Flexiport library. The -+ This driver provides a @ref interface_ranger interface to the HokuyoAIST Hokuyo laser scanner -+ driver. Communication with the laser is via the Flexiport library. The - driver supports the SCIP protocol versions 1 and 2. - - @par Compile-time dependencies - -- - Gearbox library hokuyo_aist -- - Gearbox library flexiport -+ - HokuyoAIST 3.0 -+ - Flexiport 2.0 - - @par Provides - -@@ -75,6 +75,10 @@ - - max_angle (float, radians) - - Default: 4.0 rad (Will use laser default) - - Maximum scan angle to return. Will be adjusted if outside the laser's scannable range. -+ - invert (boolean) -+ - Default: false -+ - If true, the reading will be inverted (i.e. read backwards). Useful if the laser scanner is -+ mounted upside down. - - power (boolean) - - Default: true - - If true, the sensor power will be switched on upon driver activation (i.e. when the first -@@ -91,12 +95,12 @@ - - - baud_rate (integer) - - Default: 19200bps -- - Change the baud rate of the connection to the laser. See hokuyo_aist documentation for valid -+ - Change the baud rate of the connection to the laser. See HokuyoAIST documentation for valid - values. This is separate from the scanner's power-on default baud rate, which should be - specified in portopts. - - speed_level (integer, 0 to 10 or 99) - - Default: 0 -- - The speed at which the laser operates, as a level down from maximum speed. See the hokuyo_aist -+ - The speed at which the laser operates, as a level down from maximum speed. See the HokuyoAIST - library documentation for suitable values. - - high_sensitivity (integer) - - Default: 0 -@@ -108,14 +112,14 @@ - - hw_timestamps (boolean) - - Default: false - - When false, the server will use server time stamps in data messages. When true, the time stamp -- in the laser data will be used. -+ in the laser data will be used, offset to the current system time. - - @par Example - - @verbatim - driver - ( -- name "hokuyo_aist" -+ name "hokuyoaist" - provides ["ranger:0"] - portopts "type=serial,device=/dev/ttyS0,timeout=1" - ) -@@ -128,7 +132,7 @@ - - #include - --#include -+#include - #include - - const int DEFAULT_BAUDRATE = 19200; -@@ -144,559 +148,646 @@ const bool DEFAULT_TIMESTAMPS = false; - - class HokuyoDriver : public ThreadedDriver - { -- public: -- HokuyoDriver (ConfigFile* cf, int section); -- ~HokuyoDriver (void); -- -- virtual int MainSetup (void); -- virtual void MainQuit (void); -- virtual int ProcessMessage (QueuePointer &resp_queue, player_msghdr *hdr, void *data); -- -- private: -- virtual void Main (void); -- bool ReadLaser (void); -- bool AllocateDataSpace (void); -- -- // Configuration parameters -- bool _verbose, _powerOnStartup, _getIntensities, _ignoreUnknowns; -- double _minAngle, _maxAngle; -- IntProperty _baudRate, _speedLevel, _highSensitivity; -- DoubleProperty _minDist; -- BoolProperty _hwTimeStamps; -- std::string _portOpts; -- // Geometry -- player_ranger_geom_t _geom; -- player_pose3d_t _sensorPose; -- player_bbox3d_t _sensorSize; -- // The hardware device itself -- hokuyo_aist::HokuyoLaser _device; -- // Data storage -- hokuyo_aist::HokuyoData _data; -- double *_ranges; -- double *_intensities; -- int _numRanges; -+ public: -+ HokuyoDriver(ConfigFile* cf, int section); -+ ~HokuyoDriver(void); -+ -+ virtual int MainSetup(void); -+ virtual void MainQuit(void); -+ virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr -+ *hdr, void *data); -+ -+ private: -+ virtual void Main(void); -+ bool ReadLaser(void); -+ bool AllocateDataSpace(void); -+ -+ // Configuration parameters -+ bool verbose_, invert_, powerOnStartup_, getIntensities_, -+ ignoreUnknowns_; -+ double minAngle_, maxAngle_; -+ IntProperty baudRate_, speedLevel_, highSensitivity_; -+ DoubleProperty minDist_; -+ BoolProperty hwTimeStamps_; -+ std::string portOpts_; -+ // Geometry -+ player_ranger_geom_t geom_; -+ player_pose3d_t sensorPose_; -+ player_bbox3d_t sensorSize_; -+ // The hardware device itself -+ hokuyoaist::Sensor device_; -+ // Data storage -+ hokuyoaist::ScanData data_; -+ double *_ranges; -+ double *_intensities; -+ int _numRanges; - }; - - //////////////////////////////////////////////////////////////////////////////////////////////////// - // Constructor/destructor - //////////////////////////////////////////////////////////////////////////////////////////////////// - --HokuyoDriver::HokuyoDriver (ConfigFile* cf, int section) : -- ThreadedDriver (cf, section, false, PLAYER_MSGQUEUE_DEFAULT_MAXLEN, PLAYER_RANGER_CODE), -- _baudRate ("baud_rate", DEFAULT_BAUDRATE, false), -- _speedLevel ("speed_level", DEFAULT_SPEED_LEVEL, false), -- _highSensitivity ("high_sensitivity", DEFAULT_SENSITIVITY, false), -- _minDist ("min_dist", DEFAULT_MIN_DIST, false), -- _hwTimeStamps ("hw_timestamps", DEFAULT_TIMESTAMPS, false), -- _ranges (NULL), _intensities (NULL) --{ -- // Get the baudrate, speed and sensitivity -- RegisterProperty ("baud_rate", &_baudRate, cf, section); -- RegisterProperty ("speed_level", &_speedLevel, cf, section); -- RegisterProperty ("high_sensitivity", &_highSensitivity, cf, section); -- RegisterProperty ("min_dist", &_minDist, cf, section); -- RegisterProperty ("hw_timestamps", &_hwTimeStamps, cf, section); -- -- // Get config -- _getIntensities = cf->ReadBool (section, "get_intensities", false); -- _minAngle = cf->ReadFloat (section, "min_angle", -4.0); -- _maxAngle = cf->ReadFloat (section, "max_angle", 4.0); -- _portOpts = cf->ReadString (section, "portopts", "type=serial,device=/dev/ttyACM0,timeout=1"); -- _verbose = cf->ReadBool (section, "verbose", false); -- _ignoreUnknowns = cf->ReadBool (section, "ignoreunknowns", false); -- _powerOnStartup = cf->ReadBool (section, "power", true); -- -- // Set up geometry information -- _geom.pose.px = cf->ReadTupleLength (section, "pose", 0, 0.0); -- _geom.pose.py = cf->ReadTupleLength (section, "pose", 1, 0.0); -- _geom.pose.pz = cf->ReadTupleLength (section, "pose", 2, 0.0); -- _geom.pose.proll = cf->ReadTupleAngle (section, "pose", 3, 0.0); -- _geom.pose.ppitch = cf->ReadTupleAngle (section, "pose", 4, 0.0); -- _geom.pose.pyaw = cf->ReadTupleAngle (section, "pose", 5, 0.0); -- _geom.size.sw = cf->ReadTupleLength (section, "size", 0, 0.0); -- _geom.size.sl = cf->ReadTupleLength (section, "size", 1, 0.0); -- _geom.size.sh = cf->ReadTupleLength (section, "size", 2, 0.0); -- _geom.element_poses_count = 1; -- _geom.element_poses = &_sensorPose; -- memcpy(_geom.element_poses, &_geom.pose, sizeof (_geom.pose)); -- _geom.element_sizes_count = 1; -- _geom.element_sizes = &_sensorSize; -- memcpy(_geom.element_sizes, &_geom.size, sizeof (_geom.size)); -+HokuyoDriver::HokuyoDriver(ConfigFile* cf, int section) : -+ ThreadedDriver(cf, section, false, PLAYER_MSGQUEUE_DEFAULT_MAXLEN, -+ PLAYER_RANGER_CODE), -+ baudRate_("baud_rate", DEFAULT_BAUDRATE, false), -+ speedLevel_("speed_level", DEFAULT_SPEED_LEVEL, false), -+ highSensitivity_("high_sensitivity", DEFAULT_SENSITIVITY, false), -+ minDist_("min_dist", DEFAULT_MIN_DIST, false), -+ hwTimeStamps_("hw_timestamps", DEFAULT_TIMESTAMPS, false), -+ _ranges(NULL), _intensities(NULL) -+{ -+ // Get the baudrate, speed and sensitivity -+ RegisterProperty("baud_rate", &baudRate_, cf, section); -+ RegisterProperty("speed_level", &speedLevel_, cf, section); -+ RegisterProperty("high_sensitivity", &highSensitivity_, cf, section); -+ RegisterProperty("min_dist", &minDist_, cf, section); -+ RegisterProperty("hw_timestamps", &hwTimeStamps_, cf, section); -+ -+ // Get config -+ getIntensities_ = cf->ReadBool(section, "get_intensities", false); -+ minAngle_ = cf->ReadFloat(section, "min_angle", -4.0); -+ maxAngle_ = cf->ReadFloat(section, "max_angle", 4.0); -+ invert_ = cf->ReadBool(section, "invert", false); -+ portOpts_ = cf->ReadString(section, "portopts", -+ "type=serial,device=/dev/ttyACM0,timeout=1"); -+ verbose_ = cf->ReadBool(section, "verbose", false); -+ ignoreUnknowns_ = cf->ReadBool(section, "ignoreunknowns", false); -+ powerOnStartup_ = cf->ReadBool(section, "power", true); -+ -+ // Set up geometry information -+ geom_.pose.px = cf->ReadTupleLength(section, "pose", 0, 0.0); -+ geom_.pose.py = cf->ReadTupleLength(section, "pose", 1, 0.0); -+ geom_.pose.pz = cf->ReadTupleLength(section, "pose", 2, 0.0); -+ geom_.pose.proll = cf->ReadTupleAngle(section, "pose", 3, 0.0); -+ geom_.pose.ppitch = cf->ReadTupleAngle(section, "pose", 4, 0.0); -+ geom_.pose.pyaw = cf->ReadTupleAngle(section, "pose", 5, 0.0); -+ geom_.size.sw = cf->ReadTupleLength(section, "size", 0, 0.0); -+ geom_.size.sl = cf->ReadTupleLength(section, "size", 1, 0.0); -+ geom_.size.sh = cf->ReadTupleLength(section, "size", 2, 0.0); -+ geom_.element_poses_count = 1; -+ geom_.element_poses = &sensorPose_; -+ memcpy(geom_.element_poses, &geom_.pose, sizeof(geom_.pose)); -+ geom_.element_sizes_count = 1; -+ geom_.element_sizes = &sensorSize_; -+ memcpy(geom_.element_sizes, &geom_.size, sizeof(geom_.size)); - -- // Turn on/off verbose mode -- _device.SetVerbose (_verbose); -+ // Turn on/off verbose mode -+ device_.set_verbose(verbose_); - } - --HokuyoDriver::~HokuyoDriver (void) -+HokuyoDriver::~HokuyoDriver(void) - { -- if (_ranges != NULL) -- delete[] _ranges; -- if (_intensities != NULL) -- delete[] _intensities; -+ if (_ranges != NULL) -+ delete[] _ranges; -+ if (_intensities != NULL) -+ delete[] _intensities; - } - - //////////////////////////////////////////////////////////////////////////////////////////////////// - // Driver implementation - //////////////////////////////////////////////////////////////////////////////////////////////////// - --bool HokuyoDriver::AllocateDataSpace (void) -+bool HokuyoDriver::AllocateDataSpace(void) - { -- if (_ranges != NULL) -- delete _ranges; -+ if (_ranges != NULL) -+ delete _ranges; - -- _numRanges = _device.AngleToStep (_maxAngle) - _device.AngleToStep (_minAngle) + 1; -- if ((_ranges = new double[_numRanges]) == NULL) -- { -- PLAYER_ERROR1 ("hokuyo_aist: Failed to allocate space for %d range readings.", _numRanges); -- return false; -- } -+ _numRanges = device_.angle_to_step(maxAngle_) - -+ device_.angle_to_step(minAngle_) + 1; -+ if ((_ranges = new double[_numRanges]) == NULL) -+ { -+ PLAYER_ERROR1("HokuyoAIST: Failed to allocate space for %d range readings.", -+ _numRanges); -+ return false; -+ } -+ -+ if (getIntensities_) -+ { -+ if ((_intensities = new double[_numRanges]) == NULL) -+ { -+ PLAYER_ERROR1("HokuyoAIST: Failed to allocate space for %d intensity readings.", -+ _numRanges); -+ return false; -+ } -+ } - -- if (_getIntensities) -- { -- if ((_intensities = new double[_numRanges]) == NULL) -- { -- PLAYER_ERROR1 ("hokuyo_aist: Failed to allocate space for %d intensity readings.", -- _numRanges); -- return false; -- } -- } -- -- return true; -+ return true; - } - --void HokuyoDriver::Main (void) -+void HokuyoDriver::Main(void) - { -- while (true) -- { -- ProcessMessages (); -- -- if (!ReadLaser ()) -- break; -- } -+ while (true) -+ { -+ ProcessMessages(); -+ -+ if (!ReadLaser()) -+ break; -+ } - } - --int HokuyoDriver::ProcessMessage (QueuePointer &resp_queue, player_msghdr *hdr, void *data) -+int HokuyoDriver::ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, -+ void *data) - { -- // Check for capability requests -- HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, -- PLAYER_MSGTYPE_REQ, PLAYER_CAPABILTIES_REQ); -- HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, -- PLAYER_MSGTYPE_REQ, PLAYER_RANGER_REQ_GET_GEOM); -- HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, -- PLAYER_MSGTYPE_REQ, PLAYER_RANGER_REQ_GET_CONFIG); -- HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, -- PLAYER_MSGTYPE_REQ, PLAYER_RANGER_REQ_SET_CONFIG); -- HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, -- PLAYER_MSGTYPE_REQ, PLAYER_RANGER_REQ_POWER); -- HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, -- PLAYER_MSGTYPE_REQ, PLAYER_RANGER_REQ_INTNS); -- -- // Property handlers that need to be done manually due to calling into the hokuyo_aist library. -- if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, PLAYER_SET_INTPROP_REQ, this->device_addr)) -- { -- player_intprop_req_t *req = reinterpret_cast (data); -- // Change in the baud rate -- if (strncmp (req->key, "baud_rate", 9) == 0) -- { -- try -- { -- // Change the baud rate -- _device.SetBaud (req->value); -- } -- catch (hokuyo_aist::HokuyoError &e) -- { --#if defined (WIN32) -- if (e.Code () != HOKUYO_ERR_NOTSERIAL) --#else -- if (e.Code () != hokuyo_aist::HOKUYO_ERR_NOTSERIAL) --#endif -- { -- PLAYER_ERROR2 ("hokuyo_aist: Error while changing baud rate: (%d) %s", -- e.Code (), e.what ()); -- SetError (e.Code ()); -- } -- else -- { -- PLAYER_WARN ( -- "hokuyo_aist: Cannot change the baud rate of a non-serial connection."); -- } -- -- Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_NACK, PLAYER_SET_INTPROP_REQ, -- NULL, 0, NULL); -- return 0; -- } -- _baudRate.SetValueFromMessage (data); -- Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, PLAYER_SET_INTPROP_REQ, NULL, -- 0, NULL); -- return 0; -- } -- else if (strncmp (req->key, "speed_level", 11) == 0) -- { -- try -- { -- _device.SetMotorSpeed (req->value); -- } -- catch (hokuyo_aist::HokuyoError &e) -- { -- PLAYER_ERROR2 ("hokuyo_aist: Error while changing motor speed: (%d) %s", -- e.Code (), e.what ()); -- SetError (e.Code ()); -- Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_NACK, PLAYER_SET_INTPROP_REQ, -- NULL, 0, NULL); -- return 0; -- } -- _speedLevel.SetValueFromMessage (data); -- Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, PLAYER_SET_INTPROP_REQ, NULL, -- 0, NULL); -- return 0; -- } -- else if (strncmp (req->key, "high_sensitivity", 16) == 0) -- { -- try -- { -- _device.SetHighSensitivity (req->value != 0); -- } -- catch (hokuyo_aist::HokuyoError &e) -- { -- PLAYER_ERROR2 ("hokuyo_aist: Error while changing sensitivity: (%d) %s", -- e.Code (), e.what ()); -- SetError (e.Code ()); -- Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_NACK, PLAYER_SET_INTPROP_REQ, -- NULL, 0, NULL); -- return 0; -- } -- _highSensitivity.SetValueFromMessage (data); -- Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, PLAYER_SET_INTPROP_REQ, NULL, -- 0, NULL); -- return 0; -- } -- } -+ // Check for capability requests -+ HANDLE_CAPABILITY_REQUEST(device_addr, resp_queue, hdr, data, -+ PLAYER_MSGTYPE_REQ, PLAYER_CAPABILTIES_REQ); -+ HANDLE_CAPABILITY_REQUEST(device_addr, resp_queue, hdr, data, -+ PLAYER_MSGTYPE_REQ, PLAYER_RANGER_REQ_GET_GEOM); -+ HANDLE_CAPABILITY_REQUEST(device_addr, resp_queue, hdr, data, -+ PLAYER_MSGTYPE_REQ, PLAYER_RANGER_REQ_GET_CONFIG); -+ HANDLE_CAPABILITY_REQUEST(device_addr, resp_queue, hdr, data, -+ PLAYER_MSGTYPE_REQ, PLAYER_RANGER_REQ_SET_CONFIG); -+ HANDLE_CAPABILITY_REQUEST(device_addr, resp_queue, hdr, data, -+ PLAYER_MSGTYPE_REQ, PLAYER_RANGER_REQ_POWER); -+ HANDLE_CAPABILITY_REQUEST(device_addr, resp_queue, hdr, data, -+ PLAYER_MSGTYPE_REQ, PLAYER_RANGER_REQ_INTNS); -+ -+ // Property handlers that need to be done manually due to calling into the -+ // HokuyoAIST library. -+ if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ, PLAYER_SET_INTPROP_REQ, -+ this->device_addr)) -+ { -+ player_intprop_req_t *req = -+ reinterpret_cast (data); -+ // Change in the baud rate -+ if (strncmp(req->key, "baud_rate", 9) == 0) -+ { -+ //try -+ //{ -+ // Change the baud rate -+ // device_.set_baud(req->value); -+ //} -+ //catch(hokuyoaist::NotSerialError) -+ //{ -+ PLAYER_WARN( -+ "HokuyoAIST: Cannot change the baud rate of a non-serial connection."); -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_NACK, -+ PLAYER_SET_INTPROP_REQ, NULL, 0, NULL); -+ return 0; -+ //} -+ /* -+ catch(hokuyoaist::BaseError &e) -+ { -+ PLAYER_ERROR1("HokuyoAIST: Error while changing baud rate: %s", -+ e.what()); -+ SetError(-1); -+ -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_NACK, -+ PLAYER_SET_INTPROP_REQ, NULL, 0, NULL); -+ return 0; -+ } -+ */ -+ baudRate_.SetValueFromMessage(data); -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, -+ PLAYER_SET_INTPROP_REQ, NULL, 0, NULL); -+ return 0; -+ } -+ else if (strncmp(req->key, "speed_level", 11) == 0) -+ { -+ try -+ { -+ device_.set_motor_speed(req->value); -+ } -+ catch(hokuyoaist::BaseError &e) -+ { -+ PLAYER_ERROR1("HokuyoAIST: Error while changing motor speed: %s", -+ e.what()); -+ SetError(-1); -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_NACK, -+ PLAYER_SET_INTPROP_REQ, NULL, 0, NULL); -+ return 0; -+ } -+ speedLevel_.SetValueFromMessage(data); -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, PLAYER_SET_INTPROP_REQ, NULL, -+ 0, NULL); -+ return 0; -+ } -+ else if (strncmp(req->key, "high_sensitivity", 16) == 0) -+ { -+ try -+ { -+ device_.set_high_sensitivity(req->value != 0); -+ } -+ catch(hokuyoaist::BaseError &e) -+ { -+ PLAYER_ERROR1( -+ "HokuyoAIST: Error while changing sensitivity: %s", -+ e.what()); -+ SetError(-1); -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_NACK, -+ PLAYER_SET_INTPROP_REQ, NULL, 0, NULL); -+ return 0; -+ } -+ highSensitivity_.SetValueFromMessage(data); -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, -+ PLAYER_SET_INTPROP_REQ, NULL, 0, NULL); -+ return 0; -+ } -+ } -+ -+ // Standard ranger messages -+ else if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ, -+ PLAYER_RANGER_REQ_POWER, device_addr)) -+ { -+ player_ranger_power_config_t *config = -+ reinterpret_cast (data); -+ try -+ { -+ if (config->state) -+ device_.set_power(true); -+ else -+ device_.set_power(false); -+ } -+ catch(hokuyoaist::BaseError &e) -+ { -+ PLAYER_ERROR1("HokuyoAIST: Error while setting power state: %s", -+ e.what()); -+ SetError(-1); -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_NACK, -+ PLAYER_RANGER_REQ_POWER, NULL, 0, NULL); -+ } -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, -+ PLAYER_RANGER_REQ_POWER, NULL, 0, NULL); -+ return 0; -+ } -+ else if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ, -+ PLAYER_RANGER_REQ_INTNS, device_addr)) -+ { -+ bool newValue = -+ (reinterpret_cast(data)->state != 0); -+ if (newValue && !getIntensities_) -+ { -+ // State change, allocate space for intensity data -+ if ((_intensities = new double[_numRanges]) == NULL) -+ { -+ PLAYER_ERROR1( -+ "HokuyoAIST: Failed to allocate space for %d intensity readings.", -+ _numRanges); -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_NACK, -+ PLAYER_RANGER_REQ_INTNS, NULL, 0, NULL); -+ return 0; -+ } -+ } -+ else if (!newValue && getIntensities_) -+ { -+ // State change, remove allocated space -+ delete[] _intensities; -+ _intensities = NULL; -+ } -+ getIntensities_ = newValue; -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, -+ PLAYER_RANGER_REQ_INTNS, NULL, 0, NULL); -+ return 0; -+ } -+ else if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ, -+ PLAYER_RANGER_REQ_GET_GEOM, device_addr)) -+ { -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, -+ PLAYER_RANGER_REQ_GET_GEOM, &geom_, sizeof(geom_), NULL); -+ return 0; -+ } -+ else if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ, -+ PLAYER_RANGER_REQ_GET_CONFIG, device_addr)) -+ { -+ player_ranger_config_t rangerConfig; -+ hokuyoaist::SensorInfo info; -+ device_.get_sensor_info(info); -+ -+ if (!invert_) -+ { -+ rangerConfig.min_angle = minAngle_; // These two are user-configurable -+ rangerConfig.max_angle = maxAngle_; -+ } -+ else -+ { -+ rangerConfig.min_angle = -maxAngle_; -+ rangerConfig.max_angle = -minAngle_; -+ } -+ -+ rangerConfig.angular_res = info.resolution; -+ rangerConfig.min_range = info.min_range / 1000.0; -+ rangerConfig.max_range = info.max_range / 1000.0; -+ rangerConfig.range_res = 0.001; // 1mm -+ rangerConfig.frequency = info.speed / 60.0; -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, -+ PLAYER_RANGER_REQ_GET_CONFIG, &rangerConfig, -+ sizeof(rangerConfig), NULL); -+ return 0; -+ } -+ else if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ, -+ PLAYER_RANGER_REQ_SET_CONFIG, device_addr)) -+ { -+ player_ranger_config_t *newParams = -+ reinterpret_cast (data); -+ -+ if (!invert_) -+ { -+ minAngle_ = newParams->min_angle; -+ maxAngle_ = newParams->max_angle; -+ } -+ else -+ { -+ minAngle_ = -newParams->max_angle; -+ maxAngle_ = -newParams->min_angle; -+ } -+ -+ if (!AllocateDataSpace()) -+ { -+ PLAYER_ERROR( -+ "HokuyoAIST: Failed to allocate space for storing range data."); -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_NACK, -+ PLAYER_RANGER_REQ_GET_CONFIG, NULL, 0, NULL); -+ return 0; -+ } -+ -+ try -+ { -+ hokuyoaist::SensorInfo info; -+ device_.get_sensor_info(info); -+ if (minAngle_ < info.min_angle) -+ { -+ minAngle_ = info.min_angle; -+ PLAYER_WARN1("HokuyoAIST: Adjusted min_angle to %lf", minAngle_); -+ } -+ if (maxAngle_> info.max_angle) -+ { -+ maxAngle_ = info.max_angle; -+ PLAYER_WARN1("HokuyoAIST: Adjusted max_angle to %lf", maxAngle_); -+ } -+ } -+ catch(hokuyoaist::BaseError &e) -+ { -+ PLAYER_ERROR1( -+ "HokuyoAIST: Library error while changing settings: %s", -+ e.what()); -+ SetError(-1); -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_NACK, -+ PLAYER_RANGER_REQ_GET_CONFIG, NULL, 0, NULL); -+ return 0; -+ } -+ -+ Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, -+ PLAYER_RANGER_REQ_GET_CONFIG, newParams, sizeof(*newParams), -+ NULL); -+ return 0; -+ } - -- // Standard ranger messages -- else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, PLAYER_RANGER_REQ_POWER, device_addr)) -- { -- player_ranger_power_config_t *config = -- reinterpret_cast (data); -- try -- { -- if (config->state) -- _device.SetPower (true); -- else -- _device.SetPower (false); -- } -- catch (hokuyo_aist::HokuyoError &e) -- { -- PLAYER_ERROR2 ("hokuyo_aist: Error while setting power state: (%d) %s", -- e.Code (), e.what ()); -- SetError (e.Code ()); -- Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_NACK, PLAYER_RANGER_REQ_POWER, -- NULL, 0, NULL); -- } -- Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, PLAYER_RANGER_REQ_POWER, NULL, -- 0, NULL); -- return 0; -- } -- else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, PLAYER_RANGER_REQ_INTNS, device_addr)) -- { -- bool newValue = (reinterpret_cast (data)->state != 0); -- if (newValue && !_getIntensities) -- { -- // State change, allocate space for intensity data -- if ((_intensities = new double[_numRanges]) == NULL) -- { -- PLAYER_ERROR1 ("hokuyo_aist: Failed to allocate space for %d intensity readings.", -- _numRanges); -- Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_NACK, PLAYER_RANGER_REQ_INTNS, -- NULL, 0, NULL); -- return 0; -- } -- } -- else if (!newValue && _getIntensities) -- { -- // State change, remove allocated space -- delete[] _intensities; -- _intensities = NULL; -- } -- _getIntensities = newValue; -- Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, PLAYER_RANGER_REQ_INTNS, NULL, -- 0, NULL); -- return 0; -- } -- else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, PLAYER_RANGER_REQ_GET_GEOM, -- device_addr)) -- { -- Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, PLAYER_RANGER_REQ_GET_GEOM, -- &_geom, sizeof (_geom), NULL); -- return 0; -- } -- else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, PLAYER_RANGER_REQ_GET_CONFIG, -- device_addr)) -- { -- player_ranger_config_t rangerConfig; -- hokuyo_aist::HokuyoSensorInfo info; -- _device.GetSensorInfo (&info); -- -- rangerConfig.min_angle = _minAngle; // These two are user-configurable -- rangerConfig.max_angle = _maxAngle; -- rangerConfig.angular_res = info.resolution; -- rangerConfig.min_range = info.minRange / 1000.0; -- rangerConfig.max_range = info.maxRange / 1000.0; -- rangerConfig.range_res = 0.001; // 1mm -- rangerConfig.frequency = info.speed / 60.0; -- Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, PLAYER_RANGER_REQ_GET_CONFIG, -- &rangerConfig, sizeof (rangerConfig), NULL); -- return 0; -- } -- else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, PLAYER_RANGER_REQ_SET_CONFIG, -- device_addr)) -- { -- player_ranger_config_t *newParams = reinterpret_cast (data); -- -- _minAngle = newParams->min_angle; -- _maxAngle = newParams->max_angle; -- if (!AllocateDataSpace ()) -- { -- PLAYER_ERROR ("hokuyo_aist: Failed to allocate space for storing range data."); -- Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_NACK, PLAYER_RANGER_REQ_GET_CONFIG, -- NULL, 0, NULL); -- return 0; -- } -- -- try -- { -- hokuyo_aist::HokuyoSensorInfo info; -- _device.GetSensorInfo (&info); -- if (_minAngle < info.minAngle) -- { -- _minAngle = info.minAngle; -- PLAYER_WARN1 ("hokuyo_aist: Adjusted min_angle to %lf", _minAngle); -- } -- if (_maxAngle> info.maxAngle) -- { -- _maxAngle = info.maxAngle; -- PLAYER_WARN1 ("hokuyo_aist: Adjusted max_angle to %lf", _maxAngle); -- } -- } -- catch (hokuyo_aist::HokuyoError &e) -- { -- PLAYER_ERROR2 ("hokuyo_aist: Library error while changing settings: (%d) %s", e.Code (), -- e.what ()); -- SetError (e.Code ()); -- Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_NACK, PLAYER_RANGER_REQ_GET_CONFIG, -- NULL, 0, NULL); -- return 0; -- } -- -- Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, PLAYER_RANGER_REQ_GET_CONFIG, -- newParams, sizeof (*newParams), NULL); -- return 0; -- } -- -- return -1; -+ return -1; - } - --bool HokuyoDriver::ReadLaser (void) -+bool HokuyoDriver::ReadLaser(void) - { -- double time1, time2; -- if (_getIntensities) -- { -- player_ranger_data_range_t rangeData; -- player_ranger_data_intns_t intensityData; -- -- try -- { -- GlobalTime->GetTimeDouble (&time1); -- _device.GetNewRangesAndIntensitiesByAngle (&_data, _minAngle, _maxAngle); -- GlobalTime->GetTimeDouble (&time2); -- time1 = (time1 + time2) / 2.0; -- } -- catch (hokuyo_aist::HokuyoError &e) -- { -- PLAYER_ERROR2 ("hokuyo_aist: Failed to read scan: (%d) %s", e.Code (), e.what ()); -- SetError (e.Code ()); -- return false; -- } -- -- double lastValidValue = _minDist; -- for (unsigned int ii = 0; ii < _data.Length (); ii++) -- { -- _ranges[ii] = _data[ii] / 1000.0f; -- _intensities[ii] = _data.Intensities ()[ii]; -- if (_minDist > 0) -- { -- if (_ranges[ii] < _minDist) -- _ranges[ii] = lastValidValue; -- else -- lastValidValue = _ranges[ii]; -- } -- } -- -- rangeData.ranges = _ranges; -- rangeData.ranges_count = _data.Length (); -- if (_hwTimeStamps.GetValue ()) -- { -- double ts = _data.TimeStamp () / 1000.0; -- Publish (device_addr, PLAYER_MSGTYPE_DATA, PLAYER_RANGER_DATA_RANGE, -- reinterpret_cast (&rangeData), sizeof (rangeData), &ts); -- } -- else -- { -- Publish (device_addr, PLAYER_MSGTYPE_DATA, PLAYER_RANGER_DATA_RANGE, -- reinterpret_cast (&rangeData), sizeof (rangeData), &time1); -- } -- -- intensityData.intensities = _intensities; -- intensityData.intensities_count = _data.Length (); -- if (_hwTimeStamps.GetValue ()) -- { -- double ts = _data.TimeStamp () / 1000.0; -- Publish (device_addr, PLAYER_MSGTYPE_DATA, PLAYER_RANGER_DATA_INTNS, -- reinterpret_cast (&intensityData), sizeof (intensityData), &ts); -- } -- else -- { -- Publish (device_addr, PLAYER_MSGTYPE_DATA, PLAYER_RANGER_DATA_INTNS, -- reinterpret_cast (&intensityData), sizeof (intensityData), &time1); -- } -- } -- else -- { -- player_ranger_data_range_t rangeData; -- -- try -- { -- GlobalTime->GetTimeDouble (&time1); -- _device.GetRangesByAngle (&_data, _minAngle, _maxAngle); -- GlobalTime->GetTimeDouble (&time2); -- time1 = (time1 + time2) / 2.0; -- } -- catch (hokuyo_aist::HokuyoError &e) -- { -- PLAYER_ERROR2 ("hokuyo_aist: Failed to read scan: (%d) %s", e.Code (), e.what ()); -- SetError (e.Code ()); -- return false; -- } -- -- double lastValidValue = _minDist; -- for (unsigned int ii = 0; ii < _data.Length (); ii++) -- { -- _ranges[ii] = _data[ii] / 1000.0f; -- if (_minDist > 0) -- { -- if (_ranges[ii] < _minDist) -- _ranges[ii] = lastValidValue; -- else -- lastValidValue = _ranges[ii]; -- } -- } -- rangeData.ranges = _ranges; -- rangeData.ranges_count = _data.Length (); -- if (_hwTimeStamps.GetValue ()) -- { -- double ts = _data.TimeStamp () / 1000.0; -- Publish (device_addr, PLAYER_MSGTYPE_DATA, PLAYER_RANGER_DATA_RANGE, -- reinterpret_cast (&rangeData), sizeof (rangeData), &ts); -- } -- else -- { -- Publish (device_addr, PLAYER_MSGTYPE_DATA, PLAYER_RANGER_DATA_RANGE, -- reinterpret_cast (&rangeData), sizeof (rangeData), &time1); -- } -- } -+ double time1, time2; -+ if (getIntensities_) -+ { -+ player_ranger_data_range_t rangeData; -+ player_ranger_data_intns_t intensityData; -+ -+ try -+ { -+ GlobalTime->GetTimeDouble(&time1); -+ device_.get_new_ranges_intensities_by_angle(data_, minAngle_, -+ maxAngle_); -+ GlobalTime->GetTimeDouble(&time2); -+ time1 = (time1 + time2) / 2.0; -+ } -+ catch(hokuyoaist::BaseError &e) -+ { -+ PLAYER_ERROR1("HokuyoAIST: Failed to read scan: %s", e.what()); -+ SetError(-1); -+ return false; -+ } -+ -+ double lastValidValue = minDist_; -+ if (!invert_) -+ { -+ for (unsigned int ii = 0; ii < data_.ranges_length(); ii++) -+ { -+ _ranges[ii] = data_[ii] / 1000.0f; -+ _intensities[ii] = data_.intensities()[ii]; -+ if (minDist_ > 0) -+ { -+ if (_ranges[ii] < minDist_) -+ _ranges[ii] = lastValidValue; -+ else -+ lastValidValue = _ranges[ii]; -+ } -+ } -+ } -+ else // Invert -+ { -+ for (unsigned int ii = 0; ii < data_.ranges_length(); ii++) -+ { -+ unsigned int jj = data_.ranges_length() - 1 - ii; -+ _ranges[ii] = data_[jj] / 1000.0f; -+ _intensities[ii] = data_.intensities()[jj]; -+ if (minDist_ > 0) -+ { -+ if (_ranges[ii] < minDist_) -+ _ranges[ii] = lastValidValue; -+ else -+ lastValidValue = _ranges[ii]; -+ } -+ } -+ } -+ -+ rangeData.ranges = _ranges; -+ rangeData.ranges_count = data_.ranges_length(); -+ if (hwTimeStamps_.GetValue()) -+ { -+ double ts = data_.system_time_stamp() / 1000000000.0; -+ Publish(device_addr, PLAYER_MSGTYPE_DATA, PLAYER_RANGER_DATA_RANGE, -+ reinterpret_cast(&rangeData), sizeof(rangeData), -+ &ts); -+ } -+ else -+ { -+ Publish(device_addr, PLAYER_MSGTYPE_DATA, PLAYER_RANGER_DATA_RANGE, -+ reinterpret_cast(&rangeData), sizeof(rangeData), -+ &time1); -+ } -+ -+ intensityData.intensities = _intensities; -+ intensityData.intensities_count = data_.intensities_length(); -+ if (hwTimeStamps_.GetValue()) -+ { -+ double ts = data_.system_time_stamp() / 1000000000.0; -+ Publish(device_addr, PLAYER_MSGTYPE_DATA, PLAYER_RANGER_DATA_INTNS, -+ reinterpret_cast(&intensityData), -+ sizeof(intensityData), &ts); -+ } -+ else -+ { -+ Publish(device_addr, PLAYER_MSGTYPE_DATA, PLAYER_RANGER_DATA_INTNS, -+ reinterpret_cast(&intensityData), -+ sizeof(intensityData), &time1); -+ } -+ } -+ else -+ { -+ player_ranger_data_range_t rangeData; -+ -+ try -+ { -+ GlobalTime->GetTimeDouble(&time1); -+ device_.get_ranges_by_angle(data_, minAngle_, maxAngle_); -+ GlobalTime->GetTimeDouble(&time2); -+ time1 = (time1 + time2) / 2.0; -+ } -+ catch(hokuyoaist::BaseError &e) -+ { -+ PLAYER_ERROR1("HokuyoAIST: Failed to read scan: %s", e.what()); -+ SetError(-1); -+ return false; -+ } -+ -+ double lastValidValue = minDist_; -+ if (!invert_) { -+ for (unsigned int ii = 0; ii < data_.ranges_length(); ii++) -+ { -+ _ranges[ii] = data_[ii] / 1000.0f; -+ if (minDist_ > 0) -+ { -+ if (_ranges[ii] < minDist_) -+ _ranges[ii] = lastValidValue; -+ else -+ lastValidValue = _ranges[ii]; -+ } -+ } -+ } -+ else // Invert -+ { -+ for (unsigned int ii = 0; ii < data_.ranges_length(); ii++) -+ { -+ _ranges[ii] = data_[data_.ranges_length() - 1 - ii] / 1000.0f; -+ if (minDist_ > 0) -+ { -+ if (_ranges[ii] < minDist_) -+ _ranges[ii] = lastValidValue; -+ else -+ lastValidValue = _ranges[ii]; -+ } -+ } -+ } -+ rangeData.ranges = _ranges; -+ rangeData.ranges_count = data_.ranges_length(); -+ if (hwTimeStamps_.GetValue()) -+ { -+ double ts = data_.system_time_stamp() / 1000000000.0; -+ Publish(device_addr, PLAYER_MSGTYPE_DATA, PLAYER_RANGER_DATA_RANGE, -+ reinterpret_cast (&rangeData), sizeof(rangeData), -+ &ts); -+ } -+ else -+ { -+ Publish(device_addr, PLAYER_MSGTYPE_DATA, PLAYER_RANGER_DATA_RANGE, -+ reinterpret_cast (&rangeData), sizeof(rangeData), -+ &time1); -+ } -+ } - -- return true; -+ return true; - } - --int HokuyoDriver::MainSetup (void) -+int HokuyoDriver::MainSetup(void) - { -+ try -+ { -+ device_.ignore_unknowns(ignoreUnknowns_); -+ // Open the laser -+ device_.open(portOpts_); -+ // Get the sensor information and check minAngle_ and maxAngle_ are OK -+ hokuyoaist::SensorInfo info; -+ device_.get_sensor_info(info); -+ if (minAngle_ < info.min_angle) -+ { -+ minAngle_ = info.min_angle; -+ PLAYER_WARN1("HokuyoAIST: Adjusted min_angle to %lf", minAngle_); -+ } -+ if (maxAngle_> info.max_angle) -+ { -+ maxAngle_ = info.max_angle; -+ PLAYER_WARN1("HokuyoAIST: Adjusted max_angle to %lf", maxAngle_); -+ } -+ if (!AllocateDataSpace()) -+ return -1; -+ -+ /* - try -- { -- _device.IgnoreUnknowns (_ignoreUnknowns); -- // Open the laser -- _device.OpenWithProbing (_portOpts); -- // Get the sensor information and check _minAngle and _maxAngle are OK -- hokuyo_aist::HokuyoSensorInfo info; -- _device.GetSensorInfo (&info); -- if (_minAngle < info.minAngle) -- { -- _minAngle = info.minAngle; -- PLAYER_WARN1 ("hokuyo_aist: Adjusted min_angle to %lf", _minAngle); -- } -- if (_maxAngle> info.maxAngle) -- { -- _maxAngle = info.maxAngle; -- PLAYER_WARN1 ("hokuyo_aist: Adjusted max_angle to %lf", _maxAngle); -- } -- if (!AllocateDataSpace ()) -- return -1; -- -- if (_powerOnStartup) -- _device.SetPower (true); -- -- try -- { -- _device.SetBaud (_baudRate.GetValue ()); -- } -- catch (hokuyo_aist::HokuyoError &e) -- { --#if defined (WIN32) -- if (e.Code () != HOKUYO_ERR_NOTSERIAL) --#else -- if (e.Code () != hokuyo_aist::HOKUYO_ERR_NOTSERIAL) --#endif -- PLAYER_WARN ("hokuyo_aist: Cannot change the baud rate of a non-serial connection."); -- else -- PLAYER_WARN2 ("hokuyo_aist: Error changing baud rate: (%d) %s", e.Code (), e.what ()); -- } -- try -- { -- // Catch any errors here as this is an optional setting not supported by all models -- _device.SetMotorSpeed (_speedLevel.GetValue ()); -- } -- catch (hokuyo_aist::HokuyoError &e) -- { -- PLAYER_WARN2 ("hokuyo_aist: Unable to set motor speed: (%d) %s", e.Code (), e.what ()); -- } -- try -- { -- // Optional setting -- _device.SetHighSensitivity (_highSensitivity.GetValue () != 0); -- } -- catch (hokuyo_aist::HokuyoError &e) -- { -- PLAYER_WARN2 ("hokuyo_aist: Unable to set sensitivity: (%d) %s", e.Code (), e.what ()); -- } -- } -- catch (hokuyo_aist::HokuyoError &e) -- { -- PLAYER_ERROR2 ("hokuyo_aist: Failed to setup laser driver: (%d) %s", e.Code (), e.what ()); -- SetError (e.Code ()); -- return -1; -- } -- return 0; -+ { -+ device_.set_baud(baudRate_.GetValue()); -+ } -+ catch(hokuyoaist::NotSerialError) -+ { -+ PLAYER_WARN( -+ "HokuyoAIST: Cannot change the baud rate of a non-serial connection."); -+ } -+ catch(hokuyoaist::BaseError &e) -+ { -+ PLAYER_WARN1("HokuyoAIST: Error while changing baud rate: %s", -+ e.what()); -+ } -+ */ -+ try -+ { -+ // Catch any errors here as this is an optional setting not supported by all models -+ device_.set_motor_speed(speedLevel_.GetValue()); -+ } -+ catch(hokuyoaist::BaseError &e) -+ { -+ PLAYER_WARN1("HokuyoAIST: Unable to set motor speed: %s", -+ e.what()); -+ } -+ try -+ { -+ // Optional setting -+ device_.set_high_sensitivity(highSensitivity_.GetValue() != 0); -+ } -+ catch(hokuyoaist::BaseError &e) -+ { -+ PLAYER_WARN1("HokuyoAIST: Unable to set sensitivity: %s", -+ e.what()); -+ } -+ if (hwTimeStamps_.GetValue()) { -+ device_.calibrate_time(); -+ } -+ -+ if (powerOnStartup_) -+ device_.set_power(true); -+ -+ } -+ catch(hokuyoaist::BaseError &e) -+ { -+ PLAYER_ERROR1("HokuyoAIST: Failed to setup laser driver: %s", -+ e.what()); -+ SetError(-1); -+ return -1; -+ } -+ return 0; - } - --void HokuyoDriver::MainQuit (void) -+void HokuyoDriver::MainQuit(void) - { -- _device.Close (); -- _data.CleanUp (); -- if (_ranges != NULL) -- { -- delete[] _ranges; -- _ranges = NULL; -- } -+ device_.close(); -+ data_.clean_up(); -+ if (_ranges != NULL) -+ { -+ delete[] _ranges; -+ _ranges = NULL; -+ } - } - - //////////////////////////////////////////////////////////////////////////////////////////////////// - // Driver management functions - //////////////////////////////////////////////////////////////////////////////////////////////////// - --Driver* HokuyoDriver_Init (ConfigFile* cf, int section) -+Driver* HokuyoDriver_Init(ConfigFile* cf, int section) - { -- return reinterpret_cast (new HokuyoDriver (cf, section)); -+ return reinterpret_cast (new HokuyoDriver(cf, section)); - } - --void hokuyo_aist_Register (DriverTable* table) -+void hokuyoaist_Register(DriverTable* table) - { -- table->AddDriver ("hokuyo_aist", HokuyoDriver_Init); -+ table->AddDriver("hokuyoaist", HokuyoDriver_Init); - } diff --git a/player-3.0.2.gzfile.patch b/player-3.0.2.gzfile.patch deleted file mode 100644 index fc9af40..0000000 --- a/player-3.0.2.gzfile.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up ./server/drivers/shell/readlog.cc.gzfile ./server/drivers/shell/readlog.cc ---- ./server/drivers/shell/readlog.cc.gzfile 2012-06-30 14:19:53.612450930 -0400 -+++ ./server/drivers/shell/readlog.cc 2012-06-30 14:20:29.446824252 -0400 -@@ -665,7 +665,7 @@ void ReadLog::Main() - // back up to the beginning of the file - #if HAVE_Z - if (this->gzfile) -- ret = gzseek(this->file,0,SEEK_SET); -+ ret = gzseek((gzFile)this->file,0,SEEK_SET); - else - ret = fseek(this->file,0,SEEK_SET); - #else -@@ -711,7 +711,7 @@ void ReadLog::Main() - // compared to fgets (on uncompressed files), so use the latter. - #if HAVE_Z - if (this->gzfile) -- ret = (gzgets(this->file, this->line, this->line_size) == NULL); -+ ret = (gzgets((gzFile)this->file, this->line, this->line_size) == NULL); - else - ret = (fgets(this->line, this->line_size, (FILE*) this->file) == NULL); - #else diff --git a/player-3.0.2.opencv3.patch b/player-3.0.2.opencv3.patch deleted file mode 100644 index 204e27e..0000000 --- a/player-3.0.2.opencv3.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff -up ./player-3.0.2/server/drivers/blobfinder/shapetracker/shapetracker.cc.opencv3 ./player-3.0.2/server/drivers/blobfinder/shapetracker/shapetracker.cc ---- ./player-3.0.2/server/drivers/blobfinder/shapetracker/shapetracker.cc.opencv3 2009-08-26 10:36:23.000000000 +0200 -+++ ./player-3.0.2/server/drivers/blobfinder/shapetracker/shapetracker.cc 2015-07-01 12:51:07.396751974 +0200 -@@ -530,7 +530,7 @@ void ShapeTracker::ContrastStretch( IplI - cvCalcHist(&gray, this->hist, 0, NULL); - - for(index = 0; index < this->histSize; index++){ -- hist_value = cvQueryHistValue_1D(this->hist, index); -+ hist_value = cvGetReal1D(this->hist, index); - if(hist_value != 0){ - low = index; - break; -@@ -538,7 +538,7 @@ void ShapeTracker::ContrastStretch( IplI - } - - for(index = this->histSize-1; index >= 0; index--){ -- hist_value = cvQueryHistValue_1D(this->hist, index); -+ hist_value = cvGetReal1D(this->hist, index); - if(hist_value != 0){ - high = index; - break; -@@ -554,11 +554,11 @@ void ShapeTracker::ContrastStretch( IplI - if(index > high) this->lut[index] = 255; - } - -- cvCvtPixToPlane(src, R, G, B, NULL); -+ cvSplit(src, R, G, B, NULL); - cvLUT(R, R, this->lutMat); - cvLUT(G, G, this->lutMat); - cvLUT(B, B, this->lutMat); -- cvCvtPlaneToPix(R, G, B, NULL, src); -+ cvMerge(R, G, B, NULL, src); - - cvReleaseImage(&R); - cvReleaseImage(&G); diff --git a/player-3.0.2.phidgetrfid.patch b/player-3.0.2.phidgetrfid.patch deleted file mode 100644 index 4b61041..0000000 --- a/player-3.0.2.phidgetrfid.patch +++ /dev/null @@ -1,61 +0,0 @@ -diff -up ./server/drivers/rfid/phidgetRFID.cc.phidgetrfid ./server/drivers/rfid/phidgetRFID.cc ---- ./server/drivers/rfid/phidgetRFID.cc.phidgetrfid 2013-01-26 12:56:48.934013187 -0500 -+++ ./server/drivers/rfid/phidgetRFID.cc 2013-01-26 13:32:31.206068369 -0500 -@@ -109,8 +109,8 @@ inline float timediffms(struct timeval s - return(end.tv_sec*1000.0 + end.tv_usec/1000.0 - (start.tv_sec*1000.0 + start.tv_usec/1000.0)); - } - --int TagLost(CPhidgetRFIDHandle rfid,void *hola, unsigned char *usrchar); --int TagFound(CPhidgetRFIDHandle rfid,void *hola, unsigned char *usrchar); -+int TagLost(CPhidgetRFIDHandle rfid, void *hola, char *usrchar, CPhidgetRFID_Protocol protocol); -+int TagFound(CPhidgetRFIDHandle rfid, void *hola, char *usrchar, CPhidgetRFID_Protocol protocol); - - - -@@ -220,8 +220,8 @@ int Phidgetrfid::MainSetup() { - PLAYER_MSG0(1,"Connection granted to the PhidgetRFID Reader."); - } - -- CPhidgetRFID_set_OnTagLost_Handler(rfid,TagLost,NULL); -- CPhidgetRFID_set_OnTag_Handler(rfid,TagFound,NULL); -+ CPhidgetRFID_set_OnTagLost2_Handler(rfid,TagLost,NULL); -+ CPhidgetRFID_set_OnTag2_Handler(rfid,TagFound,NULL); - //Turning on the Antena. - CPhidgetRFID_setAntennaOn(rfid,1); - CPhidgetRFID_setLEDOn(rfid,1); -@@ -361,8 +361,9 @@ void Phidgetrfid::Main() { - - - -- unsigned char tag[20]; -- CPhidgetRFID_getLastTag(rfid,tag); -+ char* tag = new char [20]; -+ CPhidgetRFID_Protocol proto = PHIDGET_RFID_PROTOCOL_PHIDGETS; -+ CPhidgetRFID_getLastTag2(rfid,&tag,&proto); - int ledstate; - player_rfid_data_t data_rfid; - data_rfid.tags = new player_rfid_tag_t[1]; -@@ -397,6 +398,7 @@ void Phidgetrfid::Main() { - } - CPhidgetRFID_setLEDOn(rfid,0); - } -+ delete [] tag; - - - //Publishing data. -@@ -439,13 +441,13 @@ void Phidgetrfid::Main() { - } - - //Handler functions to check if there is a new tag there. They are handlers as seen on the Phidget library. --int TagLost(CPhidgetRFIDHandle rfid,void *dummy, unsigned char *usrchar) { -+int TagLost(CPhidgetRFIDHandle rfid, void *dummy, char *usrchar, CPhidgetRFID_Protocol protocol) { - tagControl.rfid_present=rfid; - tagControl.tagPresent=0; - return (0); - } - --int TagFound(CPhidgetRFIDHandle rfid,void *dummy, unsigned char *usrchar) { -+int TagFound(CPhidgetRFIDHandle rfid, void *dummy, char *usrchar, CPhidgetRFID_Protocol protocol) { - tagControl.rfid_present=rfid; - tagControl.tagPresent=1; - return (0); diff --git a/player-3.1.0-cmake3.patch b/player-3.1.0-cmake3.patch new file mode 100644 index 0000000..80d8da7 --- /dev/null +++ b/player-3.1.0-cmake3.patch @@ -0,0 +1,39 @@ +diff -up ./client_libs/libplayerc++/CMakeLists.txt.cmake3 ./client_libs/libplayerc++/CMakeLists.txt +--- ./client_libs/libplayerc++/CMakeLists.txt.cmake3 2017-04-08 13:05:52.000000000 -0400 ++++ ./client_libs/libplayerc++/CMakeLists.txt 2017-04-09 13:45:57.521862361 -0400 +@@ -24,7 +24,7 @@ IF (BUILD_PLAYERCC) + # Look for Boost libraries + IF (BUILD_PLAYERCC_BOOST) + # There is a new, much better, FindBoost.cmake in 2.6 +- IF (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 5) ++ IF (CMAKE_MAJOR_VERSION GREATER 2 OR (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 5)) + OPTION (Boost_USE_STATIC_LIBS "Use the static versions of the Boost libraries" OFF) + MARK_AS_ADVANCED (Boost_USE_STATIC_LIBS) + OPTION (USE_BOOST_THREAD "Use the Boost threading library" ON) +@@ -38,7 +38,7 @@ IF (BUILD_PLAYERCC) + SET (HAVE_BOOST_THREAD FALSE CACHE INTERNAL "Is the Boost::Thread library present") + ENDIF (USE_BOOST_THREAD) + IF (USE_BOOST_SIGNALS) +- SET (BOOST_COMPONENTS ${BOOST_COMPONENTS} signals2) ++ SET (BOOST_COMPONENTS ${BOOST_COMPONENTS} signals) + ELSE (USE_BOOST_SIGNALS) + SET (HAVE_BOOST_SIGNALS FALSE CACHE INTERNAL "Is the Boost::Signals library present") + ENDIF (USE_BOOST_SIGNALS) +@@ -88,7 +88,7 @@ IF (BUILD_PLAYERCC) + "Boost libraries were not found. Boost::Signals and Boost::Thread support + will not be included in PlayerC++.") + ENDIF (Boost_FOUND) +- ELSE (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 5) ++ ELSE (CMAKE_MAJOR_VERSION GREATER 2 OR (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 5)) + FIND_PACKAGE (Boost) + IF (Boost_FOUND) + # For 2.4, assume that if boost is found then both signals and threads are present +@@ -160,7 +160,7 @@ IF (BUILD_PLAYERCC) + "Boost libraries were not found. Boost::Signals and Boost::Thread support + will not be included in PlayerC++.") + ENDIF (Boost_FOUND) +- ENDIF (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 5) ++ ENDIF (CMAKE_MAJOR_VERSION GREATER 2 OR (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 5)) + ELSE (BUILD_PLAYERCC_BOOST) + MESSAGE (STATUS + "Boost support disabled. Boost::Signals and Boost::Thread support will not be diff --git a/player-3.1.0-cpp11.patch b/player-3.1.0-cpp11.patch new file mode 100644 index 0000000..e03d9c3 --- /dev/null +++ b/player-3.1.0-cpp11.patch @@ -0,0 +1,24 @@ +diff -up ./client_libs/libplayerc++/bindings/ruby/playercpp.i.cpp11 ./client_libs/libplayerc++/bindings/ruby/playercpp.i +--- ./client_libs/libplayerc++/bindings/ruby/playercpp.i.cpp11 2017-03-19 18:50:04.074744694 -0400 ++++ ./client_libs/libplayerc++/bindings/ruby/playercpp.i 2017-03-19 18:50:15.532188950 -0400 +@@ -48,7 +48,7 @@ + } + catch (const PlayerCc::PlayerError &e) { + static VALUE playererror = rb_define_class("PlayerError", rb_eStandardError); +- rb_raise(playererror, e.GetErrorStr().c_str()); ++ rb_raise(playererror, "%s", e.GetErrorStr().c_str()); + } + } + +diff -up ./server/drivers/position/roboteq/roboteq.cc.cpp11 ./server/drivers/position/roboteq/roboteq.cc +--- ./server/drivers/position/roboteq/roboteq.cc.cpp11 2017-03-19 18:36:24.957834025 -0400 ++++ ./server/drivers/position/roboteq/roboteq.cc 2017-03-19 18:36:30.996070068 -0400 +@@ -1263,7 +1263,7 @@ int roboteq::ProcessPosition1dCmd(int mo + } + position_value = (unsigned char) (fabs(position) / rad_per_tick); + PLAYER_MSG1(MESSAGE_DEBUG,"Setting position_value to %d",position_value); +- if (motors_enabled == false || motor_enabled[motor_index] == false) { ++ if (motors_enabled == false || *motor_enabled[motor_index] == false) { + position_value = 0; + PLAYER_MSG0(MESSAGE_INFO, "Warning, the motors are disabled! Enable them before use."); + } diff --git a/player.spec b/player.spec index be6ae00..a6fc7dc 100644 --- a/player.spec +++ b/player.spec @@ -1,33 +1,21 @@ +%global abiversion 3.1 +%global releasetag release-3-1-0 + Name: player -Version: 3.0.2 -Release: 59%{?dist} +Version: 3.1.0 +Release: 1%{?dist} Summary: Cross-platform robot device interface and server Group: Applications/System License: GPLv2+ and LGPLv2+ -URL: http://playerstage.sourceforge.net -Source0: http://downloads.sourceforge.net/project/playerstage/Player/%{version}/%{name}-%{version}.tar.gz -Source1: playernav.desktop -Source2: playercam.desktop -Source3: playerv.desktop -# This patch adds a search directory for plugin libraries, proposed at http://old.nabble.com/Proposal%3A-Plugin-locations-for-Player-and-Stage-ts26868070.html -Patch0: %{name}-3.0.1.fixlibload.patch -Patch1: %{name}-3.0.2.fixunicapimage.patch -Patch2: %{name}-3.0.2.fixlinuxwifi.patch -Patch3: %{name}-3.0.2.fixplayercam.patch -Patch4: %{name}-3.0.2.enablephidget.patch -Patch5: %{name}-3.0.2.64bitarchs.patch -Patch6: %{name}-3.0.2.boostutc.patch -Patch7: %{name}-3.0.2.gzfile.patch -Patch8: %{name}-3.0.2.gbx10.patch -Patch9: %{name}-3.0.2.boost150.patch -Patch10: %{name}-3.0.2.phidgetrfid.patch -# Some hacks to make player compile against libstatgrab-0.90 -Patch11: %{name}-3.0.2.libstatgrab-0.90.patch -Patch12: %{name}-3.0.2.boost155.patch -Patch13: %{name}-3.0.2.opencv3.patch -Patch14: %{name}-3.0.2-cpp11.patch -Patch15: %{name}-3.0.2-interfacetable.patch +URL: http://playerproject.github.io +Source0: https://github.com/playerproject/%{name}/archive/%{releasetag}/%{name}-%{version}.tar.gz +Source1: playernav.desktop +Source2: playercam.desktop +Source3: playerv.desktop + +Patch0: %{name}-3.1.0-cmake3.patch +Patch1: %{name}-3.1.0-cpp11.patch # Sort order: build tools, feature libs, within alphabetically, group related # entries on single line (most dominant lib first or alphabetically) @@ -40,22 +28,29 @@ BuildRequires: libtool, libtool-ltdl-devel BuildRequires: alsa-lib-devel BuildRequires: avahi-compat-howl-devel BuildRequires: boost-devel boost-thread +BuildRequires: eigen3-devel BuildRequires: festival-devel BuildRequires: flexiport-devel +BuildRequires: freeglut-devel +BuildRequires: gearbox-devel BuildRequires: hokuyoaist-devel BuildRequires: geos-devel BuildRequires: gsl-devel BuildRequires: gstreamer-devel BuildRequires: gtk2-devel, libgnomecanvas-devel +BuildRequires: compat-guile18-devel %ifnarch s390 s390x BuildRequires: libdc1394-devel, libraw1394-devel %endif +BuildRequires: libfreenect-devel BuildRequires: libjpeg-devel BuildRequires: libphidget-devel BuildRequires: libpqxx-devel BuildRequires: libstatgrab-devel BuildRequires: libusb-devel BuildRequires: libXext-devel +BuildRequires: libXmu-devel +BuildRequires: libunicap-devel BuildRequires: mesa-libGL-devel, mesa-libGLU-devel BuildRequires: opencv-devel BuildRequires: openssl-devel @@ -139,35 +134,24 @@ are experimental. %prep -%setup -q -n %{name}-%{version} -%patch0 -p1 -b .fixlibload -%patch1 -p0 -%patch2 -p0 -%patch3 -p0 -%patch4 -p0 -%patch5 -p1 -b .s390x -%patch6 -p0 -%patch7 -p0 -%patch8 -p2 -b .gbx10 -%patch9 -p2 -b .boost150 -%patch10 -p0 -b .phidgetrfid -%if 0%{?fedora} >= 24 -# Patch only applicable for libstatgrab >= 0.90 -%patch11 -p1 -%endif -%patch12 -p1 -%patch13 -p2 -b .opencv3 -%patch14 -p0 -b .cpp11 -%patch15 -p0 -b .interfacetable -find . -name '*.c' -exec chmod -x {} \; -find . -name '*.cc' -exec chmod -x {} \; -find . -name '*.cpp' -exec chmod -x {} \; -find . -name '*.h' -exec chmod -x {} \; +%setup -q -n %{name}-%{releasetag} +%patch0 -p1 -b .cmake3 +%patch1 -p1 -b .cpp11 %build mkdir build; pushd build export LDFLAGS="%{?__global_ldflags} -lpthread" -%cmake %{?_cmake_skip_rpath} -DBUILD_DOCUMENTATION=ON -DBUILD_PLAYERCC=ON -DSWIG_EXECUTABLE=/usr/bin/swig -DBUILD_PLAYERCC_BOOST=ON -DBUILD_PYTHONC_BINDINGS=ON -DBUILD_PYTHONCPP_BINDINGS=ON -DBUILD_EXAMPLES=ON -DBUILD_RUBYCPP_BINDINGS=ON -DBoost_USE_MULTITHREAD=ON -DUNICAP_DIR=/usr -DRUBY_BINDINGS_INSTALL_DIR=%{ruby_vendorarchdir} .. +%cmake %{?_cmake_skip_rpath} .. \ + -DBUILD_DOCUMENTATION=ON \ + -DBUILD_PLAYERCC=ON \ + -DSWIG_EXECUTABLE=/usr/bin/swig \ + -DBUILD_PLAYERCC_BOOST=ON \ + -DBUILD_PYTHONC_BINDINGS=ON \ + -DBUILD_PYTHONCPP_BINDINGS=ON \ + -DBUILD_EXAMPLES=ON \ + -DBUILD_RUBYCPP_BINDINGS=ON \ + -DUNICAP_DIR=/usr \ + -DRUBY_BINDINGS_INSTALL_DIR=%{ruby_vendorarchdir} popd make -C build %{?_smp_mflags} @@ -176,7 +160,7 @@ make doc -C build %install %make_install -C build DESTDIR=%{buildroot} mkdir -p %{buildroot}/%{_sysconfdir}/%{name} -mkdir -p %{buildroot}/%{_libdir}/%{name} +mkdir -p %{buildroot}/%{_libdir}/%{name}-%{abiversion} mv %{buildroot}/%{_datadir}/%{name}/config %{buildroot}/%{_sysconfdir}/%{name} find %{buildroot} -name '*.la' -exec rm {} \; rm -rf %{buildroot}/%{_docdir}/* @@ -208,7 +192,7 @@ desktop-file-install \ %files %license COPYING COPYING.lib -%doc README AUTHORS +%doc README.md AUTHORS %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/config/* %{_bindir}/player* @@ -216,10 +200,10 @@ desktop-file-install \ %{_libdir}/*.so.* %dir %{_datadir}/player %{_datadir}/applications/*.desktop -%dir %{_libdir}/player +%dir %{_libdir}/player-%{abiversion} %files devel -%{_includedir}/player-3.0 +%{_includedir}/player-%{abiversion} %{_libdir}/*.so %{_libdir}/pkgconfig/* %{_datadir}/cmake/Modules/* @@ -240,6 +224,11 @@ desktop-file-install \ %{ruby_vendorarchdir}/*.so %changelog +* Sun Apr 09 2017 Rich Mattes - 3.1.0-1 +- Update to release 3.1.0 +- Remove upstream patches +- Add BuildRequires to enable more features + * Tue Apr 04 2017 Rich Mattes - 3.0.2-59 - Rebuild for gazebo-8.0.0 diff --git a/sources b/sources index 466412b..3480953 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b92b5ea028e6bfc49351849f420167db player-3.0.2.tar.gz +SHA512 (player-3.1.0.tar.gz) = b59090b264551a9c1bce3ee5791d5dc6aa834920a3e5e36823e9172cef4890866d1fe1a97ac5dcf5b40efdb15ed584a0b1689ec631f151e8b012da94f72d9c95