ROBOTC.net forums
http://robotc.net/forums/

Struggling to workout a project
http://robotc.net/forums/viewtopic.php?f=1&t=8511
Page 1 of 1

Author:  Benji [ Tue Apr 15, 2014 11:07 pm ]
Post subject:  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?

Author:  Coder A [ Tue Apr 22, 2014 3:51 pm ]
Post subject:  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

Author:  MHTS [ Wed Apr 23, 2014 2:32 am ]
Post subject:  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".

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/