1 | | = BarrettHand BH8-262 software setup - Linux = |
2 | | == !Ubuntu/Debian == |
3 | | The BarrettHand software version 4.4.x will run in Linux under the 32-bit version of Ubuntu 9.10. This software is installable with a Debian package, which contains the source code and precompiled binaries that are ready to run the demos, examples, and GUI for these versions of uBuntu. Double-clicking on the Debian package will download and install all dependencies automatically and is the easiest way to get started running and developing software for the BarrettHand quickly. If you are not running Ubuntu version 9.10, which this software was tested with, it may be possible to build the GUI, demos, and examples from the BarrettHand source code provided in the "tgz" compressed version of the software. |
| 1 | = BarrettHand BH8-262 software setup - Windows = |
| 2 | This file describes how to build the BarrettHand Control GUI, BarrettHand API Library, Examples, and Demos from the provided source files. The necessary third party headers and libraries (CTB serial port library, POCO, and wxWidgets) are included in the Windows installer to reduce the effort in compiling the source files for the hand with MinGW and Visual C++ 2008. The instructions for building these libraries from source code are included below. Windows XP or later is required (32-bit version) and the Peak drivers for the USB to CAN adapter if using a BH8-280 hand. |
26 | | make clean |
27 | | make |
28 | | |
29 | | When you have the GUI installed and are ready to run it, open a terminal and issue: |
30 | | |
31 | | cd /usr/local/Barrett/BHand/bhcontrol |
32 | | ./BHControl |
33 | | |
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 | | cd Desktop/codeblocks-8.02-src |
37 | | ./configure |
38 | | make -j4 |
39 | | make install |
40 | | ldconfig |
41 | | |
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 | | |
44 | | To build or rebuild the BarrettHand Control GUI: |
45 | | - Start !CodeBlocks by either: |
46 | | - Launching it in Applications -> Programming -> Code::Blocks IDE |
47 | | - Opening a terminal and issuing: sudo codeblocks |
48 | | - Open the !CodeBlocks project file BHControl (in /usr/local/Barrett/BHand/bhcontrol/BHControl.cbp) |
49 | | - Select the build target: Build -> Build Target -> Linux Release |
50 | | - Click Build -> Build and Run or press F9 |
51 | | |
52 | | The binary for the API library is not required to build the Control GUI. Presently, it is only used to build the demos to illustrate how to use a Makefile to build from the API library instead of including "bhand.cpp". |
53 | | |
54 | | To build or rebuild the BarrettHand API Library: |
55 | | - Open the !CodeBlocks project file BHand in the API directory |
56 | | - Select the build target: Build -> Build Target -> Linux Release |
57 | | - Build by clicking Build -> Build |
58 | | |
59 | | ------------------------------------------------------------------------------- |
60 | | Additional Info for BarrettHand Libraries, Headers, and Makefiles |
61 | | ------------------------------------------------------------------------------- |
62 | | |
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 | | libctb-barrett-0.14.a |
66 | | libctb-barrett-0.14.so |
67 | | libPocoFoundationBarrett.so |
68 | | |
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 | | |
71 | | ---------------------------------------------------------------------------- |
72 | | Compressed "tgz" file |
73 | | ---------------------------------------------------------------------------- |
74 | | |
75 | | The rest of this file describes how to build the BarrettHand Control GUI, BarrettHand API Library, Examples, and Demos from the provided source files for Ubuntu with the compressed tgz file. These instructions are not necessary if installing on Ubuntu 7.10 or 9.10. For these platforms it is recommended to install the BarrettHand Software with the provided Debian package, which will download dependencies so that you can get started with running and developing software for the BarrettHand quickly. In case you don't want to install the BarrettHand software with the Debian package below are alternative installation instructions to get started with the software provided in the .tgz file for the BarrettHand software. |
76 | | |
77 | | ---------------------------------------------------------------------------- |
78 | | GNU C++ Compiler |
79 | | ---------------------------------------------------------------------------- |
80 | | |
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 | | |
83 | | sudo apt-get install build-essential |
84 | | |
85 | | ------------------------------------------------------------- |
86 | | Installing Third Party Dependencies for Ubuntu |
87 | | ------------------------------------------------------------- |
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 | | |
100 | | 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 |
| 32 | - Install SED from http://gnuwin32.sourceforge.net/packages/sed.htm |
| 33 | - Locate and run the script build_ctb.bat in "C:\Program Files\Barrett Technology\BHand\ThirdParty" |
| 34 | - This scipt will automatically issue "mingw32-make -f makefile.gcc DEBUG=0 GPIB=0" to build the CTB library |
119 | | 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 | | |
125 | | 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 | | |
129 | | Notes on having multiple versions of POCO: |
130 | | 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. |
131 | | |
132 | | At this point you may compile the examples or continue the building dependencies for the GUI. |
| 54 | At this point you may compile the examples and/or continue building dependencies for the GUI. |
141 | | Select the following package and install it |
142 | | libwxgtk2.8-dev |
| 65 | The debug and release libraries still need to be built for MingGW. Follow these steps: |
| 66 | - Edit wxWidgets-2.8.11\include\wx\msw\setup.h and change the #define wxUSE_GLCANVAS 0 to #define wxUSE_GLCANVAS 1 |
| 67 | - Also change the line that defines wxWIN_COMPATIBILITY from 1 to 0 |
| 68 | - Open a command prompt and issue the following commands |
| 69 | - CD C:\wxWidgets-2.8.11\build\msw |
| 70 | - mingw32-make -f makefile.gcc SHARED=0 UNICODE=0 USE_OPENGL=1 |
| 71 | - mingw32-make -f makefile.gcc SHARED=0 BUILD=release UNICODE=0 USE_OPENGL=1 |
| 72 | - Set the WXWIN environment variable to be C:\wxWidgets-2.8.11 or the correct path |
153 | | ------------------------------------------------------------- |
154 | | Building the Examples |
155 | | ------------------------------------------------------------- |
156 | | |
157 | | To build Monitor Strain, RealTime, and Supervisory examples open a terminal. The examples do not require the BarrettHand API library binary and instead directly include the BarrettHand source files. |
158 | | |
159 | | In the terminal: |
160 | | |
161 | | 1. CD to the example directory (examples/supervisory, examples/realtime, etc) |
162 | | 2. Issue: "make" to build the example |
163 | | 3. Run it with "./Supervisory" or whatever the output name is |
| 86 | == Building the Examples == |
166 | | ------------------------------------------------------------- |
167 | | Code Blocks IDE |
168 | | ------------------------------------------------------------- |
| 89 | To build or rebuild Monitor Strain, RealTime, and Supervisory examples run the "make_examples" batch file located in the examples directory. The examples do not require the BarrettHand API Library because they include the BarrettHand source files. |
| 90 | |
| 91 | Alternatively, to build directly from the command prompt: |
| 92 | |
| 93 | 1. CD to the example directory (examples/supervisory, examples/realtime, etc) |
| 94 | 2. Issue: "mingw32-make ARCH=windows" to build the example |
| 95 | |
| 96 | Note: The POCO_BASE environment variable must be set to the directories of these dependencies. |
| 97 | |
| 98 | |
| 99 | == Code Blocks IDE == |
| 100 | |
174 | | Select the following package and install it |
175 | | codeblocks |
| 106 | 1) To build the BarrettHand Control GUI |
| 107 | - Open the CodeBlocks project file BHControl |
| 108 | - Select the build target: Build -> Build Target -> Windows Debug |
| 109 | - Build by clicking Build -> Build and Run or press F9 |
| 110 | |
| 111 | 2) To build the BarrettHand API Library |
| 112 | - Open the CodeBlocks project file BHand |
| 113 | - Select the build target: Build -> Build Target -> Windows Release |
| 114 | - Build by clicking Build -> Build |
| 115 | |
| 116 | Note: If the POCO or wxWidgets dependencies were installed to other locations you will need to modify the CodeBlocks project files so that the header and library files can be found. |
178 | | 1) To build and run the BarrettHand Control GUI |
179 | | - Start CodeBlocks by launching it in Applications -> Programming -> Code::Blocks IDE |
180 | | - Open the CodeBlocks project file BHControl (in /usr/local/Barrett/BHand/bhcontrol/) |
181 | | - Select the build target: Build -> Build Target -> Linux Debug |
182 | | - Click Build -> Build and Run or press F9 |
183 | | |
184 | | 2) To build the BarrettHand API Library |
185 | | - Open the CodeBlocks project file BHand in the API directory |
186 | | - Select the build target: Build -> Build Target -> Linux Debug |
187 | | - Build by clicking Build -> Build |
| 119 | == Building the Demos == |
229 | | The Debian package will install the PCAN USB adapter automatically. If you are installing the driver yourself, you may follow these steps to use the PCAN driver: |
230 | | |
231 | | 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 | | |
237 | | 2. Make and install PCAN library |
238 | | - cd peak-linux-driver-6.20 |
239 | | - make NET=NO |
240 | | - su -c "make install" |
241 | | |
242 | | 3. Load the PCAN loadable kernel module |
243 | | - cd driver |
244 | | - sudo modprobe pcan |
245 | | |
246 | | ------------------------------------------------------------- |
247 | | Launching BHControl GUI () |
248 | | ------------------------------------------------------------- |
249 | | |
250 | | Launching BHControl may require a known display and you may see an error similar to the one below. |
251 | | |
252 | | Xlib: extension "GLX" missing on display ":0.0". |
253 | | Xlib: extension "GLX" missing on display ":0.0". |
254 | | freeglut OpenGL GLX extension not supported by display ':0.0' |
255 | | |
256 | | Try to install graphics drivers so the that OpenGL will work for the GUI. A search online for your version of Ubuntu and the graphics manufacturer will probably return useful information for installing these graphics drivers. If you have Ubuntu 7.10 and an Nvidia card, you may try the Envy GUI found with the following link: http://linuxgamingtoday.wordpress.com/2008/01/24/install-nvidia-drivers-using-envy-in-ubuntu. |
257 | | |
| 158 | Open BHControl.sln which should be located in C:\Program Files\Barrett Technology\BHand\BHControl |
| 159 | - Select the Release configuration (debug build of the GUI in Visual Studio does not build) |
| 160 | - Right-click BHControl project in Solution Explorer and select Build |