- Timestamp:
- Aug 30, 2016, 6:42:07 PM (8 years ago)
- Location:
- trunk/lib/FlairSensorActuator/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSensorActuator/src/NmeaGps.cpp
r67 r68 53 53 } 54 54 55 /*56 if ((NMEAFlags & GST) != 0) {57 desc->SetElementName(index, 0, "dev_lat");58 desc->SetElementName(index + 1, 0, "dev_lon");59 desc->SetElementName(index + 2, 0, "dev_elv");60 index += 3;61 }62 */63 64 55 // station sol 65 56 mainTab = new Tab(parent->GetTabWidget(), name); -
trunk/lib/FlairSensorActuator/src/SimuGps.cpp
r55 r68 79 79 //simulator is ned, convert it to enu 80 80 //TODO: put simulator in enu? 81 state.x = input->ValueNoMutex(5, 0); 82 state.y = input->ValueNoMutex(4, 0); 83 state.z = -input->ValueNoMutex(6, 0); 81 state.e = input->ValueNoMutex(5, 0);//y simulator 82 state.n = input->ValueNoMutex(4, 0);//x simulator 83 state.u = -input->ValueNoMutex(6, 0);//z simulator 84 state.ve = input->ValueNoMutex(11, 0);//vy simulator 85 state.vn = input->ValueNoMutex(10, 0);//vx simulator 84 86 input->ReleaseMutex(); 85 87 … … 90 92 void SimuGps::Run(void) { 91 93 gps_states_t state; 92 char buf[5 00];94 char buf[512]; 93 95 nmeaGPGGA gga; 94 96 nmeaGPVTG vtg; 95 97 nmeaPOS pos; 96 98 nmeaINFO info; 99 100 vtg.dir_t='T'; 101 vtg.dec_m='M'; 102 vtg.spk_k='K'; 103 vtg.spn_n='N'; 97 104 98 105 if (dataRate == NULL) { … … 105 112 WarnUponSwitches(true); 106 113 107 vtg.spn=1;108 vtg.dir=0;109 114 110 115 while (!ToBeStopped()) { … … 118 123 119 124 double x, y, z; 120 ENU_2_ECEF(state. x, state.y, state.z, x,y,z, Euler::ToRadian(longitudeRef->Value()), Euler::ToRadian(latitudeRef->Value()), altitudeRef->Value());125 ENU_2_ECEF(state.e, state.n, state.u, x,y,z, Euler::ToRadian(longitudeRef->Value()), Euler::ToRadian(latitudeRef->Value()), altitudeRef->Value()); 121 126 ECEF_2_Geographique( x, y, z,pos.lon, pos.lat, gga.elv); 122 127 nmea_pos2info(&pos,&info); … … 142 147 nmea_gen_GPGGA(buf,sizeof(buf),&gga); 143 148 parseFrame(buf,sizeof(buf)); 149 150 vtg.dir=90-Euler::ToDegree(atan2f(state.vn,state.ve)); 151 vtg.spk=sqrtf(state.ve*state.ve+state.vn*state.vn)*3600./1000.; 152 nmea_gen_GPVTG(buf,sizeof(buf),&vtg); 153 parseFrame(buf,sizeof(buf)); 144 154 } 145 155 -
trunk/lib/FlairSensorActuator/src/SimuGps.h
r55 r68 87 87 88 88 typedef struct { 89 float x; 90 float y; 91 float z; 89 float e; 90 float n; 91 float u; 92 float ve; 93 float vn; 92 94 } gps_states_t; 93 95
Note:
See TracChangeset
for help on using the changeset viewer.