[player/f14/master] Merge in fixes from rawhide
rmattes
rmattes at fedoraproject.org
Sat Jan 8 19:45:09 UTC 2011
commit ea27cdd1121ea05fe13e991c3d791edaca11cae5
Author: Rich <richmattes at gmail.com>
Date: Sat Jan 8 14:34:48 2011 -0500
Merge in fixes from rawhide
player-3.0.2.enablephidget.patch | 274 ++++++++++++++++++++++++++++++++++++++
player-3.0.2.fixplayercam.patch | 62 +++++++++
player.spec | 23 ++-
3 files changed, 351 insertions(+), 8 deletions(-)
---
diff --git a/player-3.0.2.enablephidget.patch b/player-3.0.2.enablephidget.patch
new file mode 100644
index 0000000..090fe68
--- /dev/null
+++ b/player-3.0.2.enablephidget.patch
@@ -0,0 +1,274 @@
+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 <phidget21.h>\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 <unistd.h>
+ #include <string.h>
+ #include <iostream>
+@@ -97,7 +96,7 @@ driver
+ #include "phidget21.h"
+
+ #include <libplayercore/playercore.h>
+-
++#include "config.h"
+
+ //For nanosleep:
+ #include <time.h>
+@@ -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<int>(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<const char *>(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<float> 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<bool> 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 <libplayercore/playercore.h>
++#include "config.h"
+
+ #include <unistd.h>
+ #include <string.h>
+@@ -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<int>(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 <libplayercore/playercore.h>
++#include "config.h"
+
+ #include <unistd.h>
+ #include <string.h>
+@@ -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;i<n_axis;++i) {
diff --git a/player-3.0.2.fixplayercam.patch b/player-3.0.2.fixplayercam.patch
new file mode 100644
index 0000000..69a3dfa
--- /dev/null
+++ b/player-3.0.2.fixplayercam.patch
@@ -0,0 +1,62 @@
+diff -up ./utils/playercam/playercam.c.fixplayercam ./utils/playercam/playercam.c
+--- ./utils/playercam/playercam.c.fixplayercam 2010-10-03 23:22:45.197406018 -0400
++++ ./utils/playercam/playercam.c 2011-01-08 09:23:56.329551970 -0500
+@@ -21,7 +21,7 @@
+ * Desc: PlayerCam
+ * Author: Brad Kratochvil
+ * Date: 20050902
+- * CVS: $Id: playercam.c 8799 2010-06-28 04:12:42Z jpgr87 $
++ * CVS: $Id: playercam.c 8968 2010-11-15 03:06:34Z jpgr87 $
+ *************************************************************************/
+
+ /** @ingroup utils */
+@@ -413,17 +413,20 @@ player_init(int argc, char *argv[])
+ // Decompress the image
+ csize = g_camera->image_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.spec b/player.spec
index b30b2f2..1552351 100644
--- a/player.spec
+++ b/player.spec
@@ -3,7 +3,7 @@
Name: player
Version: 3.0.2
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Cross-platform robot device interface and server
Group: Applications/System
@@ -17,8 +17,8 @@ Source3: playerv.desktop
Patch0: %{name}-3.0.1.fixlibload.patch
Patch1: %{name}-3.0.2.fixunicapimage.patch
Patch2: %{name}-3.0.2.fixlinuxwifi.patch
-# This patch adds correct version checking for Flexiport (once the gearbox packages are present in Fedora). https://sourceforge.net/tracker/?func=detail&aid=2919373&group_id=42445&atid=433164
-#Patch3: %{name}-%{version}.fixflexiport.patch
+Patch3: %{name}-3.0.2.fixplayercam.patch
+Patch4: %{name}-3.0.2.enablephidget.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# Sort order: build tools, feature libs, within alphabetically, group related
@@ -41,6 +41,7 @@ BuildRequires: gstreamer-devel
BuildRequires: gtk2-devel, libgnomecanvas-devel
BuildRequires: libdc1394-devel, libraw1394-devel
BuildRequires: libjpeg-devel
+BuildRequires: libphidget-devel
BuildRequires: libpqxx-devel
BuildRequires: libstatgrab-devel
BuildRequires: libusb-devel
@@ -127,6 +128,8 @@ are experimental.
%patch0 -p1 -b .fixlibload
%patch1 -p0
%patch2 -p0
+%patch3 -p0
+%patch4 -p0
find . -name '*.c' -exec chmod -x {} \;
find . -name '*.cc' -exec chmod -x {} \;
find . -name '*.cpp' -exec chmod -x {} \;
@@ -135,10 +138,10 @@ find . -name '*.h' -exec chmod -x {} \;
%build
%cmake -DBUILD_DOCUMENTATION=ON -DBUILD_PLAYERCC=ON -DBUILD_PLAYERCC_BOOST=ON -DBUILD_PYTHONC_BINDINGS=ON -DBUILD_PYTHONCPP_BINDINGS=ON -DBUILD_EXAMPLES=ON -DBUILD_RUBYCPP_BINDINGS=ON -DBoost_USE_MULTITHREAD=ON -DENABLE_DRIVER_OCEANSERVER=OFF -DUNICAP_DIR=/usr .
make
-
-pushd doc
-doxygen player.dox
-popd
+make doc
+#pushd doc
+#doxygen player.dox
+#popd
%install
rm -rf $RPM_BUILD_ROOT
@@ -208,7 +211,11 @@ rm -rf $RPM_BUILD_ROOT
%{ruby_sitearch}/*.so
%changelog
-* Thu Jul 29 2010 Rich Mattes <richmattes at gmail.com> - 3.0.2-3
+* Sat Jan 08 2011 Rich Mattes <richmattes at gmail.com> - 3.0.2-5
+- Fix assertion error in PlayerCam
+- Enable libphidget support
+
+* Thu Jul 29 2010 Rich Mattes <richmattes at gmail.com> - 3.0.2-4
- Rebuilt for boost soname change
* Mon Jul 26 2010 Rich Mattes <richmattes at gmail.com> - 3.0.2-3
More information about the scm-commits
mailing list