From swaffoj at allegheny.edu Fri Nov 2 08:34:45 2007 From: swaffoj at allegheny.edu (John Mark Swafford) Date: Fri Nov 2 08:34:52 2007 Subject: [Pyro-users] Export and loadbrain() Questions Message-ID: <472B1965.6090405@allegheny.edu> Hello All, I have been able to make my experiment work thus far, but I have only figured out a slow way to do so. The first problem I encountered was exporting the PYTHONPATH and PYROBOT. I can run the following from the terminal: export PYTHONPATH=/dir export PYROBOT=/dir but they do not work when I run them as system commands from Python or when I run them as system commands from a Perl script. I also included them in my .bash_profile and I still have to type them every time I open a terminal. Has anyone found a way around this? My next question involves the .loadbrain() method. When I try and use the .loadbrain() method it only looks in a certain pyrobot directory (pyrobot/plugins/brains I think). I can still run my programs by linking them into that directory, but that is pretty slow. Is there a way to specify the directory that .loadbrain() looks at? Any and all suggestions would be more than welcome. Kind Regards, John Mark Swafford Allegheny College From dblank at brynmawr.edu Fri Nov 2 11:08:35 2007 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Fri Nov 2 11:08:35 2007 Subject: [Pyro-users] Export and loadbrain() Questions In-Reply-To: <472B1965.6090405@allegheny.edu> References: <472B1965.6090405@allegheny.edu> Message-ID: <2407.63.164.30.203.1194016115.squirrel@webmail.brynmawr.edu> On Fri, November 2, 2007 8:34 am, John Mark Swafford said: > Hello All, > > I have been able to make my experiment work thus far, but I have only > figured out a slow way to do so. The first problem I encountered was > exporting the PYTHONPATH and PYROBOT. I can run the following from the > terminal: > export PYTHONPATH=/dir > export PYROBOT=/dir The PYROBOT environment var should be: export PYROBOT=/dir/pyrobot and it needs to be in a subdir named pyrobot. This is probably the problem. -Doug > but they do not work when I run them as system commands from Python or > when I run them as system commands from a Perl script. I also included > them in my .bash_profile and I still have to type them every time I open > a terminal. Has anyone found a way around this? > > My next question involves the .loadbrain() method. When I try and use > the .loadbrain() method it only looks in a certain pyrobot directory > (pyrobot/plugins/brains I think). I can still run my programs by linking > them into that directory, but that is pretty slow. Is there a way to > specify the directory that .loadbrain() looks at? Any and all > suggestions would be more than welcome. > > Kind Regards, > John Mark Swafford > Allegheny College > _______________________________________________ > Pyro-users mailing list > Pyro-users@pyrorobotics.org > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > -- Douglas S. Blank Associate Professor, Bryn Mawr College http://cs.brynmawr.edu/~dblank/ Office: 610 526 6501 From swaffoj at allegheny.edu Fri Nov 2 12:04:52 2007 From: swaffoj at allegheny.edu (John Mark Swafford) Date: Fri Nov 2 12:04:53 2007 Subject: [Pyro-users] Typo in my last question Message-ID: <472B4AA4.2080402@allegheny.edu> I made a mistake when writing my last email on the line where it says: export PYROBOT=/dir should have been: export PYROBOT=/dir/pyrobot I can run the export commands straight from the command line and they function properly, but I am unable to run them from inside my Python program or a Perl program. My apologies for being unclear last time. Thanks, John Mark Swafford Allegheny College From pyro at netshark.com Fri Nov 2 16:35:50 2007 From: pyro at netshark.com (William K. Volkman) Date: Fri Nov 2 16:36:06 2007 Subject: [Pyro-users] Typo in my last question In-Reply-To: <472B4AA4.2080402@allegheny.edu> References: <472B4AA4.2080402@allegheny.edu> Message-ID: <1194035750.22882.14.camel@wkv1.zmaxsolutions.com> Hello, On Fri, 2007-11-02 at 10:04, John Mark Swafford wrote: > I made a mistake when writing my last email on the line where it says: > export PYROBOT=/dir > > should have been: > export PYROBOT=/dir/pyrobot > > I can run the export commands straight from the command line and they > function properly, but I am unable to run them from inside my Python > program or a Perl program. My apologies for being unclear last time. The problem would be in how you are performing the export. The environment data is usually initialized from the current process and inherited by child processes. I don't know how your are setting them from within your program however doing something like this will fail: os.system('export PYROBOT=/dir/pyrobot') The system command will create a child process set the environment variable and then destroy the child. The parent is not affected. Instead to set the value in the current processes environment use something like this: os.environ['PYROBOT']='/dir/pyrobot' os.system('echo $PYROBOT') If you want/need more clarification feel free to send me a snippet of your code. Cheers, William. From dblank at brynmawr.edu Fri Nov 2 21:53:45 2007 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Fri Nov 2 21:53:49 2007 Subject: [Pyro-users] Export and loadbrain() Questions In-Reply-To: <472B1965.6090405@allegheny.edu> References: <472B1965.6090405@allegheny.edu> Message-ID: <4483.63.164.30.203.1194054825.squirrel@webmail.brynmawr.edu> On Fri, November 2, 2007 8:34 am, John Mark Swafford said: ... > My next question involves the .loadbrain() method. When I try and use > the .loadbrain() method it only looks in a certain pyrobot directory > (pyrobot/plugins/brains I think). I can still run my programs by linking > them into that directory, but that is pretty slow. Is there a way to > specify the directory that .loadbrain() looks at? Any and all > suggestions would be more than welcome. Pyrobot will look in the current subdir (I think) and if it doesn't find the brain, will look in the pyrobot/plugins/brains subdir. -Doug > Kind Regards, > John Mark Swafford > Allegheny College From buys.johan at gmail.com Mon Nov 19 12:15:27 2007 From: buys.johan at gmail.com (Johan Buys) Date: Mon Nov 19 12:22:30 2007 Subject: [Pyro-users] GA NN./Blob Message-ID: HI, guys. This is my first posting, so please excuse me if I am a total idiot ;) Any way I would like some help. Ok first off I can't seem to get the NNFindblob running. I have searched google and found out that NNfindBlob needs the GAfindblobNN to run. But yet I cannot find it in the latest CVS version of Pyro? Second as mentioned above the blob stuff seems not to be working. I am using Player/Stage with a world file with a open space with colourful set of (blobs) objects. Ok so I get an error: Exception in Tkinter callback Traceback (most recent call last): File "lib-tk/Tkinter.py", line 1406, in ___call__ return self.func(*args) (And so on it goes on and on can't seem to copy paste from the pyrobot terminal x.X) and then at the very end.. ImportError: $PYRODIR/camera/blob/_blob.so: undefined symbol: _py_RefTotal I had to write out the data I couldn't copy paste... Ok on to the technical spec, Im running Ubuntu 7 with pyrobot version 5.0.0 player 2.4 stage 2.3. Any help would be very much appreciated! Thanks! -- Johan Buys From buys.johan at gmail.com Tue Nov 20 02:03:29 2007 From: buys.johan at gmail.com (Johan Buys) Date: Tue Nov 20 02:03:32 2007 Subject: [Pyro-users] _Py_RefTotal? Message-ID: Hi again, I managed to copy the output I get upon running NNfindBlob.pyc I am running python 2.5 pyrobot 5(cvs) player 2.0.4 stage 2.0.3. Numeric and all of those were installed as per instruction, but I think it has something to do with numeric not working? I used a simple test brain to see if player stage pyro is messing about but that all works, I'm busy doinga project were I need blob detection and learinig with a NN/GA. any help would be very much appreciated. Here is the output I got upon trying to load the brain NNfindBlob.pyc I get simmilar errors upon trying to run some other brains too, another error I get is step() takes exactly 3 arguments (1 given) upon trying to run NNBrain.pyc. ouput pated below. Attempting to import 'NNFindBlob'... Loaded '/usr/lib/python2.5/site-packages/pyrobot/plugins/brains/NNFindBlob.pyc'! Conx using seed: 1195607080.42 Attempting to import 'BlobCamera'... Exception in Tkinter callback Traceback (most recent call last): File "lib-tk/Tkinter.py", line 1406, in __call__ return self.func(*args) File "./gui/TK.py", line 206, in loadBrain File "./gui/__init__.py", line 483, in loadBrain self.engine.loadBrain(f) File "./engine/__init__.py", line 208, in loadBrain self.brain = system.loadINIT(file, self) File "./system/__init__.py", line 103, in loadINIT retval = userspace.INIT(engine) File "./plugins/brains/NNFindBlob.py", line 91, in INIT return NNBrain('NNBrain', engine) File "./brain/__init__.py", line 66, in __init__ self.setup(**kwargs) File "./plugins/brains/NNFindBlob.py", line 36, in setup self.robot.startDevice("BlobCamera") File "./robot/__init__.py", line 246, in startDevice dev = self.startDevices(item, **args) File "./robot/__init__.py", line 290, in startDevices file, self), **args) File "./system/__init__.py", line 86, in loadINIT exec("import " + module + " as userspace") File "", line 1, in File "./plugins/devices/BlobCamera.py", line 1, in from pyrobot.camera.blob import BlobCamera File "./camera/blob/__init__.py", line 2, in from pyrobot.camera.blob.blob import Blob File "./camera/blob/blob.py", line 7, in ImportError: /usr/lib/python2.5/site-packages/pyrobot/camera/blob/_blob.so: undefined symbol: _Py_RefTotal Attempting to import 'CamWorld'... Loaded '/usr/lib/python2.5/site-packages/pyrobot/plugins/worlds/Pyrobot/CamWorld.pyc'! Simulator starting listener on port 60000 ... Attempting to import 'NNBrain'... Conx, version 1.240 (regular speed) Loaded '/usr/lib/python2.5/site-packages/pyrobot/plugins/brains/NNBrain.pyc'! Conx using seed: 1195594362.03 Exception in thread Thread-1: Traceback (most recent call last): File "threading.py", line 460, in __bootstrap self.run() File "./brain/__init__.py", line 152, in run self.step() TypeError: step() takes exactly 3 arguments (1 given) -- Johan Buys From dblank at brynmawr.edu Tue Nov 27 10:13:04 2007 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Tue Nov 27 10:13:11 2007 Subject: [Pyro-users] _Py_RefTotal? In-Reply-To: References: Message-ID: <474C3400.4050809@brynmawr.edu> Johan, This looks to be a compile problem in: /usr/lib/python2.5/site-packages/pyrobot/camera/blob/ Looks like it could be a SWIG or Player/SWIG issue. I'll try to take a look soon, but could be a week. Let us know if you find anything. -Doug Johan Buys wrote: > Hi again, I managed to copy the output I get upon running NNfindBlob.pyc > > I am running python 2.5 pyrobot 5(cvs) player 2.0.4 stage 2.0.3. > Numeric and all of those were installed as per instruction, but I > think it has something to do with numeric not working? > > I used a simple test brain to see if player stage pyro is messing > about but that all works, I'm busy doinga project were I need blob > detection and learinig with a NN/GA. any help would be very much > appreciated. Here is the output I got upon trying to load the brain > NNfindBlob.pyc I get simmilar errors upon trying to run some other > brains too, another error I get is step() takes exactly 3 arguments (1 > given) upon trying to run NNBrain.pyc. ouput pated below. > > Attempting to import 'NNFindBlob'... > Loaded '/usr/lib/python2.5/site-packages/pyrobot/plugins/brains/NNFindBlob.pyc'! > Conx using seed: 1195607080.42 > Attempting to import 'BlobCamera'... > Exception in Tkinter callback > Traceback (most recent call last): > File "lib-tk/Tkinter.py", line 1406, in __call__ > return self.func(*args) > File "./gui/TK.py", line 206, in loadBrain > File "./gui/__init__.py", line 483, in loadBrain > self.engine.loadBrain(f) > File "./engine/__init__.py", line 208, in loadBrain > self.brain = system.loadINIT(file, self) > File "./system/__init__.py", line 103, in loadINIT > retval = userspace.INIT(engine) > File "./plugins/brains/NNFindBlob.py", line 91, in INIT > return NNBrain('NNBrain', engine) > File "./brain/__init__.py", line 66, in __init__ > self.setup(**kwargs) > File "./plugins/brains/NNFindBlob.py", line 36, in setup > self.robot.startDevice("BlobCamera") > File "./robot/__init__.py", line 246, in startDevice > dev = self.startDevices(item, **args) > File "./robot/__init__.py", line 290, in startDevices > file, self), **args) > File "./system/__init__.py", line 86, in loadINIT > exec("import " + module + " as userspace") > File "", line 1, in > File "./plugins/devices/BlobCamera.py", line 1, in > from pyrobot.camera.blob import BlobCamera > File "./camera/blob/__init__.py", line 2, in > from pyrobot.camera.blob.blob import Blob > File "./camera/blob/blob.py", line 7, in > ImportError: /usr/lib/python2.5/site-packages/pyrobot/camera/blob/_blob.so: > undefined symbol: _Py_RefTotal > > > Attempting to import 'CamWorld'... > Loaded '/usr/lib/python2.5/site-packages/pyrobot/plugins/worlds/Pyrobot/CamWorld.pyc'! > Simulator starting listener on port 60000 ... > Attempting to import 'NNBrain'... > Conx, version 1.240 (regular speed) > Loaded '/usr/lib/python2.5/site-packages/pyrobot/plugins/brains/NNBrain.pyc'! > Conx using seed: 1195594362.03 > Exception in thread Thread-1: > Traceback (most recent call last): > File "threading.py", line 460, in __bootstrap > self.run() > File "./brain/__init__.py", line 152, in run > self.step() > TypeError: step() takes exactly 3 arguments (1 given) > > From buys.johan at gmail.com Wed Nov 28 04:45:32 2007 From: buys.johan at gmail.com (Johan Buys) Date: Wed Nov 28 04:45:36 2007 Subject: [Pyro-users] _Py_RefTotal? In-Reply-To: <474C3400.4050809@brynmawr.edu> References: <474C3400.4050809@brynmawr.edu> Message-ID: Hi, I have since tried the Pyrobot knopix distro, and I still have issues with the blob handling. In the pyrobot Interface app, when I try to interact with the robot and simulator to try and retrieve blob info ( this is with stage, using a world file with blobs, and a cfg file with blobfinder) When i issue commands like robot.blobfinder[0] to access data I get nothing, is there any good reference for me to try and understand the pyrobot blob routines any better, It seems like the docs on the web is a bit dated? Has anyone gotten the player/stage blobfinder stuff to work in pyrobot? On Nov 27, 2007 5:13 PM, Douglas S. Blank wrote: > Johan, > > This looks to be a compile problem in: > > /usr/lib/python2.5/site-packages/pyrobot/camera/blob/ > > Looks like it could be a SWIG or Player/SWIG issue. I'll try to take a > look soon, but could be a week. Let us know if you find anything. > > -Doug > > > Johan Buys wrote: > > Hi again, I managed to copy the output I get upon running NNfindBlob.pyc > > > > I am running python 2.5 pyrobot 5(cvs) player 2.0.4 stage 2.0.3. > > Numeric and all of those were installed as per instruction, but I > > think it has something to do with numeric not working? > > > > I used a simple test brain to see if player stage pyro is messing > > about but that all works, I'm busy doinga project were I need blob > > detection and learinig with a NN/GA. any help would be very much > > appreciated. Here is the output I got upon trying to load the brain > > NNfindBlob.pyc I get simmilar errors upon trying to run some other > > brains too, another error I get is step() takes exactly 3 arguments (1 > > given) upon trying to run NNBrain.pyc. ouput pated below. > > > > Attempting to import 'NNFindBlob'... > > Loaded '/usr/lib/python2.5/site-packages/pyrobot/plugins/brains/NNFindBlob.pyc'! > > Conx using seed: 1195607080.42 > > Attempting to import 'BlobCamera'... > > Exception in Tkinter callback > > Traceback (most recent call last): > > File "lib-tk/Tkinter.py", line 1406, in __call__ > > return self.func(*args) > > File "./gui/TK.py", line 206, in loadBrain > > File "./gui/__init__.py", line 483, in loadBrain > > self.engine.loadBrain(f) > > File "./engine/__init__.py", line 208, in loadBrain > > self.brain = system.loadINIT(file, self) > > File "./system/__init__.py", line 103, in loadINIT > > retval = userspace.INIT(engine) > > File "./plugins/brains/NNFindBlob.py", line 91, in INIT > > return NNBrain('NNBrain', engine) > > File "./brain/__init__.py", line 66, in __init__ > > self.setup(**kwargs) > > File "./plugins/brains/NNFindBlob.py", line 36, in setup > > self.robot.startDevice("BlobCamera") > > File "./robot/__init__.py", line 246, in startDevice > > dev = self.startDevices(item, **args) > > File "./robot/__init__.py", line 290, in startDevices > > file, self), **args) > > File "./system/__init__.py", line 86, in loadINIT > > exec("import " + module + " as userspace") > > File "", line 1, in > > File "./plugins/devices/BlobCamera.py", line 1, in > > from pyrobot.camera.blob import BlobCamera > > File "./camera/blob/__init__.py", line 2, in > > from pyrobot.camera.blob.blob import Blob > > File "./camera/blob/blob.py", line 7, in > > ImportError: /usr/lib/python2.5/site-packages/pyrobot/camera/blob/_blob.so: > > undefined symbol: _Py_RefTotal > > > > > > Attempting to import 'CamWorld'... > > Loaded '/usr/lib/python2.5/site-packages/pyrobot/plugins/worlds/Pyrobot/CamWorld.pyc'! > > Simulator starting listener on port 60000 ... > > Attempting to import 'NNBrain'... > > Conx, version 1.240 (regular speed) > > Loaded '/usr/lib/python2.5/site-packages/pyrobot/plugins/brains/NNBrain.pyc'! > > Conx using seed: 1195594362.03 > > Exception in thread Thread-1: > > Traceback (most recent call last): > > File "threading.py", line 460, in __bootstrap > > self.run() > > File "./brain/__init__.py", line 152, in run > > self.step() > > TypeError: step() takes exactly 3 arguments (1 given) > > > > > > -- Johan Buys