View unanswered posts | View active topics It is currently Sat Aug 24, 2019 9:32 am






Reply to topic  [ 4 posts ] 
Strawberry Sorter Challenge 
Author Message
Rookie

Joined: Fri Jun 20, 2014 1:22 pm
Posts: 11
Post Strawberry Sorter Challenge
Here's my code. What's wrong with the gyro degrees and why isn't the plant being put in the right place?


Attachments:
StrawberryChallengeVR.JPG
StrawberryChallengeVR.JPG [ 143.33 KiB | Viewed 8966 times ]
Sat Aug 02, 2014 9:49 am
Profile
Moderator
Moderator

Joined: Mon Oct 04, 2010 2:18 pm
Posts: 196
Post Re: Strawberry Sorter Challenge
Hello,

A few things. In examining the challenge, what we want our robot to do is move forward until we detect an object. Once we detect the object, we want to stop. Then, we need our robot to make a decision. If the object is green, we want the robot to grab the object and move it to one side. Else, we want to grab the object and move it to the opposite side. So, in looking at you code, I would have the robot move forward first, until it detects an object. Then, have your if/else conditional block. Here the robot can decide if it is seeing green (then have the robot grab and move the block one way) or else, it is seeing another color (have robot grab block and move it the opposite way).

You can have all of that inside of a repeat loop, just as you currently have.

Lastly, make sure your color sensor is configured to port 9. The base configuration of the VEX IQ clawbot has it on port 3, but it will currently only work on port 9. We are currently fixing that for the next release.


Mon Aug 04, 2014 8:51 am
Profile
Rookie

Joined: Fri Jun 20, 2014 1:22 pm
Posts: 11
Post Re: Strawberry Sorter Challenge
Here's what I have now. But now, there's another problem: the robot gets stuck after reaching the first object. Why is this?


Attachments:
StrawberryChallengeVR.JPG
StrawberryChallengeVR.JPG [ 84.43 KiB | Viewed 8886 times ]
Tue Aug 12, 2014 6:00 pm
Profile
Rookie

Joined: Thu Mar 13, 2014 8:22 am
Posts: 10
Post Re: Strawberry Sorter Challenge
Hello,

You say the robot gets stuck after reaching the first object, is it grabbing and moving the first cube or just sitting in place when it reaches it? Does it matter which color cube shows up first?

If the robot is getting to the cube but not moving it, there might be a couple reasons. You could try changing your code from moving the claw motor 1 rotation to be time based like 1 second or even .5 seconds. It's possible the claw motor is trying make move that 1 rotation but can't ever get there because it's holding the cube, so the program gets stuck. Using a time command will allow the motor to move however far it can in the given time and then move on.

Another possible cause is that the color sensor isn't registering colorGreen. Make sure the port number in RVW and in ROBOTC is consistent. You can also have the debugger screen open in ROBOTC while the program is running to see which color is being registered.


Wed Aug 13, 2014 11:57 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 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.