Best Practices with the GPS Sensor

The GPS Sensor, or Game Positioning System Sensor, is a useful tool for navigating the VEX V5 Robotics Competition (V5RC) field. Read this article to learn best practices to help you get the most out of the sensor. 

Keep a clear view of the Field Code

Axel on an empty Field in the corner, with the GPS Sensor mounted to the rear of the robot facing the Field Code on the perimeter of the Field. There is a red box highlighting the GPS Sensor position on the robot and and arrow illustrating the alignment of the sensor with the Field Code.

The GPS Sensor uses a video feed to detect the pattern of the Field Code around the perimeter of the Field. As such, it is important that the sensor is not blocked by mechanisms or components of your robot.

To minimize possible obstructions of the sensor's view of the Field Code from your robot, it is recommended to mount the GPS Sensor on the rear of the robot, facing behind the robot. 

When testing projects with the GPS Sensor, be sure that no extraneous items are on the Field and blocking the Field Code (like team members or extra game elements).

Axel, the Hero Bot for the 2024-2025 High Stakes game, on an empty Field in the corner, with the GPS Sensor mounted to the rear of the robot facing the Field Code on the perimeter of the Field. There is a red box highlighting the GPS Sensor position on the robot and and arrow illustrating the height of the sensor at the same height as the Field Code.

The GPS Sensor should also be positioned at the same height as the Field Code, and not angled in any way in order to function as intended.

To learn more about Mounting the GPS Sensor on your robot, view this article.


Configure your offsets accurately

The Devices window in VEXcode V5 showing the GPS Settings for the configuration of a GPS Sensor. There is a red box highlighting the input area for the X Offset, Y Offset, and Angle offset to the left. To the right is a graphical representation of a robot with the GPS Sensor in the center, reflecting the default offset values.

To make the most of your GPS Sensor usage, you can configure the X, Y, and Angle Offset based on a reference point on your robot. The sensor will report data based on its physical position on the Field, unless an offset is configured. Once the offset is configured, VEXcode will convert the data from the GPS Sensor to reflect the reference point on your robot.

Configuring the offset allows you to follow the mounting recommendations, but navigate from a meaningful position on your robot, like the turning center point, or the robot's arm.

To learn more about setting an offset, view this article.


Keep track of positive and negative values

A top down view of the High Stakes Field with the starting positions of the game elements. Overlaid on the Field are the x and y axis lines dividing the field into four quadrants, like a coordinate grid. Each quadrant is labeled with the corresponding positive and negative values. Beginning in the upper right corner, and moving clockwise around the field - the first quadrant reads positive x, positive y values; the second quadrant reads positive x, negative y values; the third quadrand reads negative x, negative y values; and the fourth quadrant reads negative x, positive y values.

The GPS Sensor reports X and Y position data based on the coordinate grid. To use this data effectively, it is helpful to keep track of how the positive and negative values align with the coordinate grid.

This image can be recreated in your engineering notebook to help you keep track of what values to expect in each quadrant of the Field, so that you can effectively use data in a project.

A top down view of Axel with a reference point on the center of the arm at the front of the robot marked with a green dot, and the GPS Sensor highlighted with a green box on the rear of the robot. The reference point is intersected by x and y axis, indicating that the reference point creates the 0, 0 point for calculating offsets.

The same consideration of positive and negative values applies to the offset in the GPS Sensor configuration as well. Be mindful of the distance and direction from the reference point to the sensor along each axis, to ensure that you are configuring the offsets accurately. 


Use data from a stationary position

A top down view of Axel in the corner of a Field with a red box highlighting the GPS Sensor and an arrow pointing from the sensor to the Field Code, indicating how the sensor will read the Field Code from a stationary position.

The GPS Sensor uses a video feed of the Field Code around the Field to determine its position. Because the sensor is relying on visual feedback, the most accurate and clearest image will come from being in a stopped position.

Think about when you are taking a photo. Trying to take a photo while moving will result in a blurry image. Stopping and standing still while taking a picture will likely give you a much clearer result. The same is true for the GPS Sensor.

It is helpful to experiment with coding your robot to move at slower velocities to determine how quickly the robot can move while gathering accurate GPS Sensor values. Collect data, and make a data based decision that works best for your team. Be aware that environmental factors like ambient lighting can affect the reliably of these measurements, so consider the environments and lighting of your practice and competition fields when making these decisions.

Beyond just slowing down the velocity to improve accuracy, you can also stop the robot's movement entirely by building pauses of at least 0.5 seconds (500 mSec) into your project.


Think about your strategy before coding

A top down view of the upper left corner of the High Stakes Field, with the game elements in their original starting positions. Green arrows mark the intended path of the robot moving from a position to the left and driving to the mobile goal, then diagonally to rings, then returning to the mobile goal, then moving to additional rings diagonally to reach the center line of the Field.

Like any other device on your robot, how you use the GPS Sensor is going to be dependent on your strategy for playing the game. For instance, if you are trying to reach game objects on the opposite side of the Field, your robot is likely going to need to navigate around more obstacles than you would for elements that are in the same quadrant of the Field.

Thinking through what you are trying to accomplish and how you want to code the robot to complete that task with your team will help you to be able to make the most of the GPS Sensor in your project.


Practice coding with VEXcode VR

VEXcode VR Workspace shows a project to navigate the robot using the Location Sensor to the left in the workspace. To the right the Monitor Console is open and is showing data for Position Y in mm as -900 and Position X in mm as -900, showing how the Location values can be monitored during a project. On the bottom the Number Grid Playground is open, and the robot is on the number 1 in the lower lefthand corner.

The Location Sensor on the VR Robot in VEXcode VR is modeled off of the GPS Sensor. Practicing coding with the Location Sensor in VEXcode VR can help you to focus on the coding concepts of using x, y position data in a project, that you can then apply to your physical GPS Sensor on the V5RC Field.

You can learn about how to navigate using x and y location information in Knowing Your Location Unit of the Computer Science Level 1 course (Blocks) (Python). 

An image of the back of virtual Axel in its starting position on the Virtual Skills High Stakes Playground, showing the GPS Sensor and its position on the robot, in relation to the game elements and Field Setup in front of the robot.

You can also practice coding the GPS Sensor on the Hero Bot for this year's game using the Virtual Skills Playground in VEXcode VR. Virtual Skills is a great place to test out strategy and code ideas for game play in a virtual setting, before trying to apply and build projects from scratch on the Field. 

The concepts you learn and practice in Virtual Skills can easily be applied and built upon with your physical robot. View this article to learn more about getting started with Virtual Skills in VEXcode VR.


Be mindful of lighting on the Field

The GPS Device Info on the V5 Brain Screen showing the Image view to the right, where the Field Code is clearly shown in a bright well lit environment. To the left the data reported reads X 0.74m, Y 1.08m, and Heading 88.67 degrees.

Since the GPS Sensor uses a video feed, the sensor will report the most accurate data in a well-lit area. Be mindful of shadows on the Field or bright lights that cause a glare on the Field Code, and avoid those situations if possible.

If you are testing in a dim or low-lit area, you can add additional ambient light try to improve the accuracy of the reported sensor data.


Use the Device Info to check GPS Sensor data

The GPS Device Info on the V5 Brain Screen is shown with both the Location and Image views, with the Location view on top and hte image view on the bottom. The X, Y position and heading data are the same in both. In the Location view, the red arrow indicating the position of the GPS Sensor is in the upper right hand corner, close to the edge and surrounded by a round red area and ring, indicating that the sensor cannot reliably determine the position. The image view shows a small corner portion of the Field Code that the sensor is detecting in this position.

While planning your project, you can view the GPS Sensor data on the V5 Brain screen to help you determine how to build your project. 

When the sensor is too close and can't get an accurate reading of its position, it'll present a circle to denote your possible position. If you see the circle in the Location view, position the sensor further away from the wall to help pull more accurate data for your project.

To learn how to view data on the V5 Brain screen, view this article.

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: