While making a quick run into Uganda, ended up getting my car commandeered at a Military checkpoint. Soldiers wanted us to take them to Kampala, but we ended up at the Nile. They made arrangements for transport by boat, and we steamed up to the headwaters of the Nile River. We collected water from the headwaters of the Nile for a Souvenir.
All posts by admin
Review of the 3DR X8+ Unmanned Aerial Drone Multicopter
As most of you know, I teach High School Engineering, so I am always looking for exciting platforms from which I can make Match, Physics, Engineering and Programming Fun and Exciting. I have done a lot of work with Edge of Space Ballooning, but was looking for something that would allow more flights, and more COL (Cycles of Learning) per year.
I think I have happened onto something that might be the ultimate Engineering teaching tool for High School. This is the 3DR X8+ Unmanned Aerial Drone.
I have spent about six months working with this unit, and am very excited about it. I consider it to be an exceptional teaching platform and the students like it.
This is something they have to put together, read instructions carefully, and learn in order to get it up and running. This though, is one of the things I like about it. We need to teach Engineering, and some of the really ready to fly out of the box drones like the Phantom are fun, but do not offer the same educational opportunities.
I have gotten excellent technical support from 3DR when I hit a snag I can not figure out. We have had dozens of successful flights on this platform, and are now starting to build our own instrument packages to fly on it.
It requires attention, but mastering the use of this unit is well withen the skill set of motivated High School Students.
I do plan on doing lessons on some of the things we do with this drone in the future.
Beaglebone Black GPS Tracker LESSON 5: Displaying Data from GPS in Google Earth
In the earlier lessons in this series we learned how to hook the Adafruit Ultimate GPS up to the Beaglebone Black. In these lessons we got the hardware working, got to the point we could take data, and then got the NMEA sentences parsed, so that we could display understandable data for Latitude, Longitude, and Altitude. In this lesson we will show you how to create a GPS tracker, by logging your GPS data to a file on the Beaglebone Black. Then when you get back home, you can load the data into google earth to see an interactive view of where you have been.
The video shows step-by-step how to get the code working, starting with the code we developed in Lesson 3. We end up with the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | import serial import Adafruit_BBIO.UART as UART from time import sleep UART.setup("UART1") ser=serial.Serial('/dev/ttyO1',9600) class GPS: def __init__(self): #This sets up variables for useful commands. #This set is used to set the rate the GPS reports UPDATE_10_sec= "$PMTK220,10000*2F\r\n" #Update Every 10 Seconds UPDATE_5_sec= "$PMTK220,5000*1B\r\n" #Update Every 5 Seconds UPDATE_1_sec= "$PMTK220,1000*1F\r\n" #Update Every One Second UPDATE_200_msec= "$PMTK220,200*2C\r\n" #Update Every 200 Milliseconds #This set is used to set the rate the GPS takes measurements MEAS_10_sec = "$PMTK300,10000,0,0,0,0*2C\r\n" #Measure every 10 seconds MEAS_5_sec = "$PMTK300,5000,0,0,0,0*18\r\n" #Measure every 5 seconds MEAS_1_sec = "$PMTK300,1000,0,0,0,0*1C\r\n" #Measure once a second MEAS_200_msec= "$PMTK300,200,0,0,0,0*2F\r\n" #Meaure 5 times a second #Set the Baud Rate of GPS BAUD_57600 = "$PMTK251,57600*2C\r\n" #Set Baud Rate at 57600 BAUD_9600 ="$PMTK251,9600*17\r\n" #Set 9600 Baud Rate #Commands for which NMEA Sentences are sent ser.write(BAUD_57600) sleep(1) ser.baudrate=57600 GPRMC_ONLY= "$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" #Send only the GPRMC Sentence GPRMC_GPGGA="$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n"#Send GPRMC AND GPGGA Sentences SEND_ALL ="$PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" #Send All Sentences SEND_NOTHING="$PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" #Send Nothing ser.write(UPDATE_1_sec) sleep(1) ser.write(MEAS_1_sec) sleep(1) ser.write(GPRMC_GPGGA) sleep(1) ser.flushInput() ser.flushInput() print "GPS Initialized" def read(self): ser.flushInput() ser.flushInput() while ser.inWaiting()==0: pass self.NMEA1=ser.readline() while ser.inWaiting()==0: pass self.NMEA2=ser.readline() NMEA1_array=self.NMEA1.split(',') NMEA2_array=self.NMEA2.split(',') if NMEA1_array[0]=='$GPRMC': self.timeUTC=NMEA1_array[1][:-8]+':'+NMEA1_array[1][-8:-6]+':'+NMEA1_array[1][-6:-4] self.latDeg=NMEA1_array[3][:-7] self.latMin=NMEA1_array[3][-7:] self.latHem=NMEA1_array[4] self.lonDeg=NMEA1_array[5][:-7] self.lonMin=NMEA1_array[5][-7:] self.lonHem=NMEA1_array[6] self.knots=NMEA1_array[7] if NMEA1_array[0]=='$GPGGA': self.fix=NMEA1_array[6] self.altitude=NMEA1_array[9] self.sats=NMEA1_array[7] if NMEA2_array[0]=='$GPRMC': self.timeUTC=NMEA2_array[1][:-8]+':'+NMEA1_array[1][-8:-6]+':'+NMEA1_array[1][-6:-4] self.latDeg=NMEA2_array[3][:-7] self.latMin=NMEA2_array[3][-7:] self.latHem=NMEA2_array[4] self.lonDeg=NMEA2_array[5][:-7] self.lonMin=NMEA2_array[5][-7:] self.lonHem=NMEA2_array[6] self.knots=NMEA2_array[7] if NMEA2_array[0]=='$GPGGA': self.fix=NMEA2_array[6] self.altitude=NMEA2_array[9] self.sats=NMEA2_array[7] myGPS=GPS() GPSdata=open('/root/GPS_data/GPS.txt', 'w') GPSdata.close() while(1): myGPS.read() if myGPS.fix!=0: try: latDec=float(myGPS.latDeg)+float(myGPS.latMin)/60. lonDec=float(myGPS.lonDeg)+float(myGPS.lonMin)/60. if myGPS.lonHem=='W': lonDec=(-1)*lonDec if myGPS.latHem=='S': latDec=(-1)*latDec alt=myGPS.altitude GPSdata=open('/root/GPS_data/GPS.txt', 'a') myString=str(lonDec)+','+str(latDec)+','+alt+' ' GPSdata.write(myString) GPSdata.close() except: pass |
This program should create a file on the Beaglebone Black, and track your longitude, latitude and altitude.
In order to view the file on Google Earth, you will want to put a KMZ wrapper on the coordinates. A reasonable KMZ wrapper is below. Simply take your coordinates from the program above, and paste them in the file below, in the area between <coordinates> and </coordinates>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Document> <Style id="yellowPoly"> <LineStyle> <color>7f00ffff</color> <width>4</width> </LineStyle> <PolyStyle> <color>7f00ff00</color> </PolyStyle> </Style> <Placemark><styleUrl>#yellowPoly</styleUrl> <LineString> <extrude>1</extrude> <tesselate>1</tesselate> <altitudeMode>absolute</altitudeMode> <coordinates> </coordinates> </LineString></Placemark> </Document></kml> |
Beaglebone Black GPS Tracker LESSON 4: Easily Transfer Files Between Beaglebone and PC
One of the things that surprised me about the Beaglebone Black is that it does not come with any simple, direct way to transfer files back and forth with a PC. For our GPS project, we will need to transfer our logged GPS data from the Beaglebone Black to the PC. What I have found is the easiest way to transfer files is using WINscp. You can download this software at:
http://winscp.net/eng/download.php
Download and install the software, which takes just a few minutes. One downloaded, launch the program. You will see a window like this:
Under host name, you will want to put the IP address of your Beaglebone Black. If you do not know the IP address, we explain how to get it in LESSON 2.
For the default Beaglebone Black configuration, the username is root, and there is no password. Fill in these blanks, and then click “Login”.
That should take you to this screen:
At this point the right panel is a view of your Beaglebone Black files. You can navigate by clicking on the folders. An the left is your PC files. You can drag and drop files between the two panels to transfer them to and from the PC and Beaglebone Black.
Beaglebone Black GPS Tracker LESSON 3: Parsing the NMEA Sentences in Python
In the first two lessons in this series, you learned how to hook the Beaglebone Black to the Adafruit Ultimate GPS breakout board. We then learned to read NMEA sentences from the GPS, and how to control the data the GPS spits out. In this lesson we will learn to parse the NMEA sentences into useful data. You need to make sure you go back and review the first two lessons, as this one draws heavily on those. Also, you need to start with the code we had developed in LESSON 2. (If you need the gear we are using, you can get the Beaglebone Black HERE, and you can get the Adafruit GPS HERE.)
In this code we move most of the work up into our GPS class. That makes the main part of the program simple and intuitive to use.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | import serial import Adafruit_BBIO.UART as UART from time import sleep UART.setup("UART1") ser=serial.Serial('/dev/ttyO1',9600) class GPS: def __init__(self): #This sets up variables for useful commands. #This set is used to set the rate the GPS reports UPDATE_10_sec= "$PMTK220,10000*2F\r\n" #Update Every 10 Seconds UPDATE_5_sec= "$PMTK220,5000*1B\r\n" #Update Every 5 Seconds UPDATE_1_sec= "$PMTK220,1000*1F\r\n" #Update Every One Second UPDATE_200_msec= "$PMTK220,200*2C\r\n" #Update Every 200 Milliseconds #This set is used to set the rate the GPS takes measurements MEAS_10_sec = "$PMTK300,10000,0,0,0,0*2C\r\n" #Measure every 10 seconds MEAS_5_sec = "$PMTK300,5000,0,0,0,0*18\r\n" #Measure every 5 seconds MEAS_1_sec = "$PMTK300,1000,0,0,0,0*1C\r\n" #Measure once a second MEAS_200_msec= "$PMTK300,200,0,0,0,0*2F\r\n" #Meaure 5 times a second #Set the Baud Rate of GPS BAUD_57600 = "$PMTK251,57600*2C\r\n" #Set Baud Rate at 57600 BAUD_9600 ="$PMTK251,9600*17\r\n" #Set 9600 Baud Rate #Commands for which NMEA Sentences are sent ser.write(BAUD_57600) sleep(1) ser.baudrate=57600 GPRMC_ONLY= "$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" #Send only the GPRMC Sentence GPRMC_GPGGA="$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n"#Send GPRMC AND GPGGA Sentences SEND_ALL ="$PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" #Send All Sentences SEND_NOTHING="$PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" #Send Nothing ser.write(UPDATE_200_msec) sleep(1) ser.write(MEAS_200_msec) sleep(1) ser.write(GPRMC_GPGGA) sleep(1) ser.flushInput() ser.flushInput() print "GPS Initialized" def read(self): ser.flushInput() ser.flushInput() while ser.inWaiting()==0: pass self.NMEA1=ser.readline() while ser.inWaiting()==0: pass self.NMEA2=ser.readline() NMEA1_array=self.NMEA1.split(',') NMEA2_array=self.NMEA2.split(',') if NMEA1_array[0]=='$GPRMC': self.timeUTC=NMEA1_array[1][:-8]+':'+NMEA1_array[1][-8:-6]+':'+NMEA1_array[1][-6:-4] self.latDeg=NMEA1_array[3][:-7] self.latMin=NMEA1_array[3][-7:] self.latHem=NMEA1_array[4] self.lonDeg=NMEA1_array[5][:-7] self.lonMin=NMEA1_array[5][-7:] self.lonHem=NMEA1_array[6] self.knots=NMEA1_array[7] if NMEA1_array[0]=='$GPGGA': self.fix=NMEA1_array[6] self.altitude=NMEA1_array[9] self.sats=NMEA1_array[7] if NMEA2_array[0]=='$GPRMC': self.timeUTC=NMEA2_array[1][:-8]+':'+NMEA1_array[1][-8:-6]+':'+NMEA1_array[1][-6:-4] self.latDeg=NMEA2_array[3][:-7] self.latMin=NMEA2_array[3][-7:] self.latHem=NMEA2_array[4] self.lonDeg=NMEA2_array[5][:-7] self.lonMin=NMEA2_array[5][-7:] self.lonHem=NMEA2_array[6] self.knots=NMEA2_array[7] if NMEA2_array[0]=='$GPGGA': self.fix=NMEA2_array[6] self.altitude=NMEA2_array[9] self.sats=NMEA2_array[7] myGPS=GPS() while(1): myGPS.read() print myGPS.NMEA1 print myGPS.NMEA2 if myGPS.fix!=0: print 'Universal Time: ',myGPS.timeUTC print 'You are Tracking: ',myGPS.sats,' satellites' print 'My Latitude: ',myGPS.latDeg, 'Degrees ', myGPS.latMin,' minutes ', myGPS.latHem print 'My Longitude: ',myGPS.lonDeg, 'Degrees ', myGPS.lonMin,' minutes ', myGPS.lonHem print 'My Speed: ', myGPS.knots print 'My Altitude: ',myGPS.altitude |