Skip to main content

New Height

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 to heading], [Spin to position], and [Spin for] blocks to code the Hero Bot to pick up each of the four highlighted Purple Blocks and score it into Goal III. Create an algorithm that navigates the robot to a specific position to drop the Block and make the Goal have the Fill Level 3.

  • Select the VIQRC Virtual Skills - Full Volume Playground.
  • Code the Hero Bot to pick up a highlighted Purple Block and score it into Goal III. 
    • Create an algorithm to drive the robot for a certain distance and track its X and Y coordinates. Use the algorithm to drive the robot to the highlighted Purple Block.
    • Code the robot to pick up the Block.
    • Create an algorithm to navigate the robot to a specific position. Use the algorithm to navigate the robot to coordinates (-70, 1270) and turn the robot to Heading -45 degrees.
    • Code the robot to drop the Block.
  • Code the Hero Bot to pick up the second highlighted Purple Block and score it into Goal III at the same position and orientation as scoring the first Purple Block. 
  • Code the Hero Bot to pick up the third highlighted Purple Block and score it into Goal III at the same position and orientation as scoring the first Purple Block. 
  • Code the Hero Bot to pick up the fourth highlighted Purple Block and score it into Goal III at the same position and orientation as scoring the first Purple Block. 

Helpful Hints

  • Use the coordinates of the robot (x1,y1), the coordinates of the target position (x2,y2), and atan function to find the drive Heading.
    • Calculate the angle theta θ of the line connecting these two points. Diagram of two math expressions. The first expression reads 'theta is equal to atan((y2 - y1) / (x2 - x1))'. The second expression reads 'negative pi / 2 is less than theta, which is less than pi / 2'. Top down diagram shows the robot at coordinate (X1, Y1) and a line is pointing towards the coordinate (X2, Y2). The distance is labeled with the variable d, the angle is labeled with the variable theta. The horizontal distance between the points in represented as 'x2 - x1', and the vertical distance is represented as 'y2 - y1'.
    • Pseudocode example for Math expression:

      if x1 equal to x2:
      	if y2 > y1:
      		heading = 0 degrees
      	else:
      		heading = 180 degrees
      else:
      	if x2 > x1:
      		heading = 90 degrees - theta
      	else:
      		heading = 270 degrees - theta
    • Convert the angle theta θ to drive Heading.  Top down diagram labeled 'robot heading' shows the robot with a circle around it with labels marking the 360 degrees of the circle.
  • Use the coordinates of the robot (x1,y1), the coordinates of the target position(x2,y2), and the Pythagorean Theorem to find the drive distance. Math expression reads 'd = sqrt((X2 - X1) ^ 2 + (Y2 - Y1) ^ 2)' The same top down diagram as before showing the difference between two coordinates. The robot is at coordinate (X1, Y1) and a line is pointing towards the coordinate (X2, Y2). The distance is labeled with the variable d, the angle is labeled with the variable theta. The horizontal distance between the points in represented as 'x2 - x1', and the vertical distance is represented as 'y2 - y1'.

 

  • Use the function block from the Operators category to express atan function to calculate angle theta θ VEXcode Function block containing operator blocks, that all together reads 'atan of ((Y2 - Y1) / (X2 - X1))'.
    • Matching Python command: 

      math.atan((Y2 - Y1) / (X2 - X1)) / math.pi * 180
  • Use the function block from the Operators category to express the Pythagorean Theorem to calculate drive distance. VEXcode Set variable block containing function and operator blocks, that all together reads 'set driveDistance to sqrt of ((X2 - X1) * (X2 - X1) + (Y2 - Y1) * (Y2 - Y1))'.
    • Matching Python command: 

      driveDistance = math.sqrt((X2 - X1) * (X2 - X1) + (Y2 - Y1) * (Y2 - Y1))