View unanswered posts | View active topics It is currently Sun Apr 20, 2014 2:26 am

Reply to topic  [ 3 posts ] 
Storing a taken path in program 
Author Message

Joined: Sun Jul 10, 2011 3:34 pm
Posts: 30
Post Storing a taken path in program
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
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 534
Post 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 objects
2) When at B, turn around
3) 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.

Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody

Mon Dec 10, 2012 2:51 pm

Joined: Sun Jul 10, 2011 3:34 pm
Posts: 30
Post Re: Storing a taken path in program
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.

Thanks again!!

Mon Dec 10, 2012 6:10 pm
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

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

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.