Menu

#283 Fixes for the AmtecM5-actarray and PhidgetRFID drivers

Unstable
closed
G Biggs
Player (393)
5
2008-05-13
2008-05-04
No

Hi everyone,

Here is a patch to fix detection of the AmtecM5 library for controlling the Amtec (Schunk) Powercube robotic arms.

The detection of the header was not working correctly, mainly because CMAKE was trying to compile the test using gcc instead of g++. To fix it, I added a CMAKE macro called PLAYERDRIVER_REQUIRE_HEADER_CPP, and modified the CMakeLists.txt file of the actarray directory to include the correct CFLAGS and definitions.

I also ran into a linking problem, because the external libraries needed by the drivers were being set into a property called LINK_FLAGS instead of being appended to the TARGET_LINK_LIBRARIES for the player executable. This was putting the "-lsomething" flags at the beginning of the linking command, and they are needed at the end, so that all the symbols can be found correctly. (GCC's manual indicates that they follow that linking order). This problem mainly shows up with static libraries.

The solution is to simply append the libraries from the drivers to the TARGET_LINK_LIBRARIES of player. It works fine in my local tests now.

Please let me know if there was a special reason for using the property LINK_FLAGS that I did not see.

The patch also includes a small change to make the phidgetRFID driver compile under CMAKE, and a temporary solution for the switch of the amtecM5 driver to dynamic arrays, a better one will come soon.

Discussion

  • Alexis Maldonado

    Patch with fixes for the AmtecM5 and phidgetRFID drivers

     
  • Alexis Maldonado

    Logged In: YES
    user_id=1561044
    Originator: YES

    Forgot to mention it, but this patch is done against the latest SVN trunk from player (as of 4th of May, 2008).

    Greetings,

    Alexis Maldonado
    Info9 - TUM

     
  • Brian Gerkey

    Brian Gerkey - 2008-05-12
    • assigned_to: gerkey --> gbiggs
     
  • Alexis Maldonado

    Logged In: YES
    user_id=1561044
    Originator: YES

    Hello everyone!

    I noticed that the patch got accepted into Trunk tonight. Thanks!

    I did some testing, and I found that compilation was working well using the Phidgets (uses libphidget), but the compilation of the player server broke when there were no drivers present that needed external libraries. The problem was that some whitespaces sneak into the variable PLAYER_DRIVERSLIB_LINKFLAGS. This patch simply removes trailing whitespaces from it, and then the following check works (IF (PLAYER_DRIVERSLIB_LINKFLAGS)).

    Please apply this patch quickly, or compilation of the player server will break for everyone downloading player from SVN, and not using any drivers with external libraries (most people). Sorry that I did not catch this before, will do more testing next time!

    Greetings,

    Alexis Maldonado
    Info9 - TUM

    File Added: fix_compile_without_externlibs.patch

     
  • Alexis Maldonado

    small addition to fix a compilation without external libs

     
  • G Biggs

    G Biggs - 2008-05-13
    • status: open --> closed
     

Log in to post a comment.