Book Image

Mastering Beaglebone Robotics

By : Richard Grimmett
Book Image

Mastering Beaglebone Robotics

By: Richard Grimmett

Overview of this book

Table of Contents (18 chapters)
Mastering BeagleBone Robotics
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Parsing the GPS information


Your project will now have the GPS connected and also have access to querying the data via serial port. In this section, you will create a program to use this data to find where you are, and then you can determine what to do with that information.

If you have completed the last section, you should be able to receive the raw data from the GPS unit. Now you will be able to take this data and do something with it. For example, you can find your current latitude, longitude, and altitude, and then decide if your goal location is to the east or west, and to the north or south.

The first thing you'll need to do is parse the information out of the raw data. As noted previously, your position and speed are in the $GPMRC output of our GPS. First, you will write a program to simply parse out a couple of pieces of information from that data. Create a new file that looks like this screenshot:

Here are the details of the code shown in the preceding screenshot:

  • #!/usr/bin/python...