Changes between Version 1 and Version 2 of Hand/280/SoftwareSetup/Linux

Jul 7, 2015, 8:12:36 PM (7 years ago)



  • Hand/280/SoftwareSetup/Linux

    v1 v2  
    99In the past the Debian package has been compiled to run on Ubuntu 7.10 and some of these notes are left here.  However, there aren't newer versions of wxWidgets available that are needed for the BHControl GUI for Gutsy (Ubuntu 7.10).  Barrett is not planning on generating a Debian installer packages for older versions of Ubuntu.  In addition to the build-essential package the BarrettHand Debian software package contains dependencies on libwxgtk2.8-d and libglut3-dev for the Control GUI.  Ubuntu 9.10 has repositories to download these but if you are using Ubuntu 7.10 then you will need to add additional repositories to the end of /etc/apt/sources.list in order to install the BarrettHand software with the Debian package.  Instead of editing this file by hand you may goto System -> Administration -> Software Sources -> Third Party Software and add these lines one at a time.
    1111deb gutsy main universe multiverse
    1212deb gutsy-updates main universe multiverse
    1313deb gutsy-security main universe multiverse
    1515If the BarrettHand software is installed using the Debian package it will be in the directory:
    17         /usr/local/Barrett/BHand
    1919If you have installed the software with the Debian package you should be all set to run an example.  To do so, open a terminal and issue:
    21         cd /usr/local/Barrett/BHand/examples/Supervisory
    22         ./Supervisory
     21cd /usr/local/Barrett/BHand/examples/Supervisory
    2424The example should start and will ask for a COM port.  Hit "1" and the enter key for /dev/ttyS0 (or a different number for other com ports).  See the notes further below if you are using a USB to serial adapter.  There are other demos and examples to try in the BHand directory.  If the software was installed with the Debian package then you will have the build-essential package installed on your system and will be able to rebuild the example by issuing:
    26         make clean
    27         make
     26make clean
    2929When you have the GUI installed and are ready to run it, open a terminal and issue:
    31         cd /usr/local/Barrett/BHand/bhcontrol
    32         ./BHControl
     31cd /usr/local/Barrett/BHand/bhcontrol
    3434The !CodeBlocks package is required to build or rebuild the GUI and can be downloaded and installed with Synaptic Package Manager in Ubuntu 9.10.  In the future there may be additional support for other IDEs like Eclipse.  On Ubuntu 7.10 you will have to download the sources online from  In addition, if you are using Ubuntu 7.10, you will need to download and install libgtk2.0-dev using Synaptic Package Manager in order to compile !CodeBlocks.  The older version of !Codeblocks 8.02 was found to be available at: Extract the package to the desktop and from a terminal issue these commands to build and install !CodeBlocks:
    36         cd Desktop/codeblocks-8.02-src
    37         ./configure
    38         make -j4
    39         make install
    40         ldconfig
     36cd Desktop/codeblocks-8.02-src
     38make -j4
     39make install
    4242You may rebuild the BarrettHand Control GUI or the API library with !CodeBlocks but to do so may require the appropriate permissions to modify files in /usr/local/Barrett (at least for Ubuntu 9.10).  Running !CodeBlocks as root will solve issues with permissions and allow you to rebuild the GUI.
    6363The Debian package will install binaries for libraries that are dependencies for the BarrettHand in /usr/local/lib.  The library files, which are required third party dependencies for controlling the hand, that are automatically installed by the BarrettHand software are:
    65         libctb-barrett-0.14.a
    6969Notice that the filenames for the third party CTB and POCO libraries have been renamed to include "barrett" or "Barrett" in order to not stomp on a users installation of the CTB or POCO libraries.  Barrett did not want it to be possible that the BarrettHand software would overwrite the users libraries so we renamed them to make sure they were unique.  When developing these applications users should link to these libraries (in /usr/local/Barrett/BHand/thirdparty/lib or the copies of these in /usr/local/lib).  However, the required header files are only available in /usr/local/Barrett/BHand/thirdparty/include.  See the examples, which show how a Makefile may include and link the required third party headers and libraries along with the BarrettHand source code file "bhand.cpp" and header file "bhand.h".  If you would rather link to the BarrettHand library instead of including the "bhand.cpp" source file in a Makefile then take look at the demos that illustrate how to do that.
    8181If you do not already have the build-essential package installed then you may install it from a terminal using the following line:
    8383sudo apt-get install build-essential
    8686        Installing Third Party Dependencies for Ubuntu
    9393Open a terminal and issue the commands
    94         cd thirdparty/sources/ctb-0.14/build
    95         make DEBUG=0 GPIB=0
    96         sudo su
    97         make DEBUG=0 GPIB=0 install
    98         ldconfig
     95cd thirdparty/sources/ctb-0.14/build
     96make DEBUG=0 GPIB=0
     97sudo su
     98make DEBUG=0 GPIB=0 install
    100101Also, in order to use the CodeBlocks IDE project files without changes, you will need rename the CTB libraries.  Rename these by issuing these commands:
    101         cd /usr/local/lib
    102         mv libctb-0.14.a libctb-barrett-0.14.a
    103         mv
     103cd /usr/local/lib
     104mv libctb-0.14.a libctb-barrett-0.14.a
    1061082) Build the POCO library.  Version 1.3.6 is the version that was tested and is included in thirdparty/sources).  You should also be able to download the latest version if you wish.
    114116Unpackage poco into a temporary directory
    115         gunzip poco-X.Y.tar.gz
    116         tar -xf poco-X.Y.tar
    117         cd poco-X.Y
     118gunzip poco-X.Y.tar.gz
     119tar -xf poco-X.Y.tar
     120cd poco-X.Y
    119122You only need to Build only the libraries that the BarrettHand Software requires
    120         ./configure --no-tests --no-samples --omit=XML,Util,Net
    121         make -s -j4 Foundation-libexec
    122         Install POCO to /usr/local
    123         sudo make -s Foundation-libexec install
     124./configure --no-tests --no-samples --omit=XML,Util,Net
     125make -s -j4 Foundation-libexec
     127Install POCO to /usr/local
     129sudo make -s Foundation-libexec install
    125131Also, in order to use the CodeBlocks IDE project files without changes, you will need rename the POCO library.  Rename it by issuing these commands:
    126         cd /usr/local/lib
    127         mv
     133cd /usr/local/lib
    129136Notes on having multiple versions of POCO:
    130137If you want to have a separate version of POCO just for the BarrettHand then don't execute sudo make -s Foundation-libexec install.  Instead, copy the header files to a location outside of /usr/local/include and include them when you build the API.  Also, rename the as shown above.  That file can be copied to /usr/local/lib manually.
    206213the names /dev/ttyS0, /dev/ttyS1, etc.  If you want to use a USB to Serial adapter then one way
    207214to do that would be to create a symbolic link from a Terminal:
    209         rm /dev/ttyS0
    210         ln -s /dev/ttyUSB0 /dev/ttyS0
     216rm /dev/ttyS0
     217ln -s /dev/ttyUSB0 /dev/ttyS0
    212219To verify a serial connection with the Hand that is not dependent on the GUI you may use Minicom that may be downloaded with Synaptic Packet Manager.  It is a program for Linux that is similar to Hyperterminal.  Configure the baud rate, device name ("/dev/ttyS0", "/dev/ttyUSB0", etc.), and verify that commands such as "HI" can be sent to the hand.  Start minicom from a terminal with:
    214         minicom -s
     221minicom -s
    216223To actually make the USB to serial adapter work after a reset, one way is to create a script as shown below and add it to /etc/init.d
    218         #! /bin/sh
    219         rm /dev/ttyS0
    220         ln -s /dev/ttyUSB0 /dev/ttyS0
     225#! /bin/sh
     226rm /dev/ttyS0
     227ln -s /dev/ttyUSB0 /dev/ttyS0
    222229and run:
    223         update-rc.d defaults
     231update-rc.d defaults
    226234        Installing PCAN
    2312391. Create a symbolic link to the kernel header files
    232         - cd /usr/src
    233         - type uname -r to find out which linux kernel is being used
    234         - type ls and check to ensure the headers are available for this kernel (PCAN requires /usr/src/linux/include/linux/verson.h)
    235         - if you do not already have the symbolic link "linux" you may create it with ln -s linux-headers-2.6.31-14-generic linux (substitute your linux header's directory)
     241cd /usr/src
     242uname -r (to find out which linux kernel is being used)
     243ls (check to ensure the headers are available for this kernel, PCAN requires /usr/src/linux/include/linux/verson.h)
     245If you do not already have the symbolic link "linux" you may create it with:
     247ln -s linux-headers-2.6.31-14-generic linux (substitute your linux header's directory)
    2372492. Make and install PCAN library
    238         - cd peak-linux-driver-6.20
    239         - make NET=NO
    240         - su -c "make install"
     251cd peak-linux-driver-6.20
     252make NET=NO
     253su -c "make install"
    2422563. Load the PCAN loadable kernel module
    243         - cd driver
    244         - sudo modprobe pcan
     258cd driver
     259sudo modprobe pcan