Changeset 286 in flair-src for trunk/lib/FlairMeta/src/SimuX8.cpp


Ignore:
Timestamp:
Jan 8, 2019, 10:13:03 AM (3 years ago)
Author:
Sanahuja Guillaume
Message:

draw vrpn axis in simulator

File:
1 edited

Legend:

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

    r268 r286  
    2020#include <FrameworkManager.h>
    2121#include <X4X8Multiplex.h>
    22 #include <SimuImu.h>
    23 #include <SimuAhrs.h>
    24 #include <SimuBldc.h>
    25 #include <SimuUs.h>
    26 #include <SimuCamera.h>
    27 #include <SimuPressureSensor.h>
     22#include <SimulatedImu.h>
     23#include <SimulatedAhrs.h>
     24#include <SimulatedBldc.h>
     25#include <SimulatedUs.h>
     26#include <SimulatedCamera.h>
     27#include <SimulatedPressureSensor.h>
    2828#include <BatteryMonitor.h>
    29 #include <SimuGps.h>
     29#include <SimulatedGps.h>
    3030#include <Tab.h>
    3131#include <FindArgument.h>
     
    4848    SetMultiplex(new X4X8Multiplex("motors", X4X8Multiplex::X8));
    4949
    50   SetBldc(new SimuBldc(GetUavMultiplex(), GetUavMultiplex()->GetLayout(),
     50  SetBldc(new SimulatedBldc(GetUavMultiplex(), GetUavMultiplex()->GetLayout(),
    5151                       "motors", GetUavMultiplex()->MotorsCount(), simu_id,0));
    52   SetUsRangeFinder(new SimuUs("us", simu_id,0, 60));
    53   SetAhrs(new SimuAhrs("ahrs", simu_id, 0,70));
     52  SetUsRangeFinder(new SimulatedUs("us", simu_id,0, 60));
     53  SetAhrs(new SimulatedAhrs("ahrs", simu_id, 0,70));
    5454  Tab *bat_tab = new Tab(getFrameworkManager()->GetTabWidget(), "battery");
    5555  SetBatteryMonitor(new BatteryMonitor(bat_tab->NewRow(), "battery"));
     
    5959        ReadCameraResolutionOption(options,"camv",camvWidth,camvHeight);
    6060  Info("using vertical camera resolution: %ix%i\n",camvWidth, camvHeight);
    61   SetVerticalCamera(new SimuCamera("simu_cam_v", camvWidth, camvHeight, 3, simu_id,0, 10));
     61  SetVerticalCamera(new SimulatedCamera("simu_cam_v", camvWidth, camvHeight, 3, simu_id,0, 10));
    6262 
    6363  uint16_t camhWidth=320,camhHeight=240;
    6464  ReadCameraResolutionOption(options,"camh",camhWidth,camhHeight);
    6565  Info("using horizontal camera resolution: %ix%i\n",camhWidth, camhHeight);
    66   SetHorizontalCamera(new SimuCamera("simu_cam_h", camhWidth, camhHeight, 3, simu_id,1, 10));
     66  SetHorizontalCamera(new SimulatedCamera("simu_cam_h", camhWidth, camhHeight, 3, simu_id,1, 10));
    6767 
    6868  string useGps=FindArgument(options,"use_gps=",false);
    6969  if(useGps=="true") {
    70     SetGps(new SimuGps("gps", (NmeaGps::NMEAFlags_t)(NmeaGps::GGA | NmeaGps::VTG), 0,0, 40));
     70    SetGps(new SimulatedGps("gps", (NmeaGps::NMEAFlags_t)(NmeaGps::GGA | NmeaGps::VTG), 0,0, 40));
    7171  }
    7272 
    7373  string usePressureSensor=FindArgument(options,"use_pressure_sensor=",false);
    7474  if(usePressureSensor=="true") {
    75     SetPressureSensor(new SimuPressureSensor("pressuresensor", 0,0, 10));
     75    SetPressureSensor(new SimulatedPressureSensor("pressuresensor", 0,0, 10));
    7676  }
    7777}
     
    8080
    8181void SimuX8::StartSensors(void) {
    82   ((SimuImu *)(GetAhrs()->GetImu()))->Start();
    83   ((SimuUs *)GetUsRangeFinder())->Start();
    84   ((SimuCamera *)GetVerticalCamera())->Start();
    85   ((SimuCamera *)GetHorizontalCamera())->Start();
    86   if(GetGps()) ((SimuGps *)GetGps())->Start();
    87   if(GetPressureSensor()) ((SimuPressureSensor *)GetPressureSensor())->Start();
     82  ((SimulatedImu *)(GetAhrs()->GetImu()))->Start();
     83  ((SimulatedUs *)GetUsRangeFinder())->Start();
     84  ((SimulatedCamera *)GetVerticalCamera())->Start();
     85  ((SimulatedCamera *)GetHorizontalCamera())->Start();
     86  if(GetGps()) ((SimulatedGps *)GetGps())->Start();
     87  if(GetPressureSensor()) ((SimulatedPressureSensor *)GetPressureSensor())->Start();
    8888}
    8989
Note: See TracChangeset for help on using the changeset viewer.