參數 | |
空機重量 | 390g |
起飛重量(11.1V 2200mAh) | 550g |
續航時間 | 20分鐘 |
載重能力 | 200g |
懸停力效率 | >10g/w |
電機 | 2206 kv1200 |
槳 | 8043 |
單個電機最大推力 | 290g |
傳感器 | 型號 |
陀螺儀 | MAX21000 |
加速度計 | ADXL362 |
磁阻 | HMC5983 |
氣壓計 | MS5611 |
參數 | 值 |
陀螺儀ODR | 2kHz |
姿態解算更新率 | 1kHz |
控制更新率 | 1kHz |
電調控制更新率 | 1kHz |
CPU 占用率 | 50~70%* |
可擴展標記語言(英語:eXtensible Markup Language,簡稱: XML),是一種標記語言。標記指計算機所能理解的信息符號,通過此種標記,計算機之間可以處理包含各種信息的文章等。如何定義這些標記,既可以選擇國際通用的標記語言,比如HTML,也可以使用像XML這樣由相關人士自由決定的標記語言,這就是語言的可擴展性。XML是從標準通用標記語言(SGML)中簡化修改出來的。它主要用到的有可擴展標記語言、可擴展樣式語言(XSL)、XBRL和XPath等。[1]上面說了一堆,意思就是說,.kml 呢,實際上就是一個文本文件,里面用文本記錄各種描述,比如線,顏色圖形,位置等等。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | <?xml version="1.0" encoding="UTF-8"?> <kml xmlns=""> <Document> <name>Paths</name> <description> DBP V0.4 KML LOG</description> <Style id="yellowLineGreenPoly"> <LineStyle> <color>7f00ffff</color> <width>4</width> </LineStyle> <PolyStyle> <color>5f00ff00</color> </PolyStyle> </Style> <Placemark> <name>Absolute Extruded</name> <description>Deep Blue Plane V0.4 Path</description> <styleUrl>#yellowLineGreenPoly</styleUrl> <LineString> <extrude>1</extrude> <tessellate>1</tessellate> <altitudeMode>absolute</altitudeMode> <coordinates> ........ </coordinates> </LineString> </Placemark> </Document> </kml> |
1 2 3 4 5 6 7 8 9 | <Style id="yellowLineGreenPoly"> <LineStyle> <color>7f00ffff</color> <width>4</width> </LineStyle> <PolyStyle> <color>5f00ff00</color> </PolyStyle> </Style> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | //記錄kml文件 void entry_thread_kml_log(void* parameter) { int fd = -1; int size; int gps_count_bef = 1; char buf[512]; char dir[64]; unsigned int buf_offset = 0; //指示上一次寫到哪里 unsigned long long file_byte_seek = 0; //指示文件長度 unsigned int head_len = 0; //文件頭尾的長度 unsigned int tail_len = 0; const char file_name[] = "path.kml"; const char head[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" "<kml xmlns=\"\">\n" "\t<Document>\n" "<name>Paths</name>\n" "<description> DBP V0.4 KML LOG</description>\n" "<Style id=\"yellowLineGreenPoly\">\n" " <LineStyle>\n" " <color>7f00ffff</color>\n" " <width>4</width>\n" " </LineStyle>\n" " <PolyStyle>\n" " <color>5f00ff00</color>\n" " </PolyStyle>\n" "</Style>\n" "<Placemark>\n" " <name>Absolute Extruded</name>\n" " <description>Deep Blue Plane V0.4 Path</description>\n" " <styleUrl>#yellowLineGreenPoly</styleUrl> \n" " <LineString>\n" " <extrude>1</extrude>\n" " <tessellate>1</tessellate>\n" //這一句是有沒有豎線 " <altitudeMode>absolute</altitudeMode>\n" " <coordinates>\n"; const char tail[] = " </coordinates>\n " " </LineString>\n" " </Placemark>\n" "</Document>\n" "</kml>\n"; //預先記錄文件頭尾長度 head_len = strlen(head); tail_len = strlen(tail); //復制工作區 目錄 strcpy(dir, log_dir); //打開記錄文件 strcat(dir, file_name); //try to open the working file while(fd < 0) { int count = 0; fd = open(dir, O_WRONLY | O_CREAT, 0); rt_thread_delay(RT_TICK_PER_SECOND); if ((count ++ )> 60) //60 seconds { rt_kprintf("kml: open file for write failed\n"); return; } } rt_kprintf("google earth file'path.kml' has been created.\n"); //寫入文件頭 write(fd, head, head_len); file_byte_seek += head_len; //主循環 while(1) { while(gps_count_bef >= gps.count) { rt_thread_delay(5); } gps_count_bef = gps.count; //mark for 1 second a cycle //等待直到數據有效 if(gps.flag == 0) continue; sprintf(buf,"\t\t\t\t%f,%f,%f\n", gps.lon, gps.lat, gps.altitude); //將緩存區寫入文件 size = write(fd, buf, strlen(buf)); file_byte_seek += size; //記錄寫入長度 if(size>0) { //rt_kprintf(buf); } else { rt_kprintf("kml log: Write to file wrong!\n"); while(1) rt_thread_delay(1000); //相當于停止這個線程 } //寫入文件尾 write(fd, tail, tail_len); close(fd); fd = open(dir, O_WRONLY | O_CREAT | O_APPEND, 0);//末尾重新打開 //覆蓋 從文件頭開始計算寫入了多少有效數據,覆蓋文件尾 lseek(fd, file_byte_seek, DFS_SEEK_SET); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | GGA Global Positioning System Fix Data 123519 Fix taken at 12:35:19 UTC 4807.038,N Latitude 48 deg 07.038' N 01131.000,E Longitude 11 deg 31.000' E 1 Fix quality: 0 = invalid 1 = GPS fix (SPS) 2 = DGPS fix 3 = PPS fix 4 = Real Time Kinematic 5 = Float RTK 6 = estimated (dead reckoning) (2.3 feature) 7 = Manual input mode 8 = Simulation mode 08 Number of satellites being tracked 0.9 Horizontal dilution of position 545.4,M Altitude, Meters, above mean sea level 46.9,M Height of geoid (mean sea level) above WGS84 ellipsoid (empty field) time in seconds since last DGPS update (empty field) DGPS station ID number *47 the checksum data, always begins with * |
1 2 | AccAdX = ADC0H; AccAdX = (AccAdX<<8) + ADCHL; |
歡迎光臨 (http://m.zg4o1577.cn/bbs/) | Powered by Discuz! X3.1 |