Skip to main content

Unlock Locations

Create a coordinate system on the Full Volume Virtual Skills Field with the position of the red dot as the origin (0, 0) and the initial position of the Hero Bot Center located at coordinates (0, 36). Use [Drive for], [Turn for], [Spin to position], and [Spin for] blocks to code the Hero Bot to pick up the Red Block highlighted in orange, score it into Goal I, and partially park the robot in the Supply Zone. Create an algorithm to find the X and Y coordinates of the location for the robot to pick up and score the Red Block and the X and Y coordinates of the location for the robot to park the Hero Bot.

  • Select the VIQRC Virtual Skills - Full Volume Playground.
  • Create an algorithm to calculate 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. 
  • Code the Hero Bot to drive to the Red Block highlighted in orange and pick it up. 
    • 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 the Block to the Print Console.
  • Code the Hero Bot to drive toward Goal I and drop the Block into the Goal. 
    • 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 drop the Block into Goal I to the Print Console.
  • Drive the Hero Bot to a position to be partially within the Supply 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 be partially parked within the Supply Zone to the Print Console.

Helpful Hints

  • To identify the X and Y coordinates of the Hero Bot on the VIQRC Virtual Skills Field, set the initial position of the Hero Bot as the origin(0,0) of the coordinate system. 
  • Declare 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 36'.
    • Matching Python command:

      currentX = 0
      currentY = 36
  • 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(DEGREES)
  • Use the drive distance and drivetrain heading to calculate the X and Y coordinates after driving for a certain distance.
    • Math function (drive forward):

      X2 = X1+ drive_distance * sin (drive_heading)

      Y2 = Y1+ drive_distance * cos (drive_heading)

      Two side by side, top down diagrams featuring the the Hero Bot. The first diagram shows the robot with a circle around it with labels indicating the 360 degrees of the circle. The second diagram shows the robot at coordinate (X1, Y1) and pointing towards a point (X2, Y2). The distance is labeled as 'drive distance' and the angle is marked as a theta symbol.

  •  Use the function block from the Operators category to express math functions. A stack of two VEXcode Set variable blocks with block equations. The first block reads 'set currentX to currentX + drive_distance * sin of drive heading in degrees'. The second block reads 'set currentY to currentY + drive_distance * cos of drive heading in degrees'.
    • Matching Python command: 

      currentX = currentX + drive_distance * math.sin(drivetrain.heading(DEGREES) / 180.0 * math.pi)
      currentY = currentY + drive_distance * math.cos(drivetrain.heading(DEGREES) / 180.0 * math.pi)
  • For more information about VIQRC Virtual Skills Field Dimensions, please click here.