Changes between Version 1 and Version 2 of Hand/280/SoftwareSetup/Linux
- Timestamp:
- Jul 7, 2015, 8:12:36 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Hand/280/SoftwareSetup/Linux
v1 v2 8 8 9 9 In 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. 10 10 {{{ 11 11 deb http://old-releases.ubuntu.com/ubuntu/ gutsy main universe multiverse 12 12 deb http://old-releases.ubuntu.com/ubuntu/ gutsy-updates main universe multiverse 13 13 deb http://old-releases.ubuntu.com/ubuntu/ gutsy-security main universe multiverse 14 14 }}} 15 15 If the BarrettHand software is installed using the Debian package it will be in the directory: 16 17 18 16 {{{ 17 /usr/local/Barrett/BHand 18 }}} 19 19 If 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: 20 21 22 23 20 {{{ 21 cd /usr/local/Barrett/BHand/examples/Supervisory 22 ./Supervisory 23 }}} 24 24 The 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: 25 26 27 28 25 {{{ 26 make clean 27 make 28 }}} 29 29 When you have the GUI installed and are ready to run it, open a terminal and issue: 30 31 32 33 30 {{{ 31 cd /usr/local/Barrett/BHand/bhcontrol 32 ./BHControl 33 }}} 34 34 The !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 http://www.codeblocks.org/downloads. 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: http://www.codeblocks.org/downloads/6. Extract the package to the desktop and from a terminal issue these commands to build and install !CodeBlocks: 35 36 37 38 39 40 41 35 {{{ 36 cd Desktop/codeblocks-8.02-src 37 ./configure 38 make -j4 39 make install 40 ldconfig 41 }}} 42 42 You 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. 43 43 … … 62 62 63 63 The 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: 64 65 66 67 68 64 {{{ 65 libctb-barrett-0.14.a 66 libctb-barrett-0.14.so 67 libPocoFoundationBarrett.so 68 }}} 69 69 Notice 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. 70 70 … … 80 80 81 81 If you do not already have the build-essential package installed then you may install it from a terminal using the following line: 82 82 {{{ 83 83 sudo apt-get install build-essential 84 84 }}} 85 85 ------------------------------------------------------------- 86 86 Installing Third Party Dependencies for Ubuntu … … 92 92 93 93 Open 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 99 94 {{{ 95 cd thirdparty/sources/ctb-0.14/build 96 make DEBUG=0 GPIB=0 97 sudo su 98 make DEBUG=0 GPIB=0 install 99 ldconfig 100 }}} 100 101 Also, 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 libctb-0.14.so libctb-barrett-0.14.so 104 102 {{{ 103 cd /usr/local/lib 104 mv libctb-0.14.a libctb-barrett-0.14.a 105 mv libctb-0.14.so libctb-barrett-0.14.so 106 }}} 105 107 106 108 2) 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. … … 113 115 114 116 Unpackage poco into a temporary directory 115 gunzip poco-X.Y.tar.gz 116 tar -xf poco-X.Y.tar 117 cd poco-X.Y 118 117 {{{ 118 gunzip poco-X.Y.tar.gz 119 tar -xf poco-X.Y.tar 120 cd poco-X.Y 121 }}} 119 122 You 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 123 {{{ 124 ./configure --no-tests --no-samples --omit=XML,Util,Net 125 make -s -j4 Foundation-libexec 126 }}} 127 Install POCO to /usr/local 128 {{{ 129 sudo make -s Foundation-libexec install 130 }}} 125 131 Also, 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 libPocoFoundation.so libPocoFoundationBarrett.so 128 132 {{{ 133 cd /usr/local/lib 134 mv libPocoFoundation.so libPocoFoundationBarrett.so 135 }}} 129 136 Notes on having multiple versions of POCO: 130 137 If 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 libPocoFoundation.so as shown above. That file can be copied to /usr/local/lib manually. … … 206 213 the names /dev/ttyS0, /dev/ttyS1, etc. If you want to use a USB to Serial adapter then one way 207 214 to do that would be to create a symbolic link from a Terminal: 208 209 210 211 215 {{{ 216 rm /dev/ttyS0 217 ln -s /dev/ttyUSB0 /dev/ttyS0 218 }}} 212 219 To 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: 213 214 215 220 {{{ 221 minicom -s 222 }}} 216 223 To 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 217 218 219 220 221 224 {{{ 225 #! /bin/sh 226 rm /dev/ttyS0 227 ln -s /dev/ttyUSB0 /dev/ttyS0 228 }}} 222 229 and run: 223 update-rc.d myusbtoserial.sh defaults 224 230 {{{ 231 update-rc.d myusbtoserial.sh defaults 232 }}} 225 233 ------------------------------------------------------------- 226 234 Installing PCAN … … 230 238 231 239 1. 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) 236 240 {{{ 241 cd /usr/src 242 uname -r (to find out which linux kernel is being used) 243 ls (check to ensure the headers are available for this kernel, PCAN requires /usr/src/linux/include/linux/verson.h) 244 }}} 245 If you do not already have the symbolic link "linux" you may create it with: 246 {{{ 247 ln -s linux-headers-2.6.31-14-generic linux (substitute your linux header's directory) 248 }}} 237 249 2. Make and install PCAN library 238 - cd peak-linux-driver-6.20 239 - make NET=NO 240 - su -c "make install" 250 {{{ 251 cd peak-linux-driver-6.20 252 make NET=NO 253 su -c "make install" 254 }}} 241 255 242 256 3. Load the PCAN loadable kernel module 243 - cd driver 244 - sudo modprobe pcan 257 {{{ 258 cd driver 259 sudo modprobe pcan 260 }}} 245 261 246 262 -------------------------------------------------------------