From adrovane at gmail.com Sun Dec 11 06:08:07 2005 From: adrovane at gmail.com (Adrovane Kade) Date: Sun Dec 11 06:08:11 2005 Subject: [Pyro-users] SOM package error Message-ID: Hi. I'm interested in a working SOM environment in Python, and found Pyrobot. I followed the install and tutorial available in the project homepage, but I'm having this error: Python 2.4.2 (#2, Sep 30 2005, 21:19:01) [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from pyrobot.brain import psom >>> from pyrobot.brain.psom import vis >>> mysom = vis.VisPsom(3, 4, dim=5) FIXME: 0.115802197484 0 Traceback (most recent call last): File "", line 1, in ? File "./brain/psom/vis.py", line 54, in __init__ File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 241, in __init__ File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 1059, in __init__ File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 133, in list_to_arr File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 70, in _ptrset TypeError: unsubscriptable object I'm using Ubuntu 5.10. I have another question: I'm interested in using SOM in an environment which does not use robots. Is there an easy way of extract the SOM module from Pyrobot? If so, please guide me. Thanks, amklinux -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20051211/430bf72f/attachment.htm From dblank at brynmawr.edu Sun Dec 11 15:03:04 2005 From: dblank at brynmawr.edu (dblank@brynmawr.edu) Date: Sun Dec 11 15:03:07 2005 Subject: [Pyro-users] SOM package error In-Reply-To: References: Message-ID: <40482.68.34.179.225.1134331384.squirrel@webmail.brynmawr.edu> amklinux, That is a bit of fragile code that at some point should be rewritten. In the mean time, we keep putting tape to hold it together. I've made a couple of changes to hold it together. You can either get the latest from CVS, or just the one file: http://compscitest.brynmawr.edu/cgi-bin/viewcvs.cgi/pyrobot/brain/psom/__init__.py I tested it somewhat, but not extensively. Let us know if that works for you. As for using this outside of the rest of pyro; sure. Of course you don't need to build any of pyro, but it might be easier just to leave the pyro/brain/psom diretories in place. -Doug > Hi. > > I'm interested in a working SOM environment in Python, and found Pyrobot. > I > followed the install and tutorial available in the project homepage, but > I'm > having this error: > > Python 2.4.2 (#2, Sep 30 2005, 21:19:01) > [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> from pyrobot.brain import psom >>>> from pyrobot.brain.psom import vis >>>> mysom = vis.VisPsom(3, 4, dim=5) > FIXME: 0.115802197484 0 > Traceback (most recent call last): > File "", line 1, in ? > File "./brain/psom/vis.py", line 54, in __init__ > File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 241, in > __init__ > File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 1059, in > __init__ > > File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 133, in > list_to_arr > > File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 70, in > _ptrset > > TypeError: unsubscriptable object > > I'm using Ubuntu 5.10. > > I have another question: I'm interested in using SOM in an environment > which > does not use robots. Is there an easy way of extract the SOM module from > Pyrobot? If so, please guide me. > > Thanks, > > amklinux > _______________________________________________ > Pyro-users mailing list > Pyro-users@emergent.brynmawr.edu > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > From marshall at cs.pomona.edu Sun Dec 11 16:23:55 2005 From: marshall at cs.pomona.edu (Jim Marshall) Date: Sun Dec 11 16:24:31 2005 Subject: [Pyro-users] Re: Pyrobot and Speed In-Reply-To: References: Message-ID: <439C98EB.7050207@cs.pomona.edu> Dear Pyro users, Here's a question from some students trying to use a GA to evolve a brain in Pyro. Any suggestions? Thanks! Paul Aurich wrote: > So Ned and I have an evolutionary program that we'd like to evolve a > bunch (and try changing a few things and then evolving). The problem is > that Pyrobot seems to be limited to operating at 'normal' speeds (since > it's designed for simulating real robots, I would assume)... > > We looked around and found things like > http://emergent.brynmawr.edu/emergent/PyroFromPython?action=show and Dan > mentioned something along the lines of > 'self.robot.set("robot/timestep")', but none of this has actually worked... > > Do you have any tips on how we can get our program to tell Pyrobot to > drop the speed inhibitors? > > Thanks, > Paul and Ned From marshall at cs.pomona.edu Sun Dec 11 16:27:03 2005 From: marshall at cs.pomona.edu (Jim Marshall) Date: Sun Dec 11 16:27:39 2005 Subject: [Pyro-users] Re: Additional problem with Pyro In-Reply-To: <439BE80C.3040706@pomona.edu> References: <439BE80C.3040706@pomona.edu> Message-ID: <439C99A7.2020601@cs.pomona.edu> Here's another problem we've run into. Could this be a Pyrobot bug? Paul Aurich wrote: > In addition to our problem with pyro being too "slow", I just checked > the status of our current run and noted that it had crashed with the > traceback at the bottom of this message (the second traceback is, I'm > assuming, one of the other threads noting that the main simulator seems > to have crashed)... > > The code that generated this problem is based off of the multi-file > example you provided with the assignment. Our robots appear to operate > properly (i.e. stupidly ;-)) up until the point where this occurs... > > This may have happened before. Our first trial died somewhere in the > middle of the 20th generation, but that was run from one of the lab > machines and we haven't yet gone and seen if someone booted us off or > what... This trial died during generation 24 and we have the error > messages because I ran it (using X11 forwarding to one of the lab > machines) from my personal Linux computer. > > Do you have any idea why we're seeing these problems? > > Thanks, > Paul > > Exception happened during processing of request from ('127.0.0.1', 58804) > Traceback (most recent call last): > File "/usr/lib/python2.3/SocketServer.py", line 222, in handle_request > self.process_request(request, client_address) > File "/usr/lib/python2.3/SocketServer.py", line 241, in process_request > self.finish_request(request, client_address) > File "/usr/lib/python2.3/SocketServer.py", line 254, in finish_request > self.RequestHandlerClass(request, client_address, self) > File "/usr/lib/python2.3/SocketServer.py", line 521, in __init__ > self.handle() > File > "/usr/lib/python2.3/site-packages/pyrobot/plugins/simulators/PyrobotSimulator", > line 46, in handle > retval = self.gui.process(request, sockname) > File "./simulators/pysim/__init__.py", line 208, in process > ValueError: invalid literal for float(): -0.50c > ---------------------------------------- > Traceback (most recent call last): > File "PlayTagGA.py", line 159, in ? > ga.evolve() > File "./brain/ga.py", line 383, in evolve > File "./brain/ga.py", line 334, in applyFitnessFunction > File "PlayTagGA.py", line 105, in fitnessFunction > aX, aY, th = self.adapter.robot.simulation[0].getPose("Pioneer1") > ValueError: need more than 0 values to unpack > >>> Exception in thread Thread-1:Traceback (most recent call last): > File "/usr/lib/python2.3/threading.py", line 442, in __bootstrap > self.run() > File "./brain/__init__.py", line 151, in run > File "./robot/symbolic.py", line 130, in update > File "./robot/symbolic.py", line 134, in getItem > File "./robot/symbolic.py", line 200, in move > error: (32, 'Broken pipe') > > > ------------------------------------------------------------- > This message has been scanned by Postini anti-virus software. From dblank at brynmawr.edu Sun Dec 11 20:00:05 2005 From: dblank at brynmawr.edu (dblank@brynmawr.edu) Date: Sun Dec 11 20:00:08 2005 Subject: [Pyro-users] Re: Additional problem with Pyro In-Reply-To: <439C99A7.2020601@cs.pomona.edu> References: <439BE80C.3040706@pomona.edu> <439C99A7.2020601@cs.pomona.edu> Message-ID: <60439.68.34.179.225.1134349205.squirrel@webmail.brynmawr.edu> > Here's another problem we've run into. Could this be a Pyrobot bug? Jim et al, This is a symptom of a larger issue that has just popped up with the testing of such GA control programs. The problem is that there is no checking of any kind on the sending and receiving of data over the socket. If there is some data that gets corrupted, then you won't know it till you try to use it. In the last week, I have added some try/except clauses to catch some of these. The solution will be to rework the communication code to ensure that you get the right types and counts of values that you expect. If you haven't updated for a few days from CVS, you might try the latest version of Pyrobot. On the other hand, you could avoid the socket communication altogether, and that leads to the answer to your other question. You can run the Pyrobot Simulator without graphics, and without the connection to real time. This mode hasn't been tested much, but I'll send some details in the next message. -Doug > > Paul Aurich wrote: >> In addition to our problem with pyro being too "slow", I just checked >> the status of our current run and noted that it had crashed with the >> traceback at the bottom of this message (the second traceback is, I'm >> assuming, one of the other threads noting that the main simulator seems >> to have crashed)... >> >> The code that generated this problem is based off of the multi-file >> example you provided with the assignment. Our robots appear to operate >> properly (i.e. stupidly ;-)) up until the point where this occurs... >> >> This may have happened before. Our first trial died somewhere in the >> middle of the 20th generation, but that was run from one of the lab >> machines and we haven't yet gone and seen if someone booted us off or >> what... This trial died during generation 24 and we have the error >> messages because I ran it (using X11 forwarding to one of the lab >> machines) from my personal Linux computer. >> >> Do you have any idea why we're seeing these problems? >> >> Thanks, >> Paul >> >> Exception happened during processing of request from ('127.0.0.1', >> 58804) >> Traceback (most recent call last): >> File "/usr/lib/python2.3/SocketServer.py", line 222, in handle_request >> self.process_request(request, client_address) >> File "/usr/lib/python2.3/SocketServer.py", line 241, in process_request >> self.finish_request(request, client_address) >> File "/usr/lib/python2.3/SocketServer.py", line 254, in finish_request >> self.RequestHandlerClass(request, client_address, self) >> File "/usr/lib/python2.3/SocketServer.py", line 521, in __init__ >> self.handle() >> File >> "/usr/lib/python2.3/site-packages/pyrobot/plugins/simulators/PyrobotSimulator", >> line 46, in handle >> retval = self.gui.process(request, sockname) >> File "./simulators/pysim/__init__.py", line 208, in process >> ValueError: invalid literal for float(): -0.50c >> ---------------------------------------- >> Traceback (most recent call last): >> File "PlayTagGA.py", line 159, in ? >> ga.evolve() >> File "./brain/ga.py", line 383, in evolve >> File "./brain/ga.py", line 334, in applyFitnessFunction >> File "PlayTagGA.py", line 105, in fitnessFunction >> aX, aY, th = self.adapter.robot.simulation[0].getPose("Pioneer1") >> ValueError: need more than 0 values to unpack >> >>> Exception in thread Thread-1:Traceback (most recent call last): >> File "/usr/lib/python2.3/threading.py", line 442, in __bootstrap >> self.run() >> File "./brain/__init__.py", line 151, in run >> File "./robot/symbolic.py", line 130, in update >> File "./robot/symbolic.py", line 134, in getItem >> File "./robot/symbolic.py", line 200, in move >> error: (32, 'Broken pipe') From dblank at brynmawr.edu Sun Dec 11 20:33:18 2005 From: dblank at brynmawr.edu (dblank@brynmawr.edu) Date: Sun Dec 11 20:33:21 2005 Subject: [Pyro-users] Re: Pyrobot and Speed In-Reply-To: <439C98EB.7050207@cs.pomona.edu> References: <439C98EB.7050207@cs.pomona.edu> Message-ID: <49794.68.34.179.225.1134351198.squirrel@webmail.brynmawr.edu> > Dear Pyro users, > > Here's a question from some students trying to use a GA to evolve a > brain in Pyro. Any suggestions? Thanks! Jim, Ned, and Paul, You found the right page, and other than a couple of bits that needed to be updated to the current version, that should get you going. Here is a version I just tested with the latest Pyrobot: from pyrobot.simulators.pysim import * import time # (width, height), (offset x, offset y), scale: sim = Simulator((441,434), (22,420), 40.357554) # x1, y1, x2, y2 in meters: sim.addBox(0, 0, 10, 10) # (x, y) meters, brightness usually 1 (1 meter radius): sim.addLight(5, 5, 1) # port, name, x, y, th, bounding Xs, bounding Ys, color # (optional TK color name): sim.addRobot(60000, SimRobot("RedPioneer", 1, 1, -0.86, ((.75, .75, -.75, -.75), (.5, -.5, -.5, .5)))) # add some sensors: sim.robots[0].addDevice(PioneerFrontSonars()) sim.robots[0].addDevice(PioneerFrontLightSensors()) sim.robots[0].move(0, .5) print "Testing maximum speed..." steps = 1000 start = time.time() for i in range(steps): sim.step() stop = time.time() print "Average steps per second:", float(steps)/ (stop - start) And I get about 10000 steps per second. Each step is .1 seconds, so this is a substantial speed up. The sim.robots[0] interface is slightly different from the client side robot, but it does have move(). To do more, like reading the sensors for example, will require a bit more. Either you can call sim.process with the correct message, or I think you can just read the .scan array on the device. This will be very fast, and doesn't require a socket communication, so the problems from the first email will go away. I'd give this a try. Let us know if you get stuck. -Doug > > Paul Aurich wrote: >> So Ned and I have an evolutionary program that we'd like to evolve a >> bunch (and try changing a few things and then evolving). The problem is >> that Pyrobot seems to be limited to operating at 'normal' speeds (since >> it's designed for simulating real robots, I would assume)... >> >> We looked around and found things like >> http://emergent.brynmawr.edu/emergent/PyroFromPython?action=show and Dan >> mentioned something along the lines of >> 'self.robot.set("robot/timestep")', but none of this has actually >> worked... >> >> Do you have any tips on how we can get our program to tell Pyrobot to >> drop the speed inhibitors? >> >> Thanks, >> Paul and Ned From wshipley at odin.ac.hmc.edu Tue Dec 13 03:46:59 2005 From: wshipley at odin.ac.hmc.edu (William S. Shipley) Date: Tue Dec 13 08:11:09 2005 Subject: [Pyro-users] Accelerating Simulation Time with Pyrobot In-Reply-To: <439CF0E8.1080908@cs.pomona.edu> References: <439CF0E8.1080908@cs.pomona.edu> Message-ID: I've been attempting to implement a very basic genetically evolving algorithm for a robot in the PyrobotSimulator. I've seen the information at http://emergent.brynmawr.edu/emergent/PyroFromPython?action=show and I have a question involving its instructions on unlinking a simulation from real-time: The page mentions that "[This neural network brain] can, of course, be loaded as a regular brain. However, in this example, we will load it by directly instantiating an Engine object . . .." It later says, when specifically discussing the simulation acceleration, "We barely need the Engine object, but we will still use it to load the brain." I've had issues implementing an Engine that holds nothing but a brain. Specifically, when I attempt to instantiate an Engine with only a Brain, Pyrobot informs me that I need to instantiate a Robot first; instantiating with a Robot and a Brain causes the program to enter an endless loop waiting on the PyrobotSimulator; including a simfile or a worldfile starts pulling in aspects of the GUI that I would rather not use. (For instance, as per the wiki page I am using Simulator instead of TKSimulator, and the former does not have a mainloop() method, which PyrobotSimulator expects.) At the same time, I'm not entirely sure how one directly loads and accesses a brain "as a regular brain," without using an Engine object. If anyone can shed some light on what I can try next, or would like more details of my exact situation, let me know. Thanks, Will Shipley, HMC '06 From dblank at brynmawr.edu Tue Dec 13 10:31:09 2005 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Tue Dec 13 10:31:29 2005 Subject: [Pyro-users] Accelerating Simulation Time with Pyrobot In-Reply-To: References: <439CF0E8.1080908@cs.pomona.edu> Message-ID: <1134487870.9769.381.camel@mightymouse.brynmawr.edu> Will, You're on the right track, but the current way that Pyro works is that it expects that the simulator is another process for which the robot talks to over sockets. This is true for the simulators and real robots Stage, Player, Gazebo, Robocup, Aibo, and Pyrobot. However, this doesn't have to be the case. As long as the robot knows how to talk to the simulator, then the simulator could be in the same process. I've made a quick hack to test this out, and it seems to work just fine. Here's how you can do it, and get 50 to 100 updates a second depending on your computer speed. First, let's set up the simulator as per http://pyrorobotics.org/?page=PyroFromPython : ------------------------------------------------------------- from pyrobot.simulators.pysim import * import time # (width, height), (offset x, offset y), scale: sim = Simulator((441,434), (22,420), 40.357554) # x1, y1, x2, y2 in meters: sim.addBox(0, 0, 10, 10) # (x, y) meters, brightness usually 1 (1 meter radius): sim.addLight(5, 5, 1) # port, name, x, y, th, bounding Xs, bounding Ys, color # (optional TK color name): sim.addRobot(60000, SimRobot("RedPioneer", 1, 1, -0.86, ((.75, .75, -.75, -.75), (.5, -.5, -.5, .5)))) sim.addRobot(60001, SimRobot("BluePioneer", 8, 8, -0.86, ((.75, .75, -.75, -.75), (.5, -.5, -.5, .5)))) # add some sensors: sim.robots[0].addDevice(PioneerFrontSonars()) sim.robots[0].addDevice(PioneerFrontLightSensors()) sim.robots[1].addDevice(PioneerFrontSonars()) sim.robots[1].addDevice(PioneerFrontLightSensors()) ------------------------------------------------------------- Here I added a second robot and sensors to both. If you don't need sonar or light sensors, leave those off and it will go even faster. Now, we need to set up the client side: ------------------------------------------------------------- # client side: from pyrobot.robot.symbolic import Simbot from pyrobot.engine import Engine redPioneer = Simbot(sim, ["localhost", 60000], 0) bluePioneer = Simbot(sim, ["localhost", 60001], 1) rEng = Engine() rEng.robot = redPioneer rEng.loadBrain("Avoid") bEng = Engine() bEng.robot = bluePioneer bEng.loadBrain("Avoid") ------------------------------------------------------------- In this bit of code, we create a new Simbot which is just the old Pyrobot client robot, but told to talk to the simulator directly instead of through sockets. The Engine objects are used to load the brain file. (You don't have to use the brain control paradigm---you could put the code right in the loop that follows. But we'll keep the abstraction as it makes it easy to use in regular Pyro as well). Now, let's put it all together, and loop for a bit: ------------------------------------------------------------- steps = 500 start = time.time() for i in range(steps): redPioneer.update() bluePioneer.update() rEng.brain.step() bEng.brain.step() #print "red", redPioneer.x, redPioneer.y sim.step() stop = time.time() print "Average steps per second:", float(steps)/ (stop - start) ------------------------------------------------------------- That will run the brain/simulator as fast as possible. The simulator step() method moves the simulator .1 seconds forward. Notice that we have to manually update the robot, which updates the sensor readings. Then we run the step() method of the brain, which tells the robot how to move, then we move the simulator forward .1 seconds. Finally, a bit of system business. When you exit, you need to make sure that you tell the brains to stop running (brains are threads): ------------------------------------------------------------- def myquit(): rEng.shutdown() bEng.shutdown() import sys sys.exitfunc = myquit ------------------------------------------------------------- Put this all in a file, say fastpyro.py, and run like: python -i fastpyro.py and you can inspect the objects after they run. Control+d will close everything up. You can also substitute TkSimulator for Simulator and TkPioneer for Pioneer and you will be able to see the robots move in faster-than-real time. This will slow the system down a little though. Caveats: after you evolve a brain, it may not run exactly the same in the regular Pyro environment because the timings might be off. Maybe it will work. To use this, you'll need to upgrade to the 4.5.1 version in CVS. Hope this helps! -Doug On Tue, 2005-12-13 at 00:46 -0800, William S. Shipley wrote: > I've been attempting to implement a very basic genetically evolving > algorithm for a robot in the PyrobotSimulator. I've seen the information > at > > http://emergent.brynmawr.edu/emergent/PyroFromPython?action=show > > and I have a question involving its instructions on unlinking a > simulation from real-time: > > The page mentions that "[This neural network brain] can, of course, be > loaded as a regular brain. However, in this example, we will load it > by directly instantiating an Engine object . . .." It later says, > when specifically discussing the simulation acceleration, "We barely > need the Engine object, but we will still use it to load the brain." > > I've had issues implementing an Engine that holds nothing but a brain. > Specifically, when I attempt to instantiate an Engine with only a > Brain, Pyrobot informs me that I need to instantiate a Robot first; > instantiating with a Robot and a Brain causes the program to enter an > endless loop waiting on the PyrobotSimulator; including a simfile or a > worldfile starts pulling in aspects of the GUI that I would rather not > use. (For instance, as per the wiki page I am using Simulator instead > of TKSimulator, and the former does not have a mainloop() method, > which PyrobotSimulator expects.) > > At the same time, I'm not entirely sure how one directly loads and > accesses a brain "as a regular brain," without using an Engine object. > If anyone can shed some light on what I can try next, or would like > more details of my exact situation, let me know. > > Thanks, > Will Shipley, HMC '06 > _______________________________________________ > Pyro-users mailing list > Pyro-users@emergent.brynmawr.edu > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > -- Douglas S. Blank Computer Science Assistant Professor Bryn Mawr College (610)526-6501 http://cs.brynmawr.edu/~dblank From dblank at brynmawr.edu Tue Dec 13 11:54:47 2005 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Tue Dec 13 11:55:01 2005 Subject: [Pyro-users] Accelerating Simulation Time with Pyrobot In-Reply-To: <1134487870.9769.381.camel@mightymouse.brynmawr.edu> References: <439CF0E8.1080908@cs.pomona.edu> <1134487870.9769.381.camel@mightymouse.brynmawr.edu> Message-ID: <1134492887.9769.391.camel@mightymouse.brynmawr.edu> I made a couple of additional changes so that you can easily visualize your evolved soultions (and there was a bug in the size of the bounding box in the previous code I sent... which I didn't notice until I visualized the solution!) You can now use TkSimulator/TkPioneer or Simulator/Pioneer in the following code, and the code will either run in a window, or without graphics. Some tests that I ran on a 1.8 GHz Xeon computer running Linux: Regular Pyrobot: 10 steps/second Without sockets: 30 steps/second Without sockets and without GUI: 45 steps/second This will also work on Windows and Mac OS X, by the way. Here's the updated code (and I've updated the web page too). -Doug ------------------------------------------------------------------- from pyrobot.simulators.pysim import * import time # (width, height), (offset x, offset y), scale: sim = TkSimulator((441,434), (22,420), 40.357554, run = 0) # x1, y1, x2, y2 in meters: sim.addBox(0, 0, 10, 10) # (x, y) meters, brightness usually 1 (1 meter radius): sim.addLight(5, 5, 1) # port, name, x, y, th, bounding Xs, bounding Ys, color # (optional TK color name): sim.addRobot(60000, TkPioneer("RedPioneer", 1, 1, -0.86, ((.225, .225, -.225, -.225), (.15, -.15, -.15, .15)), "red")) sim.addRobot(60001, TkPioneer("BluePioneer", 8, 8, -0.86, ((.225, .225, -.225, -.225), (.15, -.15, -.15, .15)), "blue")) # add some sensors: sim.robots[0].addDevice(PioneerFrontSonars()) sim.robots[0].addDevice(PioneerFrontLightSensors()) sim.robots[1].addDevice(PioneerFrontSonars()) sim.robots[1].addDevice(PioneerFrontLightSensors()) # client side: from pyrobot.robot.symbolic import Simbot from pyrobot.engine import Engine redPioneer = Simbot(sim, ["localhost", 60000], 0) bluePioneer = Simbot(sim, ["localhost", 60001], 1) rEng = Engine() rEng.robot = redPioneer rEng.loadBrain("Avoid") bEng = Engine() bEng.robot = bluePioneer bEng.loadBrain("Avoid") steps = 1000 start = time.time() for i in range(steps): redPioneer.update() bluePioneer.update() rEng.brain.step() bEng.brain.step() #print "red", redPioneer.x, redPioneer.y sim.step(run = 0) sim.update() stop = time.time() print "Average steps per second:", float(steps)/ (stop - start) def myquit(): rEng.shutdown() bEng.shutdown() import sys sys.exitfunc = myquit -- Douglas S. Blank Computer Science Assistant Professor Bryn Mawr College (610)526-6501 http://cs.brynmawr.edu/~dblank From servando at mac.com Wed Dec 14 00:20:35 2005 From: servando at mac.com (Servando Garcia) Date: Wed Dec 14 00:20:44 2005 Subject: [Pyro-users] install ubuntu Message-ID: <1134537635.10929.1.camel@localhost.localdomain> Hello I am trying to install Pyrobot on my ubuntu machine. I am looking for a How Manual. I was hooping you could help. From servando at mac.com Wed Dec 14 08:12:01 2005 From: servando at mac.com (Servando Garcia) Date: Wed Dec 14 08:12:15 2005 Subject: [Pyro-users] install Pyrobot Message-ID: <1134565922.7092.2.camel@localhost.localdomain> I apologize for the clear message last time. It was very late. I need to install pyrobot on my ubuntu machine. From adrovane at gmail.com Wed Dec 14 08:29:03 2005 From: adrovane at gmail.com (Adrovane Kade) Date: Wed Dec 14 08:29:05 2005 Subject: [Pyro-users] SOM package error In-Reply-To: <40482.68.34.179.225.1134331384.squirrel@webmail.brynmawr.edu> References: <40482.68.34.179.225.1134331384.squirrel@webmail.brynmawr.edu> Message-ID: Hi, Doug. Yes, that worked for me! I still didn't finished the tutorial, however, but I'm not getting that error anymore. If I run into some other problem, I will let you know. Thanks, Adrovane (amklinux) 2005/12/11, dblank@brynmawr.edu : > > amklinux, > > That is a bit of fragile code that at some point should be rewritten. In > the mean time, we keep putting tape to hold it together. I've made a > couple of changes to hold it together. > > You can either get the latest from CVS, or just the one file: > > > http://compscitest.brynmawr.edu/cgi-bin/viewcvs.cgi/pyrobot/brain/psom/__init__.py > > I tested it somewhat, but not extensively. Let us know if that works for > you. > > As for using this outside of the rest of pyro; sure. Of course you don't > need to build any of pyro, but it might be easier just to leave the > pyro/brain/psom diretories in place. > > -Doug > > > Hi. > > > > I'm interested in a working SOM environment in Python, and found > Pyrobot. > > I > > followed the install and tutorial available in the project homepage, but > > I'm > > having this error: > > > > Python 2.4.2 (#2, Sep 30 2005, 21:19:01) > > [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > >>>> from pyrobot.brain import psom > >>>> from pyrobot.brain.psom import vis > >>>> mysom = vis.VisPsom(3, 4, dim=5) > > FIXME: 0.115802197484 0 > > Traceback (most recent call last): > > File "", line 1, in ? > > File "./brain/psom/vis.py", line 54, in __init__ > > File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 241, in > > __init__ > > File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 1059, in > > __init__ > > > > File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 133, in > > list_to_arr > > > > File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 70, in > > _ptrset > > > > TypeError: unsubscriptable object > > > > I'm using Ubuntu 5.10. > > > > I have another question: I'm interested in using SOM in an environment > > which > > does not use robots. Is there an easy way of extract the SOM module from > > Pyrobot? If so, please guide me. > > > > Thanks, > > > > amklinux > > _______________________________________________ > > Pyro-users mailing list > > Pyro-users@emergent.brynmawr.edu > > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20051214/0806db3e/attachment.htm From adrovane at gmail.com Wed Dec 14 10:56:00 2005 From: adrovane at gmail.com (Adrovane Kade) Date: Wed Dec 14 10:56:02 2005 Subject: [Pyro-users] install Pyrobot In-Reply-To: <1134565922.7092.2.camel@localhost.localdomain> References: <1134565922.7092.2.camel@localhost.localdomain> Message-ID: Hi, Servando. I had Pyrobot4 installed in Ubuntu 5.10, but didn't make any how-to. I followed the instructions in http://pyrorobotics.org/?page=Pyro3Installation. In my case, Ubuntu already had installed SWIG, Numeric, PIL and Tkinter, so the installation was easy. I don't remember now if I had to install extra libraries, but if you get some error, please let me know. What I really wanted from Pyrobot was the SOM stuff, not the robots interfaces. So, that's the only part of the package I really tested. I had a problem, solved by Doug (if you get an error with SOM, please see the thread 'SOM package error' for the solution). Good luck and best regards, Adrovane. 2005/12/14, Servando Garcia : > > I apologize for the clear message last time. It was very late. I need to > install pyrobot on my ubuntu machine. > > _______________________________________________ > Pyro-users mailing list > Pyro-users@emergent.brynmawr.edu > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20051214/446e455c/attachment.htm From dblank at brynmawr.edu Wed Dec 14 13:54:42 2005 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Wed Dec 14 13:54:59 2005 Subject: [Pyro-users] Pyro wins an award! Message-ID: <1134586482.9769.435.camel@mightymouse.brynmawr.edu> Pyro users, Just thought I'd take the end of the year as an opportunity to let you know that Pyro won an award! The National Engineering Education Delivery System at http://needs.org/needs/ presented us with a check and trophy as a co-winner of this year's Premier Award. In addition, they have made 2500 copies of our Pyro LiveCD for anyone who would like a copy. If you would like to get free copies of the CD for you or your students, please send your request to: Premier Award NEEDS Headquarters 2111 ABC Etcheverry Hall University of California at Berkeley Berkeley, CA 94720-1740 premier@needs.org You can also leave tips, recommendations, reviews, and comments at the NEEDS web site. Thank you to everyone who helped provided feedback, code, questions, and comments to help make Pyro award-winning courseware! We couldn't have done it without such a great, supportive community! -Doug -- Douglas S. Blank Computer Science Assistant Professor Bryn Mawr College (610)526-6501 http://cs.brynmawr.edu/~dblank From servando at mac.com Wed Dec 14 21:12:35 2005 From: servando at mac.com (Servando Garcia) Date: Wed Dec 14 21:12:43 2005 Subject: [Pyro-users] install Pyrobot In-Reply-To: References: <1134565922.7092.2.camel@localhost.localdomain> Message-ID: <1134612755.7002.3.camel@localhost.localdomain> Thanks for the reply. I followed the instructions in the link you sent me. > http://pyrorobotics.org/?page=Pyro3Installation. No luck, the error output was so big I have enclosed it as an attachment. -------------- next part -------------- A non-text attachment was scrubbed... Name: error.log Type: text/x-log Size: 4765 bytes Desc: not available Url : http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20051214/22bd05c5/error.bin From dblank at brynmawr.edu Wed Dec 14 21:33:20 2005 From: dblank at brynmawr.edu (dblank@brynmawr.edu) Date: Wed Dec 14 21:33:24 2005 Subject: [Pyro-users] install Pyrobot In-Reply-To: <1134612755.7002.3.camel@localhost.localdomain> References: <1134565922.7092.2.camel@localhost.localdomain> <1134612755.7002.3.camel@localhost.localdomain> Message-ID: <45053.68.34.179.225.1134614000.squirrel@webmail.brynmawr.edu> > Thanks for the reply. I followed the instructions in the link you sent > me. >> http://pyrorobotics.org/?page=Pyro3Installation. > No luck, the error output was so big I have enclosed it as an > attachment. You might try to get some assistance from someone that can help you with the basics of building software systems. Makefile isn't a command, but is a file with instructions to the "make" command. You just run "make" in the directory and answer the questions. -Doug > > _______________________________________________ > Pyro-users mailing list > Pyro-users@emergent.brynmawr.edu > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > From dblank at brynmawr.edu Mon Dec 19 23:30:13 2005 From: dblank at brynmawr.edu (dblank@brynmawr.edu) Date: Mon Dec 19 23:30:16 2005 Subject: [Pyro-users] conx changes to report pattern correct Message-ID: <33421.68.34.179.225.1135053013.squirrel@webmail.brynmawr.edu> In addition to the recent bug fix in using symbolic names in the Pyro Neural Network package (conx.py), I just made the following change that will be of interest to anyone that uses the neural network code. First, one limitation with conx has been that it only reports error as a per output node amount. Therefore, correct percentages are based on the number of output nodes. This is hard to interpret in some situations. For example, consider representing an output as [1, 0, 0, 1]. Conx would compare each of those values to see if it got the right output. If it got 3/4 of them correct, then the output correct would be shown as 75%. But we might really want to know if it got the entire pattern correct (that is, did it get all 4 values correct, within a certain tolerance). In that case, the output correct should be 0% (since it didn't get the entire pattern correct). Now, conx will also output a "Pattern Correct" integer in the standard output display if you use the "pattern" feature, like this: net.setPatterns( {"dog": [1, 0, 0, 1], "cat": [0, 1, 1, 0]}) You can also change the tolerance that used in computing if the outputs are close enough with: net.tolerance = .1 If you then have a correct output (on any output layer) that matches an entire pattern, then it will increment the Pattern Correct by 1. Currently, this is given by just a total integer count. It would be nice if this were a percentage correct, but some other changes will have to be made to compute this correctly. This "Pattern Correct" reporting has been commited to CVS. A few functions had to be changed, including sweep(), step(), backprop(), and compute_error(). Basically, they all return a 4th value, the "pattern correct count". These will probably also change in the future to return a "pattern total count" with which to compute percent of the patterns correct. Please let me know if you see anything that doesn't seem to be working correctly. -Doug