Changeset 180 in flair-src


Ignore:
Timestamp:
May 31, 2017, 3:53:32 PM (3 years ago)
Author:
Sanahuja Guillaume
Message:

modifs gps

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ReleaseNotes

    r176 r180  
    11* Actual Version:
    22
     3- added GSA nmea sentence
    34- resolved https://devel.hds.utc.fr/software/flair/ticket/18
    45- Vector2D and Vector3D are now templates. Replace all Vector2D to Vector2Df and Vector3D to Vector3Df to keep compatibility.
  • trunk/lib/FlairCore/src/GpsData.cpp

    r51 r180  
    4949    case GpsData::EastVelocity:
    5050    case GpsData::NorthVelocity:
     51    case GpsData::Pdop:
     52    case GpsData::Hdop:
     53    case GpsData::Vdop:
    5154      size=4;
    5255      break;
     
    6265  void CopyData(char *dst) const {
    6366    double latitude,longitude;
    64     float altitude,east,north,up,eastVelocity,northVelocity;
     67    float altitude,east,north,up,eastVelocity,northVelocity,pDop,hDop,vDop;
    6568
    6669    gpsdata->GetLla(latitude,longitude,altitude);
     
    6972    gpsdata->GetEnu(east,north,up);
    7073    gpsdata->GetVelocity(eastVelocity,northVelocity);
     74    gpsdata->GetDop(pDop,hDop,vDop);
    7175
    7276    switch (plotableData) {
     
    100104    case GpsData::NorthVelocity:
    101105      memcpy(dst, &northVelocity, sizeof(northVelocity));
     106      break;
     107    case GpsData::Pdop:
     108      memcpy(dst, &pDop, sizeof(pDop));
     109      break;
     110    case GpsData::Hdop:
     111      memcpy(dst, &hDop, sizeof(hDop));
     112      break;
     113    case GpsData::Vdop:
     114      memcpy(dst, &vDop, sizeof(vDop));
    102115      break;
    103116    default:
     
    119132    case GpsData::EastVelocity:
    120133    case GpsData::NorthVelocity:
     134    case GpsData::Pdop:
     135    case GpsData::Hdop:
     136    case GpsData::Vdop:
    121137      return floatType;
    122138      break;
     
    150166  AppendLogDescription("east velocity", floatType);
    151167  AppendLogDescription("north velocity", floatType);
     168  AppendLogDescription("pdop", floatType);
     169  AppendLogDescription("hdop", floatType);
     170  AppendLogDescription("vdop", floatType);
    152171
    153172  numberOfSatellites=0;
     
    220239}
    221240
     241void GpsData::GetDop(float &inPdop, float &inHdop,float &inVdop) const {
     242  inPdop=pDop;
     243  inHdop=hDop;
     244  inVdop=vDop;
     245}
     246
     247void GpsData::SetDop(float inPdop, float inHdop,float inVdop) {
     248  pDop=inPdop;
     249  hDop=inHdop;
     250  vDop=inVdop;
     251}
     252 
    222253IODataElement *GpsData::Element(PlotableData_t data_type) const {
    223254  string name;
     
    252283  case GpsData::NorthVelocity:
    253284    name = "NorthVelocity";
     285    break;
     286  case GpsData::Pdop:
     287    name = "Pdop";
     288    break;
     289  case GpsData::Hdop:
     290    name = "Hdop";
     291    break;
     292  case GpsData::Vdop:
     293    name = "Vdop";
    254294    break;
    255295  }
     
    271311  Queue(&dst, &eastVelocity, sizeof(eastVelocity));
    272312  Queue(&dst, &northVelocity, sizeof(northVelocity));
     313  Queue(&dst, &pDop, sizeof(pDop));
     314  Queue(&dst, &hDop, sizeof(hDop));
     315  Queue(&dst, &vDop, sizeof(vDop));
    273316
    274317  ReleaseMutex();
  • trunk/lib/FlairCore/src/GpsData.h

    r167 r180  
    4141      size += UInt8Type.GetSize(); // FixQuality_t
    4242      size += 5*floatType.GetSize();//e,n,u,ve,vn
     43      size += 3*floatType.GetSize();//pdop,hdop,vdop
    4344      return size;
    4445    }
     
    6263    EastVelocity /*! east velocity*/,
    6364    NorthVelocity /*! north velocity*/,
     65    Pdop /* dilution of precision*/,
     66    Hdop /* horizontal dilution of precision*/,
     67    Vdop /* vertical dilution of precision*/,
    6468  } PlotableData_t;
    6569
     
    214218  */
    215219  void SetFixQuality(FixQuality_t fixQuality);
     220 
     221  /*!
     222  * \brief Get dilution of precision
     223  *
     224  * This method is mutex protected.
     225  *
     226  * \param pDop dilution of precision
     227  * \param hDop horizontal dilution of precision
     228  * \param vDop vertical dilution of precision
     229  *
     230  */
     231  void GetDop(float &pDop, float &hDop,float &vDop) const;
     232
     233  /*!
     234  * \brief Set dilution of precision
     235  *
     236  * This method is mutex protected.
     237  *
     238  * \param pDop dilution of precision
     239  * \param hDop horizontal dilution of precision
     240  * \param vDop vertical dilution of precision
     241  *
     242  */
     243  void SetDop(float pDop, float hDop,float vDop);
    216244
    217245  Type const &GetDataType() const { return dataType; }
     
    234262  uint8_t numberOfSatellites;
    235263  FixQuality_t fixQuality;
    236   float east,north,up,eastVelocity,northVelocity;
     264  float east,north,up,eastVelocity,northVelocity,pDop,hDop,vDop;
    237265};
    238266
  • trunk/lib/FlairSensorActuator/src/Mb800.cpp

    r170 r180  
    9292    }
    9393  }
     94  if ((NMEAFlags & GSA) != 0) {
     95    char to_send[] = "$PASHS,NME,GSA,A,ON,0.1\r\n";
     96    written = serialport->Write(to_send, sizeof(to_send));
     97    if (written< 0) {
     98      Thread::Err("erreur Write (%s)\n", strerror(-written));
     99    }
     100  }
    94101
    95102  Sync();
  • trunk/lib/FlairSensorActuator/src/NmeaGps.cpp

    r170 r180  
    233233        gpsData->SetVelocity(info.speed * 1000. / 3600. * sin(Euler::ToRadian(info.direction)),
    234234                                  info.speed * 1000. / 3600. * cos(Euler::ToRadian(info.direction)));
    235       }/*
     235      }
     236      if ((NMEAFlags & GSA) != 0) {
     237        gpsData->SetDop(info.PDOP,info.HDOP,info.VDOP);
     238      }
     239      /*
    236240      if ((NMEAFlags & GST) != 0) {
    237241        // Thread::Printf("dev_lon:%f dev_lat:%f
  • trunk/lib/FlairSensorActuator/src/NmeaGps.h

    r170 r180  
    5353    VTG = 0x02, /*!< VTG */
    5454    GST = 0x04, /*!< GST */
     55    GSA = 0x08, /*!< GSA */
    5556  };
    5657
Note: See TracChangeset for help on using the changeset viewer.