View unanswered posts | View active topics It is currently Mon Nov 18, 2019 8:27 am






Reply to topic  [ 11 posts ] 
Line Tracking on Palm Island 
Author Message
Rookie

Joined: Sat Jun 21, 2014 12:30 pm
Posts: 8
Post Line Tracking on Palm Island
I am having some difficulties with the line tracking section on Palm Island. I went back to the Sensor chapter for some review and realized I had problems as well with the ColorSensorvaluesVR program. Downloaded it, then enabled the Vex IQ remote screen. It had the information for the color Yellow. As I used the WASD keys the values did not change.

I think if I knew which color sensor command and a value I could work out the rest for this part.

thanks,


Wed Jul 23, 2014 6:04 pm
Profile
Moderator
Moderator

Joined: Mon Oct 04, 2010 2:18 pm
Posts: 196
Post Re: Line Tracking on Palm Island
Hello,

Go to motors and sensors set up, and try putting the color sensor in port 9. See if that works for you. Thanks,


Wed Jul 23, 2014 6:07 pm
Profile
Rookie

Joined: Sat Jun 21, 2014 12:30 pm
Posts: 8
Post Re: Line Tracking on Palm Island
OK that helped. Thanks again!!!


Wed Jul 23, 2014 6:19 pm
Profile
Moderator
Moderator

Joined: Mon Oct 04, 2010 2:18 pm
Posts: 196
Post Re: Line Tracking on Palm Island
You are welcome. That will be fixed in a later update of ROBOTC Graphical.


Wed Jul 23, 2014 6:34 pm
Profile
Rookie

Joined: Sat Jun 21, 2014 12:30 pm
Posts: 8
Post Re: Line Tracking on Palm Island
Still having problems with the line tracking on Palm Island. And I can't copy paste code from Snipping Tool or the Print Screen.

setMotor(motor1,50);
setMotor(motor6,50);
while(getcolorGrayscale(colorsensorNL)<500){}
if(getColorGrayscale(colorSensorNL)>42){}
wait (3, seconds);
setMotor(motor1,0);
setMotor(motor6,50);

thanks,


Fri Jul 25, 2014 8:00 pm
Profile
Professor
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 256
Post Re: Line Tracking on Palm Island
It looks like you've got issues with your brackets. Is the code staring with the fourth line supposed to be inside the while loop? And is the code starting with the fifth line supposed to be inside the if statement? If so, you need the brackets surrounding those chunks of code, like this:
Code:
setMotor(motor1,50);
setMotor(motor6,50);
while(getcolorGrayscale(colorsensorNL)<500)
{
  if(getColorGrayscale(colorSensorNL)>42)
  {
    wait (3, seconds);
    setMotor(motor1,0);
    setMotor(motor6,50);
  }
}

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://bluechariotsoffire.com/.


Sat Jul 26, 2014 10:07 am
Profile
Rookie

Joined: Sat Jun 21, 2014 12:30 pm
Posts: 8
Post Re: Line Tracking on Palm Island
Still struggling with the line tracking on Palm Island. I have attached code that gets me to the first swing turn. I am using the Grayscale and know that a value of 0 is for Black. But I tried any number of combinations and cannot get the robot to follow the line.
Any hints at how to set up a command using the sensor would help. I have been working on this for 4 days and really feel I need to move on and try to finish before I go back to work the middle of next month.

thanks,


Attachments:
Capture.PNG
Capture.PNG [ 21.28 KiB | Viewed 10912 times ]
Mon Jul 28, 2014 11:16 am
Profile
Moderator
Moderator

Joined: Mon Oct 04, 2010 2:18 pm
Posts: 196
Post Re: Line Tracking on Palm Island
Hello,

When line following, the important thing to remember is that the robot is tracking the edge of a line. If the robot is off the line (color sensor sees white), the robot wants to move towards the line and a little forward. If the robot is on the line (color sensor sees black), the robot wants to move towards white and a little forward. This way, the robot will zig-zag forward as it line follows. You can see an example of that action in the video here: https://www.youtube.com/watch?v=MK_rODdVEQI

ROBOTC Graphical has a command that will allow the robot to do this. Remember, all the robot is doing is making a decision: Do I see white or do I see black? Then, we have to tell the robot to repeat that decision making process over and over again. In the example in the video I linked above, the robot is going to make that decision as long as the touchLED is not pressed. In the sample code below, I have the robot making the decision in a forever loop:
Image

The first box (with the value of 50) is a threshold reading. We use that to determine if the color sensor sees white or dark. The second two values are the speed at which the robot is turning. The greater the range between the two values, the sharper the turns the robot will make.

I hope that answers your questions. The virtual worlds are not designed to be "completed" while in the curriculum. With Palm Island, we are asking the user to complete the boardwalk path, collect two coconut clusters, and set two lobster traps with either robot model. The goal is to give the user some repeated practice with the concepts presented in that chapter. Feel free to move on to the next chapter, if you like. Thanks,


Tue Jul 29, 2014 7:39 am
Profile
Rookie

Joined: Sat Jun 21, 2014 12:30 pm
Posts: 8
Post Re: Line Tracking on Palm Island
Thank you for the information. I streamed the class that included information on Palm Island but never made it to the end. Got a message that said the recording was corrupted and got bounced out. I will try the line tracking because I spent so much time working on it. Then take the chapter final and move on.

Thanks again!!


Wed Jul 30, 2014 1:29 pm
Profile
Rookie

Joined: Fri Jul 25, 2014 3:11 pm
Posts: 7
Post Re: Line Tracking on Palm Island
Hello,

I've also been trying to complete the various Palm Island missions - with mixed results.

For Line Tracking (using RobotC Graphical): I tried your code but didn't have the option to choose "colorSensor" for the lineTrackRight function.
I just had "ports 1-12" -- and I tried a couple (port 3, and port 9) with no good results. In both cases the BuggyBot just meandered around in circles.


Thu Jul 31, 2014 5:26 pm
Profile
Moderator
Moderator

Joined: Mon Oct 04, 2010 2:18 pm
Posts: 196
Post Re: Line Tracking on Palm Island
Hi Scott,

Try checking your threshold value. Open the sensor tab in the debugger window while your robot is running. See if that helps,


Fri Aug 01, 2014 8:01 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 11 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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.