Ignore:
Timestamp:
03/06/18 12:12:58 (4 years ago)
Author:
Sanahuja Guillaume
Message:

maj for armv5te

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairSensorActuator/src/SimuGps.cpp

    r214 r224  
    1818#include "SimuGps.h"
    1919#include <FrameworkManager.h>
    20 #include <GeoCoordinate.h>
    2120#include <GpsData.h>
    2221#include <SharedMem.h>
     
    5756
    5857
    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 
    6958SimuGps::~SimuGps() {
    7059  SafeStop();
     
    7665  dev_name << "simu" <<  modelId << "_gps_" << deviceId;
    7766  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 enu
    87     //TODO: put simulator in enu?
    88     state.e = input->ValueNoMutex(5, 0);//y simulator
    89     state.n = input->ValueNoMutex(4, 0);//x simulator
    90     state.u = -input->ValueNoMutex(6, 0);//z simulator
    91     state.ve = input->ValueNoMutex(11, 0);//vy simulator
    92     state.vn = input->ValueNoMutex(10, 0);//vx simulator
    93     input->ReleaseMutex();
    94 
    95     shmem->Write((char *)&state, sizeof(gps_states_t));
    96   }
    9767}
    9868
Note: See TracChangeset for help on using the changeset viewer.