From thejackal13 at gmail.com Wed Nov 2 11:53:15 2005 From: thejackal13 at gmail.com (J T) Date: Wed Nov 2 11:53:21 2005 Subject: [Pyro-users] Running Multiple Robots, port 6666? Message-ID: My teamate and I are trying to run multiple robots in the StageSimulator in the tutorial world. We have tried everything that we can think of, can anyone help us get two robots to run the Avoid brain in that environment? thank you jackal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20051102/3b78260b/attachment.htm From dblank at brynmawr.edu Wed Nov 2 13:23:29 2005 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Wed Nov 2 13:23:42 2005 Subject: [Pyro-users] Running Multiple Robots, port 6666? In-Reply-To: References: Message-ID: <1130955809.13736.73.camel@mightymouse.brynmawr.edu> Jackal, You need to have a world/cfg file that has two robots defined in it. You can add a definition of another robot, like everything.cfg and everything.world. Each robot needs its own port. If you start up "everything" world in the Stage simulator, then you can start two pyrobot's up and connect one using port 6665, and other on 6666. Each will have their own brain. Does that answer your questions? -Doug On Wed, 2005-11-02 at 11:53 -0500, J T wrote: > My teamate and I are trying to run multiple robots in the > StageSimulator in the tutorial world. We have tried everything that we > can think of, can anyone help us get two robots to run the Avoid brain > in that environment? thank you > > jackal > _______________________________________________ > 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 thejackal13 at gmail.com Wed Nov 2 18:54:23 2005 From: thejackal13 at gmail.com (J T) Date: Wed Nov 2 18:54:29 2005 Subject: [Pyro-users] Running Multiple Robots, port 6666? In-Reply-To: <1130955809.13736.73.camel@mightymouse.brynmawr.edu> References: <1130955809.13736.73.camel@mightymouse.brynmawr.edu> Message-ID: Doug, Thanks for your help, that did work. We originally were trying to use the tutorial files as a starting point and use port 6666 but some of the syntax was different therefore not working for us. So using the "everything" files as a starting point got it going. But using a tutorial that our prof gave us from one of your conferences noted we had to open up two instances of pyrobot which i would have never thought of. Thanks for your help, we will probably be emailing this again, and hopefully our school can contribute to this project. Jackal p.s. You know the sym link in the rpm install still points /home/dblank/.... On 11/2/05, Douglas S. Blank wrote: > > Jackal, > > You need to have a world/cfg file that has two robots defined in it. You > can add a definition of another robot, like everything.cfg and > everything.world. Each robot needs its own port. > > If you start up "everything" world in the Stage simulator, then you can > start two pyrobot's up and connect one using port 6665, and other on > 6666. Each will have their own brain. > > Does that answer your questions? > > -Doug > > On Wed, 2005-11-02 at 11:53 -0500, J T wrote: > > My teamate and I are trying to run multiple robots in the > > StageSimulator in the tutorial world. We have tried everything that we > > can think of, can anyone help us get two robots to run the Avoid brain > > in that environment? thank you > > > > jackal > > _______________________________________________ > > 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 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20051102/a49ef9eb/attachment.htm From dblank at brynmawr.edu Thu Nov 3 17:08:24 2005 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Thu Nov 3 17:08:42 2005 Subject: [Pyro-users] Running Multiple Robots, port 6666? In-Reply-To: References: <1130955809.13736.73.camel@mightymouse.brynmawr.edu> Message-ID: <1131055704.3414.30.camel@mightymouse.brynmawr.edu> Jackal, Great to hear that you got it working, and thanks for the tip about the symlink in the rpm... will look into it. We have quite a bit of documentation on-line. Try: http://pyrorobotics.org/?page=PyroCurriculum There isn't a very good "user's manual" (yet) but there is a lot of information spread across the different modules. Highly recommended to glance through them. -Doug On Wed, 2005-11-02 at 18:54 -0500, J T wrote: > Doug, > > Thanks for your help, that did work. We originally were trying to use > the tutorial files as a starting point and use port 6666 but some of > the syntax was different therefore not working for us. So using the > "everything" files as a starting point got it going. But using a > tutorial that our prof gave us from one of your conferences noted we > had to open up two instances of pyrobot which i would have never > thought of. Thanks for your help, we will probably be emailing this > again, and hopefully our school can contribute to this project. > > Jackal > > p.s. You know the sym link in the rpm install still > points /home/dblank/.... > > On 11/2/05, Douglas S. Blank wrote: > Jackal, > > You need to have a world/cfg file that has two robots defined > in it. You > can add a definition of another robot, like everything.cfg and > everything.world. Each robot needs its own port. > > If you start up "everything" world in the Stage simulator, > then you can > start two pyrobot's up and connect one using port 6665, and > other on > 6666. Each will have their own brain. > > Does that answer your questions? > > -Doug > > On Wed, 2005-11-02 at 11:53 -0500, J T wrote: > > My teamate and I are trying to run multiple robots in the > > StageSimulator in the tutorial world. We have tried > everything that we > > can think of, can anyone help us get two robots to run the > Avoid brain > > in that environment? thank you > > > > jackal > > _______________________________________________ > > 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 > > > -- Douglas S. Blank Computer Science Assistant Professor Bryn Mawr College (610)526-6501 http://cs.brynmawr.edu/~dblank -- Douglas S. Blank Computer Science Assistant Professor Bryn Mawr College (610)526-6501 http://cs.brynmawr.edu/~dblank From nswoboda at clip.dia.fi.upm.es Tue Nov 8 07:50:36 2005 From: nswoboda at clip.dia.fi.upm.es (nswoboda@clip.dia.fi.upm.es) Date: Tue Nov 8 07:50:59 2005 Subject: [Pyro-users] Gazebo problem with FC4 Message-ID: <200511081250.jA8CoaCk010653@clip.dia.fi.upm.es> Hello I just installed Pyro from your RPM's and am having problems firing up Gazebo in FC4: starting server ** Gazebo 0.5.1 ** * Part of the Player/Stage Project [http://playerstage.sourceforge.net]. * Copyright 2000-2005 Brian Gerkey, Richard Vaughan, Andrew Howard, * Nate Koenig and contributors. * Released under the GNU General Public License. using display [:0.0] waiting for server X Error of failed request: GLXUnsupportedPrivateRequest Major opcode of failed request: 143 (GLX) Minor opcode of failed request: 16 (X_GLXVendorPrivate) Serial number of failed request: 21 Current serial number in output stream: 22 server died stopping server From Google, it seems that this problem is related to some missing functionality in FC4's X-server (Wine seems to have the same problem). But I couldn't find anything about a fix. Any suggestions? Thanks, Nik ____________________________________________________ You have Egyptian flu: you're going to be a mummy. From dblank at brynmawr.edu Tue Nov 8 09:45:37 2005 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Tue Nov 8 09:49:28 2005 Subject: [Pyro-users] Gazebo problem with FC4 In-Reply-To: <200511081250.jA8CoaCk010653@clip.dia.fi.upm.es> References: <200511081250.jA8CoaCk010653@clip.dia.fi.upm.es> Message-ID: <1131461137.3414.85.camel@mightymouse.brynmawr.edu> Nik, In order to use Gazebo, you'll need to have OpenGL running first. You need to get a version of the graphics driver that works with your video card. Section 1.3.1 on: http://pyrorobotics.org/?page=PyroInstallation contains information on different video cards. If you are using nVidia or ATI cards (and maybe others) you can use the RPMs at livna. Once you get that installed, you can test with: glxinfo | less if you see "direct rendering: Yes" then you should be fine, and can then run Gazebo, or any other OpenGL graphics program. If you don't see this, then you might not have an OpenGL-compatible graphics card, and that is beyond where we can help you. Hope that helps, -Doug On Tue, 2005-11-08 at 13:50 +0100, nswoboda@clip.dia.fi.upm.es wrote: > Hello > > I just installed Pyro from your RPM's and am having problems > firing up Gazebo in FC4: > > starting server > ** Gazebo 0.5.1 ** > * Part of the Player/Stage Project [http://playerstage.sourceforge.net]. > * Copyright 2000-2005 Brian Gerkey, Richard Vaughan, Andrew Howard, > * Nate Koenig and contributors. > * Released under the GNU General Public License. > using display [:0.0] > waiting for server > X Error of failed request: GLXUnsupportedPrivateRequest > Major opcode of failed request: 143 (GLX) > Minor opcode of failed request: 16 (X_GLXVendorPrivate) > Serial number of failed request: 21 > Current serial number in output stream: 22 > server died > stopping server > > From Google, it seems that this problem is related to some > missing functionality in FC4's X-server (Wine seems to have the > same problem). But I couldn't find anything about a fix. Any > suggestions? Thanks, > > Nik > ____________________________________________________ > > You have Egyptian flu: you're going to be a mummy. > _______________________________________________ > 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 ajikoe at gmail.com Tue Nov 8 14:12:07 2005 From: ajikoe at gmail.com (Pujo Aji) Date: Tue Nov 8 14:12:17 2005 Subject: [Pyro-users] ann output not 1 Message-ID: hello, I'm new to pyro neural network. Can anybody help me if I have to train network which has output not between 0 and 1. My problem is: I have 5 input variables and 1 output. output values is varied. Can Pyro handle this problem? Sincerely Yours, Pujo Aji -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20051108/6e50d847/attachment.htm From manaris at cs.cofc.edu Tue Nov 8 15:44:54 2005 From: manaris at cs.cofc.edu (Bill Manaris) Date: Tue Nov 8 15:45:06 2005 Subject: [Pyro-users] ann output not 1 In-Reply-To: References: Message-ID: <46538193-EB58-4E24-A25C-98561146913D@cs.cofc.edu> Hi, You should map your input and output ranges to [0-1]. Once trained, you can take the ANN output and remap it to the original range. This will improve your chances for convergence, etc. Also see the Neural Network FAQ http://www.faqs.org/faqs/ai-faq/ neural-nets/ Cheers, Bill Manaris On Nov 8, 2005, at 2:12 PM, Pujo Aji wrote: > hello, > > I'm new to pyro neural network. > Can anybody help me if I have to train network which has output not > between 0 and 1. > > My problem is: > I have 5 input variables and 1 output. > output values is varied. > > Can Pyro handle this problem? > > Sincerely Yours, > Pujo Aji > _______________________________________________ > 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/20051108/05e9be42/attachment.htm From dblank at brynmawr.edu Tue Nov 8 16:31:57 2005 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Tue Nov 8 16:32:23 2005 Subject: [Pyro-users] ann output not 1 In-Reply-To: <46538193-EB58-4E24-A25C-98561146913D@cs.cofc.edu> References: <46538193-EB58-4E24-A25C-98561146913D@cs.cofc.edu> Message-ID: <1131485517.3414.136.camel@mightymouse.brynmawr.edu> Pujo, To see exactly what the default activation function in Pyro does, you can take a look at lines around 1637 in pyrobot/brain/conx.py: def activationFunction(self, x): return (1.0 / (1.0 + Numeric.exp(-Numeric.maximum(Numeric.minimum(x, 15), -15)))) You can plot that in gnuplot with: plot 1/(1 + exp(-x)) to see the nice smooth "logistic" curve, but the y axis doesn't go outside the range 0 to 1 (a squashing function), and therefore, you can't have a target greater than 1. (Well, you could, but the network would always give a high error!) With this particular activation function (and associated weight update functions) you have to remain in this range. But, like Bill pointed out, you can simply scale the outputs. There are other activation functions (and associated weight update functions) but I haven't ever tried them. I suspect Pujo just needs to scale them before and after, but has anyone tried different activation functions? Any discussion on how others work (or don't) compared to this standard? BTW, the specific place in the FAQ is: http://www.faqs.org/faqs/ai-faq/neural-nets/part2/ -Doug On Tue, 2005-11-08 at 15:44 -0500, Bill Manaris wrote: > Hi, > > > You should map your input and output ranges to [0-1]. Once trained, > you can take the ANN output and remap it to the original range. This > will improve your chances for convergence, etc. > > > Also see the Neural Network > FAQ http://www.faqs.org/faqs/ai-faq/neural-nets/ > > > Cheers, > > > Bill Manaris > > On Nov 8, 2005, at 2:12 PM, Pujo Aji wrote: > > > hello, > > > > I'm new to pyro neural network. > > Can anybody help me if I have to train network which has output not > > between 0 and 1. > > > > My problem is: > > I have 5 input variables and 1 output. > > output values is varied. > > > > Can Pyro handle this problem? > > > > Sincerely Yours, > > Pujo Aji > > _______________________________________________ > > Pyro-users mailing list > > Pyro-users@emergent.brynmawr.edu > > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > > > _______________________________________________ > 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 ajikoe at gmail.com Tue Nov 8 18:03:07 2005 From: ajikoe at gmail.com (Pujo Aji) Date: Tue Nov 8 18:03:10 2005 Subject: [Pyro-users] ann output not 1 In-Reply-To: <1131485517.3414.136.camel@mightymouse.brynmawr.edu> References: <46538193-EB58-4E24-A25C-98561146913D@cs.cofc.edu> <1131485517.3414.136.camel@mightymouse.brynmawr.edu> Message-ID: hello.. Thanks for the information guys, Scaling is probably a very good Idea. I would like to use this scale methods: sigmoidvalue = (realvalue-min+0.001)/(max-min+0.001) realval can be calculated (vice versa) 0.001 is small float value to avoid if division by zero. I tried to create my own neural network software and I use linear activation, but without scaling the square error can be very big....and the program stop. It works with some problem such as AND, OR, simple linear input, but I have problem sometimes when I have to define the learning rate ether the error : converge, constant, too big... I'll play around with the scaling method. Sincerely Yours, pujo On 11/8/05, Douglas S. Blank wrote: > > Pujo, > > To see exactly what the default activation function in Pyro does, you > can take a look at lines around 1637 in pyrobot/brain/conx.py: > > def activationFunction(self, x): > return (1.0 / (1.0 + Numeric.exp(-Numeric.maximum(Numeric.minimum(x, > 15), -15)))) > > You can plot that in gnuplot with: > > plot 1/(1 + exp(-x)) > > to see the nice smooth "logistic" curve, but the y axis doesn't go > outside the range 0 to 1 (a squashing function), and therefore, you > can't have a target greater than 1. (Well, you could, but the network > would always give a high error!) > > With this particular activation function (and associated weight update > functions) you have to remain in this range. But, like Bill pointed out, > you can simply scale the outputs. > > There are other activation functions (and associated weight update > functions) but I haven't ever tried them. I suspect Pujo just needs to > scale them before and after, but has anyone tried different activation > functions? Any discussion on how others work (or don't) compared to this > standard? > > BTW, the specific place in the FAQ is: > > http://www.faqs.org/faqs/ai-faq/neural-nets/part2/ > > -Doug > > On Tue, 2005-11-08 at 15:44 -0500, Bill Manaris wrote: > > Hi, > > > > > > You should map your input and output ranges to [0-1]. Once trained, > > you can take the ANN output and remap it to the original range. This > > will improve your chances for convergence, etc. > > > > > > Also see the Neural Network > > FAQ http://www.faqs.org/faqs/ai-faq/neural-nets/ > > > > > > Cheers, > > > > > > Bill Manaris > > > > On Nov 8, 2005, at 2:12 PM, Pujo Aji wrote: > > > > > hello, > > > > > > I'm new to pyro neural network. > > > Can anybody help me if I have to train network which has output not > > > between 0 and 1. > > > > > > My problem is: > > > I have 5 input variables and 1 output. > > > output values is varied. > > > > > > Can Pyro handle this problem? > > > > > > Sincerely Yours, > > > Pujo Aji > > > _______________________________________________ > > > Pyro-users mailing list > > > Pyro-users@emergent.brynmawr.edu > > > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > > > > > > _______________________________________________ > > 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 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20051109/09d896e4/attachment.htm From ajikoe at gmail.com Wed Nov 9 15:36:53 2005 From: ajikoe at gmail.com (Pujo Aji) Date: Wed Nov 9 15:37:00 2005 Subject: [Pyro-users] ann output not 1 In-Reply-To: References: <46538193-EB58-4E24-A25C-98561146913D@cs.cofc.edu> <1131485517.3414.136.camel@mightymouse.brynmawr.edu> Message-ID: Hello After implementing the scaling method I have some interesting issue: I have only 1 input and 1 output The input is scaled with this code: (realvalue-min+0.001)/(max-min+0.001) The target is also scaled with: (realvalue-min+0.001)/(max-min+0.001) the output is sigmoid(sum(w*x)). I found that it is hard to predict exact linear problem such as: x y 10 10 20 20 30 30 40 40 50 50 If I use The input is scaled with this code: (realvalue-min+0.001)/(max-min+0.001) The target is also scaled with: (realvalue-min+0.001)/(max-min+0.001) the output is sum(w*x). The solution is very fast. Is it normal problem ? I mean is it normal sigmoid is hard to predict perfect linear problem ? or should I change the scaling method in the target? Sincerely Yours, pujo On 11/9/05, Pujo Aji wrote: > > hello.. > Thanks for the information guys, > Scaling is probably a very good Idea. > I would like to use this scale methods: > sigmoidvalue = (realvalue-min+0.001)/(max-min+0.001) > realval can be calculated (vice versa) > 0.001 is small float value to avoid if division by zero. > I tried to create my own neural network software and I use linear > activation, but without scaling the square error can be very big....and the > program stop. > It works with some problem such as AND, OR, simple linear input, but I > have problem sometimes when I have to define the learning rate ether the > error : converge, constant, too big... > I'll play around with the scaling method. > Sincerely Yours, > pujo > > On 11/8/05, Douglas S. Blank wrote: > > > > Pujo, > > > > To see exactly what the default activation function in Pyro does, you > > can take a look at lines around 1637 in pyrobot/brain/conx.py: > > > > def activationFunction(self, x): > > return (1.0 / (1.0 + Numeric.exp(-Numeric.maximum(Numeric.minimum(x, > > 15), -15)))) > > > > You can plot that in gnuplot with: > > > > plot 1/(1 + exp(-x)) > > > > to see the nice smooth "logistic" curve, but the y axis doesn't go > > outside the range 0 to 1 (a squashing function), and therefore, you > > can't have a target greater than 1. (Well, you could, but the network > > would always give a high error!) > > > > With this particular activation function (and associated weight update > > functions) you have to remain in this range. But, like Bill pointed out, > > you can simply scale the outputs. > > > > There are other activation functions (and associated weight update > > functions) but I haven't ever tried them. I suspect Pujo just needs to > > scale them before and after, but has anyone tried different activation > > functions? Any discussion on how others work (or don't) compared to this > > standard? > > > > BTW, the specific place in the FAQ is: > > > > http://www.faqs.org/faqs/ai-faq/neural-nets/part2/ > > > > -Doug > > > > On Tue, 2005-11-08 at 15:44 -0500, Bill Manaris wrote: > > > Hi, > > > > > > > > > You should map your input and output ranges to [0-1]. Once trained, > > > you can take the ANN output and remap it to the original range. This > > > will improve your chances for convergence, etc. > > > > > > > > > Also see the Neural Network > > > FAQ http://www.faqs.org/faqs/ai-faq/neural-nets/ > > > > > > > > > Cheers, > > > > > > > > > Bill Manaris > > > > > > On Nov 8, 2005, at 2:12 PM, Pujo Aji wrote: > > > > > > > hello, > > > > > > > > I'm new to pyro neural network. > > > > Can anybody help me if I have to train network which has output not > > > > between 0 and 1. > > > > > > > > My problem is: > > > > I have 5 input variables and 1 output. > > > > output values is varied. > > > > > > > > Can Pyro handle this problem? > > > > > > > > Sincerely Yours, > > > > Pujo Aji > > > > _______________________________________________ > > > > Pyro-users mailing list > > > > Pyro-users@emergent.brynmawr.edu > > > > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > > > > > > > > > _______________________________________________ > > > 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 > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20051109/eb3205de/attachment.htm From ajikoe at gmail.com Thu Nov 10 06:30:35 2005 From: ajikoe at gmail.com (Pujo Aji) Date: Thu Nov 10 06:30:40 2005 Subject: [Pyro-users] how to predict linear input output correlation Message-ID: hello, I use pyro to train data like this: input output 1 1 2 2 3 3 4 4 5 5 . . . . . . 15 15 I scale the input and the output in (0 - 1) So I try to run with simple model 1 node input ------ 1 node output (sigmoid activation) The result is hard to minimize the error. The model if I plot is like S shape 1 node input ------- 1 node hidden (sigmoid activation) ----- 1 node output (sigmoid activation) Still the result is hard to minimize the error and still the model like S shape I want to use linear activation in hidden layer and sigmoid activation in output layer How can I do this thing in pyro ? Thanks in advance. pujo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20051110/6778a0c1/attachment.htm From dblank at brynmawr.edu Thu Nov 10 08:23:37 2005 From: dblank at brynmawr.edu (dblank@brynmawr.edu) Date: Thu Nov 10 08:23:41 2005 Subject: [Pyro-users] how to predict linear input output correlation In-Reply-To: References: Message-ID: <54432.68.34.179.225.1131629017.squirrel@webmail.brynmawr.edu> Pujo, If I had 15 different input/output pairs, I probably would create more outputs. Such as: Input Output ----- ------ 0000 0000 0001 0001 0010 0010 0011 0011 ... But that may even be hard. You could try a "themometer" encoding: Input Output --------------- --------------- 000000000000000 000000000000000 000000000000001 000000000000001 000000000000011 000000000000011 000000000000111 000000000000111 000000000001111 000000000001111 000000000011111 000000000011111 ... Or, you could assign the bits randomly in an even larger representation to prevent much overlap between patterns. Note that the inputs don't have to be the same as the outputs, but that would make a very different problem. I don't understand why you would want to change the activation function of the hidden layer. I don't think it would help, and would require you to change the weight update procedure too. -Doug > hello, > I use pyro to train data like this: > input output > 1 1 > 2 2 > 3 3 > 4 4 > 5 5 > . . > . . > . . > 15 15 > I scale the input and the output in (0 - 1) > So I try to run with simple model > 1 node input ------ 1 node output (sigmoid activation) > The result is hard to minimize the error. The model if I plot is like S > shape > 1 node input ------- 1 node hidden (sigmoid activation) ----- 1 node > output > (sigmoid activation) > Still the result is hard to minimize the error and still the model like S > shape > I want to use linear activation in hidden layer and sigmoid activation in > output layer > How can I do this thing in pyro ? > Thanks in advance. > pujo From thejackal13 at gmail.com Thu Nov 10 12:15:36 2005 From: thejackal13 at gmail.com (J T) Date: Thu Nov 10 12:15:38 2005 Subject: [Pyro-users] Gazebo problem with FC4 In-Reply-To: <1131461137.3414.85.camel@mightymouse.brynmawr.edu> References: <200511081250.jA8CoaCk010653@clip.dia.fi.upm.es> <1131461137.3414.85.camel@mightymouse.brynmawr.edu> Message-ID: Nik, Did you get this yet because I had the same problem with FDC3 and go through on two laptops, one Nvidea and the other ATI. If yoiu didn't get it yet I can try to help ya through it. Jason On 11/8/05, Douglas S. Blank wrote: > > Nik, > > In order to use Gazebo, you'll need to have OpenGL running first. You > need to get a version of the graphics driver that works with your video > card. Section 1.3.1 on: > > http://pyrorobotics.org/?page=PyroInstallation > > contains information on different video cards. If you are using nVidia > or ATI cards (and maybe others) you can use the RPMs at livna. > > Once you get that installed, you can test with: > > glxinfo | less > > if you see "direct rendering: Yes" then you should be fine, and can > then run Gazebo, or any other OpenGL graphics program. > > If you don't see this, then you might not have an OpenGL-compatible > graphics card, and that is beyond where we can help you. > > Hope that helps, > > -Doug > > On Tue, 2005-11-08 at 13:50 +0100, nswoboda@clip.dia.fi.upm.es wrote: > > Hello > > > > I just installed Pyro from your RPM's and am having problems > > firing up Gazebo in FC4: > > > > starting server > > ** Gazebo 0.5.1 ** > > * Part of the Player/Stage Project [http://playerstage.sourceforge.net]. > > * Copyright 2000-2005 Brian Gerkey, Richard Vaughan, Andrew Howard, > > * Nate Koenig and contributors. > > * Released under the GNU General Public License. > > using display [:0.0] > > waiting for server > > X Error of failed request: GLXUnsupportedPrivateRequest > > Major opcode of failed request: 143 (GLX) > > Minor opcode of failed request: 16 (X_GLXVendorPrivate) > > Serial number of failed request: 21 > > Current serial number in output stream: 22 > > server died > > stopping server > > > > From Google, it seems that this problem is related to some > > missing functionality in FC4's X-server (Wine seems to have the > > same problem). But I couldn't find anything about a fix. Any > > suggestions? Thanks, > > > > Nik > > ____________________________________________________ > > > > You have Egyptian flu: you're going to be a mummy. > > _______________________________________________ > > 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 > > > _______________________________________________ > 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/20051110/55a531bb/attachment.htm From nswoboda at clip.dia.fi.upm.es Thu Nov 10 13:07:56 2005 From: nswoboda at clip.dia.fi.upm.es (nswoboda@clip.dia.fi.upm.es) Date: Thu Nov 10 13:08:05 2005 Subject: [Pyro-users] Gazebo problem with FC4 In-Reply-To: Message-ID: <200511101807.jAAI7up0029764@clip.dia.fi.upm.es> Hello Jason, No I haven't gotten it to work despite a number of different attempts. Any advice would be greatly appreciated! Nik > Nik, > Did you get this yet because I had the same problem with FDC3 and go throug= > h > on two laptops, one Nvidea and the other ATI. If yoiu didn't get it yet I > can try to help ya through it. > Jason > On 11/8/05, Douglas S. Blank wrote: > > > > Nik, > > > > In order to use Gazebo, you'll need to have OpenGL running first. You > > need to get a version of the graphics driver that works with your video > > card. Section 1.3.1 on: > > > > http://pyrorobotics.org/?page=3DPyroInstallation > > > > contains information on different video cards. If you are using nVidia > > or ATI cards (and maybe others) you can use the RPMs at livna. > > > > Once you get that installed, you can test with: > > > > glxinfo | less > > > > if you see "direct rendering: Yes" then you should be fine, and can > > then run Gazebo, or any other OpenGL graphics program. > > > > If you don't see this, then you might not have an OpenGL-compatible > > graphics card, and that is beyond where we can help you. > > > > Hope that helps, > > > > -Doug > > > > On Tue, 2005-11-08 at 13:50 +0100, nswoboda@clip.dia.fi.upm.es wrote: > > > Hello > > > > > > I just installed Pyro from your RPM's and am having problems > > > firing up Gazebo in FC4: > > > > > > starting server > > > ** Gazebo 0.5.1 ** > > > * Part of the Player/Stage Project [http://playerstage.sourceforge.net]= > . > > > * Copyright 2000-2005 Brian Gerkey, Richard Vaughan, Andrew Howard, > > > * Nate Koenig and contributors. > > > * Released under the GNU General Public License. > > > using display [:0.0] > > > waiting for server > > > X Error of failed request: GLXUnsupportedPrivateRequest > > > Major opcode of failed request: 143 (GLX) > > > Minor opcode of failed request: 16 (X_GLXVendorPrivate) > > > Serial number of failed request: 21 > > > Current serial number in output stream: 22 > > > server died > > > stopping server > > > > > > From Google, it seems that this problem is related to some > > > missing functionality in FC4's X-server (Wine seems to have the > > > same problem). But I couldn't find anything about a fix. Any > > > suggestions? Thanks, > > > > > > Nik > > > ____________________________________________________ > > > > > > You have Egyptian flu: you're going to be a mummy. > > > _______________________________________________ > > > 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 > > > > > > _______________________________________________ > > Pyro-users mailing list > > Pyro-users@emergent.brynmawr.edu > > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > > > --Boundary_(ID_/RIo1jbseHd3sdJFntC79A) > Content-type: text/html; charset=ISO-8859-1 > Content-transfer-encoding: quoted-printable > Content-disposition: inline > Nik,
>
>    Did you get this yet because I had the same problem with > FDC3 and go through on two laptops, one Nvidea and the other ATI. If > yoiu didn't get it yet I can try to help ya through it.
>
> Jason

On 11/8/05, _sendername">Douglas S. Blank < ">dblank@brynmawr.edu> wrote:
" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0= > .8ex; padding-left: 1ex;"> > Nik,

In order to use Gazebo, you'll need to have OpenGL running firs= > t. You
need to get a version of the graphics driver that works with your= > video
card. Section 1.3.1 on:

/?page=3DPyroInstallation"> > http://pyrorobotics.org/?page=3DPyroInstallation

contains inform= > ation on different video cards. If you are using nVidia
or ATI cards (an= > d maybe others) you can use the RPMs at livna.

Once you get that ins= > talled, you can test with: >

glxinfo | less

if you see  "direct rendering:= > Yes" then you should be fine, and can
then run Gazebo, or any othe= > r OpenGL graphics program.

If you don't see this, then you might not= > have an OpenGL-compatible >
graphics card, and that is beyond where we can help you.

Hope th= > at helps,

-Doug

On Tue, 2005-11-08 at 13:50 +0100, "mailto:nswoboda@clip.dia.fi.upm.es">nswoboda@clip.dia.fi.upm.es wrote: >
>       Hello
>
> &nb= > sp;     I just installed Pyro from your RPM's and am ha= > ving problems
>       firing up Gazebo = > in FC4:
>
> starting server
> ** Gazebo 0.5.1 **
> = > * Part of the Player/Stage Project [ > http://playerstage.sourcefor= > ge.net].
> * Copyright 2000-2005 Brian Gerkey, Richard Vaughan, A= > ndrew Howard,
> * Nate Koenig and contributors.
> * Released un= > der the GNU General Public License. >
> using display [:0.0]
> waiting for server
> X Error of= > failed request:  GLXUnsupportedPrivateRequest
>  = > ; Major opcode of failed request:  143 (GLX)
>   = > Minor opcode of failed request:  16 (X_GLXVendorPrivate) >
>   Serial number of failed request:  21
>= >    Current serial number in output stream:  22
> = > server died
> stopping server
>
>    = >    From Google, it seems that this problem is related to some >
>       missing functionality in FC4's= > X-server (Wine seems to have the
>     &nbs= > p; same problem).  But I couldn't find anything about a fix. = > ; Any
>       suggestions? &n= > bsp;Thanks,
>
>       Nik
> > ____________________________________________________
>
> Y= > ou have Egyptian flu: you're going to be a mummy.
> _________________= > ______________________________
> Pyro-users mailing list
>=20 > Pyro-users@emergent.bry= > nmawr.edu
> nfo/pyro-users">http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > >
>
--
Douglas S. Blank       Comp= > uter Science
Assistant Professor    Bryn Mawr Colleg= > e
(610)526-6501         &nb= > sp;
http://cs.brynmawr.edu/~dblan= > k


_______________________________________________ >
Pyro-users mailing list
wr.edu">Pyro-users@emergent.brynmawr.edu
brynmawr.edu/mailman/listinfo/pyro-users">http://emergent.brynmawr.edu/mail= > man/listinfo/pyro-users >

> --Boundary_(ID_/RIo1jbseHd3sdJFntC79A)-- ____________________________________________________ The universe is like a safe to which there is a combination -- but the combination is locked up in the safe. -- Peter DeVries From thejackal13 at gmail.com Fri Nov 11 10:41:42 2005 From: thejackal13 at gmail.com (J T) Date: Fri Nov 11 10:41:44 2005 Subject: [Pyro-users] Gazebo problem with FC4 In-Reply-To: <200511101807.jAAI7up0029764@clip.dia.fi.upm.es> References: <200511101807.jAAI7up0029764@clip.dia.fi.upm.es> Message-ID: Nik, Ok, Start with this: 1.3.1. Gazebo Graphics If you use ATI or NVidia graphics boards, you may wish to use the Livna kernel modules. First, add their repositories as above, or right to /etc/yum.conf. For Fedora Core 3: [livna-stable] name=Livna.org Fedora Compatible Packages (stable) baseurl=http://rpm.livna.org/fedora/$releasever/$basearch/RPMS.stable gpgcheck=1 [livna-unstable] name=Livna.org Fedora Compatible Packages (unstable) baseurl=http://rpm.livna.org/fedora/$releasever/$basearch/RPMS.unstable gpgcheck=1 [livna-testing] name=Livna.org Fedora Compatible Packages (testing) baseurl=http://rpm.livna.org/fedora/$releasever/$basearch/RPMS.testing gpgcheck=1 For Fedora Core 4: [livna-stable] name=Livna.org Fedora Compatible Packages (stable) baseurl=http://rpm.livna.org/fedora/$releasever/$basearch/RPMS.lvn gpgcheck=1 Next, add their public key to your rpm: rpm --import http://rpm.livna.org/RPM-LIVNA-GPG-KEY-i386 If you have ATI graphics card, do this: yum install kernel-module-fglrx If you have an NVIDIA graphics card, do this: yum install kernel-module-nvidia Now that will error out on the: yum install kernel-module-fglrx or yum install kernel-module-nvidia But run in any ways because it will set up all the dependencies you need. So go here: http://rpm.livna.org/fedora/4/i386/RPMS.lvn/ *this directory is for Fedora Core 4 then download the "ati fglrx" rpm and the "kernel module" rpm. I installed them both on both laptops. Make sure you get the correct one for the kernel you are running, once you do this you might want to consider sticking with that kernel for while. Restart X, then boot pyro and gazebo and tell me how you make out. To get this far though I take it you have already installed wxPython, or you may not have needed it, I needed it for for FDC3. If you got the GLX error your python packages should be ok. On 11/10/05, nswoboda@clip.dia.fi.upm.es wrote: > > Hello Jason, > > No I haven't gotten it to work despite a number of different attempts. > > Any advice would be greatly appreciated! > > Nik > > > Nik, > > > Did you get this yet because I had the same problem with FDC3 and go > throug= > > h > > on two laptops, one Nvidea and the other ATI. If yoiu didn't get it yet > I > > can try to help ya through it. > > > Jason > > > On 11/8/05, Douglas S. Blank wrote: > > > > > > Nik, > > > > > > In order to use Gazebo, you'll need to have OpenGL running first. You > > > need to get a version of the graphics driver that works with your > video > > > card. Section 1.3.1 on: > > > > > > http://pyrorobotics.org/?page=3DPyroInstallation > > > > > > contains information on different video cards. If you are using nVidia > > > or ATI cards (and maybe others) you can use the RPMs at livna. > > > > > > Once you get that installed, you can test with: > > > > > > glxinfo | less > > > > > > if you see "direct rendering: Yes" then you should be fine, and can > > > then run Gazebo, or any other OpenGL graphics program. > > > > > > If you don't see this, then you might not have an OpenGL-compatible > > > graphics card, and that is beyond where we can help you. > > > > > > Hope that helps, > > > > > > -Doug > > > > > > On Tue, 2005-11-08 at 13:50 +0100, nswoboda@clip.dia.fi.upm.es wrote: > > > > Hello > > > > > > > > I just installed Pyro from your RPM's and am having problems > > > > firing up Gazebo in FC4: > > > > > > > > starting server > > > > ** Gazebo 0.5.1 ** > > > > * Part of the Player/Stage Project [ > http://playerstage.sourceforge.net]= > > . > > > > * Copyright 2000-2005 Brian Gerkey, Richard Vaughan, Andrew Howard, > > > > * Nate Koenig and contributors. > > > > * Released under the GNU General Public License. > > > > using display [:0.0] > > > > waiting for server > > > > X Error of failed request: GLXUnsupportedPrivateRequest > > > > Major opcode of failed request: 143 (GLX) > > > > Minor opcode of failed request: 16 (X_GLXVendorPrivate) > > > > Serial number of failed request: 21 > > > > Current serial number in output stream: 22 > > > > server died > > > > stopping server > > > > > > > > From Google, it seems that this problem is related to some > > > > missing functionality in FC4's X-server (Wine seems to have the > > > > same problem). But I couldn't find anything about a fix. Any > > > > suggestions? Thanks, > > > > > > > > Nik > > > > ____________________________________________________ > > > > > > > > You have Egyptian flu: you're going to be a mummy. > > > > _______________________________________________ > > > > 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 > > > > > > > > > _______________________________________________ > > > Pyro-users mailing list > > > Pyro-users@emergent.brynmawr.edu > > > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > > > > > > --Boundary_(ID_/RIo1jbseHd3sdJFntC79A) > > Content-type: text/html; charset=ISO-8859-1 > > Content-transfer-encoding: quoted-printable > > Content-disposition: inline > > > > > ____________________________________________________ > > The universe is like a safe to which there is a combination -- but the > combination is locked up in the safe. > -- Peter DeVries > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20051111/fb1053fd/attachment-0001.htm From jparlar at cogeco.ca Sat Nov 12 14:12:55 2005 From: jparlar at cogeco.ca (Jay Parlar) Date: Sat Nov 12 11:15:42 2005 Subject: [Pyro-users] Dr Robot Message-ID: <06a3f28e93149396ff581ab675d96598@cogeco.ca> Our lab recently acquired one of these: http://www.drrobot.com/products_item.asp?itemNumber=X80 (minus the video package). The software they provide is a Windows C++ SDK, which to a bunch of Mac users, is pretty useless. So, we've started to roll our own Python interface (as they do provide us with the specs of their communication protocol). So far, we've got it going in a straight line (with a PID controller), and we can do rotations. I know that Pyro doesn't currently support the X80, but would it be worth my time to try to create a Pyro interface? What I mean is, does this robot look like a good fit for the Pyro framework? It's a differential system, with two high precision encoders for the wheels, and we've got 7 IR range sensors and three ultrasonic range sensors. Thanks in advance, Jay P. PS. Sorry if this has been covered before, I couldn't find a searchable version of the list archives. From dblank at brynmawr.edu Sat Nov 12 13:48:48 2005 From: dblank at brynmawr.edu (dblank@brynmawr.edu) Date: Sat Nov 12 13:48:51 2005 Subject: [Pyro-users] Dr Robot In-Reply-To: <06a3f28e93149396ff581ab675d96598@cogeco.ca> References: <06a3f28e93149396ff581ab675d96598@cogeco.ca> Message-ID: <46967.146.94.128.101.1131821328.squirrel@webmail.brynmawr.edu> Jay, Pyro should work very well with this type of robot. You'll just need to create a class that extends Robot (from pyrobot/robot/__init__.py) and extend the IR sensors with Device (from pyrobot/robot/Device.py). It would be great if you could document the steps necessary as an example to others that might want to do this. Feel free to use our wiki pages if you would like. Just a sketch would be helpful, and we can add to it. You can also ask questions on such a page and we will answer them there. There are some helpful hints on building your own Robot and Devices here: http://PyroRobotics.org/?page=Interfacing_20Your_20Own_20Robot and some additional hints on Devices here: http://PyroRobotics.org/?page=Pyro_20Devices_20Advanced This would make a nice example, and if you would like to donate the code to the Pyro Project, would also be useful for others that would like to use that robot. Let us know if you have any questions or problems. Good luck! -Doug PS - you can search our archives with a google search, with a search term like: site:emergent.brynmawr.edu/pipermail/pyro-users/ "robot interface" but Pyro has changed quite a bit in the last year, so beware that some of the info might be out-of-date. > Our lab recently acquired one of these: > http://www.drrobot.com/products_item.asp?itemNumber=X80 (minus the > video package). > > The software they provide is a Windows C++ SDK, which to a bunch of Mac > users, is pretty useless. So, we've started to roll our own Python > interface (as they do provide us with the specs of their communication > protocol). > > So far, we've got it going in a straight line (with a PID controller), > and we can do rotations. > > I know that Pyro doesn't currently support the X80, but would it be > worth my time to try to create a Pyro interface? What I mean is, does > this robot look like a good fit for the Pyro framework? It's a > differential system, with two high precision encoders for the wheels, > and we've got 7 IR range sensors and three ultrasonic range sensors. > > Thanks in advance, > Jay P. > > PS. Sorry if this has been covered before, I couldn't find a searchable > version of the list archives. From barcode at tampabay.rr.com Sat Nov 12 17:15:51 2005 From: barcode at tampabay.rr.com (Bar Code) Date: Sat Nov 12 17:15:52 2005 Subject: [Pyro-users] Silly question: any tours available? Message-ID: <43766997.6B761723@tampabay.rr.com> I will be driving by Bryn Mawr next week. Is there anything Pyro-related to see? And if so, is there any opportunity to see it? From dblank at brynmawr.edu Sat Nov 12 17:34:20 2005 From: dblank at brynmawr.edu (dblank@brynmawr.edu) Date: Sat Nov 12 17:34:22 2005 Subject: [Pyro-users] Silly question: any tours available? In-Reply-To: <43766997.6B761723@tampabay.rr.com> References: <43766997.6B761723@tampabay.rr.com> Message-ID: <36319.146.94.128.101.1131834860.squirrel@webmail.brynmawr.edu> Bar Code, Nothing specific going on this semester, but we'd be glad to give you a demo if we can. That's an open invitation to anyone, by the way. Just let me know (off list) when you'll be around, and I'll bet we can arrange something. Demos currently available: soccer-playing and tv-watching AIBOs; pioneer, khepera, hemisson, peoplebot, and various simulators running any of the standard Pyro programs. -Doug > I will be driving by Bryn Mawr next week. Is there anything > Pyro-related to see? And if so, is there any opportunity to see it? From barcode at tampabay.rr.com Sat Nov 12 17:42:09 2005 From: barcode at tampabay.rr.com (Bar Code) Date: Sat Nov 12 17:42:09 2005 Subject: [Pyro-users] Silly question: any tours available? References: <43766997.6B761723@tampabay.rr.com> Message-ID: <43766FC1.139DDF8F@tampabay.rr.com> I should mention that I'll be traveling with my wife and 9 year old daughter, who plays around a little bit with Mindstorms now. Bar Code wrote: > I will be driving by Bryn Mawr next week. Is there anything > Pyro-related to see? And if so, is there any opportunity to see it? > > _______________________________________________ > Pyro-users mailing list > Pyro-users@emergent.brynmawr.edu > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users From jparlar at cogeco.ca Sat Nov 12 21:10:29 2005 From: jparlar at cogeco.ca (Jay Parlar) Date: Sat Nov 12 18:13:12 2005 Subject: [Pyro-users] Dr Robot In-Reply-To: <46967.146.94.128.101.1131821328.squirrel@webmail.brynmawr.edu> References: <06a3f28e93149396ff581ab675d96598@cogeco.ca> <46967.146.94.128.101.1131821328.squirrel@webmail.brynmawr.edu> Message-ID: <48417e7e499d470db9c67dce85bfe47b@cogeco.ca> On Nov 12, 2005, at 10:48 AM, dblank@brynmawr.edu wrote: > Pyro should work very well with this type of robot. You'll just need to > create a class that extends Robot (from pyrobot/robot/__init__.py) and > extend the IR sensors with Device (from pyrobot/robot/Device.py). Sounds good. But are the IR sensors the only way the robot knows how to get around? Please excuse my ignorance, I'm busy with other stuff and haven't had time to delve into it. For instance, can the library use the wheel encoders for dead-reckoning, and do you have any PID (or other control) algorithms for ensuring movement accuracy? > It would be great if you could document the steps necessary as an > example > to others that might want to do this. Feel free to use our wiki pages > if > you would like. Just a sketch would be helpful, and we can add to it. > You > can also ask questions on such a page and we will answer them there. For now, I'll keep all my documents internal (but I will document my steps), and I'll eventually release them back to you guys. I just like to use my own systems when I'm doing work. > There are some helpful hints on building your own Robot and Devices > here: > > http://PyroRobotics.org/?page=Interfacing_20Your_20Own_20Robot > > and some additional hints on Devices here: > > http://PyroRobotics.org/?page=Pyro_20Devices_20Advanced > > This would make a nice example, and if you would like to donate the > code > to the Pyro Project, would also be useful for others that would like to > use that robot. I'm in a university lab, there should be no problem with releasing the code back, once done (of course, I'd need to get my supervisor's permission, but I doubt he'd mind). > Let us know if you have any questions or problems. > > Good luck! Thanks a lot! I look forward to diving in. > -Doug > > PS - you can search our archives with a google search, with a search > term > like: > > site:emergent.brynmawr.edu/pipermail/pyro-users/ "robot interface" > Ha, I didn't even think about a site search. Thanks. From nswoboda at clip.dia.fi.upm.es Tue Nov 15 10:34:48 2005 From: nswoboda at clip.dia.fi.upm.es (nswoboda@clip.dia.fi.upm.es) Date: Tue Nov 15 10:35:30 2005 Subject: [Pyro-users] Gazebo problem with FC4 In-Reply-To: Message-ID: <200511151534.jAFFYmIg027776@clip.dia.fi.upm.es> Jason, thanks for the reply. I actually did what you suggested before posting. I didn't get any errors after the installation and assumed that everything was fine and dandy. After reading your message I did a lsmod and realized that I was still using the radeon driver not the livna fglrx. After two days of fighting on and off with the livna driver, I have tentatively to the conclusion that it doesn't support my chipset (ATI Radeon Mobility M6 LY); it gives a 'no devices detected' error and dies saying that it can't find any screens, and a more direct error when I explicitly specify the chipIP in my xorg.conf: (WW) fglrx: ChipID 0x4C59 in Device section "Videocard0" isn't valid for this driver The strange thing is that I do get 'direct rendering: Yes' with the radeon driver, but when trying to run gazebo I still get: X Error of failed request: GLXUnsupportedPrivateRequest Major opcode of failed request: 143 (GLX) Minor opcode of failed request: 16 (X_GLXVendorPrivate) Serial number of failed request: 21 Current serial number in output stream: 22 I will have to keep playing around with it to see if I can get it to work... Thanks, Nik > Nik, > Ok, > Start with this: > 1.3.1. Gazebo Graphics > If you use ATI or NVidia graphics > boards, you may wish to use the Livna kernel modules. > First, add their repositories as above, or right to /etc/yum.conf. > For Fedora Core 3: > [livna-stable] > name=3DLivna.org Fedora Compatible Packages (stable) > baseurl=3Dhttp://rpm.livna.org/fedora/$releasever/$basearch/RPMS.stable > gpgcheck=3D1 > [livna-unstable] > name=3DLivna.org Fedora Compatible Packages (unstable) > baseurl=3Dhttp://rpm.livna.org/fedora/$releasever/$basearch/RPMS.unstable > gpgcheck=3D1 > [livna-testing] > name=3DLivna.org Fedora Compatible Packages (testing) > baseurl=3Dhttp://rpm.livna.org/fedora/$releasever/$basearch/RPMS.testing > gpgcheck=3D1 > For Fedora Core 4: > [livna-stable] > name=3DLivna.org Fedora Compatible Packages (stable) > baseurl=3Dhttp://rpm.livna.org/fedora/$releasever/$basearch/RPMS.lvn > gpgcheck=3D1 > Next, add their public key to your rpm: > rpm --import http://rpm.livna.org/RPM-LIVNA-GPG-KEY-i386 > If you have ATI graphics card, do this: > yum install kernel-module-fglrx > If you have an NVIDIA graphics card, do this: > yum install kernel-module-nvidia > Now that will error out on the: > yum install kernel-module-fglrx or > yum install kernel-module-nvidia > But run in any ways because it will set up all the dependencies you need. > So go here: http://rpm.livna.org/fedora/4/i386/RPMS.lvn/ *this directory is > for Fedora Core 4 > then download the "ati fglrx" rpm and the "kernel module" rpm. I installed > them both on both laptops. Make sure you get the correct one for the kernel > you are running, once you do this you might want to consider sticking with > that kernel for while. > Restart X, then boot pyro and gazebo and tell me how you make out. > To get this far though I take it you have already installed wxPython, or yo= > u > may not have needed it, I needed it for for FDC3. If you got the GLX error > your python packages should be ok. ____________________________________________________ The most hopelessly stupid man is he who is not aware that he is wise. From thejackal13 at gmail.com Tue Nov 15 11:00:08 2005 From: thejackal13 at gmail.com (J T) Date: Tue Nov 15 11:00:08 2005 Subject: [Pyro-users] Gazebo problem with FC4 In-Reply-To: <200511151534.jAFFYmIg027776@clip.dia.fi.upm.es> References: <200511151534.jAFFYmIg027776@clip.dia.fi.upm.es> Message-ID: Did you just go in an replace the name of the driver? If so try running, /usr/bin/X11/xf86config I would recommend running that, and making sure all the info you enter is correct (e.g. driver, refresh rates, and such) and make sure all that stuff is intalled from the previous email. I never had to edit the xorg.conf to make gazebo work, on either machine, it worked fine after a X reboot. From my understanding you still want to point to the ATI Radeon driver, but just have the fglrx stuff installed. jason On 11/15/05, nswoboda@clip.dia.fi.upm.es wrote: > > Jason, thanks for the reply. > > I actually did what you suggested before posting. I didn't get any > errors after the installation and assumed that everything was fine and > dandy. After reading your message I did a lsmod and realized that I was > still using the radeon driver not the livna fglrx. After two days of > fighting on and off with the livna driver, I have tentatively to the > conclusion that it doesn't support my chipset (ATI Radeon Mobility M6 > LY); it gives a 'no devices detected' error and dies saying that it > can't find any screens, and a more direct error when I explicitly > specify the chipIP in my xorg.conf: > > (WW) fglrx: ChipID 0x4C59 in Device section "Videocard0" isn't valid for > this driver > > The strange thing is that I do get 'direct rendering: Yes' with the > radeon driver, but when trying to run gazebo I still get: > > X Error of failed request: GLXUnsupportedPrivateRequest > Major opcode of failed request: 143 (GLX) > Minor opcode of failed request: 16 (X_GLXVendorPrivate) > Serial number of failed request: 21 > Current serial number in output stream: 22 > > I will have to keep playing around with it to see if I can get it to > work... > > Thanks, > > Nik > > > Nik, > > > Ok, > > Start with this: > > > 1.3.1. Gazebo Graphics > > > If you use ATI or NVidia > graphics > > boards, you may wish to use the Livna kernel modules. > > > First, add their repositories as above, or right to /etc/yum.conf. > > > For Fedora Core 3: > > > [livna-stable] > > name=3DLivna.org Fedora Compatible Packages (stable) > > baseurl=3Dhttp://rpm.livna.org/fedora/$releasever/$basearch/RPMS.stable > > gpgcheck=3D1 > > > [livna-unstable] > > name=3DLivna.org Fedora Compatible Packages > (unstable) > > > baseurl=3Dhttp://rpm.livna.org/fedora/$releasever/$basearch/RPMS.unstable > > gpgcheck=3D1 > > > [livna-testing] > > name=3DLivna.org Fedora Compatible Packages (testing) > > baseurl=3Dhttp://rpm.livna.org/fedora/$releasever/$basearch/RPMS.testing > > gpgcheck=3D1 > > > For Fedora Core 4: > > > [livna-stable] > > name=3DLivna.org Fedora Compatible Packages (stable) > > baseurl=3Dhttp://rpm.livna.org/fedora/$releasever/$basearch/RPMS.lvn > > gpgcheck=3D1 > > > Next, add their public key to your rpm: > > > rpm --import http://rpm.livna.org/RPM-LIVNA-GPG-KEY-i386 > > > If you have ATI graphics card, do this: > > > yum install kernel-module-fglrx > > > If you have an NVIDIA graphics card, do this: > > > yum install kernel-module-nvidia > > > Now that will error out on the: > > > yum install kernel-module-fglrx or > > yum install kernel-module-nvidia > > > But run in any ways because it will set up all the dependencies you > need. > > > So go here: http://rpm.livna.org/fedora/4/i386/RPMS.lvn/ *this directory > is > > for Fedora Core 4 > > > then download the "ati fglrx" rpm and the "kernel module" rpm. I > installed > > them both on both laptops. Make sure you get the correct one for the > kernel > > you are running, once you do this you might want to consider sticking > with > > that kernel for while. > > > Restart X, then boot pyro and gazebo and tell me how you make out. > > > To get this far though I take it you have already installed wxPython, or > yo= > > u > > may not have needed it, I needed it for for FDC3. If you got the GLX > error > > your python packages should be ok. > ____________________________________________________ > > The most hopelessly stupid man is he who is not aware that he is wise. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20051115/4c1676f1/attachment.htm From shuvoprogramsworld at yahoo.com Wed Nov 16 02:36:55 2005 From: shuvoprogramsworld at yahoo.com (Spondon Saha) Date: Wed Nov 16 02:36:55 2005 Subject: [Pyro-users] Having problems with creating robot interface Message-ID: <20051116073655.72114.qmail@web31015.mail.mud.yahoo.com> Skipped content of type multipart/alternative-------------- next part -------------- #============================================================ # # Created : 07/14/05 # # By : Spondon Saha # # SuperDroid Trekker robot interface for PyRo # based on khepera.py # #============================================================ __author__ = "Spondon Saha " __version__ = "1.0" from pyro.robot import * from pyro.robot.device import * import serial import pyro.robot.driver as driver import string, array, math import time from pyro.geometry import PIOVER180, DEG90RADS, COSDEG90RADS, SINDEG90RADS class SuperDroidSONAR(Device): def __init__(self, dev, type="sonar"): Device.__init__(self, type) self.dev = dev self.sensorData = [] self.devData['units'] = "MM" # current report units self.devData['radius'] = 0.4 # its always in meters self.devData['rawunits'] = "MM" self.devData['maxvalueraw'] = 4000 # mm - SRF04 max range is approx 3m or 3000mm. I made it 4000 to be on the safe side self.devData['maxvalue'] = self.rawToUnits(self.devData["maxvalueraw"]) self.devData['count'] = 4 self.groups = {'all' : range(4), 'front-left' : (0,1), 'front-right' : (2,3), 'left' : (1), 'right' : (3)} self.subDataFunc['ox'] = self.ox self.subDataFunc['oy'] = self.oy self.subDataFunc['oz'] = lambda pos: 0.0 # mm self.subDataFunc['th'] = self.th # degrees self.subDataFunc['thr'] = lambda pos: self.th(pos) * PIOVER180 # degrees self.subDataFunc['pos'] = lambda pos: pos self.subDataFunc['value'] = self.getSonarRange self.subDataFunc['x'] = self.hitX self.subDataFunc['y'] = self.hitY self.subDataFunc['z'] = self.hitZ self.startDevice() def getSensorValue(self, pos): return SensorValue(self, self.getValSonar(pos), pos, (self.ox(pos), self.oy(pos), 0.0, self.th(pos))) def ox(self, pos): # in MM if pos == 0: val = 63.5 elif pos == 1: val = 25.4 elif pos == 25: val = 25.4 elif pos == 3: val = 63.5 return val def oy(self, pos): # in MM """HAVE TO GET THESE VALUES FILLED OUT""" if pos == 0: val = 0.0 elif pos == 1: val = 0.0 elif pos == 2: val = 0.0 elif pos == 3: val = 0.0 return val def th(self, pos): # in degrees if pos == 0: val = 67.5 elif pos == 1: val = 22.5 elif pos == 2: val = -22.5 elif pos == 3: val = -67.5 return val def getValSonar(self, pos): try: return (self.dev.senseData['sonar'][pos]/64) * 304.8 # (raw_value/64) gives value in feet * 304.8 = range in mm. except: return 0 def getSonarRange(self, pos): dist = self.getVal(pos) return self.rawToUnits(dist) def hitX(self, pos): # convert to x,y relative to robot dist = self.getVal(pos) angle = (-self.th(pos) - 90.0) / 180.0 * math.pi return dist * math.cos(angle) def hitY(self, pos): # convert to x,y relative to robot dist = self.getVal(pos) angle = (-self.th(pos) - 90.0) / 180.0 * math.pi return dist * math.cos(angle) def hitZ(self, pos): return 0.0 class SuperDroidIR(Device): def __init__(self, dev, type="ir"): Device.__init__(self, type) self.dev = dev self.sensorData = [] self.devData['units'] = "MM" # current report units self.devData['radius'] = 0.4 # meters self.devData['rawunits'] = "MM" self.devData['maxvalueraw'] = 300 # max range of GP2D120 is 30 cm = 300 mm self.devData['maxvalue'] = self.rawToUnits(self.devData["maxvalueraw"]) self.devData['count'] = 4 self.groups = {'all' : range(4), 'left' : (0,1), 'right' : (2,3), 'left-back' : (0), 'left-front' : (1), 'right-front' : (2), 'right-back' : (3)} self.subDataFunc['ox'] = self.ox self.subDataFunc['oy'] = self.oy self.subDataFunc['oz'] = lambda pos: 0.0 # mm self.subDataFunc['th'] = self.th self.subDataFunc['thr'] = lambda pos: self.th(pos) * PIOVER180 self.subDataFunc['pos'] = lambda pos: pos self.subDataFunc['value'] = self.getIRRange self.subDataFunc['x'] = self.hitX self.subDataFunc['y'] = self.hitY self.subDataFunc['z'] = self.hitZ self.startDevice() def getSensorValue(self, pos): return SensorValue(self, self.getValIr(pos), pos, (self.ox(pos), self.oy(pos), 0.0, self.th(pos))) def ox(self, pos): """HAVE TO GET THESE VALUES FILLED OUT""" # in MM if pos == 0: val = 0.0 elif pos == 1: val = 0.0 elif pos == 2: val = 0.0 elif pos == 3: val = 0.0 return val def oy(self, pos): """HAVE TO GET THESE VALUES FILLED OUT""" # in MM if pos == 0: val = 0.0 elif pos == 1: val = 0.0 elif pos == 2: val = 0.0 elif pos == 3: val = 0.0 return val def th(self, pos): # in degrees if pos == 0: val = 90.0 elif pos == 1: val = 90.0 elif pos == 2: val = -90.0 elif pos == 3: val = -90.0 return val #def setSensorReadings(self, irArray): # self.sensorData = irArray #return null def voltsToRange(self, volts, pos): """ The IR Sensors return values in volts, which is non-linear. This means, that a graph of volts against range will be a non-linear graph. Therefore, a non-linear function that can approximate that graph is being used to interpret volt-values to range-values. An alternative would be to use a look-up table but that is time consuming and sometimes inaccurate when interpreting values. """ if pos == 0: range = 22.0# some crazy function that I have to get from Mathematica elif pos == 1: range = 22.0 elif pos == 2: range = 22.0 elif pos == 3: range = 22.0 return range def getValIr(self, pos): try: return self.voltsToRange(self.dev.senseData['ir'][pos], pos) except: return 0 def getIRRange(self, pos): data = self.getVal(pos) return self.rawToUnits(data) def hitX(self, pos): # convert to x,y relative to robot dist = self.getVal(pos) angle = (-self.th(pos) - 90.0) / 180.0 * math.pi return dist * math.cos(angle) def hitY(self, pos): # convert to x,y relative to robot dist = self.getVal(pos) angle = (-self.th(pos) - 90.0) / 180.0 * math.pi return dist * math.cos(angle) def hitZ(self, pos): return 0.0 class SuperDroidRobot(Robot): def __init__(self, name = "Shuvonator"): Robot.__init__(self) # robot constructor self.debug = 0 # Debug flag for debug mode self.buffer = [] # buffer for reading in sensor information. self.sonarbuffer = [0,0,0,0] self.irbuffer = [0,0,0,0] self.flag = 0 self.initTrans = "\0" self.endTrans = "\A" self.lastTranslate = 0 self.lastRotate = 0 self.currSpeed = [0,0] # records the current speed #--------------- CREATE SERIAL CONNECTION ------------------ self.port0 = "/dev/ttyS0" # Serial ports self.port1 = "/dev/ttyS1" self.baudrate = 9600 # chosen baud-rate. Lowest is 1200, standard is 9600, highest is 38400 try: self.s = serial.Serial(self.port0, self.baudrate) except: print "Could not create connection to serial port. It's probably in use" self.s.flushInput() # flush input buffer, discarding all it's contents self.s.flushOutput() # flush output buffer, abort output #----------------- ROBOT PARAMETERS --------------------- self.devData["radius"] = 0.4 # metres self.devData["units"] = "MM" self.devData["builtinDevices"] = ['ir','sonar'] # all builtin devices #----------- OOPIC's OBJECT EEPROM ADDRESSES -------------- self.leftMotor = "" self.rightMotor = "" self.sonar1 = "\0041JM" self.sonar2 = "\0047JM" self.sonar3 = "\0053JM" self.sonar4 = "\0059JM" self.ir1 = "\0065JM" self.ir2 = "\0070JM" self.ir3 = "\0075JM" self.ir4 = "\0080JM" #------------------- SENSOR READINGS ---------------------- self.senseData = {} self.senseData['ir'] = [0] * 4 # 4 IR sensors self.senseData['sonar'] = [0] * 4 # 4 Sonar sensors #------------------- START DEVICES ---------------------- # The call self.get("/robot/range") will default to Sonar deviceName = self.startDevice("ir") self.devDataFunc["range"] = self.get("/devices/%s/object" % deviceName) self.devDataFunc["ir"] = self.get("/devices/%s/object" % deviceName) # creates an object and stores it in self.devDataFunc["ir"] deviceName = self.startDevice("sonar") self.devDataFunc["range"] = self.get("/devices/%s/object" % deviceName) self.devDataFunc["sonar"] = self.get("/devices/%s/object" % deviceName) # creates an object and stores it in self.devDataFunc["sonar"] #------------------ FINISHING TOUCH --------------------- self.update() self.inform("SuperDroid Robot driver loaded successfully...") def connect(self): self.s.write(self.initTrans) # Open COM port to start SCP transmission def disconnect(self): self.s.write(self.endTrans) # Close COM port to end SCP transmission def startDeviceBuiltin(self, item): if item == "sonar": return {"sonar": SuperDroidSONAR(self)} # DEFINE THIS elif item == "ir": return {"ir": SuperDroidIR(self)} # DEFINE THIS else: raise AttributeError, "The Super-Droid robot does not support device '%s'" % item def readData(self): #----------------------------------------- # Parses the data coming in from the OOPic #----------------------------------------- while self.s.inWaiting() == 0: pass # wait for OOPIC to respond if self.s.inWaiting() > 0: retval = self.s.read(self.s.inWaiting()) # reads in all the returned characters self.buffer = retval.split("m") # splits the returned string into an array return self.buffer[0] def update(self): self._update() self.senseData['sonar'] = [] self.senseData['ir'] = [] #------------ Send requiest to OOPIC for sensor values ------------- """ Here, once a command is sent, the value returned from the OOPic is immediately read in. This helps in preventing the SCP channel from getting clogged due to extensive data flow and keeps the OOPic from spazing out. After all, its communicating at 9600 BPS. """ self.s.write(self.sonar1) # Sonar 1 self.senseData['sonar'].append(self.readData()) self.s.write(self.sonar2) # Sonar 2 self.senseData['sonar'].append(self.readData()) self.s.write(self.sonar3) # Sonar 3 self.senseData['sonar'].append(self.readData()) self.s.write(self.sonar4) # Sonar 4 self.senseData['sonar'].append(self.readData()) #- - - - - - - - - - - - - - - - - - - - - - - - self.s.write(self.ir1) # IR 1 self.senseData['ir'].append(self.readData()) self.s.write(self.ir2) # IR 2 self.senseData['ir'].append(self.readData()) self.s.write(self.ir3) # IR 3 self.senseData['ir'].append(self.readData()) self.s.write(self.ir4) # IR 4 self.senseData['ir'].append(self.readData()) #------------------------------------------------------------------- #print senseData['sonar'] def sendMotorCommand(self): """ This method will send new motor commands based on the lastTranslate and lastRotate values. """ left = "" right = "" self.currSpeed = [left, right] self.s.write("blahblah%s%s" % (left, right)) # sends the motor command to the robot def move(self, trans, rotate): self.lastTranslate = trans self.lastRotate = rotate self.sendMotorCommand() def rotate(dev, rotate): self.lastRotate = rotate self.sendMotorCommand() def translate(dev, trans): self.lastTranslate = trans self.sendMotorCommand() def enableMotors(self): # "oServo.Operate = cvTrue" address needs to be put in here pass def disableMotors(self): # "oservo.Operate = cvFalse" address needs to be put in here pass From dblank at brynmawr.edu Wed Nov 16 11:03:05 2005 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Wed Nov 16 11:03:18 2005 Subject: [Pyro-users] Having problems with creating robot interface In-Reply-To: <20051116073655.72114.qmail@web31015.mail.mud.yahoo.com> References: <20051116073655.72114.qmail@web31015.mail.mud.yahoo.com> Message-ID: <1132156985.13704.137.camel@mightymouse.brynmawr.edu> Shuvo, That code is pretty old; you might want to look at later versions. I suspect you may be overwriting the data. That interface was pretty ad hoc, and is brittle. It can easily overwrite the buffers. I think we hacked on it further and made it a bit more robust, but the serial io could use some serious work to make it robust. You should make sure that it works without the GUI. In Python: >>> import SuperDroid >>> robot = SuperDroid.SuperDroid() # or whatever >>> robot.get("/robot/sonar/all/range") # or in later versions: >>> robot.sonar[0]["all"] If that works, it is probably clobbering the data. Try the later versions of the code, or try putting a pause after a write to the buffer. Let us know how that goes, one way or the other. -Doug On Tue, 2005-11-15 at 23:36 -0800, Spondon Saha wrote: > Hi, > > I'm a student from Truman State University and am making a robot > interface for Pyro 3.5.1 and am having problems making it work. The > interface resembles khepera.py and the robot uses simple serial > connection with a chosen baudrate (9600) to communicate with Pyro. I > have attached the code below and cannot make it to display sensor > information. > > For example, when I type self.get("/robot/sonar/all/range") on the > console, it returns this: [0,0,0,0]. I have studied the code > extensively but cannot figure out why its not displaying the sensor > information even though I can retrieve the sensor information and > store it in senseData['sonar'] and senseData['ir']. I have tested this > by dumping the data-array right into the Pyro console (line 345). But > when I execute the above call on the Pyro console, it returns the > array [0,0,0,0] > > I guess for some reason, in the function getVal in the class > SuperDroidSonar and SuperDro! idIR, the call > self.dev.senseData['sonar/ir'] is not being retrieved properly but > cannot figure out the solution to it. It should contain the sensor > information but instead fails to display it when called in line 96 > > Please help me out with this. I desparately need someone's help asap > in this as this is part of a University project I am supposed to > complete 2 weeks from now. I will really appreciate anyone's help and > will be very grateful. > > Thank you. > > Shuvo Saha > Truman State University. > -- Douglas S. Blank Computer Science Assistant Professor Bryn Mawr College (610)526-6501 http://cs.brynmawr.edu/~dblank From ajikoe at gmail.com Thu Nov 17 08:41:45 2005 From: ajikoe at gmail.com (Pujo Aji) Date: Thu Nov 17 08:41:47 2005 Subject: [Pyro-users] manual or online help Message-ID: Hello all, I would like to learn pyro especially Con-x which is related with ann. Can anyone point to an online help or manual ? Sincerely Yours, pujo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20051117/855408b2/attachment.htm From manaris at cs.cofc.edu Thu Nov 17 09:13:07 2005 From: manaris at cs.cofc.edu (Bill Manaris) Date: Thu Nov 17 09:13:16 2005 Subject: [Pyro-users] manual or online help In-Reply-To: References: Message-ID: <6033D8A3-F756-4147-A026-2FA5494EF850@cs.cofc.edu> Hi Pujo, You might take a look at the ANN assignment I gave last Fall in our senior AI class. http://www.cs.cofc.edu/~manaris/fall04/cs470/hmwk5.html Hopefully, it will provide some guidance. Regards, Bill On Nov 17, 2005, at 8:41 AM, Pujo Aji wrote: > Hello all, > > I would like to learn pyro especially Con-x which is related with ann. > Can anyone point to an online help or manual ? > > Sincerely Yours, > pujo > _______________________________________________ > Pyro-users mailing list > Pyro-users@emergent.brynmawr.edu > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users -- Bill Manaris, Ph.D. Computer Science Department College of Charleston 66 George Street, Charleston, SC 29424 Voice: (843)953-8159, Fax: (843)953-8154 Web: http://www.cs.cofc.edu/~manaris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20051117/18c4fed1/attachment.htm From dblank at BRYNMAWR.EDU Thu Nov 17 09:37:05 2005 From: dblank at BRYNMAWR.EDU (Douglas S. Blank) Date: Thu Nov 17 09:37:17 2005 Subject: [Pyro-users] manual or online help In-Reply-To: References: Message-ID: <1132238225.13704.217.camel@mightymouse.brynmawr.edu> For background and general information on neural networks you can start here: http://pyrorobotics.org/?page=PyroModuleNeuralNetworks Specific information on conx can be found here: http://pyrorobotics.org/?page=Conx_20Implementation_20Details You can also find various course pages that use conx by using google. For example, you might take a look at these pages: http://web.cs.swarthmore.edu/~meeden/cs63/f05/lab08.html http://www.cs.pomona.edu/~marshall/courses/2005/fall/cs151/assignments/a07/ If you have questions that aren't addressed on the PyroRobotics.org pages, please let us know. -Doug On Thu, 2005-11-17 at 14:41 +0100, Pujo Aji wrote: > Hello all, > > I would like to learn pyro especially Con-x which is related with ann. > Can anyone point to an online help or manual ? > > Sincerely Yours, > pujo > _______________________________________________ > 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 meeden at cs.swarthmore.edu Thu Nov 17 09:39:05 2005 From: meeden at cs.swarthmore.edu (Lisa Meeden) Date: Thu Nov 17 09:39:05 2005 Subject: [Pyro-users] manual or online help In-Reply-To: References: Message-ID: Pujo, Pyro includes a large collection of online curricular materials. There is a module devoted to neural networks here: http://www.pyrorobotics.org/?page=PyroModuleNeuralNetworks To see other modules, just follow the curriculum link at the top of this page. Good luck, Lisa On Thu, 17 Nov 2005, Pujo Aji wrote: > Hello all, > I would like to learn pyro especially Con-x which is related with ann. > Can anyone point to an online help or manual ? > Sincerely Yours, > pujo > --- Lisa Meeden Computer Science Dept. Associate Professor Swarthmore College meeden@cs.swarthmore.edu 500 College Ave. http://www.cs.swarthmore.edu/~meeden Swarthmore, PA 19081 610-328-8565 (voice) 610-328-8606 (fax) From shuvoprogramsworld at yahoo.com Sun Nov 20 04:51:47 2005 From: shuvoprogramsworld at yahoo.com (Spondon Saha) Date: Sun Nov 20 04:51:49 2005 Subject: [Pyro-users] Having problems with creating robot interface Message-ID: <20051120095147.48285.qmail@web31014.mail.mud.yahoo.com> Skipped content of type multipart/alternative-------------- next part -------------- #============================================================ # # Created : 07/14/05 # # By : Spondon Saha # # SuperDroid Trekker robot interface for PyRo # based on khepera.py # #============================================================ __author__ = "Spondon Saha " __version__ = "1.0" from pyro.robot import * from pyro.robot.device import * import serial import pyro.robot.driver as driver import string, array, math import time import thread from threading import * from pyro.geometry import PIOVER180, DEG90RADS, COSDEG90RADS, SINDEG90RADS #======================================================================================= # GLOBAL port0 = "/dev/ttyS0" # Serial ports port1 = "/dev/ttyS1" baudrate = 9600 # chosen baud-rate. Lowest is 1200, standard is 9600, highest is 38400 try: s = serial.Serial(port0, baudrate) except: print "Could not create connection to serial port. It's probably in use" s.flushInput() # flush input buffer, discarding all it's contents s.flushOutput() # flush output buffer, abort output #======================================================================================= class sensorReadingBuffer: def __init__(self): self.buffer = 0 self.count = 0 def deposit(self, sensorReading): if not self.count: self.count += 1 # there is an item in the buffer now self.buffer = sensorReading # used to store data else: raise "Buffer is already full" time.sleep(1) # pause for a slight second def consume(self): if self.count: self.count -= 1 # decrement counter: 1 less item in buffer else: raise "Buffer is already empty" time.sleep(1) # pause for a slight second return self.buffer def isEmpty(self): return not self.count class SuperDroidUpdater(Thread): # Plays the role of a Producer in a Producer/Consumer relationship def __init__(self, devAddr, buffer): Thread.__init__(self) self.lockCOM = thread.allocate_lock() # lock for the serial port self.devAddr = devAddr self.buffer = buffer # buffer object from device call self.blah = 0 #self.robot = SuperDroidRobot() # create robot object def readData(self): # Parses the data coming in from the OOPic while s.inWaiting() == 0: pass # wait for OOPIC to respond if s.inWaiting() > 0: retval = s.read(s.inWaiting()) # reads in all the returned characters self.reading = retval.split("m") # splits the returned string into an array return int(self.reading[0]) # type casts to int def run(self): self.lockCOM.acquire() # lock serial port acces s.write(self.devAddr) # write query to serial port self.blah = self.readData() while not self.buffer.isEmpty(): pass # wait until buffer is empty self.buffer.deposit(self.blah) # write to buffer self.lockCOM.release() # release the lock on the serial port class SuperDroidSONAR(Device): def __init__(self, dev, type="sonar"): Device.__init__(self, type) self.dev = dev self.sonar = ["\0041JM", "\0047JM", "\0053JM", "\0059JM"] self.sonarReading = 0 self.sonarBuffer = sensorReadingBuffer() # creates the shared buffer object self.devData['units'] = "MM" # current report units self.devData['radius'] = 0.4 # its always in meters self.devData['rawunits'] = "MM" self.devData['maxvalueraw'] = 4000 # mm - SRF04 max range is approx 3m or 3000mm. I made it 4000 to be on the safe side self.devData['maxvalue'] = self.rawToUnits(self.devData["maxvalueraw"]) self.devData['count'] = 4 self.groups = {'all' : range(4), 'front-left' : (0,1), 'front-right' : (2,3), 'left' : (1), 'right' : (3)} self.subDataFunc['ox'] = self.ox self.subDataFunc['oy'] = self.oy self.subDataFunc['oz'] = lambda pos: 0.0 # mm self.subDataFunc['th'] = self.th # degrees self.subDataFunc['thr'] = lambda pos: self.th(pos) * PIOVER180 # degrees self.subDataFunc['pos'] = lambda pos: pos self.subDataFunc['value'] = self.getSonarRange self.subDataFunc['x'] = self.hitX self.subDataFunc['y'] = self.hitY self.subDataFunc['z'] = self.hitZ self.startDevice() def getSensorValue(self, pos): return SensorValue(self, self.getValSonar(pos), pos, (self.ox(pos), self.oy(pos), 0.0, self.th(pos))) def ox(self, pos): # in MM if pos == 0: val = 63.5 elif pos == 1: val = 25.4 elif pos == 25: val = 25.4 elif pos == 3: val = 63.5 return val def oy(self, pos): # in MM """HAVE TO GET THESE VALUES FILLED OUT""" if pos == 0: val = 0.0 elif pos == 1: val = 0.0 elif pos == 2: val = 0.0 elif pos == 3: val = 0.0 return val def th(self, pos): # in degrees if pos == 0: val = 67.5 elif pos == 1: val = 22.5 elif pos == 2: val = -22.5 elif pos == 3: val = -67.5 return val def getValSonar(self, pos): # creates a thread to fetch sensor reading self.asker = SuperDroidUpdater(self.sonar[pos], self.sonarBuffer) # define the new thread self.asker.start() # run the new thread self.asker.join() # destroy thread self.sonarReading = self.sonarBuffer.consume() return (float(self.sonarReading)/64.0) * 304.8 # (raw_value/64) gives value in feet * 304.8 = range in mm. def getSonarRange(self, pos): dist = self.getValSonar(pos) return self.rawToUnits(dist) def hitX(self, pos): # convert to x,y relative to robot dist = self.getValSonar(pos) angle = (-self.th(pos) - 90.0) / 180.0 * math.pi return dist * math.cos(angle) def hitY(self, pos): # convert to x,y relative to robot dist = self.getValSonar(pos) angle = (-self.th(pos) - 90.0) / 180.0 * math.pi return dist * math.cos(angle) def hitZ(self, pos): return 0.0 class SuperDroidIR(Device): def __init__(self, dev, type="ir"): Device.__init__(self, type) self.dev = dev self.ir = ["\0065JM", "\0070JM", "\0075JM", "\0080JM"] self.irReading = 0 self.irBuffer = sensorReadingBuffer() # creates the shared buffer object self.devData['units'] = "MM" # current report units self.devData['radius'] = 0.4 # meters self.devData['rawunits'] = "MM" self.devData['maxvalueraw'] = 300 # max range of GP2D120 is 30 cm = 300 mm self.devData['maxvalue'] = self.rawToUnits(self.devData["maxvalueraw"]) self.devData['count'] = 4 self.groups = {'all' : range(4), 'left' : (0,1), 'right' : (2,3), 'left-back' : (0), 'left-front' : (1), 'right-front' : (2), 'right-back' : (3)} self.subDataFunc['ox'] = self.ox self.subDataFunc['oy'] = self.oy self.subDataFunc['oz'] = lambda pos: 0.0 # mm self.subDataFunc['th'] = self.th self.subDataFunc['thr'] = lambda pos: self.th(pos) * PIOVER180 self.subDataFunc['pos'] = lambda pos: pos self.subDataFunc['value'] = self.getIRRange self.subDataFunc['x'] = self.hitX self.subDataFunc['y'] = self.hitY self.subDataFunc['z'] = self.hitZ self.startDevice() def getSensorValue(self, pos): return SensorValue(self, self.getValIr(pos), pos, (self.ox(pos), self.oy(pos), 0.0, self.th(pos))) def ox(self, pos): """HAVE TO GET THESE VALUES FILLED OUT""" # in MM if pos == 0: val = 0.0 elif pos == 1: val = 0.0 elif pos == 2: val = 0.0 elif pos == 3: val = 0.0 return val def oy(self, pos): """HAVE TO GET THESE VALUES FILLED OUT""" # in MM if pos == 0: val = 0.0 elif pos == 1: val = 0.0 elif pos == 2: val = 0.0 elif pos == 3: val = 0.0 return val def th(self, pos): # in degrees if pos == 0: val = 90.0 elif pos == 1: val = 90.0 elif pos == 2: val = -90.0 elif pos == 3: val = -90.0 return val #def setSensorReadings(self, irArray): # self.sensorData = irArray #return null def voltsToRange(self, volts, pos): """ The IR Sensors return values in volts, which is non-linear. This means, that a graph of volts against range will be a non-linear graph. Therefore, a non-linear function that can approximate that graph is being used to interpret volt-values to range-values. An alternative would be to use a look-up table but that is time consuming and sometimes inaccurate when interpreting values. """ if pos == 0: range = 22.0# some crazy function that I have to get from Mathematica elif pos == 1: range = 22.0 elif pos == 2: range = 22.0 elif pos == 3: range = 22.0 return range def getValIr(self, pos): # creates a thread to fetch sensor reading self.asker = SuperDroidUpdater(self.ir[pos], self.irBuffer) # define the new thread self.asker.start() # run the new thread self.asker.join() # destroy thread self.irReading = self.irBuffer.consume() return self.voltsToRange(self.irReading, pos) # (raw_value/64) gives value in feet * 304.8 = range in mm. def getIRRange(self, pos): data = self.getValIr(pos) return self.rawToUnits(data) def hitX(self, pos): # convert to x,y relative to robot dist = self.getValIr(pos) angle = (-self.th(pos) - 90.0) / 180.0 * math.pi return dist * math.cos(angle) def hitY(self, pos): # convert to x,y relative to robot dist = self.getValIr(pos) angle = (-self.th(pos) - 90.0) / 180.0 * math.pi return dist * math.cos(angle) def hitZ(self, pos): return 0.0 class SuperDroidRobot(Robot): def __init__(self, name = "Shuvonator"): Robot.__init__(self) # robot constructor self.debug = 0 # Debug flag for debug mode #self.buffer = [] # buffer for reading in sensor information. #self.sonarbuffer = [0,0,0,0] #self.irbuffer = [0,0,0,0] #self.flag = 0 self.initTrans = "\0" self.endTrans = "\A" self.lastTranslate = 0 self.lastRotate = 0 self.currSpeed = [0,0] # records the current speed #--------------- CREATE SERIAL CONNECTION ------------------ #self.port0 = "/dev/ttyS0" # Serial ports #self.port1 = "/dev/ttyS1" #self.baudrate = 9600 # chosen baud-rate. Lowest is 1200, standard is 9600, highest is 38400 #try: # self.s = serial.Serial(self.port0, self.baudrate) #except: # print "Could not create connection to serial port. It's probably in use" #self.s.flushInput() # flush input buffer, discarding all it's contents #self.s.flushOutput() # flush output buffer, abort output #----------------- ROBOT PARAMETERS --------------------- self.devData["radius"] = 0.4 # metres self.devData["units"] = "MM" self.devData["builtinDevices"] = ['ir','sonar'] # all builtin devices #----------- OOPIC's OBJECT EEPROM ADDRESSES -------------- self.leftMotor = "\0085J" self.rightMotor = "\0089J" #self.sonar1 = "\0041JM" #self.sonar2 = "\0047JM" #self.sonar3 = "\0053JM" #self.sonar4 = "\0059JM" #self.ir1 = "\0065JM" #self.ir2 = "\0070JM" #self.ir3 = "\0075JM" #self.ir4 = "\0080JM" #------------------- SENSOR READINGS ---------------------- #self.senseData = {} #self.senseData['ir'] = [0] * 4 # 4 IR sensors #self.senseData['sonar'] = [0] * 4 # 4 Sonar sensors #------------------- START DEVICES ---------------------- # The call self.get("/robot/range") will default to Sonar deviceName = self.startDevice("ir") self.devDataFunc["range"] = self.get("/devices/%s/object" % deviceName) self.devDataFunc["ir"] = self.get("/devices/%s/object" % deviceName) # creates an object and stores it in self.devDataFunc["ir"] deviceName = self.startDevice("sonar") self.devDataFunc["range"] = self.get("/devices/%s/object" % deviceName) self.devDataFunc["sonar"] = self.get("/devices/%s/object" % deviceName) # creates an object and stores it in self.devDataFunc["sonar"] #------------------ FINISHING TOUCH --------------------- self.update() self.inform("SuperDroid Robot driver loaded successfully...") def connect(self): self.s.write(self.initTrans) # Open COM port to start SCP transmission def disconnect(self): self.s.write(self.endTrans) # Close COM port to end SCP transmission def startDeviceBuiltin(self, item): if item == "sonar": return {"sonar": SuperDroidSONAR(self)} # DEFINE THIS elif item == "ir": return {"ir": SuperDroidIR(self)} # DEFINE THIS else: raise AttributeError, "The Super-Droid robot does not support device '%s'" % item def readData(self): #----------------------------------------- # Parses the data coming in from the OOPic #----------------------------------------- while self.s.inWaiting() == 0: pass # wait for OOPIC to respond if self.s.inWaiting() > 0: retval = self.s.read(self.s.inWaiting()) # reads in all the returned characters self.buffer = retval.split("m") # splits the returned string into an array return map(int, self.buffer[0]) # type casrs to int #def update(self): # self._update() #self.senseData['sonar'] = [] #self.senseData['ir'] = [] #------------ Send requiest to OOPIC for sensor values ------------- #""" #Here, once a command is sent, the value returned from the OOPic is immediately read in. #This helps in preventing the SCP channel from getting clogged due to extensive data flow #and keeps the OOPic from spazing out. After all, its communicating at 9600 BPS. #""" #self.s.write(self.sonar1) # Sonar 1 #self.senseData['sonar'].append(self.readData()) #self.s.write(self.sonar2) # Sonar 2 #self.senseData['sonar'].append(self.readData()) #self.s.write(self.sonar3) # Sonar 3 #self.senseData['sonar'].append(self.readData()) #self.s.write(self.sonar4) # Sonar 4 #self.senseData['sonar'].append(self.readData()) ##- - - - - - - - - - - - - - - - - - - - - - - - #self.s.write(self.ir1) # IR 1 #self.senseData['ir'].append(self.readData()) #self.s.write(self.ir2) # IR 2 #self.senseData['ir'].append(self.readData()) #self.s.write(self.ir3) # IR 3 #self.senseData['ir'].append(self.readData()) #self.s.write(self.ir4) # IR 4 #self.senseData['ir'].append(self.readData()) #------------------------------------------------------------------- #print senseData['sonar'] def sendMotorCommand(self): """ This method will send new motor commands based on the lastTranslate and lastRotate values. """ left = "\0---" right = "\0---" self.currSpeed = [left, right] self.s.write("blahblah%s%s" % (left, right)) # sends the motor command to the robot def move(self, trans, rotate): self.lastTranslate = trans self.lastRotate = rotate self.sendMotorCommand() def rotate(dev, rotate): self.lastRotate = rotate self.sendMotorCommand() def translate(dev, trans): self.lastTranslate = trans self.sendMotorCommand() def enableMotors(self): # "oServo.Operate = cvTrue" address needs to be put in here pass def disableMotors(self): # "oservo.Operate = cvFalse" address needs to be put in here pass From dblank at brynmawr.edu Mon Nov 21 10:51:12 2005 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Mon Nov 21 10:51:26 2005 Subject: [Pyro-users] Having problems with creating robot interface In-Reply-To: <20051120095147.48285.qmail@web31014.mail.mud.yahoo.com> References: <20051120095147.48285.qmail@web31014.mail.mud.yahoo.com> Message-ID: <1132588272.13704.282.camel@mightymouse.brynmawr.edu> Shuvo, I think you are discovering some of the issues in asynchronous robot communication! What is really needed is a threaded process that is always running that can get data either as fast as possible, or at an appropriate frequency. Then, a request to get the current reading is just a retrieval of the last read. This will still need the lock/unlock functions but will separate the update into its own thread. The way that Pyro currently works is like this: If the brain is currently running, then the update() method is called right before the step() method. The idea here is that update() is called right before the data is needed, and no locking is necessary. If the brain is not running, then update() is called about 10 times a second in order to update the GUI. Again, the update method is called right before the data is needed, and no lock/unlock is needed. Both of these modes have the issue that it slows down the main loop, and should be redone. In the current system we avoided having the user be responsible for lock/unlocks, but created some other problems (slowness). A better idea would be to have a update thread whose frequency can be set, and put a lock before the step method is called. That way, we have the best of both worlds. I think this would be a good plan for Pyro Version 5. -Doug On Sun, 2005-11-20 at 01:51 -0800, Spondon Saha wrote: > Hi Doug, > > I did a work around for the problem. Earlier, the update method in the > robot class was updating all sensor readings. Instead, I deprecated > the use of the update method and instead made 2 additional classes, > one of them of type Thread. So using threads and using the idea of > critical sections, I can now update the sensor readings in the desired > fashion. > > The reason why the earlier version wasnt working is because read and > write attempts were being made on the buffer at the same time. Only > writes were favored and so when I tried to read by typing the command > self.get("/robot/sonar/all/value"), it would never work. > > The new version takes into account this problem and makes the buffer > mutually exclusive to any thread (using locks). > > However, I noticed a major snag: It takes forever to retrieve the > values once you type the command in the console. It looks like a lot > of time is being s! pent in creating and destroying threads. So I > guess I will have to find another workaround for this new problem. I > think I'll try to use the concept of "reusable threads". That way, > hopefully it will be faster and less time will be spent on creating > and destroying threads. I am attaching the modified version of the > interface for your reference...even though its not perfected yet. > > Lemme know if you notice any discrepancies in the code. Thanks! > > Shuvo > > "Douglas S. Blank" wrote: > Shuvo, > > That code is pretty old; you might want to look at later > versions. I > suspect you may be overwriting the data. That interface was > pretty ad > hoc, and is brittle. It can easily overwrite the buffers. I > think we > hacked on it further and made it a bit more robust, but the > serial io > c! ould use some serious work to make it robust. > > You should make sure that it works without the GUI. In Python: > > >>> import SuperDroid > >>> robot = SuperDroid.SuperDroid() # or whatever > >>> robot.get("/robot/sonar/all/range") # or in later > versions: > >>> robot.sonar[0]["all"] > > If that works, it is probably clobbering the data. Try the > later > versions of the code, or try putting a pause after a write to > the > buffer. > > Let us know how that goes, one way or the other. > > -Doug > > On Tue, 2005-11-15 at 23:36 -0800, Spondon Saha wrote: > > Hi, > > > > I'm a student from Truman State University and am making a > robot > > interface for Pyro 3.5.1 and am having problems making it > work. The > > interface resembles khepera.py and the robot uses simple > serial > > connection with a chosen baudrate (9600) to communicate with > Pyro. I > > have attached the code below and cannot make it to disp! lay > sensor > > information. > > > > For example, when I type self.get("/robot/sonar/all/range") > on the > > console, it returns this: [0,0,0,0]. I have studied the code > > extensively but cannot figure out why its not displaying the > sensor > > information even though I can retrieve the sensor > information and > > store it in senseData['sonar'] and senseData['ir']. I have > tested this > > by dumping the data-array right into the Pyro console (line > 345). But > > when I execute the above call on the Pyro console, it > returns the > > array [0,0,0,0] > > > > I guess for some reason, in the function getVal in the class > > SuperDroidSonar and SuperDro! idIR, the call > > self.dev.senseData['sonar/ir'] is not being retrieved > properly but > > cannot figure out the solution to it. It should contain the > sensor > > information but instead fails to display it when called in > line 96 > > > > Please help me out with th! is. I desparately need someone's > help asap > > in this as this is part of a University project I am > supposed to > > complete 2 weeks from now. I will really appreciate anyone's > help and > > will be very grateful. > > > > Thank you. > > > > Shuvo Saha > > Truman State University. > > > > -- > Douglas S. Blank Computer Science > Assistant Professor Bryn Mawr College > (610)526-6501 http://cs.brynmawr.edu/~dblank > > > > ______________________________________________________________________ > Yahoo! FareChase - Search multiple travel sites in one click. > plain text document attachment (SuperDroidRobot.py), > "332713851-SuperDroidRobot.py" > #============================================================ > # > # Created : 07/14/05 > # > # By : Spondon Saha > # > # SuperDroid Trekker robot interface for PyRo > # based on khepera.py > # > #============================================================ > > __author__ = "Spondon Saha " > __version__ = "1.0" > > from pyro.robot import * > from pyro.robot.device import * > import serial > import pyro.robot.driver as driver > import string, array, math > import time > import thread > from threading import * > from pyro.geometry import PIOVER180, DEG90RADS, COSDEG90RADS, SINDEG90RADS > > #======================================================================================= > # GLOBAL > port0 = "/dev/ttyS0" # Serial ports > port1 = "/dev/ttyS1" > baudrate = 9600 # chosen baud-rate. Lowest is 1200, standard is 9600, highest is 38400 > try: > s = serial.Serial(port0, baudrate) > except: > print "Could not create connection to serial port. It's probably in use" > s.flushInput() # flush input buffer, discarding all it's contents > s.flushOutput() # flush output buffer, abort output > #======================================================================================= > > class sensorReadingBuffer: > > def __init__(self): > self.buffer = 0 > self.count = 0 > > def deposit(self, sensorReading): > if not self.count: > self.count += 1 # there is an item in the buffer now > self.buffer = sensorReading # used to store data > else: > raise "Buffer is already full" > time.sleep(1) # pause for a slight second > > def consume(self): > if self.count: self.count -= 1 # decrement counter: 1 less item in buffer > else: raise "Buffer is already empty" > time.sleep(1) # pause for a slight second > return self.buffer > > def isEmpty(self): > return not self.count > > > class SuperDroidUpdater(Thread): > # Plays the role of a Producer in a Producer/Consumer relationship > def __init__(self, devAddr, buffer): > Thread.__init__(self) > self.lockCOM = thread.allocate_lock() # lock for the serial port > self.devAddr = devAddr > self.buffer = buffer # buffer object from device call > self.blah = 0 > #self.robot = SuperDroidRobot() # create robot object > > def readData(self): > # Parses the data coming in from the OOPic > while s.inWaiting() == 0: pass # wait for OOPIC to respond > > if s.inWaiting() > 0: > retval = s.read(s.inWaiting()) # reads in all the returned characters > self.reading = retval.split("m") # splits the returned string into an array > return int(self.reading[0]) # type casts to int > > def run(self): > self.lockCOM.acquire() # lock serial port acces > s.write(self.devAddr) # write query to serial port > self.blah = self.readData() > while not self.buffer.isEmpty(): pass # wait until buffer is empty > self.buffer.deposit(self.blah) # write to buffer > self.lockCOM.release() # release the lock on the serial port > > > class SuperDroidSONAR(Device): > > def __init__(self, dev, type="sonar"): > Device.__init__(self, type) > self.dev = dev > self.sonar = ["\0041JM", "\0047JM", "\0053JM", "\0059JM"] > self.sonarReading = 0 > self.sonarBuffer = sensorReadingBuffer() # creates the shared buffer object > self.devData['units'] = "MM" # current report units > self.devData['radius'] = 0.4 # its always in meters > self.devData['rawunits'] = "MM" > self.devData['maxvalueraw'] = 4000 # mm - SRF04 max range is approx 3m or 3000mm. I made it 4000 to be on the safe side > self.devData['maxvalue'] = self.rawToUnits(self.devData["maxvalueraw"]) > self.devData['count'] = 4 > self.groups = {'all' : range(4), > 'front-left' : (0,1), > 'front-right' : (2,3), > 'left' : (1), > 'right' : (3)} > self.subDataFunc['ox'] = self.ox > self.subDataFunc['oy'] = self.oy > self.subDataFunc['oz'] = lambda pos: 0.0 # mm > self.subDataFunc['th'] = self.th # degrees > self.subDataFunc['thr'] = lambda pos: self.th(pos) * PIOVER180 # degrees > self.subDataFunc['pos'] = lambda pos: pos > self.subDataFunc['value'] = self.getSonarRange > self.subDataFunc['x'] = self.hitX > self.subDataFunc['y'] = self.hitY > self.subDataFunc['z'] = self.hitZ > self.startDevice() > > def getSensorValue(self, pos): > return SensorValue(self, self.getValSonar(pos), pos, > (self.ox(pos), self.oy(pos), 0.0, self.th(pos))) > > def ox(self, pos): > # in MM > if pos == 0: > val = 63.5 > elif pos == 1: > val = 25.4 > elif pos == 25: > val = 25.4 > elif pos == 3: > val = 63.5 > return val > > def oy(self, pos): > # in MM > """HAVE TO GET THESE VALUES FILLED OUT""" > if pos == 0: > val = 0.0 > elif pos == 1: > val = 0.0 > elif pos == 2: > val = 0.0 > elif pos == 3: > val = 0.0 > return val > > def th(self, pos): > # in degrees > if pos == 0: > val = 67.5 > elif pos == 1: > val = 22.5 > elif pos == 2: > val = -22.5 > elif pos == 3: > val = -67.5 > return val > > def getValSonar(self, pos): > # creates a thread to fetch sensor reading > self.asker = SuperDroidUpdater(self.sonar[pos], self.sonarBuffer) # define the new thread > self.asker.start() # run the new thread > self.asker.join() # destroy thread > self.sonarReading = self.sonarBuffer.consume() > return (float(self.sonarReading)/64.0) * 304.8 # (raw_value/64) gives value in feet * 304.8 = range in mm. > > def getSonarRange(self, pos): > dist = self.getValSonar(pos) > return self.rawToUnits(dist) > > def hitX(self, pos): > # convert to x,y relative to robot > dist = self.getValSonar(pos) > angle = (-self.th(pos) - 90.0) / 180.0 * math.pi > return dist * math.cos(angle) > > def hitY(self, pos): > # convert to x,y relative to robot > dist = self.getValSonar(pos) > angle = (-self.th(pos) - 90.0) / 180.0 * math.pi > return dist * math.cos(angle) > > def hitZ(self, pos): return 0.0 > > class SuperDroidIR(Device): > > def __init__(self, dev, type="ir"): > Device.__init__(self, type) > self.dev = dev > self.ir = ["\0065JM", "\0070JM", "\0075JM", "\0080JM"] > self.irReading = 0 > self.irBuffer = sensorReadingBuffer() # creates the shared buffer object > self.devData['units'] = "MM" # current report units > self.devData['radius'] = 0.4 # meters > self.devData['rawunits'] = "MM" > self.devData['maxvalueraw'] = 300 # max range of GP2D120 is 30 cm = 300 mm > self.devData['maxvalue'] = self.rawToUnits(self.devData["maxvalueraw"]) > self.devData['count'] = 4 > self.groups = {'all' : range(4), > 'left' : (0,1), > 'right' : (2,3), > 'left-back' : (0), > 'left-front' : (1), > 'right-front' : (2), > 'right-back' : (3)} > self.subDataFunc['ox'] = self.ox > self.subDataFunc['oy'] = self.oy > self.subDataFunc['oz'] = lambda pos: 0.0 # mm > self.subDataFunc['th'] = self.th > self.subDataFunc['thr'] = lambda pos: self.th(pos) * PIOVER180 > self.subDataFunc['pos'] = lambda pos: pos > self.subDataFunc['value'] = self.getIRRange > self.subDataFunc['x'] = self.hitX > self.subDataFunc['y'] = self.hitY > self.subDataFunc['z'] = self.hitZ > self.startDevice() > > def getSensorValue(self, pos): > return SensorValue(self, self.getValIr(pos), pos, > (self.ox(pos), self.oy(pos), 0.0, self.th(pos))) > def ox(self, pos): > """HAVE TO GET THESE VALUES FILLED OUT""" > # in MM > if pos == 0: > val = 0.0 > elif pos == 1: > val = 0.0 > elif pos == 2: > val = 0.0 > elif pos == 3: > val = 0.0 > return val > > def oy(self, pos): > """HAVE TO GET THESE VALUES FILLED OUT""" > # in MM > if pos == 0: > val = 0.0 > elif pos == 1: > val = 0.0 > elif pos == 2: > val = 0.0 > elif pos == 3: > val = 0.0 > return val > > def th(self, pos): > # in degrees > if pos == 0: > val = 90.0 > elif pos == 1: > val = 90.0 > elif pos == 2: > val = -90.0 > elif pos == 3: > val = -90.0 > return val > > #def setSensorReadings(self, irArray): > # self.sensorData = irArray > #return null > > def voltsToRange(self, volts, pos): > """ > The IR Sensors return values in volts, which is non-linear. This means, that a graph > of volts against range will be a non-linear graph. Therefore, a non-linear function > that can approximate that graph is being used to interpret volt-values to range-values. > An alternative would be to use a look-up table but that is time consuming and sometimes > inaccurate when interpreting values. > """ > if pos == 0: > range = 22.0# some crazy function that I have to get from Mathematica > elif pos == 1: > range = 22.0 > elif pos == 2: > range = 22.0 > elif pos == 3: > range = 22.0 > > return range > > def getValIr(self, pos): > # creates a thread to fetch sensor reading > self.asker = SuperDroidUpdater(self.ir[pos], self.irBuffer) # define the new thread > self.asker.start() # run the new thread > self.asker.join() # destroy thread > self.irReading = self.irBuffer.consume() > return self.voltsToRange(self.irReading, pos) # (raw_value/64) gives value in feet * 304.8 = range in mm. > > def getIRRange(self, pos): > data = self.getValIr(pos) > return self.rawToUnits(data) > > def hitX(self, pos): > # convert to x,y relative to robot > dist = self.getValIr(pos) > angle = (-self.th(pos) - 90.0) / 180.0 * math.pi > return dist * math.cos(angle) > > def hitY(self, pos): > # convert to x,y relative to robot > dist = self.getValIr(pos) > angle = (-self.th(pos) - 90.0) / 180.0 * math.pi > return dist * math.cos(angle) > > def hitZ(self, pos): return 0.0 > > class SuperDroidRobot(Robot): > > def __init__(self, name = "Shuvonator"): > Robot.__init__(self) # robot constructor > self.debug = 0 # Debug flag for debug mode > #self.buffer = [] # buffer for reading in sensor information. > #self.sonarbuffer = [0,0,0,0] > #self.irbuffer = [0,0,0,0] > #self.flag = 0 > self.initTrans = "\0" > self.endTrans = "\A" > self.lastTranslate = 0 > self.lastRotate = 0 > self.currSpeed = [0,0] # records the current speed > #--------------- CREATE SERIAL CONNECTION ------------------ > #self.port0 = "/dev/ttyS0" # Serial ports > #self.port1 = "/dev/ttyS1" > #self.baudrate = 9600 # chosen baud-rate. Lowest is 1200, standard is 9600, highest is 38400 > #try: > # self.s = serial.Serial(self.port0, self.baudrate) > #except: > # print "Could not create connection to serial port. It's probably in use" > #self.s.flushInput() # flush input buffer, discarding all it's contents > #self.s.flushOutput() # flush output buffer, abort output > #----------------- ROBOT PARAMETERS --------------------- > self.devData["radius"] = 0.4 # metres > self.devData["units"] = "MM" > self.devData["builtinDevices"] = ['ir','sonar'] # all builtin devices > #----------- OOPIC's OBJECT EEPROM ADDRESSES -------------- > self.leftMotor = "\0085J" > self.rightMotor = "\0089J" > #self.sonar1 = "\0041JM" > #self.sonar2 = "\0047JM" > #self.sonar3 = "\0053JM" > #self.sonar4 = "\0059JM" > #self.ir1 = "\0065JM" > #self.ir2 = "\0070JM" > #self.ir3 = "\0075JM" > #self.ir4 = "\0080JM" > #------------------- SENSOR READINGS ---------------------- > #self.senseData = {} > #self.senseData['ir'] = [0] * 4 # 4 IR sensors > #self.senseData['sonar'] = [0] * 4 # 4 Sonar sensors > #------------------- START DEVICES ---------------------- > # The call self.get("/robot/range") will default to Sonar > deviceName = self.startDevice("ir") > self.devDataFunc["range"] = self.get("/devices/%s/object" % deviceName) > self.devDataFunc["ir"] = self.get("/devices/%s/object" % deviceName) # creates an object and stores it in self.devDataFunc["ir"] > deviceName = self.startDevice("sonar") > self.devDataFunc["range"] = self.get("/devices/%s/object" % deviceName) > self.devDataFunc["sonar"] = self.get("/devices/%s/object" % deviceName) # creates an object and stores it in self.devDataFunc["sonar"] > #------------------ FINISHING TOUCH --------------------- > self.update() > self.inform("SuperDroid Robot driver loaded successfully...") > > def connect(self): > self.s.write(self.initTrans) # Open COM port to start SCP transmission > > def disconnect(self): > self.s.write(self.endTrans) # Close COM port to end SCP transmission > > def startDeviceBuiltin(self, item): > if item == "sonar": > return {"sonar": SuperDroidSONAR(self)} # DEFINE THIS > elif item == "ir": > return {"ir": SuperDroidIR(self)} # DEFINE THIS > else: > raise AttributeError, "The Super-Droid robot does not support device '%s'" % item > > def readData(self): > #----------------------------------------- > # Parses the data coming in from the OOPic > #----------------------------------------- > while self.s.inWaiting() == 0: pass # wait for OOPIC to respond > > if self.s.inWaiting() > 0: > retval = self.s.read(self.s.inWaiting()) # reads in all the returned characters > self.buffer = retval.split("m") # splits the returned string into an array > return map(int, self.buffer[0]) # type casrs to int > > #def update(self): > # self._update() > #self.senseData['sonar'] = [] > #self.senseData['ir'] = [] > #------------ Send requiest to OOPIC for sensor values ------------- > #""" > #Here, once a command is sent, the value returned from the OOPic is immediately read in. > #This helps in preventing the SCP channel from getting clogged due to extensive data flow > #and keeps the OOPic from spazing out. After all, its communicating at 9600 BPS. > #""" > #self.s.write(self.sonar1) # Sonar 1 > #self.senseData['sonar'].append(self.readData()) > #self.s.write(self.sonar2) # Sonar 2 > #self.senseData['sonar'].append(self.readData()) > #self.s.write(self.sonar3) # Sonar 3 > #self.senseData['sonar'].append(self.readData()) > #self.s.write(self.sonar4) # Sonar 4 > #self.senseData['sonar'].append(self.readData()) > ##- - - - - - - - - - - - - - - - - - - - - - - - > #self.s.write(self.ir1) # IR 1 > #self.senseData['ir'].append(self.readData()) > #self.s.write(self.ir2) # IR 2 > #self.senseData['ir'].append(self.readData()) > #self.s.write(self.ir3) # IR 3 > #self.senseData['ir'].append(self.readData()) > #self.s.write(self.ir4) # IR 4 > #self.senseData['ir'].append(self.readData()) > #------------------------------------------------------------------- > #print senseData['sonar'] > > def sendMotorCommand(self): > """ > This method will send new motor commands based on the > lastTranslate and lastRotate values. > """ > left = "\0---" > right = "\0---" > > self.currSpeed = [left, right] > self.s.write("blahblah%s%s" % (left, right)) # sends the motor command to the robot > > def move(self, trans, rotate): > self.lastTranslate = trans > self.lastRotate = rotate > self.sendMotorCommand() > > def rotate(dev, rotate): > self.lastRotate = rotate > self.sendMotorCommand() > > def translate(dev, trans): > self.lastTranslate = trans > self.sendMotorCommand() > > def enableMotors(self): # "oServo.Operate = cvTrue" address needs to be put in here > pass > > def disableMotors(self): # "oservo.Operate = cvFalse" address needs to be put in here > pass > > > _______________________________________________ > 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 nswoboda at clip.dia.fi.upm.es Mon Nov 28 12:55:32 2005 From: nswoboda at clip.dia.fi.upm.es (nswoboda@clip.dia.fi.upm.es) Date: Mon Nov 28 12:56:17 2005 Subject: [Pyro-users] Vision with a brain? Message-ID: <200511281755.jASHtWqF031009@clip.dia.fi.upm.es> Hello I am trying to sort out using vision with pyro by implementing a simple line following brain (at the moment with gazebo). I would like to implement the image processing stuff in C++, but I can't seem to find any examples of how to put all the pieces together. I have been looking at the myVision example, but that seems somewhat different from what I want to do... (BTW, in the end the gazebo startup problem I posted about a couple of weeks ago seems to be related to my video driver and chip (which is ATI by unfortunately isn't supported by livna). In the end I gave up for lack of time and am using a different machine with a supported chip.) Nik ____________________________________________________ He looked at me as if I were a side dish he hadn't ordered. -- Ring Lardner From dblank at brynmawr.edu Mon Nov 28 16:54:58 2005 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Mon Nov 28 16:58:50 2005 Subject: [Pyro-users] Vision with a brain? In-Reply-To: <200511281755.jASHtWqF031009@clip.dia.fi.upm.es> References: <200511281755.jASHtWqF031009@clip.dia.fi.upm.es> Message-ID: <1133214898.9769.67.camel@mightymouse.brynmawr.edu> On Mon, 2005-11-28 at 18:55 +0100, nswoboda@clip.dia.fi.upm.es wrote: > Hello > > I am trying to sort out using vision with pyro by implementing a > simple line following brain (at the moment with gazebo). I > would like to implement the image processing stuff in C++, but I > can't seem to find any examples of how to put all the pieces > together. I have been looking at the myVision example, but that > seems somewhat different from what I want to do... Nik, If you want to work in C++, then you are looking at the right example: pyrobot/vision/example/myVision.cpp We don't have much documentation on the process, but I'll add a version of the following to the docs. 1. First step is to write the C++ code. You'll might want to add your new functionality as a "filter" so that you can combine it with other functions, or at least toggle it on and off. First, you will define your C++ function, and determine arguments (if any). That might look like: void myVision::swapPlanes(int d1, int d2) { for (int h = 0; h < height; h++) { for (int w = 0; w < width; w++) { unsigned int temp = Image[(h * width + w) * depth + d1]; Image[(h * width + w) * depth + d1] = Image[(h * width + w) * depth + d2]; Image[(h * width + w) * depth + d2] = temp; } } } This is in the myVision.cpp example. At this point, you should know that there are two ways to make your function useful. The first is to actually alter the Image array (like in this example). The second is to mayke your function return something. If you want to return something simple, such as an int or double, then you just return it. If you want to return something more complicated, such as a list or other Python object, then you will have to construct it. There are more examples of both types in: pyrobot/vision/cvision/Vision.cpp 2. The next step is to make the filter available to the menu of the camera GUI (this isn't strictly necessary, but will help and is quite easy). You just add the function to the getMenu list in myVision.cpp: PyObject *myVision::getMenu() { PyObject *menu = PyList_New( 0 ); PyList_Append(menu, Py_BuildValue("sssiiiii", "myFilters", "Match pixel", "match", 0, 0, 0, 30, 0)); PyList_Append(menu, Py_BuildValue("sssiiiii", "myFilters", "Match pixel", "swap", 0, 0, 0, 30, 0)); ... The PyBuildValue takes three strings (sss) (menu group, filter description, and filter name) which are all arbitrary names. Then you should give some defaults. This one takes 5 integers (iiiii): 0,0,0,30,0. Then you need to actually put a call to the function in applyFilter: ... } else if(strcmp((char *)command, "swap") == 0) { swapPlanes(); return Py_BuildValue(""); } This example doesn't return anything back. See myVision.cpp or Vision.cpp for examples that do return values. 4. Finally, you are ready to apply the filter, and use the return values (or pixel changes) to affect a brain. First, you need to load the camera device with the appropriate "vision system." Here you will choose your code from above; see for example pyrobot/plugin/devices/PlayerCamera.py: from pyrobot.camera.player import PlayerCamera from pyrobot.vision.example.myvision import myVision def INIT(robot): return {"camera": PlayerCamera("localhost", 6665, visionSystem = myVision())} 5. After you have your camera and vision system loaded, then you should be able to select the filter from the menu. Once you have done that, then you can get filter results back from their return values in self.robot.camera[0].filterResults (which is a list.) Currently, the position in the list indicates which filter was used (applied in order). That is, the first element in the list goes with the first filter that was applied. Let us know if you have any problems. -Doug > (BTW, in the end the gazebo startup problem I posted about a > couple of weeks ago seems to be related to my video driver and > chip (which is ATI by unfortunately isn't supported by livna). > In the end I gave up for lack of time and am using a different > machine with a supported chip.) [Thanks for the update!] > Nik -- Douglas S. Blank Computer Science Assistant Professor Bryn Mawr College (610)526-6501 http://cs.brynmawr.edu/~dblank