Is there a way that I can somehow store a path that was taken in the program, so the robot knows how to get back to the starting location....

Let me give you an example to clarify what I mean.A robot is driving in a room full of obstacles. Using sensors, it finds it way through the room, but when a certain condition is true, it knows to turn around and head back to it's starting position. Is there a way to store the path it took in the program, or even better, a way to reverse everything so it knows how to go back following the same path?

Thank you in advance. It would be AWESOME if I could get this to work!

Wed Dec 05, 2012 8:57 pm

JohnWatson

Site Admin

Joined: Thu May 24, 2012 12:15 pmPosts: 722

Re: Storing a taken path in program

This would definitely be doable, but would be dependent upon what types and how many sensors you planned on using. Which sensors do you have available for this project, and how many of each?

As a rough, simple guide of one way to do this, break the project down into your goals:

1) Move from A to B, avoiding objects2) When at B, turn around3) Follow same path back to A, avoiding objects

Since turning right one direction is the same as turning left when facing the opposite direction, you would have to find out which way you turn when coming up to an object so you can mirror the object when moving back. For this, 90 degree turns are ideal because you wouldn't have to to figure out the corresponding angles when going back to start. So, the actual execution of the code will also depend on the layout of the objects you may encounter; if they are able to be avoided with nothing more than sharp 90 degree turns, then the program will be much simpler.

My only problem is actually putting into code how to remember the unexpected/varying path that the robot has taken, then reversing it. I am actually going to apply this to a competition that I am entering. The robot must start and end in the same place, while performing several tasks between the two points. I thought that the most efficient way to find the home base again would just be to follow its path that it took to get back. I thought that it would be easier if i gave a simpler example It basically the same concept, just different task.

So, if it still pertains.....I am using most of the sensors that I have for performing the tasks, so it really only leaves me with 2 optical shaft encoders (which I think might be helpful for turns), 1 potentiometer, 1 ultrasonic sensor, several touch sensors, a couple of line followers, and a light sensor.

However, I do know for sure, that all of the turns will NOT be 90 degree turns. Also, not all of the motors will be reversed. I have two motors that (1 serving as a fork lift type mechanism, and 1 serving as a turret like mechanism) will not need to be reversed. I hope this helps!

I really need this to work. Let me know if you need anymore info to understand.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum