Changeset 224 in flair-src for trunk/lib/FlairSensorActuator/src/SimuGps.cpp
- Timestamp:
- Mar 6, 2018, 12:12:58 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSensorActuator/src/SimuGps.cpp
r214 r224 18 18 #include "SimuGps.h" 19 19 #include <FrameworkManager.h> 20 #include <GeoCoordinate.h>21 20 #include <GpsData.h> 22 21 #include <SharedMem.h> … … 57 56 58 57 59 SimuGps::SimuGps(const IODevice *parent, string name, uint32_t modelId,uint32_t deviceId)60 : NmeaGps(parent, name), Thread(parent, name, 0) {61 dataRate = NULL;62 63 shmem = new SharedMem((Thread *)this,ShMemName(modelId, deviceId),64 sizeof(gps_states_t));65 66 SetIsReady(true);67 }68 69 58 SimuGps::~SimuGps() { 70 59 SafeStop(); … … 76 65 dev_name << "simu" << modelId << "_gps_" << deviceId; 77 66 return dev_name.str().c_str(); 78 }79 80 void SimuGps::UpdateFrom(const io_data *data) {81 if (data != NULL) {82 Matrix *input = (Matrix *)data;83 gps_states_t state;84 85 input->GetMutex();86 //simulator is ned, convert it to enu87 //TODO: put simulator in enu?88 state.e = input->ValueNoMutex(5, 0);//y simulator89 state.n = input->ValueNoMutex(4, 0);//x simulator90 state.u = -input->ValueNoMutex(6, 0);//z simulator91 state.ve = input->ValueNoMutex(11, 0);//vy simulator92 state.vn = input->ValueNoMutex(10, 0);//vx simulator93 input->ReleaseMutex();94 95 shmem->Write((char *)&state, sizeof(gps_states_t));96 }97 67 } 98 68
Note:
See TracChangeset
for help on using the changeset viewer.