The GPS Sensor Navigation--Drive to a specific X/Y location in VRC Virtual Skills (2022-2023)

In the 2022-2023 VRC (VEX Robotics Competition) Virtual Skills, the sensors equipped on Virtual Disco, the Hero Bot, plays a vital role in cracking the challenges effectively.
To accomplish the tasks and score the most points possible during the limited time, precise navigation is the key when it comes to guidance. Virtual Disco uses both the GPS sensor and the distance sensor for autonomous navigation. This post will focus on how to use the GPS sensor to navigate the robot precisely according to a designed trajectory.

tasks1 f

VCR Virtual Skills Field provides a coordinate system with precise dimensions. This allows us to identify the coordinates of any specific position on the VCR Field. Meanwhile, the GPS Sensor can report the current X and Y position of the robot.

Utilizing the X and Y coordinates of the current and target positions, we can figure out the drive direction (heading ) and the drive distance, to ultimately design an algorithm that can navigate the robot to any specific position.

move f

  1. Using the Pythagorean Theorem to calculate the distance the robot needs to move.

  1. Integrating the Atan function to calculate the heading(direction) of the robot to drive in. (Drive forward example)

4). Convert Theta to drive heading

The Atan function returns the value of Theta between -90 degrees and 90 degrees. The value of heading is between 0 degrees and 359.9 degrees. We need to convert Theta to heading for Disco to drive in. See image 3

Image 3

3, Passing the calculated drive distance and heading to the robot to implement the navigation.

Image 61

As we know, block-based programming is easier to read and syntax-free, while Python programming (text-based programming) is precise and lightweight. The VEXcode supports both of them.
Now we can guide the robot to any specific position by utilizing the GPS sensor. In the next post, we will discuss the strategies to optimize the placement for the robot to execute a certain task, and how to integrate the distance sensor for navigation.

tasks2 f