Using the GPS Sensor with VEX V5

The Game Positioning System™ (GPS) Sensor is designed to track and report the location and heading of the sensor using the Field Code on the perimeter of the VEX V5 Robotics Competition (V5RC) Field. 

This article describes how the GPS Sensor functions, the data reported, and how to view and understand this sensor data on the V5 Brain's screen so you can begin to use this sensor effectively. Watch the video below to learn about the concepts covered in this article.


How the GPS Sensor Works

GPS Sensor is shown attached to a robot in a VEX V5 Competition Field. The walls of the field show a black and white pattern, and an arrow indicates that the sensor uses this pattern for positioning.

The GPS (Game Positioning System) Sensor uses a video feed to look at the pattern on the perimeter of the Field. Based on the detected pattern, the sensor reports data about its location on the Field.

 

Angled view of the V5RC Field, with a diagram of a coordinate grid overlayed on the field. The center of the field is marked 0, 0, and the positive and negative directions on the X and Y axes are labeled.

Locations on the VEX V5 Competition (V5RC) Field are determined by a coordinate system. The (0, 0), or origin, is found at the center of the Field, as shown here. 

Overhead view of the V5RC Field with a coordinate grid overlayed on the field. The distances are marked on each axis in meters, and the edge of the field is at the positive or negative 1.8 meter mark on both axes.

The Field ranges from approximately –1.8 meters (m) to 1.8 meters (m) along the X and Y axes. The GPS Sensor reports data based on this coordinate system.

Section of the GPS Field Code is shown as an example, it consists of two rows of black and white rectangles of varying widths.

The walls of the Field have the GPS Field Code printed directly on them. The checkerboard-like pattern on each wall is non-repeating, and corresponds to a specific area of the Field.

Based on the detected portion of Field Code, the GPS Sensor calculates the coordinate location of the sensor on the Field. 

Brain screen is shown in the GPS Sensor menu that lists the sensor's data. The menu reports data of the X position, Y position, and Heading in degrees. The menu also has a video preview from the sensor, and an overlay indicates that the sensor can view and identify the GPS Field Code shown in the preview.

Based on the calculated position, the GPS Sensor reports information about the sensor's location:

  • X coordinate of the sensor on the Field 
  • Y coordinate of the sensor on the Field 
  • Heading of the sensor on the Field in degrees
  • Signal quality (confidence of the sensor data reported) 

Overhead view of the V5RC Field and robot with a coordinate grid overlayed on the field. The units of the X axis are labeled, and the robot is shown with its X coordinate around 1.4 meters.

The X position is the reported location of the GPS Sensor along the X axis of the Field. 

In this example, the X coordinate is approximately 1.4m. 

Overhead view of the V5RC Field and robot with a coordinate grid overlayed on the field. The units of the Y axis are labeled, and the robot is shown with its Y coordinate around 1.2 meters.

The Y position is the reported location of the GPS Sensor along the Y axis of the Field.

In this example, the Y coordinate is approximately 1.2m. 

Overhead view of the V5RC Field with a circle and rotational degrees overlayed on the field. The degrees range from 0 to 359.9, and the 0 degree mark is facing towards the 12 o'clock position, or 'up' in this diagram.

The heading corresponds to the Field heading, which is a range of 0º to 359.9º in the clockwise direction. The 0º is in the 12 o'clock position.

Overhead view of the V5RC Field and robot with rotational degrees overlayed on the field. A line from the center of the field to the robot is shown, and the line in this example is around 40 degrees.

In this example, the heading is approximately 40º. 


Getting Started Using the GPS Sensor

Mounting the GPS Sensor

The data from the GPS Sensor can be viewed on the V5 Brain. To view this data, you first need to attach the GPS Sensor to your robot.

GPS Sensor is shown attached to the rear of a robot in a VEX V5 Competition Field.

It is recommended that the GPS Sensor is mounted on the rear of the robot, facing behind the robot. If mounted on the front, the game elements could obstruct the majority of the view of the sensor.

Note: Ensure the GPS Sensor is mounted right-side up with VEX logo correctly oriented, otherwise your position will not be reported correctly.

GPS Sensor is shown attached to the rear of a robot in a VEX V5 Competition Field. An arrow indicates the height of the sensor from the ground, and in this example the sensor is roughly at the height of the GPS Field Code.

It is also recommended that the GPS sensor should be mounted on the robot high enough off of the ground to be in line with the Field Code. This will reduce the possibility that other errant objects on the Field or robot mechanisms will interfere with the sensor's ability to detect the Field Code.

Overhead view of the GPS Sensor attached to the rear of a robot in a VEX V5 Competition Field. An arrow indicates the angle of the GPS sensor, and in this exmaple it is parallel to the back of the robot and facing directly backwards.

In a similar fashion, the sensor is recommended to be placed parallel to the back of the robot (not at an angle). This again reduces the possibility of interference while also reducing the steps needed to configure the sensor in VEXcode. To learn more about configuring the robot in VEXcode V5, see this article.

Viewing GPS Sensor data

Once the sensor is mounted on the robot and the robot is on the Field, you can begin to view data from the GPS Sensor on the V5 Brain. To view the Device Info, follow these steps.

Brain screen is shown in the Home menu with the Devices option highlighted.

Turn on the V5 Brain, and select the Devices icon.

Brain screen is shown in the Device Info menu which has a list of all of the Brain's Smart Ports and connected devices. The GPS Sensor icon in the Device Info menu is highlighted to indicate that items can be selected to open their information menus.

Select the GPS Sensor icon on the Device Info screen.

Brain screen is shown in the GPS Sensor menu that lists the sensor's data. The menu reports data of the X position in meters, Y position in meters, and Heading in degrees. The menu also has a diagram of the sensor's location and heading on the field.

Now you can move the robot around the field to observe the sensor's current location and heading displayed on the V5 Brain’s screen.

Angled view of the robot on the V5RC field. The robot is shown with the same position and heading as the sensor's diagram indicated.

Let's break down how the location of the GPS Sensor is represented on the Devices Screen on the V5 Brain. For reference, this is the position of the robot on the Field. 

Brain screen is shown in the GPS Sensor menu that lists the sensor's data. The location view diagram is highlighted, this diagram helps visualize the sensor's location and heading.

In the Location view, a graphical representation of the Field and its coordinate grid can be seen on the righthand side.

The red arrow represents the current heading of the GPS Sensor. The white cone coming off the arrow displays the sensor's current field of view.

Brain screen is shown in the GPS Sensor menu that lists the sensor's data. The X and Y position values are highlighted. In this example the X position reads 0.21 meters, and the Y position reads negative 0.38 meters.

The X and Y position of the GPS Sensor is displayed in the top left side of the Brain's screen.

Note: You can change the displayed units from meters (m) to inches (in) by selecting the boxes containing the X and Y position on the Brain's screen.

Brain screen is shown in the GPS Sensor menu that lists the sensor's data. The Heading value is highlighted, and in this example it reads negative 67.64 degrees. This heading is close to facing 'left', or towards the negative X axis.

The current heading of the GPS Sensor is also displayed in degrees.

Overhead view of the V5RC Field with a circle and rotational degrees overlayed on the field. The degrees range from -180 to 180, and the 0 degree mark is facing towards the 12 o'clock position, or 'up' in this diagram. The negative 180 and positive 180 degree positions meet in the 6 o'clock position, or 'down' in this diagram.

Note: The V5 Brain Screen displays GPS Sensor headings from –180 to 180 degrees.

Starting from the 0º location:

  • Headings in the clockwise direction from 0º to 180º are positive
  • Headings in the counterclockwise direction from 0º to –180º are negative

Brain screen is shown in the GPS Sensor menu that lists the sensor's data. The Image button in the bottom left corner of the screen is highlighted. This can be selected to change between the location view and vieo preview.

You can toggle between the location grid view and the actual camera view of the GPS Sensor by selecting the bottom lefthand box on the Brain’s screen, as indicated in the image here.

Brain screen is shown in the GPS Sensor menu that lists the sensor's data. The Image button has been selected, and now a live video preview is shown instead of the location grid. An overlay indicates that the sensor can view and is tracking the GPS Field Code. The Image button now reads Location.

With the image option showing, you can see the elements being detected by the sensor:

  • the pattern of black and white boxes on the Field Strips
  • the location GPS Field Code (indicated by the green bounding lines)
  • the distance between the detected patterns (indicated by the red dots at the intersections of the pattern elements)

Understanding the Data from the GPS Sensor

Now that you know how to view GPS Sensor data on the Brain screen, you can begin to test the GPS Sensor for yourself. Below are some examples to illustrate how the position of the robot and GPS Sensor connect to the data shown on the Brain screen, to help you get started.

Select any image below to enlarge.

Example 1

Angled view of the robot on the V5RC field. The robot is shown in a new position as an example.

In this example, you can see that the robot is at the top right corner of the Field, with the GPS Sensor facing the wall to the right.

From this position, we can expect:

  • a positive x coordinate
  • a positive y coordinate
  • a heading of approximately 90º
Location View Image View
Brain screen is shown in the GPS Sensor menu that lists the sensor's data. In this example, the X position reads 0.74 meters, the Y position reads 1.08 meters, and the Heading reads 88.68 degrees. The menu also has a diagram of the sensor's location and heading on the field, which matches up with the robot's new location. Brain screen is shown in the GPS Sensor menu that lists the sensor's data. The values are the same, but now the video preview from the sensor is shown instead of the location view.

The data seen in these images from the V5 Brain's screen match the predictions above.

When you look at the data from the GPS Sensor on the V5 Brain's screen, the coordinates of the sensor are reported at (0.74, 1.08). This is also shown in the coordinate grid form with the location view.

Note here that the heading of the sensor is reported at about 90º (88.68º), aligning with the direction the red arrow is pointing. In contrast, the robot is holding a Mobile Goal and at an estimated 270º heading. This is because the sensor is mounted in the recommended position facing behind the robot.

Example 2

Angled view of the robot on the V5RC field. The robot is shown in a new position as an example.

In this example, the robot is in roughly the same position on the Field, but has been turned 180º, so the GPS Sensor is facing the left side wall.

From this position, we can expect:

  • a positive x coordinate
  • a positive y coordinate
  • a heading of approximately -90º
Location View Image View
Brain screen is shown in the GPS Sensor menu that lists the sensor's data. In this example, the X position reads 0.58 meters, the Y position reads 0.91 meters, and the Heading reads negative 85.65 degrees. The menu also has a diagram of the sensor's location and heading on the field, which matches up with the robot's new location. Brain screen is shown in the GPS Sensor menu that lists the sensor's data. The values are the same, but now the video preview from the sensor is shown instead of the location view.

The data seen in these images from the V5 Brain's screen match the predictions above.

In contrast to the Image view in the first example, there are significantly more intersections marked with red dots, indicating that a larger section of Field Code is detected. Remember that the sensor calculates the distance from the perimeter based on the amount of Field Code detected, as well as the pattern of the Field Code detected.

Again, note here that the heading of the sensor is reported at about –90º (–85.65º), which is also equivalent to a heading of 270º. In contrast, the robot is holding a Mobile Goal and at an estimated 90º heading.


Next Steps

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

Last Updated: