Use Estimates to Score Points
When you are coding, you will need to estimate the distance that Fling needs to drive and turn to score. This section will break down how we estimated the distance that Fling had to turn and drive to score the first Ball in Lesson 2.
Estimating Turn Angles
You created this project in Lesson 2 to have Fling score the first Ball. We're going to recreate the project and walk through the steps for estimating the turn angle and drive distance needed to successfully push the Ball into the Low Goal to score.
First, Fling has to turn to face the Ball. We can use what we know about angles to estimate how far Fling will have to turn.
We can see that the turn needed is less than 90 degrees. We can also see that it is less than 45 degrees. The turn is a little more than one-half of 45 degrees.
Using these angles as a reference, we can estimate the turn for 25 degrees.
Once we have estimated the turn angle, we input that value into the [Turn for] block and change the turn parameter to 'left.'
Then, we test the project to see if our estimate causes Fling to face the Ball. It does, so the estimate was correct, and we can move on.
Pro-tip: You can use these basic turn angles as a starting point to make more precise estimates as you code Fling to turn and drive to other Balls and score more points.
Note: The turning point for Fling is in the center of the drivetrain, shown here with the red circle. Keep this in mind as you estimate turns in your code.
Estimating Drive Distances
Now that we’ve turned Fling to face the Ball, the robot has to drive forward far enough to push the Ball into the Low Goal.
We can use the Field Tile to estimate how far Fling will have to drive to push the Ball into the Low Goal.
Each Field Tile is 300 mm (~12 inches) by 300 mm (~12 inches).
It looks like the distance that Fling has to drive forward to reach the Low Goal is approximately one-half of a Field Tile which would be 150 mm.
We can use this as our estimate and add it in the [Drive for] block.
Then, test the project to see if Fling reaches the Ball. Fling doesn’t drive far enough to push the Ball into the Goal.
We should increase the distance in the [Drive for] block, and try again. It looks like Fling just needed to go a little further.
One-half of a Field Tile wasn't far enough, let's try approximately three-quarters of the distance of a Tile — 225 mm.
Fling scores a goal!
By using the squares on the Field as a guide to make our first estimate, then testing our projects and making adjustments, we were able to find the distance to have Fling drive to push the Ball into the Low Goal.
Go Use Estimation to Score!
See this article for more information on the VIQC Virtual Skills Field dimensions to help you use the Field features to make estimates when coding Fling.
Select < Return to Lessons to go back to the Lesson Overview.
Select Next Lesson > to continue to Lesson 3, and learn how to score a Ball in the High Goal.