Follow the Shortest Route
Create a coordinate system on the VIQC Virtual Skills Field with the initial position of the Hero Bot as the origin(0,0). Create an algorithm to use [Drive for], [Turn to heading], and [Spin for] blocks to drive the Hero Bot following the shortest route to specific positions to remove all the Discs from a blue Dispenser and the yellow Dispenser, and pick up a Disc as fast as possible!
- Select the VIQC Virtual Skills - Slapshot Playground.
- Drive the Hero Bot to the position located at (0, 290) along the shortest route.
- Code the Hero Bot to turn to the blue Dispenser and remove all the Discs from it.
- Drive the Hero Bot to the position located at (1000, 175) along the shortest route.
- Code the Hero Bot to turn to the yellow Dispenser and remove all the Discs from it.
- Drive the Hero Bot to the position located at (730, 329) along the shortest route.
- Code the Hero Bot to spin the Intake Motor to intake a Disc.
Helpful Hints
- The line between the robot’s current position and the target position is the shortest route to drive the robot to the target.
- Use two variables to record and store the current X and Y coordinates of the Hero Bot.
- Use the Pythagorean Theorem to calculate the drive distance. Use the Atan function to find the drive heading.