Welcome, Guest. Please Login.
Surveyor Corporation Surveyor SRV-1
Home Help Search Login

Surveyor Robotics Forum

Welcome to the user support forum for Surveyor SRV-1 robots, SRV-1 robot controllers and SVS stereo vision systems. To register for this forum, please send an email to support@surveyor.com which includes your desired forum user name, your registration email address, and a brief explanation of why you wish to join, and we will create a forum account for you.

Please note that there is a Search button in the forum toolbar for forum topics. Another effective search method for the entire surveyor.com site is to use Google, e.g. "xyz site://www.surveyor.com" where "xyz" is the search topic.



Pages: 1 2 
Send Topic Print
Myro and ffnet (Read 18385 times)
localyodel
YaBB Newbies
*




Posts: 13
Myro and ffnet
04/01/07 at 12:42pm
 
Hello,  Thought I would share this as I find it fairly simple, useful and fun.  Using Myro and ffnet I have been able to get impresive object avoidance capabilities from the srv ir sensors... given the limits of ir. Below is a training program for a neural net and a brain for use of a trained network with the srv.  
 
Run the training program to create the trained network, it will save to a file called srv_ir.net in the directory that the trainer is run from. Then use the brain to run the trained network with the srv.  
 
I found if I turn on the srv in the room or area that it is going to be operated in I get better results from the ir sensors.
 
Beware ffnet has some dependencies and caused me to go in circles for an hour or so... this however was probably just due to my lack of experience with python.  
 
Here are the websites for the software:
 
http://ffnet.sourceforge.net/
http://wiki.roboteducation.org/Myro_Hardware
 
Example programs:
 
 
 
BEGIN TRAINER CODE:
 
########################################################################
##  Copyright (C) 2006 by Marek Wojciechowski
##  <mwojc@p.lodz.pl>
##
##  Distributed under the terms of the GNU General Public License (GPL)
##  http://www.gnu.org/copyleft/gpl.html
##  Modified for SRV-1 Robot IR sensor navigation 03/31/07 By Jason Copeland
##  jason@linux4solutions.com
########################################################################
 
### SRV-1 IR sensor input ###
 
from ffnet import ffnet, mlgraph
 
# Generate standard layered network architecture
conec = mlgraph((4,4,2))
# Create network
net = ffnet(conec)
 
# Define training data
#All possible ir input combos, can be chaged to increase/decrese sensitivity of srv ir.  
input = [[0.,0.,0.,0.], [0.,0.,0.,0.3], [0.,0.,0.3,0.], [0.,0.,0.3,0.3],[0.,0.3,0.,0.],[0.,0.3,0.,0.3],[0.,0.3,0.3,0],[0.,0.3,0.3,0.3],[0.3,0.,0.,0.],[0.3,0.,0.,0.3],[0.3,0.,0.3,0.],[0.3,0.,0.3,0.3],[0.3,0.3,0.3,0.],[0.3,0.3,0.,0.3],[0.3,0.3,0.3,0.],[0.3,0.3,0.3,0.3]]
#These are the reactions I want from the coresponding input, they should in essence avoid all objects in given environment, these can be chaged to get many different behaviors.
target  = [[1.,1.], [1.,1.], [1.,1.], [1.,1.], [1.,1.], [1.,1.], [1.,1.], [1.,1.],[0.,0.],[0.,1.],[0.,1.],[0.,1.],[1.,0.],[0.,0.],[1.,0.],[0.,0.]]
 
# Train network
#first find good starting point with genetic algorithm (not necessary, but may be helpful)
print "FINDING STARTING WEIGHTS WITH GENETIC ALGORITHM..."
net.train_genetic(input, target, individuals=20, generations=500)
#then train with scipy tnc optimizer
print "TRAINING NETWORK..."
net.train_tnc(input, target, maxfun = 1000, messages=1)
 
# Test network
print
print "TESTING NETWORK..."
output, regression = net.test(input, target, iprint = 2)
 
# Save/load/export network
from ffnet import savenet, loadnet, exportnet
print "Network is saved..."
savenet(net, "srv_ir.net")
print "loading trained neural net..."
net = loadnet("srv_ir.net")
print "Network is tested again, but nothing is printed..."
output, regression = net.test(input, target, iprint = 0)
print
print output
print
print "Done..."
 
END TRAINER CODE:  
 
BEGIN BRAIN CODE:
 
##IR sensor brain for srv-1
##Takes as inputs SRV-1 ir sensors
 
from ffnet import ffnet, loadnet
from myro import *
 
#initialize robot
robot = Surveyor("com4")
 
#Output adjustment.
adjustL = 0.6
adjustR = 0.6
 
#Load network created with training program.
net = loadnet("srv_ir.net")
 
while True:
    ans = net.call(robot.get("ir")) #Nework input
    robot.motors(ans[0]-adjustL, ans[1]-adjustR) #Network output
 
END BRAIN CODE:
 
Save the two examples in the same directory as something like:
 
trainer.py
brain.py
 
From a command line enter the directory you saved to and execute:
 
python trainer.py
 
Make sure the srv is turned on and ready to go, execute:
 
python brain.py
 
Keep an eye on srv...
 
Enjoy,
 
Jason
 
 
Back to top
 
 
  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Myro and ffnet
Reply #1 - 04/01/07 at 1:08pm
 
Jason -
 
That's great !
 
I have an update to the SRV-1 firmware that will release shortly, and one of the significant changes is modification to the IR code to make it more accurate and less quirky.
 
There is a revised bounceIR() function in utils.c.  The IR detectors are very sensitive, and the IR LED's are quite powerful, and our old logic required all 4 detectors to fire to detect a response.  The code has been changed to require just the nearest 3 detectors to fire for each emitter, but the pulse length has been shortened to compensate for increased sensitivity.  If you want to try a pre-release version of the revised firmware, you can download it here -  
    http://www.surveyor.com/srvdownload/srv-032307.zip
 
I'll be interested whether the revised IR code produces better results in your tests.
 
 
Back to top
 
 

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
localyodel
YaBB Newbies
*




Posts: 13
Re: Myro and ffnet
Reply #2 - 04/01/07 at 4:26pm
 
Hey, I only did two quick runs, the first with the above training values caused the srv to crash before deciding to avoid, I lowered all the 0.3 values in the training program to 0.2 the result was the best run I've seen... no crashes in three minutes.  I will have to do more tests in different lighting but the IR appears way more reliable.
 
Thanks
Back to top
 
 
  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Myro and ffnet
Reply #3 - 04/01/07 at 5:20pm
 
That's good news.  I should have mentioned that the scaling of the returned values from the revised ir() function isn't quite the same, but you figured it out.
Back to top
 
 

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Myro and ffnet
Reply #4 - 04/05/07 at 1:05pm
 
Prof. Doug Blank (Myro's author) enjoyed your example and posted it to other Myro users.  He suggested a variation on this theme would be to drive the robot around and let it figure out what the "rules" are. For example, see:
 
http://pyrorobotics.org/?page=Robot_20Learning_20using_20Neural_20Networks
 
and
 
http://pyrorobotics.org/?page=Generalization_20in_20a_20Neural_20Network
 
He's using a different NN library called CONX which is similar in function to ffnet, so the techniques he's suggesting should easily translate.
Back to top
 
 

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
localyodel
YaBB Newbies
*




Posts: 13
Re: Myro and ffnet
Reply #5 - 04/05/07 at 7:14pm
 
Very cool, I'm going to work through his examples.  
 
I am using two networks currently (one for ir one for camera) and have the srv avoiding everything, while avoiding, looking for a color blob, when found, it seeks the blob.  When I get the network tuned just right and get a good color sample the srv gives an impressive demonstration.  
 
I look forward to having my srv figure out it's own rules.
 
Thanks for the tips, I appreciate any I can get.  
Back to top
 
 
  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Myro and ffnet
Reply #6 - 04/05/07 at 10:44pm
 
How are you setting up the input neurons for the blob tracking ?  
 
I was thinking about mapping the various vision functions into blocks of inputs - maybe 4 neuron inputs representing 4 quadrants of the visual field (pixel column 0-15, 16-31, 32-47, 48-63) for the blob function or scan function, or one of the new vision functions ("vf" and "vn").  
 
What I've been struggling with in moving the neural net code into firmware has been figuring a nice way to represent this mapping.  One thought is to have a fixed mapping, e.g. 4 neurons for IR, 4 neurons for color #0, 4 neurons for color #1, etc, and then a code for each set of neurons that identifies the vision function that is used to feed each block of neurons.  Initially, a neural net that had up to 16 inputs (4 IR's plus 3 sets of color functions with 4 inputs each) would probably be a pretty rich setup, and we could always expand later.  Other inputs might include feedback from the motor power levels and perhaps an external input from an external entity (e.g. the supervisor), though maybe that feedback is just used for generating the error signal in backpropagation.
 
Anyhow, I'd just like to put all of this stuff ...
   - color bin definitions
   - neuron input mappings (which functions to employ for each color)
   - number of hidden layers
   - externally generated or internally learned weights
   - learning rate
   - maybe some training data sets just to initialize the net
into a table/file that gets stored internally in flash and is written/read with a command similar to "zw" and "zr", but using a separate flash sector.
 
Any feedback on this would be welcome.  I have an integer version of the backprop engine that will run on the ARM7 and can be run off-board for training, but haven't gotten comfortable with an approach that makes this easy to set up.
Back to top
 
« Last Edit: 04/05/07 at 10:46pm by admin »  

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
localyodel
YaBB Newbies
*




Posts: 13
Re: Myro and ffnet
Reply #7 - 04/06/07 at 8:51am
 
I am new to NN's and the abilities of the camera, and so have gone very simple.  Currently for the camera I am taking a single input.  I am adding x1 and x2 like the basic example brain on Myro's site then feeding the single value into the network.  My next step is two inputs; x's and y's setup like myro's basic example then feed the two values into the network, I am slowly ratcheting up the complexity.
 
You have thought it through way further than me and have a much greater understanding.  I would only suggest keeping things in perspective, as you mentioned, it can always be expanded upon.  I like the idea of having a file that can be edited and uploaded (from web or txt).   I will think about it more and let you know if anything comes to mind...
 
If setup like described you will have rich networks indeed; very exciting.  
 
I included my current code for the camera trainer and the brain for camera and ir combined in case you or anyone cares to look or perhaps has suggestions for improvement.
 
########################################################################
##  Copyright (C) 2006 by Marek Wojciechowski
##  <mwojc@p.lodz.pl>
##
##  Distributed under the terms of the GNU General Public License (GPL)
##  http://www.gnu.org/copyleft/gpl.html
##  Modified by Jason Copeland to train a network for SRV-1 Robot x axis camera navigation
########################################################################
 
### SRV Camera track color ###
 
from ffnet import ffnet, mlgraph
 
# Generate standard layered network architecture
conec = mlgraph((1,2,2))
# Create network
net = ffnet(conec)
 
# Define training data
input = [[0.],[5.],[10.], [15.], [20.], [25.], [30.], [35.], [40.], [45.], [50.], [55.], [60.], [65.], [70.], [75.]]
#These are the outcomes that I want when srv observes a given scenario.
target  = [[0.,0.], [0.,1.], [0.,1.], [0.,1.], [0.,1.], [1.,1.], [1.,1.], [1.,1.],[1.,1.],[1.,0.],[1.,0.],[1.,0.],[1.,0.],[1.,0.],[1.,0.],[1.,0.]]
 
# Train network
#first find good starting point with genetic algorithm (not necessary, but may be helpful)
#print "FINDING STARTING WEIGHTS WITH GENETIC ALGORITHM..."
net.train_genetic(input, target, individuals=20, generations=1500)
#then train with scipy tnc optimizer
print "TRAINING NETWORK..."
net.train_tnc(input, target, maxfun = 2000, messages=1)
 
# Test network
print
print "TESTING NETWORK..."
output, regression = net.test(input, target, iprint = 2)
 
# Save/load/export network
from ffnet import savenet, loadnet, exportnet
print "Network is saved..."
savenet(net, "srv_xcamera.net")
print "loading trained neural net..."
net = loadnet("srv_xcamera.net")
print "Network is tested again, but nothing is printed..."
output, regression = net.test(input, target, iprint = 0)
print
print output
print
print "Done..."
 
END TRAINER:
 
##Avoid everything but given color.
 
from ffnet import ffnet, loadnet
from myro import *
import time
 
#initialize robot
robot = Surveyor("com4")
 
#Output adjustment.
iradjustL = 0.5
iradjustR = 0.5
 
camadjustL = 0.5
camadjustR = 0.5
 
#Speed adjustment.
irspeedL = 0.5
irspeedR = 0.5
 
camspeedL = 0.5
camspeedR = 0.5
 
#scan area
scan = 0
nextscandir = 0
 
#Load networks created with training program.
xcamnet = loadnet("srv_xcamera.net")
irnet = loadnet("srv_ir.net")
 
def getX(): #get color blob x location
    x1, y1, x2, y2, count = robot.getBlob(0)
    centerx = (x1 + x2) / 2
    return centerx
 
def getIR():
    return irnet.call(robot.get("ir"))
               
def trackColor(cx):
    while cx > 0:
       xcam = xcamnet.call(cx)
       robot.motors((xcam[0]-camadjustL)*camspeedL, (xcam[1]-camadjustR)*camspeedR) #Network output camera
       if not(xcam[0] > .8 and xcam[1] > .8):
           robot.motors(.7,.4)
       cx = getX()
       
def irMotor(ir):
    robot.motors((ir[0]-iradjustL)*irspeedL, (ir[1]-iradjustR)*irspeedR)
    trackColor(getX())  #track color
           
robot.watch() #store color to track in tracking bin.
 
while True:
    trackColor(getX())  #track color
    irMotor(getIR())    #watch for periferal objects
 
     
END BRAIN            
Back to top
 
 
  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Myro and ffnet
Reply #8 - 04/06/07 at 10:18am
 
That's the nice thing about neural nets - you can start with a really simple architecture and build to whatever level of complexity you want.  I am really glad to see you pursuing this, and hope others will jump in.
 
Eventually, I would like to see these experiments evolve into a set of tutorials that explore the use of neural nets in place of procedural code for managing/developing robot behaviors.  I think we can keep this at a relatively simple and understandable level, though we should be able to develop some very interesting capabilities.  
 
Beyond functions for the most basic colored object detection, we should be able to add some simple functions for shape recognition using low-resolution nets (face recognition is even possible).  Anyhow, that's what I have been thinking about, but none of this is useful if we don't put the first basic capabilities in place in firmware, so I really need to finalize a code release with some NN functions.
Back to top
 
 

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
localyodel
YaBB Newbies
*




Posts: 13
Re: Myro and ffnet
Reply #9 - 04/08/07 at 8:33pm
 
Hello, I am really enjoying learning about neural nets and am starting to understand how powerful they are.  I think they make robot programming easier and cleaner once you start getting a grasp on them.
 
Anyways, for what it's worth, I think the fixed mapping is a fine place to start. Perhaps just the training inputs and desired outputs could be configurable to start.  Or maybe nothing is configurable for ir, it will simply avoid and only color sample inputs are configurable for the camera.  Maybe a simple ir avoid routine that takes no configuration at all and is called from a command.  I would be happy with a starting point of the most simple nn function in firmware... I really look forward to seeing your code.
 
I now have three networks running; 4 input ir, 1 input x color, 1 input y color.  I am using a 6'x8' room and a red dixie cup for the srv environemnt and goal.  It rarely runs into anything (there is a black surface that it hits sometimes, but recognizes it 80%-90% of the time) and finds the randomly kicked red dixie cup regularly in under 20-30 seconds, and routinely under a minute or two.  That's good to me but there is a lot of potential for improvement.  Also a "just right" color sample seems very important.  I am still tweeking the code, but plan on posting here later tonight or tommorow for those if any that are interested.
 
I want to combine all my networks into one, so think I am going to try and get training going next... I already started reading through Prof. Blanks articles but have not attempted any code yet.  I was thinking I could use my existing networks to train the combined network... however this may just end up confusing me... not sure.
 
Any thoughts?
Back to top
 
 
  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Myro and ffnet
Reply #10 - 04/08/07 at 10:49pm
 
So now you are getting into some really interesting questions.
 
I don't know if there is a way numerically to combine your existing weights from the different networks - Doug Blank will probably have an answer to that.  However, the more fundamental question is how you want to train a network of increasing complexity.  A few possibilities -  
 
1.  you can still use an off-line training set, created from considering the different possible inputs and the desired outputs of the network.  As the number of inputs increase, the complexity of creating a comprehensive training set expands exponentially
 
2.  you can use a simulator to model the robot's behavior, and employ genetic algorithms to evolve the neural net weights, and defining a fitness function to measure the best performing combination which progress to succeeding generations (see Nolfi / Floreano "Evolutionary Robotics")
 
3.  you can also use a simulator with a fitness function to generate an error measurement  for "backpropagation" - this causes an adjustment of the network weights
 
4.  you can operate the robot in real time, and act as the supervisor, providing the error signal that feeds the backpropagation algorithm.  I think this is the most interesting technique, and the direction in which I've been moving.  
 
As you can see, there are many possibilities, but it is exciting to see that it is possible for interesting behaviors to derive from weights in a matrix rather than explicit lines of procedural program code.
Back to top
 
 

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
localyodel
YaBB Newbies
*




Posts: 13
Re: Myro and ffnet
Reply #11 - 04/09/07 at 12:58am
 
I was thinking potentially I could use my current setup to collect the sensor data in place of procedural code for training offline of the "combined network".  But I am already kind of doing this I guess, only I am not using the srv to collect the data.  Training is a whole seperate beast, I am just going to have to keep reading and experimenting.
 
Heres more code:
 
Training inputs and outputs:
 
# Define training data
input = [[0.],[2.],[4.], [6.], [8.], [10.], [12.], [14.], [16.], [18.], [20.], [22.], [24.], [26.], [28.], [30.]]
#These are the outcomes that I want when srv observes a given scenario.
target  = [[0.,0.], [1.,1.], [1.,1.], [1.,1.], [1.,1.], [1.,1.], [1.,1.], [1.,1.],[1.,1.],[1.,1.],[1.,1.],[1.,1.],[1.,1.],[1.,1.],[0.,0.],[0.,0.]]
 
Change the network file name to:
 
net = loadnet("srv_ycamera.net")
 
 
 
BEGIN BRAIN:
##Avoid everything but given color.
 
from ffnet import ffnet, loadnet
from myro import *
import time
 
#initialize robot
robot = Surveyor("com4")
 
irthreshold = 0.4
 
#Output adjustment.
iradjustL = 0.5
iradjustR = 0.5
 
xcamadjustL = 0.5
xcamadjustR = 0.5
 
ycamadjustL = 0.0
ycamadjustR = 0.0
 
#Speed adjustment.
#NOTE: I have to give my left motor more power than the right to balance movement.
irspeedL = 0.6
irspeedR = 0.35
 
xcamspeedL = 0.55
xcamspeedR = 0.3
 
ycamspeedL = 0.7
ycamspeedR = 0.45
 
#Load networks created with training programs.
ycamnet = loadnet("srv_ycamera.net")
xcamnet = loadnet("srv_xcamera.net")
irnet = loadnet("srv_ir.net")
 
def getIR():
    ir = robot.get("ir")
    ir[0] = round(ir[0], 1)  
    ir[1] = round(ir[1], 1)
    ir[2] = round(ir[2], 1)
    ir[3] = round(ir[3], 1)
    #print ir
    return irnet.call(ir)
 
def getX(colorbin): #get x
    x1, y1, x2, y2, count = robot.getBlob(colorbin)
    #print ((x1+x2)/2)
    return xcamnet.call((x1 + x2)/2)
 
def getY(colorbin): #get y
    x1, y1, x2, y2, count = robot.getBlob(colorbin)
    #print ((y1+y2)/2)
    return ycamnet.call((y1 + y2)/2)
 
def getXY(centers): #get x and y
    return [xcamnet.call(centers[0]),ycamnet.call(centers[1])]
 
def getCenters(colorbin):
    x1, y1, x2, y2, count = robot.getBlob(colorbin)
    return [((x1 + x2)/2), ((y1 + y2)/2)]
               
def motorCX(cx):
    cx[0] = round(cx[0])
    cx[1] = round(cx[1])
    robot.motors((cx[0]-xcamadjustL)*xcamspeedL, (cx[1]-xcamadjustR)*xcamspeedR) #Network output camera
       
def motorCY(cy):
    cy[0] = round(cy[0])
    cy[1] = round(cy[1])
    robot.motors((cy[0]-ycamadjustL)*ycamspeedL, (cy[1]-ycamadjustR)*ycamspeedR) #Network output camera
       
def motorIR(ir):
    ir[0] = round(ir[0])
    ir[0] = round(ir[0])
    robot.motors((ir[0]-iradjustL)*irspeedL, (ir[1]-iradjustR)*irspeedR) #Network output ir
     
def openSpace():  #Perhaps this can be worked into nn... it cuts search times for the room i am using but has potential for circles in larger areas...
    irsense = robot.get("ir")
    if irsense[0] == 0 and irsense[1] == 0:  #turn into open space on left.
       robot.motors(-.35,.25)
    elif irsense[0] == 0 and irsense[3] == 0: #turn into open space on right.
       robot.motors(.35,-.25)
       
def lookatLoneObject():  #not sure if this really does any good in the room I am using. I need to test it more.
    irsense = robot.get("ir")
    if irsense[0] < irthreshold and irsense[1] < irthreshold and irsense[2] < irthreshold and irsense[3] > irthreshold:  #If lone object on right look at it.
       robot.motors(.35,-.3)
    elif irsense[0] < irthreshold and irsense[1] > irthreshold and irsense[2] < irthreshold and irsense[3] < irthreshold:  #if lone object on left look at it.
       robot.motors(.35,-.3)
    elif irsense[0] < irthreshold and irsense[1] < irthreshold and irsense[2] > irthreshold and irsense[3] < irthreshold:  #if lone object on left look at it.
       robot.motors(.35,-.3)
       sleep(0.3)
     
def goal():  #If goal found hold the srv in position in front of goal.  Move goal out of view srv drops back into search.
    i = 0
    centers = getCenters(0)
    while centers[1] > 26:
       robot.stop()
       if i == 0:
           computer.speak("found goal")
           i=1
       centers = getCenters(0)
       
def findGoal(): #Search for goal/color with out hitting anything.  Once goal is spotted seek then stop in front of goal.  Move goal from veiw srv starts searching again.
    centers = getCenters(0)
    if centers[0] == 0 and centers[1] == 0:
       motorIR(getIR()) #avoid with nn.
       lookatLoneObject()  #look at single ir hits
       openSpace()  #turn into open space
       centers = getCenters(0)
    if centers[0] > 0 or centers[1] > 0:  #If either of these are true we have spotted color pass control to nn
       motorCX(getX(0)) #searching for x color with nn.
       motorCY(getY(0)) #searching for y color with nn.
       goal()#Check to see if we have met conditions for goal found.
           
robot.watch() #store color to track in tracking bin.
while True:
    findGoal()
Back to top
 
 
  IP Logged
dblank
YaBB Newbies
*




Posts: 6
Re: Myro and ffnet
Reply #12 - 04/10/07 at 9:13am
 
The ffnet code looks nice, but if you would prefer to use a version that has all of the niceties of Python, and is still fast, then you can use the code referenced in:
 
http://pyrorobotics.org/?page=PyroModuleNeuralNetworks  
 
You can copy the Python Neural Network program, found here:
 
http://cvs.cs.brynmawr.edu/cgi-bin/viewcvs.cgi/pyrobot/brain/conx.py?rev=HEAD&am p;content-type=text/vnd.viewcvs-markup
 
Click on download and save it in your Python path (current directory, or Python installed directory). Install Numeric for your OS (try here: http://pyrorobotics.org/download/ or http://numpy.scipy.org/#older_array )
 
Running Psyco will also make it run even faster (http://psyco.sourceforge.net/psycoguide/binaries.html)
 
One thing this will allow is to provide incremental learning. Also, you can do some fancy things like add (and remove) units and entire layers on the fly.  
 
We would be happy to help put together a version for easy use with Myro.
 
-Doug
Back to top
 
 
WWW   IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Myro and ffnet
Reply #13 - 04/10/07 at 10:31am
 
Doug -
 
It would be great to tie this all together with Myro and Conx.
 
Could we agree up-front to some conventions for mapping the Myro functions for SRV-1 sensor inputs to the neural net architecture we will use in this combined exercise ?  If so, we'll gain the benefit of being able to use Python for off-robot neural net training, perhaps eventually being able to use a Python-based simulator, and this will map nicely into some on-board neural net functions.
 
We already have the 4 IR inputs (note that you should install the latest srv-032307 firmware, as it greatly improves the IR performance - http://www.surveyor.com/cgi-bin/robot_journal.cgi/2007/04/03#093 ).  
 
You already support 2 SRV-1 image functions in Myro - 'vs' (scan) and 'vb' (blob), and you might consider adding 2 more functions - 'vf' (find distance to first pixel matching target color in each pixel column) and 'vn' (number of pixels matching target color in each pixel column), the 'vs' and 'vb' already give you a lot of functionality.
 
My thought was to map each vision function into 3 or 4 input neurons, basically shrinking the 80 pixel columns down into 3 or 4 regions.  I originally considered 4, but it could be 3 for 'left', 'center' and 'right' - I'm open to suggestion on this.  In any case, the mapping for the 'vs' scan function would generate neuron inputs corresponding to the existence of blockages in each of the 3 regions, and the mapping for the 'vb' blob function would generate neuron inputs corresponding to the presence of the target blob in each of the 3 regions - this might be easier than trying to deal with blobx, bloby and blobsize data.  
 
Likewise, we could build mappings for the 'vf' and 'vn' functions.  The 'vn' function might be used instead of 'vb', since it counts the number of pixels in each region that match the target color.  Again, I'm open to suggestion.
 
If we can coordinate our ideas on this, I'll hold off on moving neural functions on-board, since I would really like the on-board feed-forward network to match the off-board network, and it's not an issue to convert the Conx floating point weights to integer for on-board processing.
 
Does this make sense ?
 
 
 
Back to top
 
 

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
localyodel
YaBB Newbies
*




Posts: 13
Re: Myro and ffnet
Reply #14 - 04/10/07 at 6:43pm
 
Makes sense to me; If I can be of help let me know what to do.  I have Myro running with Conx which is guiding the srv via ir, works great!
Back to top
 
 
  IP Logged
Pages: 1 2 
Send Topic Print