🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Using a neural net to drive a robot

Started by
9 comments, last by Alan Kemp 21 years, 6 months ago
Hi, I have a mobile robot with eight sonar sensors for range finding. I am thinking of using a neural network as the navigation brain of the robot. I have been reading Mat''s book (which is superb, and has an example of nearly exactly what I want to do :-) ), but am concered using the sonar sensors as inputs to the net. From each of the sonar sensors I get a range to hit (or a no hit in range) and am planning on using those as the eight inputs to my net. The problem is the sonar inputs are quite jittery. By that I mean that the range returned variaes slightly frame to frame, even if the robot it not moving. This is just an "intrested feature" of sonar sensors so I can''t fix it in hardware. With this jitter in the input data do you think I will still be able to train a network? I plan on using a genetic algorithm much like the "obstacle avoidance and exploration v2.2" example in Mat''s book. Any other comments of thoughts on the idea? Alan
"There will come a time when you believe everything is finished. That will be the beginning." -Louis L'Amour
Advertisement
Hi Alan,

Yes, you can do that. ANNs are pretty good at coping with (a little) noise. You can see this for yourself if you add some noise to the minesweepers'' inputs from the example in the book.

I''m wondering though... how do you plan on using a GA with just one robot? Or do you plan on simulating the robot in software first? Forgive me if this is obvious but its 6am here and I haven''t had any sleep yet. I''m bloody knackered! But my mind is still going crazy with ideas! There''s no way it''ll let me sleep yet.

ps. I''m happy you enjoyed the book.



ai-junkie.com
Your description, below, would seem to touch on three distinct problem areas: 1. sensor management, 2. environment mapping and 3. route mapping (I''ll ignore acutation here). My quick thoughts are: Noisy sensors may still be effective "as is", and if not, may be smoothed (averagin multiple samples over time, for instance, to trade speed for accuracy) or fused (combining the outputs of two or more sensors to achieve some improvement). There are a variety of environment mapping constructs, probably the most direct being occupancy grids. Planning routes is not my area of expertise, but neural networks are- I think under some limited circumstances nerual networks could be used as a guidance system, but I don''t think it will be easy to get them to map complex routes (through obstacles, etc.).

quote: Original post by AlanKemp
I have a mobile robot with eight sonar sensors for range finding. I am thinking of using a neural network as the navigation brain of the robot. I have been reading Mat''s book (which is superb, and has an example of nearly exactly what I want to do :-) ), but am concered using the sonar sensors as inputs to the net.

From each of the sonar sensors I get a range to hit (or a no hit in range) and am planning on using those as the eight inputs to my net. The problem is the sonar inputs are quite jittery. By that I mean that the range returned variaes slightly frame to frame, even if the robot it not moving. This is just an "intrested feature" of sonar sensors so I can''t fix it in hardware.

With this jitter in the input data do you think I will still be able to train a network? I plan on using a genetic algorithm much like the "obstacle avoidance and exploration v2.2" example in Mat''s book.

Any other comments of thoughts on the idea?


Thanks for the information.

quote:
how do you plan on using a GA with just one robot? Or do you plan on simulating the robot in software first?


I have a software simulator that includes a simulation of the jitter in the sonar data. I will be training the net up on that.

Predictor: At this time I have little intrest in planning routes. I mainly want the robot to explore and map its environment. The actual mapping will not be done witha neural network, it will be handled seperatly

Alan
"There will come a time when you believe everything is finished. That will be the beginning." -Louis L'Amour
One thing you could do is use a ''leaky integrator'' neurone as the actual input location of the sensory data, and pass them then to the ANN inputs.

Tweak the ''leakiness'' of the integrator until you get appropriate response with acceptable noise.

-Richard
You can also try some kind of weak smoothing...
First, let me say that there is an absolute wealth of information online regarding this sort of problem, so you shouldn''t have any problems finding papers, technical reports or book references covering the topics being discussed here.

Traditionally, sensor noise is handled using a Bayesian filtering approach. Essentially, the problem of estimating the true signal given a noisy observation (in this case, the true range given the noisy value returned by the range sensor) is one of (usually linear) regression. The optimal solution to this problem is, for a discrete time signal, a Kalman filter, which is efficiently implemented as a set of matrix operations. You can ignore noise and feed the data directly into a network for training, however as fup mentioned, once the signal to noise ratio grows (basically, for moderately large signal variance), the network has trouble converging its parameters.

Once you have your range estimate from your filter, there are many different ways to tackle environment mapping. I''ve got some good papers on the subject but at the moment they''re packed away (I''m finally moving out of my Monash office) but if you need the references, I should be able to hunt them down for you.

As for route planning, there are MANY different approaches to this problem and ten times as much literature online!

Here are some keywords to help your search for more information:

Bayesian Filtering
Bayesian Estimation
Robot Localisation
Robot Mapping

If you''ve got access to it, there''s a good coverage of these topics in Russell & Norvig''s, ''Artificial Intelligence: A Modern Approach''.

If you''ve got any further queries on anything I''ve mentioned, or how to go about it, feel free to ask... I did a lot of this stuff for my PhD so I''m aware of the problems you will face.

I can also point you toward more advanced techniques if you''d like.

Cheers,

Timkin
Wow! Thanks a lot Timkin.

> there are many different ways to tackle environment mapping

Whilst maybe not the most advanced technique, I am currently trying this:

- Divide world (100m square area) into 10cm square grid. This all start out with value zero. Every time a sonar hit is returned I determine which grid square it fell into, and increment that grids value by one. When a grid square reaches 10 points (arbitarily) it becomes a permenent feature on the map. Every 10 seconds (again arbitarily) I go over the whole map and remove a point from every square. So far this seems to do a reasonable job of getting rid of phantom results and of temporary objects). The robot is curently driven around by a human operator using the keyboard, but I am planning on moving this over to using some sort of neural network to drive around, avoiding walls.

> As for route planning, there are MANY different approaches to this problem and ten times as much literature online!

I am not going to be planning a higher level path (ie, from point a to point b), all I want the robot to do it keep moving, not hit walls, and favor moving towards areas it has not been in before. To do the moving towards new areas I am implimenting the approch from Mat''s book which ties in nicely with the gridded approch I have already taken with my world.

Thanks for your help, and that of the other posters of course :-)

Alan
"There will come a time when you believe everything is finished. That will be the beginning." -Louis L'Amour
quote: Original post by AlanKemp
- Divide world (100m square area) into 10cm square grid. This all start out with value zero. Every time a sonar hit is returned I determine which grid square it fell into, and increment that grids value by one. When a grid square reaches 10 points (arbitarily) it becomes a permenent feature on the map. Every 10 seconds (again arbitarily) I go over the whole map and remove a point from every square. So far this seems to do a reasonable job of getting rid of phantom results and of temporary objects).


Interesting! This has the feel of a Bayesian approach to modelling the domain. Basically you are looking for support for a prior hypothesis (that at some time in the past you detected something in a grid) in your current observations. An observation of a given obstacle supports or denies a prior belief in the presence or absence of that obstacle. I take it that initially you are assuming there are no obstacles, or perhaps you have an unknown value?

I have one idea, that may or may not be useful, in terms of training your NN for exploration. You could represent the domain with a quad-tree, since what you are discovering with the sonar sensors is obstacles that will cause branching in the tree. Your ''decay'' of knowledge would represent a decay of a leaf toward an ''empty/unknown'' value.

When it comes to exploration, you could feed the network the quadtree leaf values (perhaps along with the size of each quad) and the present quad it was in and then train your ANN to prefer moving the robot toward quads that it didn''t know the value of yet (which would turn out to be the biggest quads in the tree... those closest to the root.

fup, I''d be interested to hear your opinion of this idea and how you think it would stack up against the methods you have tried.

Cheers,

Timkin
AlanKemp: After reading through Mat''s book, and reading this thread I was wondering about creating a robot for myself. I''m just curious to know what kind of hardware the robot is using and how you get it to work with windows!

This topic is closed to new replies.

Advertisement