├── AziFromPos.py ├── Comm.py ├── Ctrl.py ├── LICENSE ├── LatLong.txt ├── LocationBackup ├── 从车队场地到12公寓.txt └── 车队场地小环形.txt ├── LocationTrans ├── .ipynb_checkpoints │ ├── Untitled-checkpoint.ipynb │ └── Untitled1-checkpoint.ipynb ├── CONFIGURE │ └── Basis.kml ├── LatLong.txt ├── MapDataOutput1.kml ├── Untitled.ipynb ├── Untitled1.ipynb ├── kml2txt.py └── txt2kml.py ├── Madgwick_AHRS_Test.py ├── MainSequence.py ├── NRF24L01.py ├── README.md ├── Record_Coordinates.py ├── rpi-pins-40-0.png ├── sound ├── ARRIVEDEST.mp3 ├── GPSFIXED.mp3 ├── GPSNOFIX.mp3 ├── SEQUENCESTART.mp3 ├── SYSTEMSHUTDOWN.mp3 └── subthreadserr.mp3 └── start.sh /AziFromPos.py: -------------------------------------------------------------------------------- 1 | '''Copyright 2019 李东豫<8523429@qq.com> 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License.''' 14 | import math 15 | 16 | #测试通过 17 | def DDD2DMS(number): 18 | D = number//1 19 | temp = number%1 20 | M = (temp*60)//1 21 | temp = (temp*60) %1 22 | S = (temp*60) 23 | return D+(M/100)+(S/10000) 24 | 25 | #测试通过 26 | def angleFromCoordinate(long1, lat1, long2, lat2): 27 | lat1 = math.radians(DDD2DMS(lat1)) 28 | lat2 = math.radians(DDD2DMS(lat2)) 29 | long1 = math.radians(DDD2DMS(long1)) 30 | long2 = math.radians(DDD2DMS(long2)) 31 | y = math.sin(long2-long1)*math.cos(lat2) 32 | x = math.cos(lat1)*math.sin(lat2)-math.sin(lat1)*math.cos(lat2)*math.cos(long2-long1) 33 | deltaLon = long2-long1 34 | theta = math.atan2(y,x) 35 | theta = math.degrees(theta) 36 | theta = (theta+360)%360 37 | return theta 38 | 39 | def distanceFromCoordinate(lon1, lat1, lon2, lat2): # 经度1,纬度1,经度2,纬度2 (十进制度数) 40 | """ 41 | Calculate the great circle distance between two points 42 | on the earth (specified in decimal degrees) 43 | """ 44 | # 将十进制度数转化为弧度 45 | lon1, lat1, lon2, lat2 = map(math.radians, [lon1, lat1, lon2, lat2]) 46 | 47 | # haversine公式 48 | dlon = lon2 - lon1 49 | dlat = lat2 - lat1 50 | a = math.sin(dlat/2)**2 + math.cos(lat1) * math.cos(lat2) * math.sin(dlon/2)**2 51 | c = 2 * math.asin(math.sqrt(a)) 52 | r = 6371 # 地球平均半径,单位为公里 53 | return c * r * 1000 *100 54 | 55 | temp = angleFromCoordinate(120.5139651439754,36.89759065531443,120.5147411312813,36.89198937216152) 56 | print(temp) 57 | temp = distanceFromCoordinate(120.5139651439754,36.89759065531443,120.5147411312813,36.89198937216152) 58 | print(temp) 59 | -------------------------------------------------------------------------------- /Comm.py: -------------------------------------------------------------------------------- 1 | '''Copyright 2019 李东豫<8523429@qq.com> 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License.''' 14 | # -*- coding: utf-8 -* 15 | 16 | import serial 17 | import time 18 | import threading 19 | import Ctrl 20 | import os 21 | 22 | #环形缓冲区类 23 | class ringBuff: 24 | Head = 0 25 | Tail = 0 26 | data = [] 27 | length = 0 28 | elements = 0 29 | def __init__(self,length,baud,WirelessPort,serial): 30 | self.length = length 31 | self.Head = 0 32 | self.Tail = 0 33 | self.elements = 0 34 | self.WirelessPort = WirelessPort 35 | self.ser = serial 36 | for cnt in range(length):#初始化列表 37 | self.data.append(0) 38 | def readData(self): 39 | if(self.elements >= self.length): 40 | return False 41 | else: 42 | dataIn = 'abc' 43 | if self.ser.inWaiting() != 0: 44 | if(self.WirelessPort.Status): 45 | if(not self.WirelessPort.getAUXstatus()): 46 | dataIn = self.ser.read(1) #读一个字节 47 | else: 48 | dataIn = self.ser.read(1) 49 | #print("data in = %d"%ord(dataIn)) 50 | if(dataIn != 'abc') : 51 | if type(dataIn).__name__ == 'bytes': 52 | dataIn = int.from_bytes(dataIn,byteorder='big',signed=False) 53 | self.data[self.Tail] = dataIn 54 | self.elements += 1 55 | #print("正在读入,尾序号为%d,读入数据为%d"%(self.Tail,dataIn)) 56 | self.Tail = (1+self.Tail) % self.length 57 | 58 | def outputData(self): 59 | if(self.elements==0): 60 | return False 61 | else: 62 | dataOut = self.data[self.Head] 63 | #print("正在输出,头序号为%d,输出数据为%d"%(self.Head,dataOut)) 64 | self.elements -= 1 65 | self.Head = (self.Head+1) % self.length 66 | return dataOut 67 | def getLength(self): 68 | return self.elements 69 | #船体姿态描述 70 | class UASattitude: 71 | lattitude = 0 72 | longtitude = 0 73 | fixtype = 0 74 | hAcc = 0 75 | yaw = 0 76 | pitch = 0 77 | roll = 0 78 | speed = 0 79 | angleSpeed = 0 80 | dataProcessed = 0 81 | #手动、自动模式标志位,1表示自动;2表示采点;3表示手动 82 | manual_automatic = 1 83 | def __init__(self): 84 | self.lattitude = 0 85 | self.longtitude = 0 86 | self.yaw = 1 87 | self.pitch = 1 88 | self.roll = 1 89 | self.fixtype = 0 90 | self.dataProcessed = 0 91 | self.manual_automatic = 3 92 | #路线规划描述: 93 | class Route: 94 | yaw = 0 #单位:° 95 | distance = 0#单位:厘米,u16型数据 96 | EndOfNav = 0#导航结束标志位 97 | def __init__(self): 98 | self.yaw = 0 99 | self.distance = 0 100 | self.EndOfNav = 0 101 | def SendNavMessege(ser,Route,WirelessPort): 102 | sendFile = list() 103 | sumup = 0 104 | for cnt in range(20): 105 | sendFile.append(0) #初始化数组 106 | sendFile[0]=0x63 107 | sendFile[1]=0x73 108 | sendFile[2]=(Route.yaw&0xff00)>>8 109 | sendFile[3]=Route.yaw&0xff 110 | sendFile[4]=(Route.distance&0xff00)>>8 111 | sendFile[5]=Route.distance&0xff 112 | sendFile[6]=(Route.EndOfNav << 7)&0xff 113 | #这里用来后续填充 114 | for cnt in range(17): 115 | sumup+=sendFile[2+cnt] 116 | sumup = sumup & 0xff 117 | sendFile[19] = sumup 118 | sendBytes = bytes() 119 | for cnt in range(20): 120 | sendBytes += bytes([sendFile[cnt]]) 121 | if(WirelessPort.Status): 122 | if(not WirelessPort.getAUXstatus()): 123 | ser.write(sendBytes) 124 | else: 125 | ser.write(sendBytes) 126 | 127 | #部署线程 128 | class sysnthesisData(threading.Thread): 129 | revData = list() 130 | counter = 0 131 | delay = 0 132 | sumUp = 0 133 | def __init__(self,RingBuff,Ship,ValidShip,freq,systemFlag): 134 | threading.Thread.__init__(self) 135 | time.sleep(0.5) 136 | self.ObjRingBuff = RingBuff 137 | self.Ship = Ship 138 | self.ValidShip = ValidShip 139 | self.freq = freq 140 | self.delay = 1/freq 141 | self.systemFlag = systemFlag 142 | for cnt in range(22):#初始化列表 143 | self.revData.append(0) 144 | print("Eastar Protocol Data Frame Length Configuration:%d"%len(self.revData)) 145 | def run(self): 146 | while self.systemFlag: 147 | time.sleep(self.delay) 148 | if(self.ObjRingBuff.getLength()>=22): 149 | for cnt in range(22):#21为一帧数据的长度 150 | self.revData[0] = self.ObjRingBuff.outputData() 151 | if(self.revData[0]==0x73): 152 | self.revData[1] = self.ObjRingBuff.outputData() 153 | if(self.revData[1]==0x63): 154 | self.counter = 1 155 | #print("接受到引导码") 156 | break 157 | else: 158 | self.counter = 0 159 | 160 | if(self.counter == 1): 161 | while(self.counter<21):#从1读到21 一共20个 162 | self.counter += 1 163 | self.revData[self.counter] = self.ObjRingBuff.outputData() 164 | #print("读入数据集:",self.revData) 165 | #验证环节: 166 | self.sumUp = 0 167 | for temp in range(19): 168 | self.sumUp += self.revData[temp+2] 169 | self.sumUp = self.sumUp & 0xFF 170 | #print("Sum up is calculated to be %d"%self.sumUp) 171 | if self.sumUp == self.revData[21]:#校验和验证通过 172 | #准备转化数据 173 | threadLock.acquire() 174 | self.Ship.longtitude = bytes() 175 | self.Ship.lattitude = bytes() 176 | self.Ship.yaw = bytes() 177 | self.Ship.pitch = bytes() 178 | self.Ship.roll = bytes() 179 | #开始转化数据 180 | for cnt in range(4): 181 | self.Ship.longtitude += bytes([self.revData[cnt+2]]) 182 | self.Ship.lattitude += bytes([self.revData[cnt+2+4]]) 183 | 184 | for cnt in range(2): 185 | #print("%d八位数据:yaw:%d,pitch:%d,roll:%d"%(cnt,self.revData[cnt+10],self.revData[cnt+12],self.revData[cnt+14])) 186 | self.Ship.yaw += bytes([self.revData[cnt+10]]) 187 | self.Ship.pitch += bytes([self.revData[cnt+12]]) 188 | self.Ship.roll += bytes([self.revData[cnt+14]]) 189 | if(self.Ship.yaw!=b'00' and self.Ship.pitch!=b'00' and self.Ship.roll!=b'00'): 190 | self.ValidShip.yaw=int.from_bytes(self.Ship.yaw,byteorder='big',signed=False) 191 | self.ValidShip.pitch=int.from_bytes(self.Ship.pitch,byteorder='big',signed=True) 192 | self.ValidShip.roll=int.from_bytes(self.Ship.roll,byteorder='big',signed=True) 193 | #print(0xc0 & int.from_bytes(bytes([self.revData[20]]),byteorder='big',signed=False)) 194 | self.ValidShip.fixtype = (0xc0 & int.from_bytes(bytes([self.revData[20]]),byteorder='big',signed=False)) >> 6 195 | self.ValidShip.manual_automatic = (0x30 & int.from_bytes(bytes([self.revData[20]]),byteorder='big',signed=False)) >> 4 196 | self.ValidShip.hAcc = int.from_bytes(bytes([self.revData[16]]),byteorder='big',signed=False) 197 | self.ValidShip.lattitude = (int.from_bytes(self.Ship.lattitude,byteorder='big',signed=False)/1e7) 198 | self.ValidShip.longtitude = (int.from_bytes(self.Ship.longtitude,byteorder='big',signed=False)/1e7) 199 | self.ValidShip.dataProcessed=1 200 | #数据转化完毕 201 | threadLock.release() 202 | #print("%d八位数据:yaw:%d,pitch:%d,roll:%d"%(self.ValidShip.yaw,self.ValidShip.pitch,self.ValidShip.roll)) 203 | 204 | 205 | else: 206 | print("CRC Failed to validate") 207 | pass 208 | 209 | def stop(self): 210 | self.systemFlag = 0 211 | 212 | 213 | 214 | class USARTinData(threading.Thread): 215 | def __init__(self,RingBuff,systemFlag): 216 | time.sleep(0.5) 217 | threading.Thread.__init__(self) 218 | self.RingBuff = RingBuff 219 | self.systemFlag = systemFlag 220 | def run(self): 221 | print("Serial port started") 222 | while self.systemFlag: 223 | self.RingBuff.readData() 224 | def stop(self): 225 | self.systemFlag = 0 226 | 227 | class SendCommand(threading.Thread): 228 | def __init__(self,ser,ValidShip,Route,WirelessPort,freq,systemFlag): 229 | threading.Thread.__init__(self) 230 | time.sleep(1) 231 | self.serial = ser 232 | self.Route = Route 233 | self.ValidShip = ValidShip 234 | self.WirelessPort = WirelessPort 235 | self.freq = freq 236 | self.delay = 1/self.freq 237 | self.systemFlag = systemFlag 238 | def run(self): 239 | while self.systemFlag: 240 | if (self.ValidShip.fixtype != 0): 241 | time.sleep(self.delay) 242 | #SendNavMessege(self.serial,self.Route,self.WirelessPort) 243 | 244 | def cease(self): 245 | self.systemFlag = 0 246 | def recover(self): 247 | self.systemFlag = 1 248 | 249 | 250 | threadLock = threading.Lock() 251 | 252 | 253 | def Ship_Attitude_On_Screen(ValidShip): 254 | fixtype = {0:"No fix",1:"Dead reckoning only",2:"2D-fix",3:"3D-fix",4:"GNSS + dead reckoning combined",5:"Other fixtype"} 255 | print("Yaw:%d\n"%(ValidShip.yaw)) 256 | print(fixtype[ValidShip.fixtype]) 257 | if(ValidShip.fixtype != 0): 258 | print("=>Longtitude:%.7f\n=>Latitude:%.7f"%(ValidShip.longtitude,ValidShip.lattitude)) 259 | print("hAcc:%.1fMeter"%(ValidShip.hAcc/10)) 260 | return 1 261 | return 0 262 | -------------------------------------------------------------------------------- /Ctrl.py: -------------------------------------------------------------------------------- 1 | '''Copyright 2019 李东豫<8523429@qq.com> 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License.''' 14 | 15 | #!/usr/bin/env python 16 | # coding: utf-8 17 | try: 18 | import AziFromPos 19 | import time 20 | import RPi.GPIO as GPIO 21 | import serial 22 | except: 23 | print("Ctrl模块文件引入出错!") 24 | 25 | 26 | 27 | def GPIOinit(): 28 | #配置设备 29 | GPIO.setmode(GPIO.BOARD) 30 | GPIO.setwarnings(False) 31 | try: 32 | GPIO.cleanup() 33 | except RuntimeWarning: 34 | pass 35 | 36 | def GPIO_Shutoff(): 37 | #关闭GPIO,清除配置 38 | GPIO.cleanup() 39 | print("GPIO已重置。") 40 | 41 | 42 | #无线串口类 43 | class WirelessUSART: 44 | MD0 = 0 45 | AUX = 0 46 | Status = 0 47 | def __init__(self): 48 | self.MD0 = 7 49 | self.AUX = 11 50 | GPIO.setup(self.MD0, GPIO.OUT,initial=GPIO.LOW) 51 | GPIO.setup(self.AUX, GPIO.IN,pull_up_down=GPIO.PUD_DOWN) 52 | def EnterCfgMode(self): 53 | if(not GPIO.input(self.MD0)): 54 | GPIO.output(self.MD0, GPIO.HIGH) 55 | time.sleep(0.3) 56 | else: 57 | print("无线串口MD0处于置高状态,无法配置") 58 | def ExitCfgMode(self): 59 | if(GPIO.input(self.MD0)): 60 | GPIO.output(self.MD0, GPIO.LOW) 61 | time.sleep(0.5) 62 | else: 63 | print("无线串口未处于配置模式") 64 | def getAUXstatus(self):#读写都加上判断 65 | return GPIO.input(self.AUX) 66 | 67 | #无线串口配置函数 68 | def ConfigWirelessPort(ser,wirelessPort): 69 | configureSuccess = 0 70 | string = str() 71 | wirelessPort.EnterCfgMode() 72 | ser.reset_input_buffer() 73 | ser.reset_output_buffer() 74 | time.sleep(0.1) 75 | ser.write(b"AT\r\n") 76 | time.sleep(0.5) 77 | while ser.inWaiting() != 0: 78 | dataIn = ser.read() 79 | #dataIn = dataIn.decode() 80 | #print("data incoming:",dataIn) 81 | if(dataIn==b'O'): 82 | config = b"AT+RESET\r\n" 83 | ser.write(config) 84 | configureSuccess = 1 85 | time.sleep(0.2) 86 | print("无线串口已上线。") 87 | wirelessPort.Status = 1 88 | baudrate = 9600 89 | ser = serial.Serial("/dev/ttyAMA0",baudrate) 90 | break 91 | if(not configureSuccess): 92 | print("Wireless Serial Port Offline.") 93 | wirelessPort.Status = 0 94 | 95 | wirelessPort.ExitCfgMode() 96 | return ser 97 | 98 | 99 | 100 | 101 | 102 | def AcquireMapData(): 103 | try: 104 | #读取所有点坐标 105 | f = open('LatLong.txt','r') 106 | Mapdata = {} 107 | for line in f: 108 | startIndex = line.find(':') 109 | endIndex = line.find(',') 110 | name = int(line[:startIndex]) 111 | Position0 = float(line[startIndex+1:endIndex]) 112 | startIndex = endIndex 113 | line = line[endIndex+1:] 114 | endIndex = line.find(',') 115 | Position1 = float(line[:endIndex]) 116 | Mapdata[name] = [Position0,Position1] 117 | for key in Mapdata.keys(): 118 | print("Point#%d:%s"%(key,str(Mapdata[key]))) 119 | print("%d Points In Total."%len(Mapdata.keys())) 120 | except FileNotFoundError: 121 | print("Map Data Not Found!") 122 | f.close() 123 | return Mapdata 124 | 125 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LatLong.txt: -------------------------------------------------------------------------------- 1 | 1:122.0771542,37.525824,0 2 | 2:122.0771548,37.5258248,0 3 | 3:122.0771597,37.5258222,0 4 | 4:122.0771622,37.525821,0 5 | 5:122.0771651,37.5258212,0 6 | 6:122.0771687,37.5258204,0 7 | 7:122.0771728,37.5258216,0 8 | 8:122.0771761,37.525825,0 9 | 9:122.0771788,37.5258297,0 10 | 10:122.0771796,37.5258321,0 11 | 11:122.0771813,37.5258382,0 12 | 12:122.0771828,37.5258435,0 13 | 13:122.0771857,37.5258482,0 14 | 14:122.0771885,37.5258533,0 15 | 15:122.0771889,37.5258562,0 16 | 16:122.077188,37.5258607,0 17 | 17:122.0771846,37.5258638,0 18 | 18:122.0771792,37.5258645,0 19 | 19:122.0771732,37.525863,0 20 | 20:122.0771703,37.5258612,0 21 | 21:122.077165,37.5258586,0 22 | 22:122.0771585,37.5258562,0 23 | 23:122.0771519,37.5258555,0 24 | 24:122.0771471,37.5258525,0 25 | 25:122.0771445,37.525851,0 26 | 26:122.0771396,37.5258468,0 27 | -------------------------------------------------------------------------------- /LocationBackup/从车队场地到12公寓.txt: -------------------------------------------------------------------------------- 1 | 1:122.0798381744116,37.53365868092361,0 2 | 2:122.0798822385348,37.5337901295923,0 3 | 3:122.0799626946874,37.53396964788379,0 4 | 4:122.0801721184039,37.53395056048491,0 5 | 5:122.0803532072225,37.53393986520665,0 6 | 6:122.080548295629,37.53393061399319,0 7 | 7:122.0807293089753,37.53393018519977,0 8 | 8:122.0808785195586,37.53393211620206,0 9 | 9:122.0809286443959,37.53390572353602,0 10 | 10:122.0809329827406,37.53385596013391,0 11 | 11:122.0809281169773,37.53377395793353,0 12 | 12:122.0809198225843,37.53369714419735,0 13 | 13:122.0809003230632,37.53360433472216,0 14 | 14:122.0808855265746,37.53350076125706,0 15 | 15:122.0808601885181,37.53340651256328,0 16 | 16:122.0808283958124,37.53329959098392,0 17 | 17:122.0807667903693,37.53315549488042,0 18 | 18:122.0807027163044,37.53302807721941,0 19 | 19:122.080638407156,37.53291627677624,0 20 | 20:122.0805827575191,37.53281178328417,0 21 | 21:122.0805138324526,37.53270548678613,0 22 | 22:122.0804624814983,37.53263413083916,0 23 | 23:122.0803679749986,37.53252921745841,0 24 | 24:122.0801942527038,37.53234840330008,0 25 | -------------------------------------------------------------------------------- /LocationBackup/车队场地小环形.txt: -------------------------------------------------------------------------------- 1 | 1:122.0797581,37.5333334,0 2 | 2:122.0797585,37.5333336,0 3 | 3:122.0797581,37.5333345,0 4 | 4:122.0797573,37.5333347,0 5 | 5:122.079757,37.5333342,0 6 | 6:122.0797572,37.5333339,0 7 | 7:122.0797546,37.5333318,0 8 | 8:122.0797525,37.5333263,0 9 | 9:122.0797503,37.5333187,0 10 | 10:122.0797473,37.5333115,0 11 | 11:122.0797462,37.5333081,0 12 | 12:122.0797437,37.5333006,0 13 | 13:122.0797423,37.5332971,0 14 | 14:122.0797385,37.5332897,0 15 | 15:122.0797357,37.5332819,0 16 | 16:122.0797331,37.5332744,0 17 | 17:122.079732,37.5332701,0 18 | 18:122.0797312,37.533266,0 19 | 19:122.07973,37.5332573,0 20 | 20:122.0797291,37.5332533,0 21 | 21:122.0797283,37.533249,0 22 | 22:122.0797277,37.5332409,0 23 | 23:122.0797272,37.5332368,0 24 | 24:122.0797275,37.5332326,0 25 | 25:122.0797275,37.5332242,0 26 | 26:122.0797258,37.533216,0 27 | 27:122.0797257,37.5332118,0 28 | 28:122.0797256,37.5332078,0 29 | 29:122.0797262,37.5331993,0 30 | 30:122.0797255,37.5331955,0 31 | 31:122.0797252,37.5331866,0 32 | 32:122.079725,37.5331773,0 33 | 33:122.0797256,37.5331728,0 34 | 34:122.0797265,37.533168,0 35 | 35:122.0797292,37.5331584,0 36 | 36:122.0797323,37.5331486,0 37 | 37:122.0797338,37.5331441,0 38 | 38:122.0797368,37.5331394,0 39 | 39:122.0797392,37.5331352,0 40 | 40:122.0797451,37.5331268,0 41 | 41:122.0797534,37.5331195,0 42 | 42:122.0797567,37.5331161,0 43 | 43:122.07976,37.5331131,0 44 | 44:122.0797684,37.5331064,0 45 | 45:122.0797731,37.5331039,0 46 | 46:122.0797785,37.5331019,0 47 | 47:122.0797886,37.5330988,0 48 | 48:122.0797939,37.5330968,0 49 | 49:122.0797995,37.5330963,0 50 | 50:122.0798171,37.5330964,0 51 | 51:122.0798224,37.5330974,0 52 | 52:122.0798335,37.5331001,0 53 | 53:122.0798389,37.5331011,0 54 | 54:122.0798448,37.5331026,0 55 | 55:122.0798546,37.5331069,0 56 | 56:122.0798593,37.5331094,0 57 | 57:122.0798637,37.5331113,0 58 | 58:122.0798716,37.5331165,0 59 | 59:122.0798755,37.5331189,0 60 | 60:122.0798831,37.5331254,0 61 | 61:122.0798859,37.5331293,0 62 | 62:122.0798892,37.5331332,0 63 | 63:122.0798955,37.533142,0 64 | 64:122.0798975,37.5331463,0 65 | 65:122.0798988,37.5331557,0 66 | 66:122.0798988,37.5331599,0 67 | 67:122.0798979,37.5331645,0 68 | 68:122.0798961,37.5331737,0 69 | 69:122.0798937,37.5331784,0 70 | 70:122.0798881,37.5331869,0 71 | 71:122.0798849,37.5331904,0 72 | 72:122.0798786,37.5331988,0 73 | 73:122.0798757,37.5332027,0 74 | 74:122.0798687,37.5332107,0 75 | 75:122.0798656,37.5332145,0 76 | 76:122.0798591,37.5332227,0 77 | 77:122.0798554,37.5332269,0 78 | 78:122.0798523,37.5332312,0 79 | 79:122.0798462,37.5332401,0 80 | 80:122.0798431,37.5332441,0 81 | 81:122.0798403,37.5332484,0 82 | 82:122.0798351,37.5332568,0 83 | 83:122.0798288,37.533265,0 84 | 84:122.0798259,37.5332692,0 85 | 85:122.0798193,37.5332766,0 86 | 86:122.0798125,37.5332837,0 87 | 87:122.0798087,37.5332872,0 88 | 88:122.0798048,37.5332903,0 89 | 89:122.0798005,37.5332961,0 90 | 90:122.0797995,37.5332981,0 91 | 91:122.0797976,37.5333007,0 92 | 92:122.0797967,37.5333025,0 93 | -------------------------------------------------------------------------------- /LocationTrans/.ipynb_checkpoints/Untitled-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 132, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "outputData={}\n", 10 | "StartLoop = 0\n", 11 | "nameNotFound = 1\n", 12 | "posNotFound = 1" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": 133, 18 | "metadata": {}, 19 | "outputs": [], 20 | "source": [ 21 | "f = open(\"MapData.kml\",\"r\")\n", 22 | "fw = open(\"LatLong.kml\",\"w\")" 23 | ] 24 | }, 25 | { 26 | "cell_type": "code", 27 | "execution_count": 134, 28 | "metadata": { 29 | "scrolled": false 30 | }, 31 | "outputs": [ 32 | { 33 | "name": "stdout", 34 | "output_type": "stream", 35 | "text": [ 36 | "a1:120.520163178378,36.89206629053305,0\n", 37 | "a2:120.5193894447255,36.89284333308383,0\n", 38 | "a3:120.5190596853301,36.89239965021736,0\n" 39 | ] 40 | } 41 | ], 42 | "source": [ 43 | "f.seek(0,0) #首先把文件指针移动到初始位置\n", 44 | "dataPoint = f.readlines()\n", 45 | "for line in dataPoint:\n", 46 | " nameIndex = line.find('')\n", 47 | " if(nameIndex != -1):#找到了题头\n", 48 | " StartLoop = 1\n", 49 | " \n", 50 | " if(StartLoop):\n", 51 | " if(nameNotFound):\n", 52 | " nameIndexBegin = line.find('')\n", 53 | " nameIndexEnd = line.find('')\n", 54 | " if(nameIndexBegin != -1):\n", 55 | " name = line[nameIndexBegin+len(''):nameIndexEnd]\n", 56 | " nameNotFound = 0\n", 57 | " elif((not nameNotFound) and posNotFound):\n", 58 | " posIndexBegin = line.find('')\n", 59 | " posIndexEnd = line.find('')\n", 60 | " if(posIndexBegin != -1):\n", 61 | " pos = line[posIndexBegin+len(''):posIndexEnd]\n", 62 | " outputData[name]=pos.split(',')\n", 63 | " posNotFound = 0\n", 64 | " else:\n", 65 | " posNotFound = 1\n", 66 | " nameNotFound = 1\n", 67 | "\n", 68 | "f.close()\n", 69 | "for item in outputData:\n", 70 | " print(item + ':' + outputData[item][0] + ',' + outputData[item][1] + ',' + outputData[item][2])\n", 71 | " fw.write(item + ':' + outputData[item][0] + ',' + outputData[item][1] + ',' + outputData[item][2] + '\\n') \n", 72 | "fw.close()\n" 73 | ] 74 | }, 75 | { 76 | "cell_type": "code", 77 | "execution_count": null, 78 | "metadata": {}, 79 | "outputs": [], 80 | "source": [] 81 | } 82 | ], 83 | "metadata": { 84 | "kernelspec": { 85 | "display_name": "Python 3", 86 | "language": "python", 87 | "name": "python3" 88 | }, 89 | "language_info": { 90 | "codemirror_mode": { 91 | "name": "ipython", 92 | "version": 3 93 | }, 94 | "file_extension": ".py", 95 | "mimetype": "text/x-python", 96 | "name": "python", 97 | "nbconvert_exporter": "python", 98 | "pygments_lexer": "ipython3", 99 | "version": "3.6.6" 100 | } 101 | }, 102 | "nbformat": 4, 103 | "nbformat_minor": 2 104 | } 105 | -------------------------------------------------------------------------------- /LocationTrans/.ipynb_checkpoints/Untitled1-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 122, 6 | "metadata": { 7 | "scrolled": true 8 | }, 9 | "outputs": [], 10 | "source": [ 11 | "fw = open(\"MapDataOutput1.kml\",\"w+\")\n", 12 | "f = open(\"LatLong.txt\",\"r\")\n", 13 | "test = open(\"MapData.kml\",\"r\") #open(\"CONFIGURE/t.kml\",\"r\")#,encoding='gb18030',errors='ignore')#,encoding='UTF-8')#,encoding='gb18030',errors='ignore')" 14 | ] 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": 123, 19 | "metadata": {}, 20 | "outputs": [ 21 | { 22 | "name": "stdout", 23 | "output_type": "stream", 24 | "text": [ 25 | "\n", 26 | "\n", 27 | "\n", 28 | "\n", 29 | "\n", 30 | "\n", 31 | "\tMapData.kml\n", 32 | "\n", 33 | "\t\n", 50 | "\n", 51 | "\t\n", 52 | "\n", 53 | "\t\t\n", 54 | "\n", 55 | "\t\t\tnormal\n", 56 | "\n", 57 | "\t\t\t#s_ylw-pushpin\n", 58 | "\n", 59 | "\t\t\n", 60 | "\n", 61 | "\t\t\n", 62 | "\n", 63 | "\t\t\thighlight\n", 64 | "\n", 65 | "\t\t\t#s_ylw-pushpin_hl\n", 66 | "\n", 67 | "\t\t\n", 68 | "\n", 69 | "\t\n", 70 | "\n", 71 | "\t\n", 88 | "\n", 89 | "\t\n", 90 | "\n", 91 | "\t\t涓存椂浣嶇疆\n", 92 | "\n", 93 | "\t\t1\n", 94 | "\n", 95 | "\t\t\n", 96 | "\n" 97 | ] 98 | } 99 | ], 100 | "source": [ 101 | "for line in test:\n", 102 | " state = line.find(\"\")\n", 103 | " print(line)\n", 104 | " if(state == -1):\n", 105 | " fw.write(line)\n", 106 | " else:\n", 107 | " break" 108 | ] 109 | }, 110 | { 111 | "cell_type": "code", 112 | "execution_count": 124, 113 | "metadata": { 114 | "scrolled": true 115 | }, 116 | "outputs": [ 117 | { 118 | "name": "stdout", 119 | "output_type": "stream", 120 | "text": [ 121 | "name:a1 lat:120.520163178378 lon:36.89206629053305\n", 122 | "name:a2 lat:120.5193894447255 lon:36.89284333308383\n", 123 | "name:a3 lat:120.5190596853301 lon:36.89239965021736\n", 124 | "name:a4 lat:120.5162256 lon:36.8934955\n" 125 | ] 126 | } 127 | ], 128 | "source": [ 129 | "f.seek(0,0)\n", 130 | "for line in f:\n", 131 | " spliter = line.find(\":\")\n", 132 | " name = line[:spliter]\n", 133 | " spliter_latlon = line.find(\",\")\n", 134 | " lon = line[spliter+1:spliter_latlon]\n", 135 | " line =line[spliter_latlon+1:]\n", 136 | " spliter_latlon = line.find(\",\")\n", 137 | " lat = line[:spliter_latlon]\n", 138 | " print( \"\\t\\t\\t\\n\\t\\t\\t{0}\\n\\t\\t\\t\\n\\t\\t\\t\\t{1}\\n\\t\\t\\t\\t{2}\\n\\t\\t\\t\\t0\\n\\t\\t\\t\\t0\\n\\t\\t\\t\\t0\\n\\t\\t\\t\\t728.8612258819933\\n\\t\\t\\t\\trelativeToSeaFloor\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t#m_ylw-pushpin\\n\\t\\t\\t\\n\\t\\t\\t\\t1\\n\\t\\t\\t\\t{1},{2},0\\n\\t\\t\\t\\t\\n\\t\\t\\t\\n\".format(name,lon,lat),file=fw)\n", 139 | " print(\"name:%s lat:%s lon:%s\"%(name,lon,lat))" 140 | ] 141 | }, 142 | { 143 | "cell_type": "code", 144 | "execution_count": 125, 145 | "metadata": {}, 146 | "outputs": [], 147 | "source": [ 148 | "print(\"\\n\\n\\n\",file=fw)\n", 149 | "fw.close()\n", 150 | "f.close()\n", 151 | "test.close()" 152 | ] 153 | }, 154 | { 155 | "cell_type": "code", 156 | "execution_count": 118, 157 | "metadata": {}, 158 | "outputs": [ 159 | { 160 | "name": "stdout", 161 | "output_type": "stream", 162 | "text": [ 163 | "\t\t\t\n", 164 | "\n", 165 | "\t\t\ta1\n", 166 | "\n", 167 | "\t\t\t\n", 168 | "\n", 169 | "\t\t\t\t120.520163178378\n", 170 | "\n", 171 | "\t\t\t\t36.89206629053305\n", 172 | "\n", 173 | "\t\t\t\t0\n", 174 | "\n", 175 | "\t\t\t\t0\n", 176 | "\n", 177 | "\t\t\t\t0\n", 178 | "\n", 179 | "\t\t\t\t728.8612258819933\n", 180 | "\n", 181 | "\t\t\t\trelativeToSeaFloor\n", 182 | "\n", 183 | "\t\t\t\t\n", 184 | "\n", 185 | "\t\t\t\t#m_ylw-pushpin\n", 186 | "\n", 187 | "\t\t\t\n", 188 | "\n", 189 | "\t\t\t\t1\n", 190 | "\n", 191 | "\t\t\t\t120.520163178378,36.89206629053305,0\n", 192 | "\n", 193 | "\t\t\t\t\n", 194 | "\n", 195 | "\t\t\t\n", 196 | "\n", 197 | "\n", 198 | "\n", 199 | "\t\t\t\n", 200 | "\n", 201 | "\t\t\ta2\n", 202 | "\n", 203 | "\t\t\t\n", 204 | "\n", 205 | "\t\t\t\t120.5193894447255\n", 206 | "\n", 207 | "\t\t\t\t36.89284333308383\n", 208 | "\n", 209 | "\t\t\t\t0\n", 210 | "\n", 211 | "\t\t\t\t0\n", 212 | "\n", 213 | "\t\t\t\t0\n", 214 | "\n", 215 | "\t\t\t\t728.8612258819933\n", 216 | "\n", 217 | "\t\t\t\trelativeToSeaFloor\n", 218 | "\n", 219 | "\t\t\t\t\n", 220 | "\n", 221 | "\t\t\t\t#m_ylw-pushpin\n", 222 | "\n", 223 | "\t\t\t\n", 224 | "\n", 225 | "\t\t\t\t1\n", 226 | "\n", 227 | "\t\t\t\t120.5193894447255,36.89284333308383,0\n", 228 | "\n", 229 | "\t\t\t\t\n", 230 | "\n", 231 | "\t\t\t\n", 232 | "\n", 233 | "\n", 234 | "\n", 235 | "\t\t\t\n", 236 | "\n", 237 | "\t\t\ta3\n", 238 | "\n", 239 | "\t\t\t\n", 240 | "\n", 241 | "\t\t\t\t120.5190596853301\n", 242 | "\n", 243 | "\t\t\t\t36.89239965021736\n", 244 | "\n", 245 | "\t\t\t\t0\n", 246 | "\n", 247 | "\t\t\t\t0\n", 248 | "\n", 249 | "\t\t\t\t0\n", 250 | "\n", 251 | "\t\t\t\t728.8612258819933\n", 252 | "\n", 253 | "\t\t\t\trelativeToSeaFloor\n", 254 | "\n", 255 | "\t\t\t\t\n", 256 | "\n", 257 | "\t\t\t\t#m_ylw-pushpin\n", 258 | "\n", 259 | "\t\t\t\n", 260 | "\n", 261 | "\t\t\t\t1\n", 262 | "\n", 263 | "\t\t\t\t120.5190596853301,36.89239965021736,0\n", 264 | "\n", 265 | "\t\t\t\t\n", 266 | "\n", 267 | "\t\t\t\n", 268 | "\n", 269 | "\n", 270 | "\n", 271 | "\t\t\t\n", 272 | "\n", 273 | "\t\t\ta4\n", 274 | "\n", 275 | "\t\t\t\n", 276 | "\n", 277 | "\t\t\t\t120.5162256\n", 278 | "\n", 279 | "\t\t\t\t36.8934955\n", 280 | "\n", 281 | "\t\t\t\t0\n", 282 | "\n", 283 | "\t\t\t\t0\n", 284 | "\n", 285 | "\t\t\t\t0\n", 286 | "\n", 287 | "\t\t\t\t728.8612258819933\n", 288 | "\n", 289 | "\t\t\t\trelativeToSeaFloor\n", 290 | "\n", 291 | "\t\t\t\t\n", 292 | "\n", 293 | "\t\t\t\t#m_ylw-pushpin\n", 294 | "\n", 295 | "\t\t\t\n", 296 | "\n", 297 | "\t\t\t\t1\n", 298 | "\n", 299 | "\t\t\t\t120.5162256,36.8934955,0\n", 300 | "\n", 301 | "\t\t\t\t\n", 302 | "\n", 303 | "\t\t\t\n", 304 | "\n", 305 | "\n", 306 | "\n", 307 | "\n", 308 | "\n", 309 | "\n", 310 | "\n", 311 | "\n", 312 | "\n", 313 | "\n", 314 | "\n" 315 | ] 316 | } 317 | ], 318 | "source": [ 319 | "fw = open(\"MapDataOutput1.kml\",\"r\")\n", 320 | "for line in fw:\n", 321 | " print(line)" 322 | ] 323 | }, 324 | { 325 | "cell_type": "code", 326 | "execution_count": 119, 327 | "metadata": {}, 328 | "outputs": [], 329 | "source": [ 330 | "fw.close()" 331 | ] 332 | }, 333 | { 334 | "cell_type": "code", 335 | "execution_count": null, 336 | "metadata": {}, 337 | "outputs": [], 338 | "source": [] 339 | } 340 | ], 341 | "metadata": { 342 | "kernelspec": { 343 | "display_name": "Python 3", 344 | "language": "python", 345 | "name": "python3" 346 | }, 347 | "language_info": { 348 | "codemirror_mode": { 349 | "name": "ipython", 350 | "version": 3 351 | }, 352 | "file_extension": ".py", 353 | "mimetype": "text/x-python", 354 | "name": "python", 355 | "nbconvert_exporter": "python", 356 | "pygments_lexer": "ipython3", 357 | "version": "3.6.6" 358 | } 359 | }, 360 | "nbformat": 4, 361 | "nbformat_minor": 2 362 | } 363 | -------------------------------------------------------------------------------- /LocationTrans/CONFIGURE/Basis.kml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | MapData.kml 5 | 14 | 15 | 16 | normal 17 | #s_ylw-pushpin 18 | 19 | 20 | highlight 21 | #s_ylw-pushpin_hl 22 | 23 | 24 | 33 | 34 | 临时位置 35 | 1 36 | 37 | a1 38 | 39 | 120.5201631783779 40 | 36.89206629053305 41 | 0 42 | 0.0009283321903380009 43 | 0 44 | 729.5832683227507 45 | relativeToSeaFloor 46 | 47 | #m_ylw-pushpin 48 | 49 | 1 50 | 120.520163178378,36.89206629053305,0 51 | 52 | 53 | 54 | a2 55 | 56 | 120.5201631783779 57 | 36.89206629053305 58 | 0 59 | 0.0009283321903380009 60 | 0 61 | 729.5832683227507 62 | relativeToSeaFloor 63 | 64 | #m_ylw-pushpin 65 | 66 | 1 67 | 120.5193894447255,36.89284333308383,0 68 | 69 | 70 | 71 | a3 72 | 73 | 120.5196914785991 74 | 36.89206629308877 75 | 0 76 | 0.000645166337686031 77 | 0 78 | 728.8612258819933 79 | relativeToSeaFloor 80 | 81 | #m_ylw-pushpin 82 | 83 | 1 84 | 120.5190596853301,36.89239965021736,0 85 | 86 | 87 | 88 | a4 89 | 90 | 120.5162256 91 | 36.8934955 92 | 0 93 | 0.000645166337686031 94 | 0 95 | 728.8612258819933 96 | relativeToSeaFloor 97 | 98 | #m_ylw-pushpin 99 | 100 | 1 101 | 120.5162256,36.8934955,0 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /LocationTrans/LatLong.txt: -------------------------------------------------------------------------------- 1 | 1:122.0797581,37.5333334,0 2 | 2:122.0797585,37.5333336,0 3 | 3:122.0797581,37.5333345,0 4 | 4:122.0797573,37.5333347,0 5 | 5:122.079757,37.5333342,0 6 | 6:122.0797572,37.5333339,0 7 | 7:122.0797546,37.5333318,0 8 | 8:122.0797525,37.5333263,0 9 | 9:122.0797503,37.5333187,0 10 | 10:122.0797473,37.5333115,0 11 | 11:122.0797462,37.5333081,0 12 | 12:122.0797437,37.5333006,0 13 | 13:122.0797423,37.5332971,0 14 | 14:122.0797385,37.5332897,0 15 | 15:122.0797357,37.5332819,0 16 | 16:122.0797331,37.5332744,0 17 | 17:122.079732,37.5332701,0 18 | 18:122.0797312,37.533266,0 19 | 19:122.07973,37.5332573,0 20 | 20:122.0797291,37.5332533,0 21 | 21:122.0797283,37.533249,0 22 | 22:122.0797277,37.5332409,0 23 | 23:122.0797272,37.5332368,0 24 | 24:122.0797275,37.5332326,0 25 | 25:122.0797275,37.5332242,0 26 | 26:122.0797258,37.533216,0 27 | 27:122.0797257,37.5332118,0 28 | 28:122.0797256,37.5332078,0 29 | 29:122.0797262,37.5331993,0 30 | 30:122.0797255,37.5331955,0 31 | 31:122.0797252,37.5331866,0 32 | 32:122.079725,37.5331773,0 33 | 33:122.0797256,37.5331728,0 34 | 34:122.0797265,37.533168,0 35 | 35:122.0797292,37.5331584,0 36 | 36:122.0797323,37.5331486,0 37 | 37:122.0797338,37.5331441,0 38 | 38:122.0797368,37.5331394,0 39 | 39:122.0797392,37.5331352,0 40 | 40:122.0797451,37.5331268,0 41 | 41:122.0797534,37.5331195,0 42 | 42:122.0797567,37.5331161,0 43 | 43:122.07976,37.5331131,0 44 | 44:122.0797684,37.5331064,0 45 | 45:122.0797731,37.5331039,0 46 | 46:122.0797785,37.5331019,0 47 | 47:122.0797886,37.5330988,0 48 | 48:122.0797939,37.5330968,0 49 | 49:122.0797995,37.5330963,0 50 | 50:122.0798171,37.5330964,0 51 | 51:122.0798224,37.5330974,0 52 | 52:122.0798335,37.5331001,0 53 | 53:122.0798389,37.5331011,0 54 | 54:122.0798448,37.5331026,0 55 | 55:122.0798546,37.5331069,0 56 | 56:122.0798593,37.5331094,0 57 | 57:122.0798637,37.5331113,0 58 | 58:122.0798716,37.5331165,0 59 | 59:122.0798755,37.5331189,0 60 | 60:122.0798831,37.5331254,0 61 | 61:122.0798859,37.5331293,0 62 | 62:122.0798892,37.5331332,0 63 | 63:122.0798955,37.533142,0 64 | 64:122.0798975,37.5331463,0 65 | 65:122.0798988,37.5331557,0 66 | 66:122.0798988,37.5331599,0 67 | 67:122.0798979,37.5331645,0 68 | 68:122.0798961,37.5331737,0 69 | 69:122.0798937,37.5331784,0 70 | 70:122.0798881,37.5331869,0 71 | 71:122.0798849,37.5331904,0 72 | 72:122.0798786,37.5331988,0 73 | 73:122.0798757,37.5332027,0 74 | 74:122.0798687,37.5332107,0 75 | 75:122.0798656,37.5332145,0 76 | 76:122.0798591,37.5332227,0 77 | 77:122.0798554,37.5332269,0 78 | 78:122.0798523,37.5332312,0 79 | 79:122.0798462,37.5332401,0 80 | 80:122.0798431,37.5332441,0 81 | 81:122.0798403,37.5332484,0 82 | 82:122.0798351,37.5332568,0 83 | 83:122.0798288,37.533265,0 84 | 84:122.0798259,37.5332692,0 85 | 85:122.0798193,37.5332766,0 86 | 86:122.0798125,37.5332837,0 87 | 87:122.0798087,37.5332872,0 88 | 88:122.0798048,37.5332903,0 89 | 89:122.0798005,37.5332961,0 90 | 90:122.0797995,37.5332981,0 91 | 91:122.0797976,37.5333007,0 92 | 92:122.0797967,37.5333025,0 93 | -------------------------------------------------------------------------------- /LocationTrans/MapDataOutput1.kml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | MapData.kml 5 | 14 | 15 | 16 | normal 17 | #s_ylw-pushpin 18 | 19 | 20 | highlight 21 | #s_ylw-pushpin_hl 22 | 23 | 24 | 33 | 34 | 临时位置 35 | 1 36 | 37 | 1 38 | 39 | 122.0797581 40 | 37.5333334 41 | 0 42 | 0 43 | 0 44 | 728.8612258819933 45 | relativeToSeaFloor 46 | 47 | #m_ylw-pushpin 48 | 49 | 1 50 | 122.0797581,37.5333334,0 51 | 52 | 53 | 54 | 55 | 2 56 | 57 | 122.0797585 58 | 37.5333336 59 | 0 60 | 0 61 | 0 62 | 728.8612258819933 63 | relativeToSeaFloor 64 | 65 | #m_ylw-pushpin 66 | 67 | 1 68 | 122.0797585,37.5333336,0 69 | 70 | 71 | 72 | 73 | 3 74 | 75 | 122.0797581 76 | 37.5333345 77 | 0 78 | 0 79 | 0 80 | 728.8612258819933 81 | relativeToSeaFloor 82 | 83 | #m_ylw-pushpin 84 | 85 | 1 86 | 122.0797581,37.5333345,0 87 | 88 | 89 | 90 | 91 | 4 92 | 93 | 122.0797573 94 | 37.5333347 95 | 0 96 | 0 97 | 0 98 | 728.8612258819933 99 | relativeToSeaFloor 100 | 101 | #m_ylw-pushpin 102 | 103 | 1 104 | 122.0797573,37.5333347,0 105 | 106 | 107 | 108 | 109 | 5 110 | 111 | 122.079757 112 | 37.5333342 113 | 0 114 | 0 115 | 0 116 | 728.8612258819933 117 | relativeToSeaFloor 118 | 119 | #m_ylw-pushpin 120 | 121 | 1 122 | 122.079757,37.5333342,0 123 | 124 | 125 | 126 | 127 | 6 128 | 129 | 122.0797572 130 | 37.5333339 131 | 0 132 | 0 133 | 0 134 | 728.8612258819933 135 | relativeToSeaFloor 136 | 137 | #m_ylw-pushpin 138 | 139 | 1 140 | 122.0797572,37.5333339,0 141 | 142 | 143 | 144 | 145 | 7 146 | 147 | 122.0797546 148 | 37.5333318 149 | 0 150 | 0 151 | 0 152 | 728.8612258819933 153 | relativeToSeaFloor 154 | 155 | #m_ylw-pushpin 156 | 157 | 1 158 | 122.0797546,37.5333318,0 159 | 160 | 161 | 162 | 163 | 8 164 | 165 | 122.0797525 166 | 37.5333263 167 | 0 168 | 0 169 | 0 170 | 728.8612258819933 171 | relativeToSeaFloor 172 | 173 | #m_ylw-pushpin 174 | 175 | 1 176 | 122.0797525,37.5333263,0 177 | 178 | 179 | 180 | 181 | 9 182 | 183 | 122.0797503 184 | 37.5333187 185 | 0 186 | 0 187 | 0 188 | 728.8612258819933 189 | relativeToSeaFloor 190 | 191 | #m_ylw-pushpin 192 | 193 | 1 194 | 122.0797503,37.5333187,0 195 | 196 | 197 | 198 | 199 | 10 200 | 201 | 122.0797473 202 | 37.5333115 203 | 0 204 | 0 205 | 0 206 | 728.8612258819933 207 | relativeToSeaFloor 208 | 209 | #m_ylw-pushpin 210 | 211 | 1 212 | 122.0797473,37.5333115,0 213 | 214 | 215 | 216 | 217 | 11 218 | 219 | 122.0797462 220 | 37.5333081 221 | 0 222 | 0 223 | 0 224 | 728.8612258819933 225 | relativeToSeaFloor 226 | 227 | #m_ylw-pushpin 228 | 229 | 1 230 | 122.0797462,37.5333081,0 231 | 232 | 233 | 234 | 235 | 12 236 | 237 | 122.0797437 238 | 37.5333006 239 | 0 240 | 0 241 | 0 242 | 728.8612258819933 243 | relativeToSeaFloor 244 | 245 | #m_ylw-pushpin 246 | 247 | 1 248 | 122.0797437,37.5333006,0 249 | 250 | 251 | 252 | 253 | 13 254 | 255 | 122.0797423 256 | 37.5332971 257 | 0 258 | 0 259 | 0 260 | 728.8612258819933 261 | relativeToSeaFloor 262 | 263 | #m_ylw-pushpin 264 | 265 | 1 266 | 122.0797423,37.5332971,0 267 | 268 | 269 | 270 | 271 | 14 272 | 273 | 122.0797385 274 | 37.5332897 275 | 0 276 | 0 277 | 0 278 | 728.8612258819933 279 | relativeToSeaFloor 280 | 281 | #m_ylw-pushpin 282 | 283 | 1 284 | 122.0797385,37.5332897,0 285 | 286 | 287 | 288 | 289 | 15 290 | 291 | 122.0797357 292 | 37.5332819 293 | 0 294 | 0 295 | 0 296 | 728.8612258819933 297 | relativeToSeaFloor 298 | 299 | #m_ylw-pushpin 300 | 301 | 1 302 | 122.0797357,37.5332819,0 303 | 304 | 305 | 306 | 307 | 16 308 | 309 | 122.0797331 310 | 37.5332744 311 | 0 312 | 0 313 | 0 314 | 728.8612258819933 315 | relativeToSeaFloor 316 | 317 | #m_ylw-pushpin 318 | 319 | 1 320 | 122.0797331,37.5332744,0 321 | 322 | 323 | 324 | 325 | 17 326 | 327 | 122.079732 328 | 37.5332701 329 | 0 330 | 0 331 | 0 332 | 728.8612258819933 333 | relativeToSeaFloor 334 | 335 | #m_ylw-pushpin 336 | 337 | 1 338 | 122.079732,37.5332701,0 339 | 340 | 341 | 342 | 343 | 18 344 | 345 | 122.0797312 346 | 37.533266 347 | 0 348 | 0 349 | 0 350 | 728.8612258819933 351 | relativeToSeaFloor 352 | 353 | #m_ylw-pushpin 354 | 355 | 1 356 | 122.0797312,37.533266,0 357 | 358 | 359 | 360 | 361 | 19 362 | 363 | 122.07973 364 | 37.5332573 365 | 0 366 | 0 367 | 0 368 | 728.8612258819933 369 | relativeToSeaFloor 370 | 371 | #m_ylw-pushpin 372 | 373 | 1 374 | 122.07973,37.5332573,0 375 | 376 | 377 | 378 | 379 | 20 380 | 381 | 122.0797291 382 | 37.5332533 383 | 0 384 | 0 385 | 0 386 | 728.8612258819933 387 | relativeToSeaFloor 388 | 389 | #m_ylw-pushpin 390 | 391 | 1 392 | 122.0797291,37.5332533,0 393 | 394 | 395 | 396 | 397 | 21 398 | 399 | 122.0797283 400 | 37.533249 401 | 0 402 | 0 403 | 0 404 | 728.8612258819933 405 | relativeToSeaFloor 406 | 407 | #m_ylw-pushpin 408 | 409 | 1 410 | 122.0797283,37.533249,0 411 | 412 | 413 | 414 | 415 | 22 416 | 417 | 122.0797277 418 | 37.5332409 419 | 0 420 | 0 421 | 0 422 | 728.8612258819933 423 | relativeToSeaFloor 424 | 425 | #m_ylw-pushpin 426 | 427 | 1 428 | 122.0797277,37.5332409,0 429 | 430 | 431 | 432 | 433 | 23 434 | 435 | 122.0797272 436 | 37.5332368 437 | 0 438 | 0 439 | 0 440 | 728.8612258819933 441 | relativeToSeaFloor 442 | 443 | #m_ylw-pushpin 444 | 445 | 1 446 | 122.0797272,37.5332368,0 447 | 448 | 449 | 450 | 451 | 24 452 | 453 | 122.0797275 454 | 37.5332326 455 | 0 456 | 0 457 | 0 458 | 728.8612258819933 459 | relativeToSeaFloor 460 | 461 | #m_ylw-pushpin 462 | 463 | 1 464 | 122.0797275,37.5332326,0 465 | 466 | 467 | 468 | 469 | 25 470 | 471 | 122.0797275 472 | 37.5332242 473 | 0 474 | 0 475 | 0 476 | 728.8612258819933 477 | relativeToSeaFloor 478 | 479 | #m_ylw-pushpin 480 | 481 | 1 482 | 122.0797275,37.5332242,0 483 | 484 | 485 | 486 | 487 | 26 488 | 489 | 122.0797258 490 | 37.533216 491 | 0 492 | 0 493 | 0 494 | 728.8612258819933 495 | relativeToSeaFloor 496 | 497 | #m_ylw-pushpin 498 | 499 | 1 500 | 122.0797258,37.533216,0 501 | 502 | 503 | 504 | 505 | 27 506 | 507 | 122.0797257 508 | 37.5332118 509 | 0 510 | 0 511 | 0 512 | 728.8612258819933 513 | relativeToSeaFloor 514 | 515 | #m_ylw-pushpin 516 | 517 | 1 518 | 122.0797257,37.5332118,0 519 | 520 | 521 | 522 | 523 | 28 524 | 525 | 122.0797256 526 | 37.5332078 527 | 0 528 | 0 529 | 0 530 | 728.8612258819933 531 | relativeToSeaFloor 532 | 533 | #m_ylw-pushpin 534 | 535 | 1 536 | 122.0797256,37.5332078,0 537 | 538 | 539 | 540 | 541 | 29 542 | 543 | 122.0797262 544 | 37.5331993 545 | 0 546 | 0 547 | 0 548 | 728.8612258819933 549 | relativeToSeaFloor 550 | 551 | #m_ylw-pushpin 552 | 553 | 1 554 | 122.0797262,37.5331993,0 555 | 556 | 557 | 558 | 559 | 30 560 | 561 | 122.0797255 562 | 37.5331955 563 | 0 564 | 0 565 | 0 566 | 728.8612258819933 567 | relativeToSeaFloor 568 | 569 | #m_ylw-pushpin 570 | 571 | 1 572 | 122.0797255,37.5331955,0 573 | 574 | 575 | 576 | 577 | 31 578 | 579 | 122.0797252 580 | 37.5331866 581 | 0 582 | 0 583 | 0 584 | 728.8612258819933 585 | relativeToSeaFloor 586 | 587 | #m_ylw-pushpin 588 | 589 | 1 590 | 122.0797252,37.5331866,0 591 | 592 | 593 | 594 | 595 | 32 596 | 597 | 122.079725 598 | 37.5331773 599 | 0 600 | 0 601 | 0 602 | 728.8612258819933 603 | relativeToSeaFloor 604 | 605 | #m_ylw-pushpin 606 | 607 | 1 608 | 122.079725,37.5331773,0 609 | 610 | 611 | 612 | 613 | 33 614 | 615 | 122.0797256 616 | 37.5331728 617 | 0 618 | 0 619 | 0 620 | 728.8612258819933 621 | relativeToSeaFloor 622 | 623 | #m_ylw-pushpin 624 | 625 | 1 626 | 122.0797256,37.5331728,0 627 | 628 | 629 | 630 | 631 | 34 632 | 633 | 122.0797265 634 | 37.533168 635 | 0 636 | 0 637 | 0 638 | 728.8612258819933 639 | relativeToSeaFloor 640 | 641 | #m_ylw-pushpin 642 | 643 | 1 644 | 122.0797265,37.533168,0 645 | 646 | 647 | 648 | 649 | 35 650 | 651 | 122.0797292 652 | 37.5331584 653 | 0 654 | 0 655 | 0 656 | 728.8612258819933 657 | relativeToSeaFloor 658 | 659 | #m_ylw-pushpin 660 | 661 | 1 662 | 122.0797292,37.5331584,0 663 | 664 | 665 | 666 | 667 | 36 668 | 669 | 122.0797323 670 | 37.5331486 671 | 0 672 | 0 673 | 0 674 | 728.8612258819933 675 | relativeToSeaFloor 676 | 677 | #m_ylw-pushpin 678 | 679 | 1 680 | 122.0797323,37.5331486,0 681 | 682 | 683 | 684 | 685 | 37 686 | 687 | 122.0797338 688 | 37.5331441 689 | 0 690 | 0 691 | 0 692 | 728.8612258819933 693 | relativeToSeaFloor 694 | 695 | #m_ylw-pushpin 696 | 697 | 1 698 | 122.0797338,37.5331441,0 699 | 700 | 701 | 702 | 703 | 38 704 | 705 | 122.0797368 706 | 37.5331394 707 | 0 708 | 0 709 | 0 710 | 728.8612258819933 711 | relativeToSeaFloor 712 | 713 | #m_ylw-pushpin 714 | 715 | 1 716 | 122.0797368,37.5331394,0 717 | 718 | 719 | 720 | 721 | 39 722 | 723 | 122.0797392 724 | 37.5331352 725 | 0 726 | 0 727 | 0 728 | 728.8612258819933 729 | relativeToSeaFloor 730 | 731 | #m_ylw-pushpin 732 | 733 | 1 734 | 122.0797392,37.5331352,0 735 | 736 | 737 | 738 | 739 | 40 740 | 741 | 122.0797451 742 | 37.5331268 743 | 0 744 | 0 745 | 0 746 | 728.8612258819933 747 | relativeToSeaFloor 748 | 749 | #m_ylw-pushpin 750 | 751 | 1 752 | 122.0797451,37.5331268,0 753 | 754 | 755 | 756 | 757 | 41 758 | 759 | 122.0797534 760 | 37.5331195 761 | 0 762 | 0 763 | 0 764 | 728.8612258819933 765 | relativeToSeaFloor 766 | 767 | #m_ylw-pushpin 768 | 769 | 1 770 | 122.0797534,37.5331195,0 771 | 772 | 773 | 774 | 775 | 42 776 | 777 | 122.0797567 778 | 37.5331161 779 | 0 780 | 0 781 | 0 782 | 728.8612258819933 783 | relativeToSeaFloor 784 | 785 | #m_ylw-pushpin 786 | 787 | 1 788 | 122.0797567,37.5331161,0 789 | 790 | 791 | 792 | 793 | 43 794 | 795 | 122.07976 796 | 37.5331131 797 | 0 798 | 0 799 | 0 800 | 728.8612258819933 801 | relativeToSeaFloor 802 | 803 | #m_ylw-pushpin 804 | 805 | 1 806 | 122.07976,37.5331131,0 807 | 808 | 809 | 810 | 811 | 44 812 | 813 | 122.0797684 814 | 37.5331064 815 | 0 816 | 0 817 | 0 818 | 728.8612258819933 819 | relativeToSeaFloor 820 | 821 | #m_ylw-pushpin 822 | 823 | 1 824 | 122.0797684,37.5331064,0 825 | 826 | 827 | 828 | 829 | 45 830 | 831 | 122.0797731 832 | 37.5331039 833 | 0 834 | 0 835 | 0 836 | 728.8612258819933 837 | relativeToSeaFloor 838 | 839 | #m_ylw-pushpin 840 | 841 | 1 842 | 122.0797731,37.5331039,0 843 | 844 | 845 | 846 | 847 | 46 848 | 849 | 122.0797785 850 | 37.5331019 851 | 0 852 | 0 853 | 0 854 | 728.8612258819933 855 | relativeToSeaFloor 856 | 857 | #m_ylw-pushpin 858 | 859 | 1 860 | 122.0797785,37.5331019,0 861 | 862 | 863 | 864 | 865 | 47 866 | 867 | 122.0797886 868 | 37.5330988 869 | 0 870 | 0 871 | 0 872 | 728.8612258819933 873 | relativeToSeaFloor 874 | 875 | #m_ylw-pushpin 876 | 877 | 1 878 | 122.0797886,37.5330988,0 879 | 880 | 881 | 882 | 883 | 48 884 | 885 | 122.0797939 886 | 37.5330968 887 | 0 888 | 0 889 | 0 890 | 728.8612258819933 891 | relativeToSeaFloor 892 | 893 | #m_ylw-pushpin 894 | 895 | 1 896 | 122.0797939,37.5330968,0 897 | 898 | 899 | 900 | 901 | 49 902 | 903 | 122.0797995 904 | 37.5330963 905 | 0 906 | 0 907 | 0 908 | 728.8612258819933 909 | relativeToSeaFloor 910 | 911 | #m_ylw-pushpin 912 | 913 | 1 914 | 122.0797995,37.5330963,0 915 | 916 | 917 | 918 | 919 | 50 920 | 921 | 122.0798171 922 | 37.5330964 923 | 0 924 | 0 925 | 0 926 | 728.8612258819933 927 | relativeToSeaFloor 928 | 929 | #m_ylw-pushpin 930 | 931 | 1 932 | 122.0798171,37.5330964,0 933 | 934 | 935 | 936 | 937 | 51 938 | 939 | 122.0798224 940 | 37.5330974 941 | 0 942 | 0 943 | 0 944 | 728.8612258819933 945 | relativeToSeaFloor 946 | 947 | #m_ylw-pushpin 948 | 949 | 1 950 | 122.0798224,37.5330974,0 951 | 952 | 953 | 954 | 955 | 52 956 | 957 | 122.0798335 958 | 37.5331001 959 | 0 960 | 0 961 | 0 962 | 728.8612258819933 963 | relativeToSeaFloor 964 | 965 | #m_ylw-pushpin 966 | 967 | 1 968 | 122.0798335,37.5331001,0 969 | 970 | 971 | 972 | 973 | 53 974 | 975 | 122.0798389 976 | 37.5331011 977 | 0 978 | 0 979 | 0 980 | 728.8612258819933 981 | relativeToSeaFloor 982 | 983 | #m_ylw-pushpin 984 | 985 | 1 986 | 122.0798389,37.5331011,0 987 | 988 | 989 | 990 | 991 | 54 992 | 993 | 122.0798448 994 | 37.5331026 995 | 0 996 | 0 997 | 0 998 | 728.8612258819933 999 | relativeToSeaFloor 1000 | 1001 | #m_ylw-pushpin 1002 | 1003 | 1 1004 | 122.0798448,37.5331026,0 1005 | 1006 | 1007 | 1008 | 1009 | 55 1010 | 1011 | 122.0798546 1012 | 37.5331069 1013 | 0 1014 | 0 1015 | 0 1016 | 728.8612258819933 1017 | relativeToSeaFloor 1018 | 1019 | #m_ylw-pushpin 1020 | 1021 | 1 1022 | 122.0798546,37.5331069,0 1023 | 1024 | 1025 | 1026 | 1027 | 56 1028 | 1029 | 122.0798593 1030 | 37.5331094 1031 | 0 1032 | 0 1033 | 0 1034 | 728.8612258819933 1035 | relativeToSeaFloor 1036 | 1037 | #m_ylw-pushpin 1038 | 1039 | 1 1040 | 122.0798593,37.5331094,0 1041 | 1042 | 1043 | 1044 | 1045 | 57 1046 | 1047 | 122.0798637 1048 | 37.5331113 1049 | 0 1050 | 0 1051 | 0 1052 | 728.8612258819933 1053 | relativeToSeaFloor 1054 | 1055 | #m_ylw-pushpin 1056 | 1057 | 1 1058 | 122.0798637,37.5331113,0 1059 | 1060 | 1061 | 1062 | 1063 | 58 1064 | 1065 | 122.0798716 1066 | 37.5331165 1067 | 0 1068 | 0 1069 | 0 1070 | 728.8612258819933 1071 | relativeToSeaFloor 1072 | 1073 | #m_ylw-pushpin 1074 | 1075 | 1 1076 | 122.0798716,37.5331165,0 1077 | 1078 | 1079 | 1080 | 1081 | 59 1082 | 1083 | 122.0798755 1084 | 37.5331189 1085 | 0 1086 | 0 1087 | 0 1088 | 728.8612258819933 1089 | relativeToSeaFloor 1090 | 1091 | #m_ylw-pushpin 1092 | 1093 | 1 1094 | 122.0798755,37.5331189,0 1095 | 1096 | 1097 | 1098 | 1099 | 60 1100 | 1101 | 122.0798831 1102 | 37.5331254 1103 | 0 1104 | 0 1105 | 0 1106 | 728.8612258819933 1107 | relativeToSeaFloor 1108 | 1109 | #m_ylw-pushpin 1110 | 1111 | 1 1112 | 122.0798831,37.5331254,0 1113 | 1114 | 1115 | 1116 | 1117 | 61 1118 | 1119 | 122.0798859 1120 | 37.5331293 1121 | 0 1122 | 0 1123 | 0 1124 | 728.8612258819933 1125 | relativeToSeaFloor 1126 | 1127 | #m_ylw-pushpin 1128 | 1129 | 1 1130 | 122.0798859,37.5331293,0 1131 | 1132 | 1133 | 1134 | 1135 | 62 1136 | 1137 | 122.0798892 1138 | 37.5331332 1139 | 0 1140 | 0 1141 | 0 1142 | 728.8612258819933 1143 | relativeToSeaFloor 1144 | 1145 | #m_ylw-pushpin 1146 | 1147 | 1 1148 | 122.0798892,37.5331332,0 1149 | 1150 | 1151 | 1152 | 1153 | 63 1154 | 1155 | 122.0798955 1156 | 37.533142 1157 | 0 1158 | 0 1159 | 0 1160 | 728.8612258819933 1161 | relativeToSeaFloor 1162 | 1163 | #m_ylw-pushpin 1164 | 1165 | 1 1166 | 122.0798955,37.533142,0 1167 | 1168 | 1169 | 1170 | 1171 | 64 1172 | 1173 | 122.0798975 1174 | 37.5331463 1175 | 0 1176 | 0 1177 | 0 1178 | 728.8612258819933 1179 | relativeToSeaFloor 1180 | 1181 | #m_ylw-pushpin 1182 | 1183 | 1 1184 | 122.0798975,37.5331463,0 1185 | 1186 | 1187 | 1188 | 1189 | 65 1190 | 1191 | 122.0798988 1192 | 37.5331557 1193 | 0 1194 | 0 1195 | 0 1196 | 728.8612258819933 1197 | relativeToSeaFloor 1198 | 1199 | #m_ylw-pushpin 1200 | 1201 | 1 1202 | 122.0798988,37.5331557,0 1203 | 1204 | 1205 | 1206 | 1207 | 66 1208 | 1209 | 122.0798988 1210 | 37.5331599 1211 | 0 1212 | 0 1213 | 0 1214 | 728.8612258819933 1215 | relativeToSeaFloor 1216 | 1217 | #m_ylw-pushpin 1218 | 1219 | 1 1220 | 122.0798988,37.5331599,0 1221 | 1222 | 1223 | 1224 | 1225 | 67 1226 | 1227 | 122.0798979 1228 | 37.5331645 1229 | 0 1230 | 0 1231 | 0 1232 | 728.8612258819933 1233 | relativeToSeaFloor 1234 | 1235 | #m_ylw-pushpin 1236 | 1237 | 1 1238 | 122.0798979,37.5331645,0 1239 | 1240 | 1241 | 1242 | 1243 | 68 1244 | 1245 | 122.0798961 1246 | 37.5331737 1247 | 0 1248 | 0 1249 | 0 1250 | 728.8612258819933 1251 | relativeToSeaFloor 1252 | 1253 | #m_ylw-pushpin 1254 | 1255 | 1 1256 | 122.0798961,37.5331737,0 1257 | 1258 | 1259 | 1260 | 1261 | 69 1262 | 1263 | 122.0798937 1264 | 37.5331784 1265 | 0 1266 | 0 1267 | 0 1268 | 728.8612258819933 1269 | relativeToSeaFloor 1270 | 1271 | #m_ylw-pushpin 1272 | 1273 | 1 1274 | 122.0798937,37.5331784,0 1275 | 1276 | 1277 | 1278 | 1279 | 70 1280 | 1281 | 122.0798881 1282 | 37.5331869 1283 | 0 1284 | 0 1285 | 0 1286 | 728.8612258819933 1287 | relativeToSeaFloor 1288 | 1289 | #m_ylw-pushpin 1290 | 1291 | 1 1292 | 122.0798881,37.5331869,0 1293 | 1294 | 1295 | 1296 | 1297 | 71 1298 | 1299 | 122.0798849 1300 | 37.5331904 1301 | 0 1302 | 0 1303 | 0 1304 | 728.8612258819933 1305 | relativeToSeaFloor 1306 | 1307 | #m_ylw-pushpin 1308 | 1309 | 1 1310 | 122.0798849,37.5331904,0 1311 | 1312 | 1313 | 1314 | 1315 | 72 1316 | 1317 | 122.0798786 1318 | 37.5331988 1319 | 0 1320 | 0 1321 | 0 1322 | 728.8612258819933 1323 | relativeToSeaFloor 1324 | 1325 | #m_ylw-pushpin 1326 | 1327 | 1 1328 | 122.0798786,37.5331988,0 1329 | 1330 | 1331 | 1332 | 1333 | 73 1334 | 1335 | 122.0798757 1336 | 37.5332027 1337 | 0 1338 | 0 1339 | 0 1340 | 728.8612258819933 1341 | relativeToSeaFloor 1342 | 1343 | #m_ylw-pushpin 1344 | 1345 | 1 1346 | 122.0798757,37.5332027,0 1347 | 1348 | 1349 | 1350 | 1351 | 74 1352 | 1353 | 122.0798687 1354 | 37.5332107 1355 | 0 1356 | 0 1357 | 0 1358 | 728.8612258819933 1359 | relativeToSeaFloor 1360 | 1361 | #m_ylw-pushpin 1362 | 1363 | 1 1364 | 122.0798687,37.5332107,0 1365 | 1366 | 1367 | 1368 | 1369 | 75 1370 | 1371 | 122.0798656 1372 | 37.5332145 1373 | 0 1374 | 0 1375 | 0 1376 | 728.8612258819933 1377 | relativeToSeaFloor 1378 | 1379 | #m_ylw-pushpin 1380 | 1381 | 1 1382 | 122.0798656,37.5332145,0 1383 | 1384 | 1385 | 1386 | 1387 | 76 1388 | 1389 | 122.0798591 1390 | 37.5332227 1391 | 0 1392 | 0 1393 | 0 1394 | 728.8612258819933 1395 | relativeToSeaFloor 1396 | 1397 | #m_ylw-pushpin 1398 | 1399 | 1 1400 | 122.0798591,37.5332227,0 1401 | 1402 | 1403 | 1404 | 1405 | 77 1406 | 1407 | 122.0798554 1408 | 37.5332269 1409 | 0 1410 | 0 1411 | 0 1412 | 728.8612258819933 1413 | relativeToSeaFloor 1414 | 1415 | #m_ylw-pushpin 1416 | 1417 | 1 1418 | 122.0798554,37.5332269,0 1419 | 1420 | 1421 | 1422 | 1423 | 78 1424 | 1425 | 122.0798523 1426 | 37.5332312 1427 | 0 1428 | 0 1429 | 0 1430 | 728.8612258819933 1431 | relativeToSeaFloor 1432 | 1433 | #m_ylw-pushpin 1434 | 1435 | 1 1436 | 122.0798523,37.5332312,0 1437 | 1438 | 1439 | 1440 | 1441 | 79 1442 | 1443 | 122.0798462 1444 | 37.5332401 1445 | 0 1446 | 0 1447 | 0 1448 | 728.8612258819933 1449 | relativeToSeaFloor 1450 | 1451 | #m_ylw-pushpin 1452 | 1453 | 1 1454 | 122.0798462,37.5332401,0 1455 | 1456 | 1457 | 1458 | 1459 | 80 1460 | 1461 | 122.0798431 1462 | 37.5332441 1463 | 0 1464 | 0 1465 | 0 1466 | 728.8612258819933 1467 | relativeToSeaFloor 1468 | 1469 | #m_ylw-pushpin 1470 | 1471 | 1 1472 | 122.0798431,37.5332441,0 1473 | 1474 | 1475 | 1476 | 1477 | 81 1478 | 1479 | 122.0798403 1480 | 37.5332484 1481 | 0 1482 | 0 1483 | 0 1484 | 728.8612258819933 1485 | relativeToSeaFloor 1486 | 1487 | #m_ylw-pushpin 1488 | 1489 | 1 1490 | 122.0798403,37.5332484,0 1491 | 1492 | 1493 | 1494 | 1495 | 82 1496 | 1497 | 122.0798351 1498 | 37.5332568 1499 | 0 1500 | 0 1501 | 0 1502 | 728.8612258819933 1503 | relativeToSeaFloor 1504 | 1505 | #m_ylw-pushpin 1506 | 1507 | 1 1508 | 122.0798351,37.5332568,0 1509 | 1510 | 1511 | 1512 | 1513 | 83 1514 | 1515 | 122.0798288 1516 | 37.533265 1517 | 0 1518 | 0 1519 | 0 1520 | 728.8612258819933 1521 | relativeToSeaFloor 1522 | 1523 | #m_ylw-pushpin 1524 | 1525 | 1 1526 | 122.0798288,37.533265,0 1527 | 1528 | 1529 | 1530 | 1531 | 84 1532 | 1533 | 122.0798259 1534 | 37.5332692 1535 | 0 1536 | 0 1537 | 0 1538 | 728.8612258819933 1539 | relativeToSeaFloor 1540 | 1541 | #m_ylw-pushpin 1542 | 1543 | 1 1544 | 122.0798259,37.5332692,0 1545 | 1546 | 1547 | 1548 | 1549 | 85 1550 | 1551 | 122.0798193 1552 | 37.5332766 1553 | 0 1554 | 0 1555 | 0 1556 | 728.8612258819933 1557 | relativeToSeaFloor 1558 | 1559 | #m_ylw-pushpin 1560 | 1561 | 1 1562 | 122.0798193,37.5332766,0 1563 | 1564 | 1565 | 1566 | 1567 | 86 1568 | 1569 | 122.0798125 1570 | 37.5332837 1571 | 0 1572 | 0 1573 | 0 1574 | 728.8612258819933 1575 | relativeToSeaFloor 1576 | 1577 | #m_ylw-pushpin 1578 | 1579 | 1 1580 | 122.0798125,37.5332837,0 1581 | 1582 | 1583 | 1584 | 1585 | 87 1586 | 1587 | 122.0798087 1588 | 37.5332872 1589 | 0 1590 | 0 1591 | 0 1592 | 728.8612258819933 1593 | relativeToSeaFloor 1594 | 1595 | #m_ylw-pushpin 1596 | 1597 | 1 1598 | 122.0798087,37.5332872,0 1599 | 1600 | 1601 | 1602 | 1603 | 88 1604 | 1605 | 122.0798048 1606 | 37.5332903 1607 | 0 1608 | 0 1609 | 0 1610 | 728.8612258819933 1611 | relativeToSeaFloor 1612 | 1613 | #m_ylw-pushpin 1614 | 1615 | 1 1616 | 122.0798048,37.5332903,0 1617 | 1618 | 1619 | 1620 | 1621 | 89 1622 | 1623 | 122.0798005 1624 | 37.5332961 1625 | 0 1626 | 0 1627 | 0 1628 | 728.8612258819933 1629 | relativeToSeaFloor 1630 | 1631 | #m_ylw-pushpin 1632 | 1633 | 1 1634 | 122.0798005,37.5332961,0 1635 | 1636 | 1637 | 1638 | 1639 | 90 1640 | 1641 | 122.0797995 1642 | 37.5332981 1643 | 0 1644 | 0 1645 | 0 1646 | 728.8612258819933 1647 | relativeToSeaFloor 1648 | 1649 | #m_ylw-pushpin 1650 | 1651 | 1 1652 | 122.0797995,37.5332981,0 1653 | 1654 | 1655 | 1656 | 1657 | 91 1658 | 1659 | 122.0797976 1660 | 37.5333007 1661 | 0 1662 | 0 1663 | 0 1664 | 728.8612258819933 1665 | relativeToSeaFloor 1666 | 1667 | #m_ylw-pushpin 1668 | 1669 | 1 1670 | 122.0797976,37.5333007,0 1671 | 1672 | 1673 | 1674 | 1675 | 92 1676 | 1677 | 122.0797967 1678 | 37.5333025 1679 | 0 1680 | 0 1681 | 0 1682 | 728.8612258819933 1683 | relativeToSeaFloor 1684 | 1685 | #m_ylw-pushpin 1686 | 1687 | 1 1688 | 122.0797967,37.5333025,0 1689 | 1690 | 1691 | 1692 | 1693 | 1694 | 1695 | 1696 | -------------------------------------------------------------------------------- /LocationTrans/Untitled.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 132, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "outputData={}\n", 10 | "StartLoop = 0\n", 11 | "nameNotFound = 1\n", 12 | "posNotFound = 1" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": 133, 18 | "metadata": {}, 19 | "outputs": [], 20 | "source": [ 21 | "fw = open(\"MapData.kml\",\"r\")\n", 22 | "f = open(\"LatLong.txt\",\"w\")" 23 | ] 24 | }, 25 | { 26 | "cell_type": "code", 27 | "execution_count": 134, 28 | "metadata": { 29 | "scrolled": false 30 | }, 31 | "outputs": [ 32 | { 33 | "name": "stdout", 34 | "output_type": "stream", 35 | "text": [ 36 | "a1:120.520163178378,36.89206629053305,0\n", 37 | "a2:120.5193894447255,36.89284333308383,0\n", 38 | "a3:120.5190596853301,36.89239965021736,0\n" 39 | ] 40 | } 41 | ], 42 | "source": [ 43 | "f.seek(0,0) #首先把文件指针移动到初始位置\n", 44 | "dataPoint = f.readlines()\n", 45 | "for line in dataPoint:\n", 46 | " nameIndex = line.find('')\n", 47 | " if(nameIndex != -1):#找到了题头\n", 48 | " StartLoop = 1\n", 49 | " \n", 50 | " if(StartLoop):\n", 51 | " if(nameNotFound):\n", 52 | " nameIndexBegin = line.find('')\n", 53 | " nameIndexEnd = line.find('')\n", 54 | " if(nameIndexBegin != -1):\n", 55 | " name = line[nameIndexBegin+len(''):nameIndexEnd]\n", 56 | " nameNotFound = 0\n", 57 | " elif((not nameNotFound) and posNotFound):\n", 58 | " posIndexBegin = line.find('')\n", 59 | " posIndexEnd = line.find('')\n", 60 | " if(posIndexBegin != -1):\n", 61 | " pos = line[posIndexBegin+len(''):posIndexEnd]\n", 62 | " outputData[name]=pos.split(',')\n", 63 | " posNotFound = 0\n", 64 | " else:\n", 65 | " posNotFound = 1\n", 66 | " nameNotFound = 1\n", 67 | "\n", 68 | "f.close()\n", 69 | "for item in outputData:\n", 70 | " print(item + ':' + outputData[item][0] + ',' + outputData[item][1] + ',' + outputData[item][2])\n", 71 | " fw.write(item + ':' + outputData[item][0] + ',' + outputData[item][1] + ',' + outputData[item][2] + '\\n') \n", 72 | "fw.close()\n" 73 | ] 74 | }, 75 | { 76 | "cell_type": "code", 77 | "execution_count": null, 78 | "metadata": {}, 79 | "outputs": [], 80 | "source": [] 81 | } 82 | ], 83 | "metadata": { 84 | "kernelspec": { 85 | "display_name": "Python 3", 86 | "language": "python", 87 | "name": "python3" 88 | }, 89 | "language_info": { 90 | "codemirror_mode": { 91 | "name": "ipython", 92 | "version": 3 93 | }, 94 | "file_extension": ".py", 95 | "mimetype": "text/x-python", 96 | "name": "python", 97 | "nbconvert_exporter": "python", 98 | "pygments_lexer": "ipython3", 99 | "version": "3.6.6" 100 | } 101 | }, 102 | "nbformat": 4, 103 | "nbformat_minor": 2 104 | } 105 | -------------------------------------------------------------------------------- /LocationTrans/Untitled1.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 142, 6 | "metadata": { 7 | "scrolled": true 8 | }, 9 | "outputs": [], 10 | "source": [ 11 | "fw = open(\"MapDataOutput1.kml\",\"w+\")\n", 12 | "f = open(\"LatLong.txt\",\"r\")\n", 13 | "test = open(\"CONFIGURE/Basis.kml\",\"r\") #open(\"CONFIGURE/t.kml\",\"r\")#,encoding='gb18030',errors='ignore')#,encoding='UTF-8')#,encoding='gb18030',errors='ignore')" 14 | ] 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": 143, 19 | "metadata": {}, 20 | "outputs": [], 21 | "source": [ 22 | "for line in test:\n", 23 | " state = line.find(\"\")\n", 24 | " if(state == -1):\n", 25 | " fw.write(line)\n", 26 | " else:\n", 27 | " break" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": 144, 33 | "metadata": { 34 | "scrolled": true 35 | }, 36 | "outputs": [ 37 | { 38 | "name": "stdout", 39 | "output_type": "stream", 40 | "text": [ 41 | "name:a1 lat:120.520163178378 lon:36.89206629053305\n", 42 | "name:a2 lat:120.5193894447255 lon:36.89284333308383\n", 43 | "name:a3 lat:120.5190596853301 lon:36.89239965021736\n", 44 | "name:a4 lat:120.5162256 lon:36.8934955\n" 45 | ] 46 | } 47 | ], 48 | "source": [ 49 | "f.seek(0,0)\n", 50 | "for line in f:\n", 51 | " spliter = line.find(\":\")\n", 52 | " name = line[:spliter]\n", 53 | " spliter_latlon = line.find(\",\")\n", 54 | " lon = line[spliter+1:spliter_latlon]\n", 55 | " line =line[spliter_latlon+1:]\n", 56 | " spliter_latlon = line.find(\",\")\n", 57 | " lat = line[:spliter_latlon]\n", 58 | " print( \"\\t\\t\\t\\n\\t\\t\\t{0}\\n\\t\\t\\t\\n\\t\\t\\t\\t{1}\\n\\t\\t\\t\\t{2}\\n\\t\\t\\t\\t0\\n\\t\\t\\t\\t0\\n\\t\\t\\t\\t0\\n\\t\\t\\t\\t728.8612258819933\\n\\t\\t\\t\\trelativeToSeaFloor\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t#m_ylw-pushpin\\n\\t\\t\\t\\n\\t\\t\\t\\t1\\n\\t\\t\\t\\t{1},{2},0\\n\\t\\t\\t\\t\\n\\t\\t\\t\\n\".format(name,lon,lat),file=fw)\n", 59 | " print(\"name:%s lat:%s lon:%s\"%(name,lon,lat))" 60 | ] 61 | }, 62 | { 63 | "cell_type": "code", 64 | "execution_count": 145, 65 | "metadata": {}, 66 | "outputs": [], 67 | "source": [ 68 | "print(\"\\n\\n\\n\",file=fw)\n", 69 | "fw.close()\n", 70 | "f.close()\n", 71 | "test.close()" 72 | ] 73 | }, 74 | { 75 | "cell_type": "code", 76 | "execution_count": 146, 77 | "metadata": {}, 78 | "outputs": [ 79 | { 80 | "name": "stdout", 81 | "output_type": "stream", 82 | "text": [ 83 | "\n", 84 | "\n", 85 | "\n", 86 | "\n", 87 | "\n", 88 | "\n", 89 | "\tMapData.kml\n", 90 | "\n", 91 | "\t\n", 108 | "\n", 109 | "\t\n", 110 | "\n", 111 | "\t\t\n", 112 | "\n", 113 | "\t\t\tnormal\n", 114 | "\n", 115 | "\t\t\t#s_ylw-pushpin\n", 116 | "\n", 117 | "\t\t\n", 118 | "\n", 119 | "\t\t\n", 120 | "\n", 121 | "\t\t\thighlight\n", 122 | "\n", 123 | "\t\t\t#s_ylw-pushpin_hl\n", 124 | "\n", 125 | "\t\t\n", 126 | "\n", 127 | "\t\n", 128 | "\n", 129 | "\t\n", 146 | "\n", 147 | "\t\n", 148 | "\n", 149 | "\t\t涓存椂浣嶇疆\n", 150 | "\n", 151 | "\t\t1\n", 152 | "\n", 153 | "\t\t\t\n", 154 | "\n", 155 | "\t\t\ta1\n", 156 | "\n", 157 | "\t\t\t\n", 158 | "\n", 159 | "\t\t\t\t120.520163178378\n", 160 | "\n", 161 | "\t\t\t\t36.89206629053305\n", 162 | "\n", 163 | "\t\t\t\t0\n", 164 | "\n", 165 | "\t\t\t\t0\n", 166 | "\n", 167 | "\t\t\t\t0\n", 168 | "\n", 169 | "\t\t\t\t728.8612258819933\n", 170 | "\n", 171 | "\t\t\t\trelativeToSeaFloor\n", 172 | "\n", 173 | "\t\t\t\t\n", 174 | "\n", 175 | "\t\t\t\t#m_ylw-pushpin\n", 176 | "\n", 177 | "\t\t\t\n", 178 | "\n", 179 | "\t\t\t\t1\n", 180 | "\n", 181 | "\t\t\t\t120.520163178378,36.89206629053305,0\n", 182 | "\n", 183 | "\t\t\t\t\n", 184 | "\n", 185 | "\t\t\t\n", 186 | "\n", 187 | "\n", 188 | "\n", 189 | "\t\t\t\n", 190 | "\n", 191 | "\t\t\ta2\n", 192 | "\n", 193 | "\t\t\t\n", 194 | "\n", 195 | "\t\t\t\t120.5193894447255\n", 196 | "\n", 197 | "\t\t\t\t36.89284333308383\n", 198 | "\n", 199 | "\t\t\t\t0\n", 200 | "\n", 201 | "\t\t\t\t0\n", 202 | "\n", 203 | "\t\t\t\t0\n", 204 | "\n", 205 | "\t\t\t\t728.8612258819933\n", 206 | "\n", 207 | "\t\t\t\trelativeToSeaFloor\n", 208 | "\n", 209 | "\t\t\t\t\n", 210 | "\n", 211 | "\t\t\t\t#m_ylw-pushpin\n", 212 | "\n", 213 | "\t\t\t\n", 214 | "\n", 215 | "\t\t\t\t1\n", 216 | "\n", 217 | "\t\t\t\t120.5193894447255,36.89284333308383,0\n", 218 | "\n", 219 | "\t\t\t\t\n", 220 | "\n", 221 | "\t\t\t\n", 222 | "\n", 223 | "\n", 224 | "\n", 225 | "\t\t\t\n", 226 | "\n", 227 | "\t\t\ta3\n", 228 | "\n", 229 | "\t\t\t\n", 230 | "\n", 231 | "\t\t\t\t120.5190596853301\n", 232 | "\n", 233 | "\t\t\t\t36.89239965021736\n", 234 | "\n", 235 | "\t\t\t\t0\n", 236 | "\n", 237 | "\t\t\t\t0\n", 238 | "\n", 239 | "\t\t\t\t0\n", 240 | "\n", 241 | "\t\t\t\t728.8612258819933\n", 242 | "\n", 243 | "\t\t\t\trelativeToSeaFloor\n", 244 | "\n", 245 | "\t\t\t\t\n", 246 | "\n", 247 | "\t\t\t\t#m_ylw-pushpin\n", 248 | "\n", 249 | "\t\t\t\n", 250 | "\n", 251 | "\t\t\t\t1\n", 252 | "\n", 253 | "\t\t\t\t120.5190596853301,36.89239965021736,0\n", 254 | "\n", 255 | "\t\t\t\t\n", 256 | "\n", 257 | "\t\t\t\n", 258 | "\n", 259 | "\n", 260 | "\n", 261 | "\t\t\t\n", 262 | "\n", 263 | "\t\t\ta4\n", 264 | "\n", 265 | "\t\t\t\n", 266 | "\n", 267 | "\t\t\t\t120.5162256\n", 268 | "\n", 269 | "\t\t\t\t36.8934955\n", 270 | "\n", 271 | "\t\t\t\t0\n", 272 | "\n", 273 | "\t\t\t\t0\n", 274 | "\n", 275 | "\t\t\t\t0\n", 276 | "\n", 277 | "\t\t\t\t728.8612258819933\n", 278 | "\n", 279 | "\t\t\t\trelativeToSeaFloor\n", 280 | "\n", 281 | "\t\t\t\t\n", 282 | "\n", 283 | "\t\t\t\t#m_ylw-pushpin\n", 284 | "\n", 285 | "\t\t\t\n", 286 | "\n", 287 | "\t\t\t\t1\n", 288 | "\n", 289 | "\t\t\t\t120.5162256,36.8934955,0\n", 290 | "\n", 291 | "\t\t\t\t\n", 292 | "\n", 293 | "\t\t\t\n", 294 | "\n", 295 | "\n", 296 | "\n", 297 | "\n", 298 | "\n", 299 | "\n", 300 | "\n", 301 | "\n", 302 | "\n", 303 | "\n", 304 | "\n" 305 | ] 306 | } 307 | ], 308 | "source": [ 309 | "fw = open(\"MapDataOutput1.kml\",\"r\")\n", 310 | "for line in fw:\n", 311 | " print(line)" 312 | ] 313 | }, 314 | { 315 | "cell_type": "code", 316 | "execution_count": 147, 317 | "metadata": {}, 318 | "outputs": [], 319 | "source": [ 320 | "fw.close()" 321 | ] 322 | }, 323 | { 324 | "cell_type": "code", 325 | "execution_count": null, 326 | "metadata": {}, 327 | "outputs": [], 328 | "source": [] 329 | } 330 | ], 331 | "metadata": { 332 | "kernelspec": { 333 | "display_name": "Python 3", 334 | "language": "python", 335 | "name": "python3" 336 | }, 337 | "language_info": { 338 | "codemirror_mode": { 339 | "name": "ipython", 340 | "version": 3 341 | }, 342 | "file_extension": ".py", 343 | "mimetype": "text/x-python", 344 | "name": "python", 345 | "nbconvert_exporter": "python", 346 | "pygments_lexer": "ipython3", 347 | "version": "3.6.6" 348 | } 349 | }, 350 | "nbformat": 4, 351 | "nbformat_minor": 2 352 | } 353 | -------------------------------------------------------------------------------- /LocationTrans/kml2txt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | # In[132]: 5 | outputData={} 6 | StartLoop = 0 7 | nameNotFound = 1 8 | posNotFound = 1 9 | 10 | 11 | # In[133]: 12 | 13 | 14 | f = open("MapData.kml","r",encoding='gb18030',errors='ignore') 15 | fw = open("LatLong.txt","w") 16 | 17 | 18 | # In[134]: 19 | f.seek(0,0) #首先把文件指针移动到初始位置 20 | dataPoint = f.readlines() 21 | for line in dataPoint: 22 | nameIndex = line.find('') 23 | if(nameIndex != -1):#找到了题头 24 | StartLoop = 1 25 | 26 | if(StartLoop): 27 | if(nameNotFound): 28 | nameIndexBegin = line.find('') 29 | nameIndexEnd = line.find('') 30 | if(nameIndexBegin != -1): 31 | name = line[nameIndexBegin+len(''):nameIndexEnd] 32 | nameNotFound = 0 33 | elif((not nameNotFound) and posNotFound): 34 | posIndexBegin = line.find('') 35 | posIndexEnd = line.find('') 36 | if(posIndexBegin != -1): 37 | pos = line[posIndexBegin+len(''):posIndexEnd] 38 | outputData[name]=pos.split(',') 39 | posNotFound = 0 40 | else: 41 | posNotFound = 1 42 | nameNotFound = 1 43 | 44 | f.close() 45 | for item in outputData: 46 | print(item + ':' + outputData[item][0] + ',' + outputData[item][1] + ',' + outputData[item][2]) 47 | fw.write(item + ':' + outputData[item][0] + ',' + outputData[item][1] + ',' + outputData[item][2] + '\n') 48 | fw.close() 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /LocationTrans/txt2kml.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | # In[142]: 5 | 6 | 7 | fw = open("MapDataOutput1.kml","w+") 8 | f = open("LatLong.txt","r") 9 | test = open("CONFIGURE/Basis.kml","r") #open("CONFIGURE/t.kml","r")#,encoding='gb18030',errors='ignore') 10 | 11 | 12 | # In[143]: 13 | 14 | 15 | for line in test: 16 | state = line.find("") 17 | if(state == -1): 18 | fw.write(line) 19 | else: 20 | break 21 | 22 | 23 | # In[144]: 24 | 25 | 26 | f.seek(0,0) 27 | for line in f: 28 | spliter = line.find(":") 29 | name = line[:spliter] 30 | spliter_latlon = line.find(",") 31 | lon = line[spliter+1:spliter_latlon] 32 | line =line[spliter_latlon+1:] 33 | spliter_latlon = line.find(",") 34 | lat = line[:spliter_latlon] 35 | print( "\t\t\t\n\t\t\t{0}\n\t\t\t\n\t\t\t\t{1}\n\t\t\t\t{2}\n\t\t\t\t0\n\t\t\t\t0\n\t\t\t\t0\n\t\t\t\t728.8612258819933\n\t\t\t\trelativeToSeaFloor\n\t\t\t\t\n\t\t\t\t#m_ylw-pushpin\n\t\t\t\n\t\t\t\t1\n\t\t\t\t{1},{2},0\n\t\t\t\t\n\t\t\t\n".format(name,lon,lat),file=fw) 36 | print("name:%s lat:%s lon:%s"%(name,lon,lat)) 37 | 38 | 39 | # In[145]: 40 | 41 | 42 | print("\n\n\n",file=fw) 43 | fw.close() 44 | f.close() 45 | test.close() 46 | 47 | 48 | # In[146]: 49 | 50 | 51 | fw = open("MapDataOutput1.kml","r") 52 | for line in fw: 53 | print(line) 54 | 55 | 56 | # In[147]: 57 | 58 | 59 | fw.close() 60 | 61 | 62 | # In[ ]: 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /Madgwick_AHRS_Test.py: -------------------------------------------------------------------------------- 1 | '''Copyright 2019 Eastar Tech 李东豫<8523429@qq.com> 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License.''' 14 | ''' 15 | 本脚本用于测试下位机由电子罗盘计算得到的偏航角与由姿态解算算法输出的偏航角的评估 16 | 使用前请确保下位机使用Eastar Protocol 发送偏航角数据 17 | ''' 18 | 19 | #!/usr/bin/env python 20 | # coding: utf-8 21 | import matplotlib.pyplot as plt 22 | import serial 23 | import serial.tools.list_ports 24 | import pylab as pl 25 | import datetime 26 | #船体姿态描述 27 | class UASattitude: 28 | lattitude = 0 29 | longtitude = 0 30 | yaw = 0 31 | pitch = 0 32 | roll = 0 33 | speed = 0 34 | angleSpeed = 0 35 | dataProcessed = 0 36 | def __init__(self): 37 | self.latitude = 36.89198937216152 38 | self.longtitude = 120.5147411312813 39 | self.yaw = 11 40 | self.pitch = 12 41 | self.roll = 11 42 | self.dataProcessed = 0 43 | 44 | ValidShip = UASattitude() 45 | Ship = UASattitude() 46 | 47 | ################################################################ 48 | Port_online = 0 49 | baudrate = 115200 50 | port_list = list(serial.tools.list_ports.comports()) 51 | 52 | if(len(port_list)==0): 53 | print("无可用串口") 54 | else: 55 | Port_online = 1 56 | print("当前以下端口在线:") 57 | for port in port_list: 58 | print(port) 59 | Port = input("请输入要打开的串口:") 60 | ser = serial.Serial(Port,baudrate) 61 | print("串口配置如下::") 62 | print(ser,'\n') 63 | if ser.isOpen == False: 64 | ser.open() 65 | print("串口已启动") 66 | 67 | 68 | beta = input("请输入当前滤波器增益:") 69 | if(beta==''): 70 | beta = 'default' 71 | timeSet = 10 72 | timeSet = input("请输入数据采集的时间(以秒为单位):") 73 | if(timeSet.isdigit()): 74 | Start = 1 75 | elif timeSet == '': 76 | timeSet = 10 77 | print("正在使用默认10s采集间隔进行") 78 | else: 79 | Start = 0 80 | 81 | 82 | if(Start): 83 | timeSequence1 = list() 84 | yawReceivedFromCompass = list() 85 | 86 | timeSequence2 = list() 87 | yawReceivedFromMadgwick = list() 88 | 89 | get0x73 = 0 90 | startBit = 0 91 | startTime = datetime.datetime.now() 92 | counter = 0 93 | counterForMagData = 0 94 | counterForMagCalibration = 0 95 | timeSpan = 0 96 | revData = list() 97 | dataIn = str() 98 | for cnt in range(22):#初始化列表 99 | revData.append(0) 100 | 101 | 102 | while True: 103 | 104 | #收到第一个数据时,开始记录采集时间 105 | if(not startBit): 106 | startTime = datetime.datetime.now() 107 | print("数据采集已开始。") 108 | 109 | #采集Madgwick输出姿态数据 110 | Ship.dataProcessed=0 111 | for cnt in range(22):#21为一帧数据的长度 112 | while(ser.inWaiting() ==0): 113 | pass 114 | if(not get0x73): 115 | revData[0] = ser.read(1) 116 | if(revData[0]==b's' or get0x73==1): 117 | get0x73 = 0 118 | revData[1] = ser.read(1) 119 | if(revData[1]==b'c'): 120 | counter = 1 121 | startBit = 1 122 | #print("接受到引导码") 123 | break 124 | elif (revData[0]==b'y'): 125 | revData[1] = ser.read(1) 126 | if(revData[1]==b'a'): 127 | revData[2] = ser.read(1) 128 | revData[3] = ser.read(1) 129 | counterForMagData = 3 130 | startBit =1 131 | break 132 | else: 133 | counter = 0 134 | counterForMagData = 0 135 | 136 | 137 | #解析磁力计输出偏航角 138 | if(counterForMagData==3): 139 | dataIn = str() 140 | getNumber = 0 141 | timeNow = datetime.datetime.now() 142 | getNumber = ser.read(1) 143 | while((getNumber.decode()).isdigit()): 144 | counterForMagData +=1 145 | revData[counterForMagData] = getNumber 146 | getNumber = ser.read(1) 147 | if(counterForMagData>=4): 148 | dataIn += revData[counterForMagData].decode() 149 | if(getNumber==b's'): 150 | get0x73 = 1 151 | revData[0] = 0X73 152 | else: 153 | get0x73 = 0 154 | #print(dataIn) 155 | if(dataIn.isdigit()): 156 | yawReceivedFromCompass.append(eval(dataIn)) 157 | timeSequence1.append((timeNow - startTime).seconds+((timeNow - startTime).microseconds)/1000000) 158 | ValidShip.dataProcessed=1 159 | counterForMagData = 0 160 | #print("磁罗盘姿态解算数据:yaw:%d"%(eval(dataIn))) 161 | else: 162 | counterForMagData = 0 163 | 164 | #解析Madgwick偏航角 165 | if(counter == 1): 166 | while(counter<21):#从1读到21 一共20个 167 | counter += 1 168 | revData[counter] = ord(ser.read(1)) 169 | #print("读入数据集:",revData) 170 | #验证环节: 171 | sumUp = 0 172 | timeNow = datetime.datetime.now() 173 | for temp in range(19): 174 | sumUp += revData[temp+2] 175 | sumUp = sumUp & 0xFF 176 | #print("Sum up is calculated to be %d"%self.sumUp) 177 | if sumUp == revData[21]:#校验和验证通过 178 | #准备转化数据 179 | Ship.longtitude = bytes() 180 | Ship.lattitude = bytes() 181 | Ship.yaw = bytes() 182 | Ship.pitch = bytes() 183 | Ship.roll = bytes() 184 | #开始转化数据 185 | for cnt in range(4): 186 | Ship.longtitude += bytes([revData[cnt+2]]) 187 | Ship.lattitude += bytes([revData[cnt+2+4]]) 188 | 189 | for cnt in range(2): 190 | #print("%d八位数据:yaw:%d,pitch:%d,roll:%d"%(cnt,self.revData[cnt+10],self.revData[cnt+12],self.revData[cnt+14])) 191 | Ship.yaw += bytes([revData[cnt+10]]) 192 | Ship.pitch += bytes([revData[cnt+12]]) 193 | Ship.roll += bytes([revData[cnt+14]]) 194 | #print(Ship.yaw) 195 | 196 | ValidShip.yaw=int.from_bytes(Ship.yaw,byteorder='big',signed=False) 197 | ValidShip.pitch=int.from_bytes(Ship.pitch,byteorder='big',signed=True) 198 | ValidShip.roll=int.from_bytes(Ship.roll,byteorder='big',signed=True) 199 | ValidShip.lattitude = (int.from_bytes(Ship.lattitude,byteorder='big',signed=False)/1e7) 200 | ValidShip.longtitude = (int.from_bytes(Ship.longtitude,byteorder='big',signed=False)/1e7) 201 | #数据转化完毕 202 | #print("MADGWICK姿态解算数据:yaw:%d,pitch:%d,roll:%d"%(ValidShip.yaw,ValidShip.pitch,ValidShip.roll)) 203 | ValidShip.dataProcessed=1 204 | yawReceivedFromMadgwick.append(ValidShip.yaw) 205 | timeSequence2.append((timeNow - startTime).seconds+((timeNow - startTime).microseconds)/1000000) 206 | #print(revData) 207 | else: 208 | print("CRC校验失败") 209 | 210 | currentTime = datetime.datetime.now() 211 | last_timeSpan = timeSpan 212 | timeSpan = (currentTime - startTime).seconds 213 | if(last_timeSpan != timeSpan): 214 | print("当前数据采集时间:%dsec"%timeSpan) 215 | if(timeSpan>=eval(timeSet)): 216 | #计算误差 217 | errorTimeSequence = list() 218 | error = list() 219 | errorTimeSequence = timeSequence2 220 | if(len(timeSequence1)<= len(timeSequence2)): 221 | errorTimeSequence = timeSequence1 222 | print(len(timeSequence1),',',len(timeSequence2)) 223 | for time in range(len(errorTimeSequence)): 224 | error.append(yawReceivedFromMadgwick[time]-yawReceivedFromCompass[time]) 225 | #画图 226 | plot1 = pl.plot(timeSequence1,yawReceivedFromCompass,'b',label='Computed from Compass') 227 | plot2 = pl.plot(timeSequence2,yawReceivedFromMadgwick,'g',label='Computed from Algorithm') 228 | plot3 = pl.plot(errorTimeSequence,error,'r:',label='Error') 229 | pl.title(str("Madgwick Gradient Decent/Beta="+beta)) 230 | pl.xlabel('Time Sequence/sec') 231 | pl.ylabel('Yaw/deg') 232 | pl.legend(loc='lower right') 233 | 234 | pl.savefig(str("C:\\Users\\85234\\Desktop\\Madgwick_Eval\\"+(datetime.datetime.now().strftime('%m%d-%H%M%S'))+'.png'),bbox_inches='tight') 235 | pl.show() 236 | request = input("是否继续?(y\\n)") 237 | if(request == 'y' or request == 'Y'): 238 | startBit = 0 239 | timeSet = input("请输入数据采集的时间(以秒为单位):") 240 | print("程序继续运行中") 241 | else: 242 | break 243 | 244 | -------------------------------------------------------------------------------- /MainSequence.py: -------------------------------------------------------------------------------- 1 | '''Copyright 2019 李东豫<8523429@qq.com> 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License.''' 14 | 15 | 16 | #!/usr/bin/env python 17 | # coding: utf-8 18 | import time 19 | import Ctrl 20 | import Comm 21 | import serial 22 | import threading 23 | import AziFromPos 24 | import Record_Coordinates 25 | import os 26 | systemOnline = 1#启动系统 27 | 28 | #启动前配置: 29 | Ctrl.GPIOinit() 30 | baudrate = 921600 31 | ser = serial.Serial("/dev/ttyAMA0",baudrate) 32 | VEHECLE_LENGTH = 150 #载具的长度,单位为cm 33 | print("Serial Port Configuration:") 34 | print(ser) 35 | if ser.isOpen == False: 36 | ser.open() 37 | 38 | #状态机定义 39 | STATE_NORMALLY_RUNNING=1 40 | STATE_COLLECTING_POINTS=2 41 | STATE_MANUAL_CTRL=3 42 | 43 | #实例化各模块 44 | Ship = Comm.UASattitude() 45 | Route = Comm.Route() 46 | ValidShip = Comm.UASattitude() 47 | wirelessPort = Ctrl.WirelessUSART() 48 | RingBuff = Comm.ringBuff(100,baudrate,wirelessPort,ser) 49 | #创建多线程 50 | tSynthesis = Comm.sysnthesisData(RingBuff,Ship,ValidShip,10,systemOnline) 51 | tUART = Comm.USARTinData(RingBuff,systemOnline) 52 | #创建线程池 53 | THREADS = [tSynthesis,tUART] 54 | try: 55 | for sub_thread in THREADS: 56 | sub_thread.start() 57 | except: 58 | os.system('mplayer -really-quiet "/home/pi/RpiCentre/sound/subthreadserr.mp3"') 59 | 60 | os.system('mplayer -really-quiet "/home/pi/RpiCentre/sound/SEQUENCESTART.mp3"') 61 | time.sleep(0.5) 62 | 63 | #启动主任务 64 | try: 65 | startFromMinDistance = 0 #选择载具是从第一个点开始前进0还是就近开始前进1 66 | #读取路径轨迹 67 | while True: 68 | if(ValidShip.manual_automatic == STATE_NORMALLY_RUNNING): 69 | if(ValidShip.fixtype == 0): 70 | os.system('mplayer -really-quiet "/home/pi/RpiCentre/sound/GPSNOFIX.mp3"') 71 | else: 72 | os.system('mplayer -really-quiet "/home/pi/RpiCentre/sound/GPSFIXED.mp3"') 73 | Mapdata = Ctrl.AcquireMapData() 74 | #上面是路线规划,下面是实时运行 75 | MaxDistance = VEHECLE_LENGTH #单位为cm 76 | #通过以上参数设定GPS点偏离的最大值,在GPS目标点的MaxDistance范围内视作已经经过了该点 77 | #自动选取路径起始点 78 | if(startFromMinDistance==0): 79 | nextPoint = min(Mapdata.keys()) 80 | else: 81 | for key in Mapdata.keys(): 82 | distance = AziFromPos.distanceFromCoordinate(ValidShip.longtitude,ValidShip.lattitude,Mapdata[key][0],Mapdata[key][1]) 83 | if(key==1): 84 | minimum = distance 85 | indexMin = 1 86 | else: 87 | if(distance < minimum): 88 | minimum = distance 89 | indexMin = key 90 | nextPoint = indexMin 91 | print("Starting Point at #%d"%nextPoint) 92 | #===============参数设置================= 93 | delay = 0.3 94 | freq = 1//delay 95 | delay_counter = 0 96 | #===============主程序运行=============== 97 | while ValidShip.manual_automatic == STATE_NORMALLY_RUNNING: 98 | if ValidShip.dataProcessed==1: 99 | time.sleep(delay) 100 | if (Comm.Ship_Attitude_On_Screen(ValidShip)): 101 | distance = AziFromPos.distanceFromCoordinate(ValidShip.longtitude,ValidShip.lattitude,Mapdata[nextPoint][0],Mapdata[nextPoint][1]) 102 | if distance >= 250: 103 | distance = 250 104 | angle = AziFromPos.angleFromCoordinate(ValidShip.longtitude,ValidShip.lattitude,Mapdata[nextPoint][0],Mapdata[nextPoint][1]) 105 | Route.yaw = round(angle) 106 | Route.distance = round(distance) 107 | delay_counter += 1 108 | if(delay_counter > 2*freq): 109 | delay_counter = 0 110 | print("Distance to next location:%.2fMeter"%(Route.distance/100)) 111 | print("Current Progress:%.2f%%"%(nextPoint/len(Mapdata.keys())*100)) 112 | print("%d Degrees to next location"%Route.yaw) 113 | if(distance > MaxDistance): 114 | #如果超出范围 115 | pass 116 | #----根据夹角调转机头----# 117 | elif(nextPoint == len(Mapdata.keys())): 118 | #未超出范围,则已达到目标点。 119 | nextPoint = nextPoint 120 | Route.EndOfNav = 1 121 | time.sleep(1) 122 | os.system('mplayer -really-quiet "/home/pi/RpiCentre/sound/ARRIVEDEST.mp3"') 123 | else: 124 | Route.EndOfNav = 0 125 | nextPoint += 1 126 | Comm.SendNavMessege(ser,Route,wirelessPort) 127 | elif ValidShip.manual_automatic == STATE_COLLECTING_POINTS: 128 | if(Comm.Ship_Attitude_On_Screen(ValidShip)): 129 | index = 1 130 | Coordinates_Saving_File = open("LatLong_Record.txt","w+") 131 | print("Coordinate Saving File Created.") 132 | print("Recording Coordinates") 133 | while (ValidShip.manual_automatic==STATE_COLLECTING_POINTS): 134 | time.sleep(0.7)#采点时间间隔设置 135 | print('%ds Coordinates saved') 136 | Record_Coordinates.start(Coordinates_Saving_File,index,ValidShip.longtitude,ValidShip.lattitude,0) 137 | index += 1 138 | Coordinates_Saving_File.close() 139 | os.rename('LatLong_Record.txt','LatLong.txt') 140 | print("New Coordinates Saved") 141 | elif ValidShip.manual_automatic == STATE_MANUAL_CTRL: 142 | time.sleep(0.3) 143 | print('\fManually Controlling') 144 | except KeyboardInterrupt: 145 | print('\f') 146 | systemOnline = 0 147 | tUART.stop() 148 | tSynthesis.stop() 149 | try: 150 | for sub_thread in THREADS: 151 | sub_thread.join() 152 | print("Sub-threads shutdown.") 153 | except RuntimeError: 154 | print("System Start Failure") 155 | try: 156 | if(not Coordinates_Saving_File.closed): 157 | Coordinates_Saving_File.close() 158 | print("Coordinates Saved.") 159 | except NameError: 160 | pass 161 | ser.flushInput() 162 | ser.close() 163 | print("Serial Port Closed") 164 | Ctrl.GPIO_Shutoff() 165 | os.system('mplayer -really-quiet "/home/pi/RpiCentre/sound/SYSTEMSHUTDOWN.mp3"') 166 | print("\n---System Offline---\n") 167 | -------------------------------------------------------------------------------- /NRF24L01.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*- 2 | import time 3 | import threading 4 | import RPi.GPIO as GPIO 5 | #nrf24l01的C语言宏定义 6 | TX_ADR_WIDTH = 5 # 5 uints TX address width 7 | RX_ADR_WIDTH = 5 # 5 uints RX address width 8 | TX_PLOAD_WIDTH = 32 # 20 uints TX payload 9 | RX_PLOAD_WIDTH = 32 # 20 uints TX payload 10 | 11 | TX_ADDRESS = [0x34,0x43,0x10,0x10,0x01] #本地地址 12 | RX_ADDRESS = [0x34,0x43,0x10,0x10,0x01] #接收地址 13 | READ_REG = 0x00 # 读寄存器指令 14 | WRITE_REG = 0x20 # 写寄存器指令 15 | RD_RX_PLOAD = 0x61 # 读取接收数据指令 16 | WR_TX_PLOAD = 0xA0 # 写待发数据指令 17 | FLUSH_TX = 0xE1 # 冲洗发送 FIFO指令 18 | FLUSH_RX = 0xE2 # 冲洗接收 FIFO指令 19 | REUSE_TX_PL = 0xE3 # 定义重复装载数据指令 20 | NOP = 0xFF # 保留 21 | #*************************************SPI(nRF24L01)寄存器地址**************************************************** 22 | CONFIG = 0x00 # 配置收发状态,CRC校验模式以及收发状态响应方式 23 | EN_AA = 0x01 # 自动应答功能设置 24 | EN_RXADDR = 0x02 # 可用信道设置 25 | SETUP_AW = 0x03 # 收发地址宽度设置 26 | SETUP_RETR = 0x04 # 自动重发功能设置 27 | RF_CH = 0x05 # 工作频率设置 28 | RF_SETUP = 0x06 # 发射速率、功耗功能设置 29 | STATUS = 0x07 # 状态寄存器 30 | OBSERVE_TX = 0x08 # 发送监测功能 31 | CD = 0x09 # 地址检测 32 | RX_ADDR_P0 = 0x0A # 频道0接收数据地址 33 | RX_ADDR_P1 = 0x0B # 频道1接收数据地址 34 | RX_ADDR_P2 = 0x0C # 频道2接收数据地址 35 | RX_ADDR_P3 = 0x0D # 频道3接收数据地址 36 | RX_ADDR_P4 = 0x0E # 频道4接收数据地址 37 | RX_ADDR_P5 = 0x0F # 频道5接收数据地址 38 | TX_ADDR = 0x10 # 发送地址寄存器 39 | RX_PW_P0 = 0x11 # 接收频道0接收数据长度 40 | RX_PW_P1 = 0x12 # 接收频道0接收数据长度 41 | RX_PW_P2 = 0x13 # 接收频道0接收数据长度 42 | RX_PW_P3 = 0x14 # 接收频道0接收数据长度 43 | RX_PW_P4 = 0x15 # 接收频道0接收数据长度 44 | RX_PW_P5 = 0x16 # 接收频道0接收数据长度 45 | FIFO_STATUS = 0x17 # FIFO栈入栈出状态寄存器设置 46 | 47 | TX_OK = 0x20 #TX发送完成中断 48 | MAX_TX = 0x10 #达到最大发送次数中断 49 | TX_FULL = 0X01 50 | #sta = 0 51 | #RX_DR = 0 52 | #树莓派各个引脚的定义 53 | MOSI = 29 54 | CSN = 31 55 | MISO = 33 56 | SCK = 35 57 | CE = 37 58 | IRQ = 32 59 | def GPIO_Init(): 60 | GPIO.setmode(GPIO.BOARD) 61 | GPIO.setwarnings(False) 62 | Pinlist = [29,31,35,37,11] 63 | GPIO.setup(Pinlist, GPIO.OUT) 64 | Pinlist_Input = [33,32] 65 | GPIO.setup(Pinlist_Input, GPIO.IN) 66 | return 0 67 | 68 | #**************************************************************************************************** 69 | #*函数:uint SPI_RW(uint dat) 70 | #*功能:NRF24L01的SPI写时序 71 | #**************************************************************************************************** 72 | def SPI_RW(dat): 73 | bit_ctr = 8 74 | _MOSI = 0 75 | while(bit_ctr): 76 | 77 | bit_ctr = bit_ctr - 1 78 | _MOSI = dat & 0x80 #output 'dat', MSB to MOSI 79 | if(_MOSI): 80 | GPIO.output(MOSI, GPIO.HIGH) 81 | else: 82 | GPIO.output(MOSI, GPIO.LOW) 83 | dat = (dat << 1) #shift next bit into MSB.. 84 | dat &= 0xff 85 | GPIO.output(SCK, GPIO.HIGH) #Set SCK GPIO.high.. 86 | dat |= GPIO.input(MISO) #capture current MISO bit 87 | GPIO.output(SCK, GPIO.LOW) #..then set SCK GPIO.low again 88 | return dat #return read dat 89 | 90 | #**************************************************************************************************** 91 | #*函数:uchar SPI_Read(uchar reg) 92 | #*功能:NRF24L01的SPI读时序 93 | #***************************************************************************************************** 94 | def SPI_Read(reg): 95 | reg_val = 0 96 | GPIO.output(CSN, GPIO.LOW) #CSN GPIO.low, initialize SPI communication... 97 | SPI_RW(reg) #Select register to read from.. 98 | reg_val = SPI_RW(0) #..then read registervalue 99 | GPIO.output(CSN, GPIO.HIGH) #CSN GPIO.high, terminate SPI communication 100 | return reg_val #return register value 101 | 102 | #****************************************************************************************************# 103 | #*功能:NRF24L01读写寄存器函数 104 | #****************************************************************************************************# 105 | def SPI_RW_Reg(reg,value): 106 | status = 0 107 | GPIO.output(CSN, GPIO.LOW) #CSN GPIO.low, init SPI transaction 108 | status = SPI_RW(reg) #select register 109 | SPI_RW(value) #..and write value to it.. 110 | GPIO.output(CSN, GPIO.HIGH) #CSN GPIO.high again 111 | return status #return nRF24L01 status uchar 112 | 113 | #****************************************************************************************************# 114 | #*函数:uint SPI_Read_Buf(uchar reg, uchar *pBuf, uchar uchars) 115 | #*功能: 用于读数据,reg:为寄存器地址,pBuf:为待读出数据地址,uchars:读出数据的个数 116 | #****************************************************************************************************# 117 | def SPI_Read_Buf(reg, pBuf, uchars): 118 | status = 0 119 | uchar_ctr = 0 120 | GPIO.output(CSN, GPIO.LOW) # Set CSN GPIO.low, init SPI tranaction 121 | status = SPI_RW(reg) # Select register to write to and read status uchar 122 | while(uchar_ctr < uchars): 123 | pBuf[uchar_ctr] = SPI_RW(0) # 124 | uchar_ctr = uchar_ctr + 1 125 | GPIO.output(CSN, GPIO.HIGH) 126 | return(status) #return nRF24L01 status uchar 127 | 128 | #********************************************************************************************************* 129 | #*函数:uint SPI_Write_Buf(uchar reg, uchar *pBuf, uchar uchars) 130 | #*功能: 用于写数据:为寄存器地址,pBuf:为待写入数据地址,uchars:写入数据的个数 131 | #*********************************************************************************************************# 132 | def SPI_Write_Buf(reg, pBuf, uchars): 133 | status = 0 134 | uchar_ctr = 0 135 | GPIO.output(CSN, GPIO.LOW) #SPI使能 136 | status = SPI_RW(reg) 137 | while(uchar_ctr < uchars): 138 | SPI_RW(pBuf[uchar_ctr]) 139 | uchar_ctr = uchar_ctr + 1 140 | GPIO.output(CSN, GPIO.HIGH) #关闭SPI 141 | return(status) 142 | 143 | 144 | #****************************************************************************************************# 145 | #*函数:void SetRX_Mode(void) 146 | #*功能:数据接收配置 147 | #****************************************************************************************************# 148 | def SetRX_Mode(): 149 | GPIO.output(CE, GPIO.LOW) 150 | SPI_RW_Reg(WRITE_REG + CONFIG, 0x0b) # IRQ收发完成中断响应,8位CRC ,主接收 151 | GPIO.output(CE, GPIO.HIGH) 152 | def SetTX_Mode(): 153 | GPIO.output(CE, GPIO.LOW) 154 | SPI_RW_Reg(WRITE_REG + CONFIG, 0x0a) # IRQ收发完成中断响应,8位CRC 155 | GPIO.output(CE, GPIO.HIGH) 156 | 157 | #******************************************************************************************************# 158 | #*函数:unsigned char nRF24L01_RxPacket(unsigned char* rx_buf) 159 | #*功能:数据读取后放如rx_buf接收缓冲区中 160 | #******************************************************************************************************# 161 | def nRF24L01_RxPacket(rx_buf): 162 | revale = 0 163 | sta = 0 164 | RX_DR = 0 165 | sta = SPI_Read(STATUS) # 读取状态寄存其来判断数据接收状况 166 | RX_DR = sta&0x40 167 | if(RX_DR): # 判断是否接收到数据 168 | GPIO.output(CE, GPIO.LOW) #SPI使能 169 | SPI_Read_Buf(RD_RX_PLOAD,rx_buf,TX_PLOAD_WIDTH) # read receive payload from RX_FIFO buffer 170 | revale =1 #读取数据完成标志 171 | SPI_RW_Reg(WRITE_REG+STATUS,sta) #接收到数据后RX_DR,TX_DS,MAX_PT都置高为1,通过写1来清楚中断标志 172 | return revale 173 | 174 | 175 | #*********************************************************************************************************** 176 | #*函数:void nRF24L01_TxPacket(unsigned char * tx_buf) 177 | #*功能:发送 tx_buf中数据 178 | #**********************************************************************************************************# 179 | 180 | def nRF24L01_TxPacket(tx_buf): 181 | sta = 0 182 | GPIO.output(CE, GPIO.LOW) 183 | SPI_RW_Reg(WRITE_REG + CONFIG, 0x0a) # IRQ收发完成中断响应,8位CRC 184 | time.sleep(0.001) 185 | #GPIO.output(CE, GPIO.LOW) #StandBy I模式 186 | SPI_Write_Buf(WR_TX_PLOAD, tx_buf, TX_PLOAD_WIDTH) # 装载数据 187 | GPIO.output(CE, GPIO.HIGH) #置高CE,激发数据发送 188 | # while(GPIO.input(IRQ)!=0) #等待发送完成 189 | sta=SPI_Read(STATUS) 190 | if(sta & MAX_TX): #达到最大重发次数 191 | SPI_RW_Reg(WRITE_REG+STATUS,sta) 192 | return MAX_TX 193 | if(sta & TX_FULL): 194 | SPI_RW_Reg(FLUSH_TX,0xff) #清除TX FIFO寄存器 195 | if(sta&TX_OK): #发送完成 196 | return 0 197 | 198 | return 0xff #其他原因发送失败 199 | 200 | #**************************************************************************************** 201 | #*NRF24L01初始化 202 | #***************************************************************************************# 203 | def Init_NRF24L01(): 204 | GPIO.output(CE, GPIO.LOW) # chip enable 205 | GPIO.output(CSN, GPIO.HIGH) # Spi disable 206 | GPIO.output(SCK, GPIO.LOW) # Spi clock line init GPIO.high 207 | SPI_Write_Buf(WRITE_REG + TX_ADDR, TX_ADDRESS, TX_ADR_WIDTH) # 写本地地址 208 | SPI_Write_Buf(WRITE_REG + RX_ADDR_P0, RX_ADDRESS, RX_ADR_WIDTH) # 写接收端地址 209 | SPI_RW_Reg(WRITE_REG + EN_AA, 0x01) # 频道0自动 ACK应答允许 210 | SPI_RW_Reg(WRITE_REG + EN_RXADDR, 0x01) # 允许接收地址只有频道0,如果需要多频道可以参考Page21 211 | SPI_RW_Reg(WRITE_REG + RF_CH, 60) # 设置信道工作为2.4GHZ,收发必须一致 212 | SPI_RW_Reg(WRITE_REG + RX_PW_P0, RX_PLOAD_WIDTH) #设置接收数据长度,本次设置为32字节 213 | SPI_RW_Reg(WRITE_REG + SETUP_RETR,0x1a) #自动重发延时:500us,上限重发10次 214 | status = SPI_RW_Reg(WRITE_REG + RF_SETUP, 0x06) 215 | #设置发射速率:0x06:1Mb;0x0e:2Mb;0x16:250kbps,发射功率为最大值0dB 216 | return status 217 | 218 | def printConfig(): 219 | data = [1] #1Byte数据 220 | TXaddr = [1,1,1,1,1] 221 | status = SPI_Read(STATUS) 222 | print("===24L01 Current Configuration===") 223 | SPI_Read_Buf(CONFIG, data,1) 224 | print("Status = %d\nConfig = %d"%(status,data[0])) 225 | SPI_Read_Buf(RF_CH, data,1) 226 | print("RF_CH = %d"%data[0]) 227 | SPI_Read_Buf(RF_SETUP, data,1) 228 | print("RF_SETUP = %d"%data[0]) 229 | SPI_Read_Buf(FIFO_STATUS, data,1) 230 | print("FIFO_STATUS = %d"%data[0]) 231 | SPI_Read_Buf(TX_ADDR, TXaddr,5) 232 | print("TXADDR = %s"%str(TXaddr)) 233 | SPI_Read_Buf(RX_ADDR_P0, TXaddr,5) 234 | print("RXADDR = %s"%str(TXaddr)) 235 | print("===End of File===") 236 | 237 | def RemoteMonitoring(freq,TxBuf,RxBuf,systemFlag): 238 | data = [1] 239 | delay = 1/freq 240 | while systemFlag==1: 241 | time.sleep(delay) 242 | SPI_Read_Buf(FIFO_STATUS, data,1) 243 | if nRF24L01_TxPacket(TxBuf)==0: 244 | pass 245 | 246 | def sendBack_data_attitude(ValidShip): 247 | TxBuf = list() 248 | for cnt in range(32): 249 | TxBuf.append(0) 250 | yaw = ValidShip.yaw 251 | pitch = ValidShip.pitch 252 | roll = ValidShip.roll 253 | TxBuf[0] = 27 254 | if ValidShip.dataProcessed == 1: 255 | TxBuf[1] = ord('Y') 256 | TxBuf[2] = ord('a') 257 | TxBuf[3] = ord('w') 258 | TxBuf[4] = ord(':') 259 | for cnt in range(3):#123 260 | temp = ((yaw % 10)+48) 261 | yaw //= 10 262 | yaw = int(yaw) 263 | TxBuf[5+2-cnt]=temp 264 | #7 265 | TxBuf[8] = ord('R') 266 | TxBuf[9] = ord('o') 267 | TxBuf[10] = ord('l') 268 | TxBuf[11] = ord('l') 269 | TxBuf[12] = ord(':') 270 | TxBuf[13]=ord('+') 271 | if(roll<0): 272 | TxBuf[13]=ord('-') 273 | roll = -roll 274 | for cnt in range(3): 275 | temp = ((roll % 10)+48) 276 | roll //= 10 277 | TxBuf[14+2-cnt]=temp 278 | TxBuf[17] = ord('P') 279 | TxBuf[18] = ord('i') 280 | TxBuf[19] = ord('t') 281 | TxBuf[20] = ord('c') 282 | TxBuf[21] = ord('h') 283 | TxBuf[22] = ord(':') 284 | TxBuf[23]=ord('+') 285 | if(pitch<0): 286 | TxBuf[23]=ord('-') 287 | pitch = -pitch 288 | for cnt in range(3): 289 | temp = ((pitch % 10)+48) 290 | pitch //= 10 291 | TxBuf[24+2-cnt]=temp 292 | TxBuf[27] = ord('\n') 293 | return TxBuf 294 | 295 | 296 | #部署线程 297 | class NRFOnline(threading.Thread): 298 | data = [1] 299 | delay = 0 300 | systemFlag = 0 301 | def __init__(self,freq,TxBuf,RxBuf,ValidShip,systemFlag): 302 | threading.Thread.__init__(self) 303 | self.freq = freq 304 | self.TxBuf = TxBuf 305 | self.RxBuf = RxBuf 306 | self.data = [1] 307 | self.delay = 1/freq 308 | self.ValidShip = ValidShip 309 | self.systemFlag = systemFlag 310 | def run(self): 311 | while self.systemFlag==1: 312 | time.sleep(self.delay) 313 | #print(SPI_Read_Buf(FIFO_STATUS, self.data,1)) 314 | if nRF24L01_TxPacket(sendBack_data_attitude(self.ValidShip))==0: 315 | pass 316 | #print("Data Sent") 317 | def stop(self): 318 | self.systemFlag = 0 319 | 320 | if __name__ == "__main__": 321 | TxBuf = [3,ord('a'),ord('b'),ord('c'),1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0] 322 | RxBuf = [0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0] 323 | GPIO_Init() 324 | Init_NRF24L01() 325 | printConfig() 326 | while True: 327 | time.sleep(1) 328 | if nRF24L01_TxPacket(TxBuf)==0: 329 | pass 330 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 无人船上位机端程序 2 | 此为使用多线程开发的无人船上位机程序,即一个CPU即可处理多个任务。 3 | ## 功能 4 | * 语音提示GPS连接情况、机体运行情况等。(只需要给上位机接一个小音箱) 5 | * 使用遥控器控制 6 | * 采集GPS坐标:此时在使用遥控器控制的同时,上位机在后台记录当前GPS坐标点 7 | * 输入GPS坐标,自主导航。(输入坐标的方法可用Google Earth采点或使用之前采集的GPS坐标) 8 | # 使用说明 9 | 将整个工程文件用git clone的方式下载到某个目录下(比如桌面Desktop/UAS/),然后进入文件夹内,输入sudo python3 MainSequence.py即可。 10 | 如有需要也可以直接将MainSequence.py配置为开机自启。 11 | # 整体代码说明: 12 | * LocationTrans文件夹内的脚本用于把从谷歌地球上采集的坐标点转换为GPS可用的坐标点。其中: 13 | * 谷歌地球中提取坐标点时会得到一个kml格式的文件,此时将其重命名为MapDataOutput.kml,拖进LocationTrans文件夹内 14 | * 点击kml2txt.py文件,此时会生成一个LatLong.txt文件,此即上位机可用的坐标文件(点开可以看到具体的GPS坐标) 15 | * txt2kml.py文件用于实现上述过程的反向实现。即:当你使用采点模式记录下载具走过的路线之后,载具上位机端会生成一个*.txt的坐标文件。点击txt2kml.py会将此文件转换为*.kml文件,打开*.kml即可直接在谷歌地球上观察载具之前记录的坐标点。 16 | * sound文件夹用于存储语音提示时的音频 17 | * AziFromPos.py将方位角转换为GPS坐标。即:输入目标点相对于载具的方位角(比如北偏东多少度),以及两点之间距离,此脚本会根据当前坐标点生成目标点的GPS坐标。 18 | * Comm.py用于与下位机串口通信。 19 | * Ctrl.py用于连接LoRa模块(没有也一样用,这里可以无视),同时获取坐标点用于导航。 20 | * Record_Coordinates.py用于记录坐标点。 21 | * Madgwick_AHRS_Test.py 用于评估算法收敛程度。在实际使用时可以无视这个文件。 22 | * MainSequence.py 为主程序,负责上面提到的各个模块的调度与初始化等等。在使用时,需要显式调用的程序只有MainSequence.py。 23 | 24 | # 同时也在开发基于ROS的上位机程序 25 | * [上位机端ROS版Github地址](https://github.com/matreshka15/ROS-based-unmanned-vehicle-project) 26 | 建议使用非ROS版上位机程序,原因:开发环境容易配置(只需要Python),并且稳定性好。 27 | * [姿态解算算法的解释与实机演示视频](https://zhuanlan.zhihu.com/p/82973264) 28 | ### 重要!所有开发下位机过程中的开发日志以及手册均已存放在下面地址 29 | * [开发无人船过程中参考的传感器手册以及算法资料](https://github.com/matreshka15/unmanned-ship-datasheets) 30 | * 开发日志记录了项目从一开始的立项到后面一步步测试成功的大大小小细节。前后由于放弃了旧的姿态算法、选取了新的姿态算法,因此前期关于姿态的说明仅供参考用。 31 | * 通信协议的部分已摘抄出来,放在超链接处的Repo目录下。即:整体框架与通信协议.docx 32 | 33 | # 开发环境 34 | 在树莓派3B上开发,树莓派4上测试也没问题。理论支持任何支持python的开发板 35 | # 其他 36 | * 正在将此程序移植至ROS平台,连接:https://github.com/matreshka15/uas-raspi-ros 37 | * 如有意向共同开发,请联系作者 38 | * Email:8523429@qq.com 39 | -------------------------------------------------------------------------------- /Record_Coordinates.py: -------------------------------------------------------------------------------- 1 | '''Copyright 2019 李东豫<8523429@qq.com> 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License.''' 14 | # -*- coding: utf-8 -* 15 | 16 | #记录点函数 17 | #传入参数: 18 | #startbit:记录点标志位; 19 | #file:打开的文件 20 | #index:写入点的索引号 21 | def start(file,index,longtitude,latitude,height): 22 | #print(index + ':' + longtitude + ',' + latitude + ',' + height + '\n') 23 | file.write(str(index) + ':' + str(longtitude) + ',' + str(latitude) + ',' + str(height) + '\n') 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /rpi-pins-40-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matreshka15/USV-raspberrypi-part/b93e586b19967f3acb5baa741d9f8426a1ab0b9f/rpi-pins-40-0.png -------------------------------------------------------------------------------- /sound/ARRIVEDEST.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matreshka15/USV-raspberrypi-part/b93e586b19967f3acb5baa741d9f8426a1ab0b9f/sound/ARRIVEDEST.mp3 -------------------------------------------------------------------------------- /sound/GPSFIXED.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matreshka15/USV-raspberrypi-part/b93e586b19967f3acb5baa741d9f8426a1ab0b9f/sound/GPSFIXED.mp3 -------------------------------------------------------------------------------- /sound/GPSNOFIX.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matreshka15/USV-raspberrypi-part/b93e586b19967f3acb5baa741d9f8426a1ab0b9f/sound/GPSNOFIX.mp3 -------------------------------------------------------------------------------- /sound/SEQUENCESTART.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matreshka15/USV-raspberrypi-part/b93e586b19967f3acb5baa741d9f8426a1ab0b9f/sound/SEQUENCESTART.mp3 -------------------------------------------------------------------------------- /sound/SYSTEMSHUTDOWN.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matreshka15/USV-raspberrypi-part/b93e586b19967f3acb5baa741d9f8426a1ab0b9f/sound/SYSTEMSHUTDOWN.mp3 -------------------------------------------------------------------------------- /sound/subthreadserr.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matreshka15/USV-raspberrypi-part/b93e586b19967f3acb5baa741d9f8426a1ab0b9f/sound/subthreadserr.mp3 -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd /home/pi/RpiCentre 3 | sleep 5s 4 | nohup sudo python3 MainSequence.py & 5 | --------------------------------------------------------------------------------