![]() |
|||||||
| [ Home ] | [ Software ] | [ Curriculum ] | [ Hardware ] | [ Community ] | [ News ] | [ Publications ] | [ Search ] |
|
Pyro InstallationThis page documents the procedure to install Pyro. Pyro has been tested under RedHat Linux versions 7.x, 8.0, and 9. Pyro should work under any system that supports Python. To begin, you will need Python and a good compiler (gcc). On top of that, follow the instructions below, and please update this page if you have useful hints or questions. Thanks, and good luck!
To install and use Pyro, you will need all of the following:
Soon, we hope to have packages for Debian (.deb) and Redhat (.rpm). However, until we do, you'll want to follow the instructions to make and install each of the different packages manually. But, we have begun to explore Debian's automatted installation tools. Jim Marshall has started a detail set of instructions for Debian: PyroInstallationDebian. Other users will probably want to follow the following install notes.
Step 0: Install Swig 1.3.17 or betterIf you get an error about not finding SWIG or if your version is too low, you will need to install it. How can you tell?
% swig -version SWIG Version 1.3.17u-20030407-1334 Copyright (c) 1995-1998 University of Utah and the Regents of the University of California Copyright (c) 1998-2002 University of Chicago Compiled with CC
If your version is less than 1.3.17, then you need to upgrade.
Step 1: Install Python 2.2 or betterIf you already have Python 2.2 installed, go to step #2. How can you tell?
% python Python 2.2.1 (#1, Oct 19 2001, 11:57:05) [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on linux2 Type "copyright", "credits" or "license" for more information. >>> If the version number is less than 2.2, you need a more recent version. Press Control+d to exit. Sometimes python2.1 or python2.2 may be installed in addition to python1.5. Try typing python2.2 or python2.3 at the shell prompt. If the system comes back with something like command not found for both python2.2 and python2.3, then you will need to install a 2.x version of Python. Pyro has been tested with 2.2-2.3.
Download a version of Python 2 from
It is a good idea after this step to exit from the shell that you are currently running (exit or Control+d) and start a new one. For example, your LD_LIBRARY_PATH may have changed, and you need to refresh it.
Step 2: Install Numeric.pyIf you already have Numeric.py installed, go to step #3. How can you tell?
$ python Python 2.1.1 (#1, Oct 19 2001, 11:57:05) [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on linux2 Type "copyright", "credits" or "license" for more information. >>> import Numeric >>> If this gives an error, then you need to install Numeric.py. You can find Numeric at emergent.brynmawr.edu/~dblank/pyrobot/tars/ . Installing it looks something like:
Note: You should install Numeric version 22, which includes the RandomArray module required by Con-x in Pyro version 3.3.0 and less. You can use Numeric version 23 with Pyro 3.3.1 and greater. Note: for Fedora Core 2, versions more recent than 23.1 will require updating Atlas to get lcblas.
Step 3: Install PILIf you already have the Python Image Library installed, go to step #4. How can you tell?
$ python Python 2.1.1 (#1, Oct 19 2001, 11:57:05) [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on linux2 Type "copyright", "credits" or "license" for more information. >>> import PIL >>> If this gives an error, then you need to install PIL. You can find PIL at www.pythonware.com/products/pil/index.htm. Installing it looks something like:
Taking the hint from /usr/include/freetype2/freetype/freetype.h, in _imagingft.c of the current PIL distribution replace #include <freetype/freetype.h> with #include <ft2build.h> #include FT_FREETYPE_H NOTE: For Fedora Core 2, a PIL rpm file can be obtained from atrpms.net/dist/fc2/PIL/.
Step # 4: Install TkinterThe latest versions of Python may not have included Tkinter. If you get an error in Python with import Tkinter then you may need to install the tkinter-XX.rpm, itcl-XX.rpm and tix-XX.rpm files as well. Note: For Fedora Core 2 use "yum install tkinter".
Step #5: Install PyroOnce the above have been installed, you are ready to setup the environment and make the Pyro C-based modules. You can find the latest Pyro installation files at: emergent.brynmawr.edu/~dblank/pyrobot/tars/ and select the highest numbered file. Next, put the Pyro tar file where you will install the system:
% su - % mv pyro-X.X.tgz /usr/local/ % cd /usr/local Untar the system, and change to that directory:
% tar xfz pyro-X.X.tgz % cd pyro Now you are ready to build Pyro. NOTE: you must build Pyro in the location that it will be installed. If you move it, you will need to remake it (make clean; make). Now, simply run 'make' in the root of the pyro subdirectory:
% make The first step in the process is to define some variables. Answer the questions as they are posed. The answers will be stored in the file Makefile.cfg. You can run the config options again by running "python configure.py". This will run automatically the first time when you run make. For example:
$ make --------------------------------------------------------------------- This is the configure.py script for installing Pyro, Python Robotics. Pressing ENTER by itself will accept the default (shown in brackets). --------------------------------------------------------------------- What version of Python do you want to build Pyro for? (Leave empty if your Python binary is just "python") If you need to type 'python2.2' to run Python, then enter "2.2". ----------------------- 1. Python version number? []: 2.2 ----------------------- 2. Where are Python's include files? [/usr/local/include/python2.2]: ----------------------- 3. Where is Python's binary? [/usr/local/bin/python2.2]: ----------------------- 4. Where is Saphira? (Type 'none' if you don't have it) [/usr/local/saphira/ver62]: ----------------------- 5. Where is the X11 include directory? [/usr/X11]: Configuration is complete! You just created Makefile.cfg. You can run this again, or edit Makefile.cfg by hand if you need to. Now you are ready to run 'make' Although you don't need to right now, you can also run "make clean", and "mkdir tars; make tar".
Step #6: Testing the InstallationNow let's run the program. First, we need to set some environment variables. The following examples are given in the form assuming a bash-style console. If you use tcsh or another shell, you may have to use the "setenv VAR=value" format. Put some or all of the following (depending on what you have installed) in your $HOME/.bashrc file.
export PYTHONSTARTUP=$HOME/.python # Needed for some nice features (history in Python) If you will be running Saphira or Aria, then you also need to set these:
export SAPHIRA=/usr/local/saphira/ver62/ # Needed if you run the Pioneer robots export SAPHIRA_COMPIPE=/tmp/$USER # Needed if you run the Pioneer robots export ARIA=/usr/local/Aria # Needed for Saphira 8.0 export PATH=$PATH:/usr/local/Aria/bin # Needed for Saphira 8.0 All done! You can now run Pyro with the command:
% cd pyro % bin/pyro or put pyrobot/bin in your path and just call pyro. You should see a window appear, with no error messages.
Optional: Python Command-line HistoryIf you would like a nice command-line history in Python, put the following in your /home/YOURNAME/.python file:
import os, readline
histfile = os.path.join(os.environ["HOME"], ".pyhist")
try:
readline.read_history_file(histfile)
except IOError:
pass
import atexit
atexit.register(readline.write_history_file, histfile)
#readline.parse_and_bind("tab: complete")
del os, histfile, readline
and export PYTHONSTARTUP=~/.python. See PyroSetUp for further site customizations. That's it for installation! Have fun!
Trouble ShootingWhat are some common problems people might have? Put your question or hint here. Thanks! Version considerations:
The next planned version of Pyro (Pyro Version 4.0) is schedule to be ready around March, 2005. It is planned to have an upgraded interface, refactored internals to make some functions "more Pythonic", be compatible with the latest Player/Stage/Gazebo, work with Sony's AIBO, and have versions for Windows and Macintosh. Additional Notes:
export LD_LIBRARY_PATH=/usr/local/lib
in the installer's .bashrc file. This might have been mentioned elsewhere, but it was the key for our install.
Multiuser Robocup-Type EventsHere is an easy project: build a Gazebo or Stage world with as many robots as you have students. Start it on the server. Each student is assigned a port (or you could make robot.py files for each student with the port/hostname already defined). Then each would connect onto the server. You could:
One issue with this is that you will need to be able to access each machine. If you have a firewall up, here is how to poke some holes in it. You need to edit /etc/sysconfig/iptables by adding the appropriate lines: In RedHat 9.0, add:
-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 6665:6765 --syn -j ACCEPT In Fedora Core 2, add:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 6665:6765 --syn -j ACCEPT
Related topics: Go here for full search functions |
| [ Home ] | [ Software ] | [ Curriculum ] | [ Hardware ] | [ Community ] | [ News ] | [ Publications ] | [ Search ] |
View Wiki Source | Edit Wiki Source | Mail Webmaster | |||||||