Changeset 245 in flair-src for trunk/lib


Ignore:
Timestamp:
May 24, 2018, 11:45:54 AM (4 years ago)
Author:
Sanahuja Guillaume
Message:

added simupressuresensor

Location:
trunk/lib
Files:
4 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairMeta/src/SimuX4.cpp

    r206 r245  
    2424#include <SimuUs.h>
    2525#include <SimuCamera.h>
     26#include <SimuPressureSensor.h>
    2627#include <BatteryMonitor.h>
    2728#include <SimuGps.h>
     
    6768  if(useGps=="true") {
    6869    SetGps(new SimuGps("gps", (NmeaGps::NMEAFlags_t)(NmeaGps::GGA | NmeaGps::VTG), 0,0, 40));
     70  }
     71 
     72  string usePressureSensor=FindArgument(options,"use_pressure_sensor=",false);
     73  if(usePressureSensor=="true") {
     74    SetPressureSensor(new SimuPressureSensor("pressuresensor", 0,0, 10));
    6975  }
    7076}
     
    7884  //((SimuCamera *)GetHorizontalCamera())->Start();
    7985  if(GetGps()) ((SimuGps *)GetGps())->Start();
     86  if(GetPressureSensor()) ((SimuPressureSensor *)GetPressureSensor())->Start();
    8087}
    8188
  • trunk/lib/FlairMeta/src/SimuX8.cpp

    r186 r245  
    2424#include <SimuUs.h>
    2525#include <SimuCamera.h>
     26#include <SimuPressureSensor.h>
    2627#include <BatteryMonitor.h>
    2728#include <SimuGps.h>
     
    6869    SetGps(new SimuGps("gps", (NmeaGps::NMEAFlags_t)(NmeaGps::GGA | NmeaGps::VTG), 0,0, 40));
    6970  }
     71 
     72  string usePressureSensor=FindArgument(options,"use_pressure_sensor=",false);
     73  if(usePressureSensor=="true") {
     74    SetPressureSensor(new SimuPressureSensor("pressuresensor", 0,0, 10));
     75  }
    7076}
    7177
     
    7884  ((SimuCamera *)GetHorizontalCamera())->Start();
    7985  if(GetGps()) ((SimuGps *)GetGps())->Start();
     86  if(GetPressureSensor()) ((SimuPressureSensor *)GetPressureSensor())->Start();
    8087}
    8188
  • trunk/lib/FlairSensorActuator/src/SimuCamera.cpp

    r238 r245  
    6363void SimuCamera::Run(void) {
    6464  Time time;
    65 //  if (data_rate == NULL) {
    66 //    Thread::Err("not applicable for simulation part.\n");
    67 //    return;
    68 //  }
    6965
    7066//  SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
  • trunk/lib/FlairSensorActuator/src/SimuGps.cpp

    r224 r245  
    8282  gga.diff_units='M';
    8383
    84   if (dataRate == NULL) {
    85     Thread::Err("not applicable for simulation part.\n");
    86     return;
    87   }
    88 
    8984  SetPeriodUS((uint32_t)(1000000. / dataRate->Value()));
    9085
  • trunk/lib/FlairSensorActuator/src/SimuImu.cpp

    r224 r245  
    6262  GetDatas(&imuData);
    6363
    64   if (dataRate == NULL) {
    65     Thread::Err("not applicable for simulation part.\n");
    66     return;
    67   }
    68 
    6964  SetPeriodUS((uint32_t)(1000000. / dataRate->Value()));
    7065
  • trunk/lib/FlairSensorActuator/src/SimuLaser.cpp

    r224 r245  
    5656  float z[360];
    5757
    58   if (data_rate == NULL) {
    59     Thread::Err("not applicable for simulation part.\n");
    60     return;
    61   }
    62 
    6358  SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
    6459
  • trunk/lib/FlairSensorActuator/src/SimuUs.cpp

    r230 r245  
    5555void SimuUs::Run(void) {
    5656  float z;
    57 
    58   if (data_rate == NULL) {
    59     Thread::Err("not applicable for simulation part.\n");
    60     return;
    61   }
    62 
     57 
    6358  SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
    6459
  • trunk/lib/FlairSimulator/src/SimuUs.h

    r224 r245  
    6767  */
    6868  void UpdateFrom(const core::io_data *data){};
    69 
    70   /*!
    71   * \brief Run function
    72   *
    73   * Reimplemented from Thread.
    74   *
    75   */
    76   void Run(void);
    7769 
    7870  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
  • trunk/lib/FlairSimulator/src/SimuUsGL.cpp

    r214 r245  
    5555    // todo: utiliser le placement de l'us dans le drone et sa portée
    5656    Matrix *input = (Matrix *)data;
    57     value = input->Value(9, 0);
     57    value = input->Value(6, 0);
    5858    shmem->Write((char *)&value, sizeof(float));
    5959#ifdef GL
Note: See TracChangeset for help on using the changeset viewer.