Using the GPS Sensor
In this video, Alaina walks you through the Game Positioning System™ (GPS) Sensor including the data reported by the sensor, how the sensor works, and how to view data from the sensor on the V5 Brain screen. She explains that the GPS Sensor uses a video feed to look at the checkerboard-like pattern on the perimeter of the Field and reports the position of the sensor on the Field. She then walks through examples to illustrate how the data from the sensor connects to the physical position of the robot on the field, so you can better understand how to use sensor data effectively.
Welcome to the VEX classroom. My name is Alaina, and in this video, we're gonna be talking all about using the GPS sensor, that is our game positioning system sensor. So with the word game, we are talking about the VEX V5 Robotic Competition game, so our V5RC. This sensor is able to report the position of the sensor on a V5RC field, both the X and Y position, the heading of the sensor, and the quality of the signal that's coming from the sensor.
So in this video, we're gonna talk all about how the sensor works and how you can view the data that comes from the sensor on the V5 Brain so that you can start to use that data and apply it in your own projects. So let's get started.
The GPS sensor, again, the game positioning system sensor, uses a video feed to look at this perimeter around the field, and this perimeter has a checkerboard-like pattern and those patterns all around the field are unique. So the sensor looks with the video feed at that pattern and is able then to determine based on the pattern seen, how much of the pattern is seen, where the sensor is located, and the heading of the sensor on the V5RC field.
On the V5RC field, the 0,0 coordinate location is in the very center. So we can see here that to the right we have positive X, to the left, negative X, and then upwards we have the positive Y and then negative Y going down. So the GPS center is going to report that X and Y location of the sensor on the field. The values that you'll see for the V5RC field range from negative 1.8 meters to positive 1.8 meters in both the X and the Y direction.
So we can see here from this coordinate grid the four quadrants that make up the V5RC field and what coordinates would go with those different areas of the field. As I mentioned, the GPS sensor is using a video feed to look for these patterns that are on the inside of the perimeter of the field. Each part of this is a unique pattern that's non-repeating where the sensor then can determine where it is based on this pattern and it reports that data to the V5 Brain screen as well.
So here I can see all of those things that the sensor is reporting. The exposition, which in this particular instance is 1.42 meters, the Y position, which in this example is 1.2 meters, the video of how much of the pattern that the sensor is seeing over here, which we can see in the video feed, as well as the heading of the sensor, which in this case is about 38 degrees.
So now that we're seeing this on the Brain screen, let's look at where the robot's position is on the field itself. So here looking at the X-coordinate, I can see that the robot is up in that first quadrant, so both positive X and positive Y-coordinate values. And from here I can see that the X-coordinate of the GPS sensor is about 1.4, which I can see from that red dotted line. You'll notice here that that red dotted line is, again, going through the location of the GPS sensor on the robot. It's not aiming for the center of the robot or the front of the robot, but rather for the sensor itself, which on this robot is located on the back, facing away from the front of the robot.
We're gonna go over the mounting recommendations for the sensor a little more further in the video. And then looking at the Y-coordinate of the sensor on the field, we're looking at about 1.3 here, which we can see from that blue dotted line for our Y-coordinate position of the sensor itself.
When we are looking at the heading of our sensor, we are looking at the field as a whole. So thinking about this as a clock, at the 12 o'clock position, that is the zero-degree heading. The three o'clock is the 90-degree and it increases as you go clockwise all the way from 0 to 359.99 or 0 to 360 degrees.
So going back to that example of our sensor, it's being pointed roughly towards that corner on the field, which is somewhere between 40 and 45 degrees for that heading of the sensor. When thinking about where to place the GPS sensor on your robot, it's important that it's in an area of the robot where it can get a clear reading of the field code without any obstructions from your robot itself or game elements that you may be collecting throughout the game. It is recommended that the sensor be on the back of the robot, facing away from the robot, to help with that. We also recommend that the sensor be at roughly the height of that field code so that it has a clear line of sight to the field code so it can read that pattern through the video feed.
You can see here how the sensor is aligned with that field code pattern, facing away from the front of the robot, and it is roughly at the height of the field code. In addition to the height and location of the sensor, you also want to think about the orientation of the sensor in relation to the robot and the field code as well. So here you can see it is parallel with the front of the robot, so that way you have a clear line of sight and you're not worrying about calculating the angle of the sensor itself and its position on the field, which does make the configuring process much simpler, which will be covered in another article.
Now that we've discussed how the sensor works by reading that field code and what the sensor reports, the X and Y-coordinate location of the sensor, as well as its heading and the signal quality of the sensor, we can start to look at how that data is reported on the V5 Brain screen once you have it mounted on your robot. On the V5 Brain screen, once the sensor is mounted and connected, you want to turn on the Brain and select the Devices option on that home screen. From there, you want to look at what port the sensor is plugged into. So in this case, I have the sensor plugged into port eight. Once you've selected your sensor, you'll see a screen that contains all of the data being reported by the GPS to the V5 Brain.
So first on the right-hand side of the screen, you can see the location details of the sensor. So here you can see that coordinate grid from negative 1.8 meters to positive 1.8 meters. You can see the location of the sensor on the field with that red arrow right here, and that arrow is also pointing in the direction that the sensor is oriented towards as well, so the heading of that sensor. And you can also see the field of view of that sensor by this white cone that comes off of the arrow as well. So looking here, I can see that the robot is towards the center of the field, barely into that bottom right-hand quadrant because my sensor is even closer to those axes than the rest of the robot itself. Because this is where the front of the robot is, the back of the robot and the sensor itself is pointing towards this direction.
Now, you'll see here that the heading is reported at negative 67 degrees approximately. In our original discussion about heading, we talked about heading as a 0 to 360-degree value. On the V5 Brain screen, however, the GPS sensor uses negative 180 to 0 and then 0 to 180 degrees. So again, starting with the zero-degree heading being at that 12 o'clock position for our field, the V5 Brain screen will report the data from the GPS sensor as 0 to positive 180 degrees moving in the clockwise direction, and then moving in the counter-clockwise direction from the zero degrees, it will report from 0 to negative 180 degrees. So if we go back to our example, we'll see that that negative 67 degrees is pointing just about where we would expect up in this direction here.
The final option here on the V5 Brain screen when looking at the Devices option for the GPS sensor is the option to toggle between the location view, which we currently have on the right-hand side, and the image view on the right-hand side. The image view provides that camera feed from the GPS sensor and sends that to the V5 Brain screen so that you can see what the sensor is detecting at any given point of time while you're planning your projects.
In order to switch back and forth from location to image view, you select the button on the bottom left-hand side of the Brain screen. So now that we've gone through also the data on the V5 Brain screen, as well as how to access the device information for the GPS sensor, we're going to walk through two examples together, starting with an image of the robot on the field with a GPS sensor, and then talk through what data we will expect to see back from the GPS sensor on the V5 Brain screen.
So for this first example, the robot is in that first quadrant, so we should expect a positive X and a positive Y-coordinate location for our sensor, which is right here approximately. Then we should expect a heading of around 90 degrees because the sensor is pointing to this three o'clock location here, which is that roughly 90-degree heading. Remember that heading being reported by the GPS sensor is the heading of the sensor itself, not the front of our robot.
Here I can see the current video feed of our robot, which is looking at the wall to the right-hand side and detecting that field code there. I can see that both my X and my Y-coordinate values are positive as we anticipated. And the heading of our sensor is approximately 90 degrees, it's 88.67. If I look at the location view in the bottom right of the screen here, I can see what portion of the field that sensor is detecting or what portion of the field code the sensor is able to read through that cone of vision.
Now, in comparison, this robot has been turned roughly 180 degrees, but it's in approximately the same location on the field. So the robot itself is in the same location, however, when you move the sensor from this side of the back of the robot to this side of the back of the robot, we should see some difference in the position itself because all of this data is being reported about the location of the GPS sensor. Here I would expect coordinate values, again, to be positive X, positive Y. And now my heading should be closer to negative 90 because it's pointed in the other direction. Remember, negative 90 is also equivalent to a heading of 270 degrees.
Looking at the Devices screen for our GPS sensor on this robot, we're seeing, again, the approximate X and Y values, both positive values, and we're seeing a heading of negative 85 degrees, which matches with that approximate negative 90 that we were expecting here, which also matches with what we're seeing in the image view and on the location view with that coordinate grid.
To recap, our GPS sensor, or game positioning system sensor, uses a video feed to read the perimeter of our V5RC field to look for field code that's printed on, which are those checkerboard-like patterns, and it uses that unique non-repeating pattern, how much of it it sees and what pattern it's seeing, to report the X and Y location of the sensor on the field, as well as the heading of the sensor on the field. It's able to do this because our sensor is not obstructed by anything on our robot itself, and we do that with our recommendations for mounting, which is that the sensor is on the back of the robot, facing away from the front, and that it's at roughly the height of the field code on the interior of the V5RC field perimeter.
Beyond that, we also looked at the V5 Brain screen, how to access the device info for the GPS sensor once it's been mounted and connected to my robot. This helps us understand what it looks like with those different values that are reported using both the image and the location view. By connecting all of that information together, we can make sense of the data being reported from the GPS sensor.
Now, moving forward, if you're looking for next steps, I recommend that you configure your GPS sensor in VEXcode V5. You can follow along in a following article or a following video in order to do that. Have fun coding with your GPS sensor.
(upbeat music)
Share
Like this video? Share it with others!
Additional Resources
Looking for more? Learn about Configuring a GPS Sensor in VEXcode V5 in this video.
Additional Resources
Like this video? Discuss it in the VEX Professional Learning Community.