The GPS (Game Positioning System) 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
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.
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.
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.
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.
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)
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.
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.
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.
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.
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.
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.
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.
Turn on the V5 Brain, and select the Devices icon.
Select the GPS Sensor icon on the Device Info screen.
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.
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.
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.
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.
The current heading of the GPS Sensor is also displayed in degrees.
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
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.
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
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 |
---|---|
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
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 |
---|---|
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
- View GPS Sensor data for yourself! Mount your GPS Sensor to your robot, place it on the Field, and use the Devices Screen to view sensor data in different locations.
- Ready to start coding? Get started by configuring the GPS Sensor in VEXcode V5. View this article to learn more about configuring the GPS Sensor.