Skip to main content

Explore Locations

Create a coordinate system on the VIQC Virtual Skills Field with the initial position of the Hero Bot as the origin(0,0). Use [Drive for], [Turn for], and [Spin for] blocks to code the Hero Bot to remove all the Discs from a blue Dispenser, pick up a Disc, and score it in the Goal Zone. Create an algorithm to find the X and Y coordinates of the location for the robot to knock the Dispenser, and the X and Y coordinates of the location for the robot to pick up and score the Disc.

  • Select the VIQC Virtual Skills - Slapshot Playground.
  • Create an algorithm to find and record the X and Y coordinates of the robot’s position after driving for a certain distance using the drive distance and the drivetrain heading.
  • Drive the robot to remove all the Discs from a blue Dispenser. Use the algorithm to track the X and Y coordinates of the robot’s position. Use the [print] block to print the X and Y coordinates of the location for the robot to knock the Dispenser to the Print Console.
  • Drive the robot to pick up a Disc and launch it in the Goal Zone. Use the algorithm to track the X and Y coordinates of the robot’s position. Use the [print] block to print the X and Y coordinates of the location for the robot to pick up and launch the Disc to the Print Console.

Helpful Hints

  • To identify the X and Y coordinates of the Hero Bot on the Field, set the initial position of the Hero Bot as the origin(0,0) of the coordinate system on the VIQC Virtual Skills.
  • Use two variables to store the X and Y coordinates of the Hero Bot. Use the set blocks from the Variables category to set the values of the X and Y coordinates to 0 at the beginning of the project.
    VEXcode Set variable block that reads 'set currentX to 0'.
    VEXcode Set variable block that reads 'set currentY to 0'.
    • Matching Python command:

      currentX = 0
      currentY = 0
  • Use the Reporter blocks from the Sensing category to get the drivetrain heading value from the Inertial Sensor.
    VEXcode Drive heading block that reads 'drive heading in degrees'.
    • Matching Python command:

      drivetrain.heading()
  • Use the drive distance and drivetrain heading to calculate the X and Y coordinates after driving for a certain distance.

    Math diagram demonstrating drive distance and drive heading. An equation titled 'Drive forward for a certain distance' reads 'X2 = X1 + drive_distance * cos(drive_heading)', and then another below it reads 'Y2 = Y1 - drive_distance * sin(drive_heading)'. A diagram to the right of the equation shows the relationship between drive distance and drive heading using a triangle and theta. The same equation and diagram are copied below but for driving in reverse, with the addition and subtraction swapped in the reverse equation.

  • For more information about VIQC Virtual Skills Field Dimensions, please click here.