View unanswered posts | View active topics It is currently Wed Oct 22, 2014 11:09 pm






Reply to topic  [ 3 posts ] 
Struggling to workout a project 
Author Message
Rookie

Joined: Tue Apr 15, 2014 10:45 pm
Posts: 1
Post Struggling to workout a project
Basically I need a robot to follow a line, and push objects off the line than continue following a line. I got the robot to follow the line fine using the colour sensor fairly easily using the sample code provided, however getting it to push objects (Foam cups) off the line is proving difficult. The line is just a metre by metre square so I was thinking I could get it to detect the object with sonar, make a 90 degree turn, move forward, 90 degree turn, move forward (pushes object off) than try and redetect line. No idea how to do this is coding though. Any advice?


Tue Apr 15, 2014 11:07 pm
Profile
Moderator
Moderator

Joined: Thu Jan 03, 2013 5:10 pm
Posts: 198
Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Post Re: Struggling to workout a project
Try this:

Code:

while no object is detected
    follow the line

push off the object
go backwards to where you were

continue following the line



Since it sounds like this is a school project, I can't give you actual code, but that should get you on the right track.

-A

_________________
I'm not a robot! I'm british! ~ quote from an asparagus
I am not a robot! I am a unicorn! ~ quote from a robot


Tue Apr 22, 2014 3:51 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Struggling to workout a project
Please define "push objects off the line". If there are foam cups on the line, wouldn't the robot push them off the line while following the line without you doing anything special? In that case, you never leave the line and don't need to "find the line again".


Wed Apr 23, 2014 2:32 am
Profile
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.