Changeset 157 in flair-src for trunk/lib/FlairMeta/src/SimuX4.cpp


Ignore:
Timestamp:
Mar 4, 2017, 3:29:18 PM (4 years ago)
Author:
Sanahuja Guillaume
Message:

iadded isready to iodevice:
avoid problem of imu not ready in ardrone2

File:
1 edited

Legend:

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

    r137 r157  
    2626#include <BatteryMonitor.h>
    2727#include <Tab.h>
     28#include <FindArgument.h>
    2829
    2930using std::string;
     
    3738namespace meta {
    3839
    39 SimuX4::SimuX4(string name, int simu_id,
     40SimuX4::SimuX4(string name, int simu_id,string options,
    4041               filter::UavMultiplex *multiplex)
    4142    : Uav(name, multiplex) {
     
    5152  SetBatteryMonitor(new BatteryMonitor(bat_tab->NewRow(), "battery"));
    5253  GetBatteryMonitor()->SetBatteryValue(12);
     54 
     55  string camvOpts=FindArgument(options,"camv=",false);
     56  uint16_t camvWidth=320,camvHeight=240;
     57        if(camvOpts=="") {
     58    Info("using default vertical camera resolution: %ix%i\n",camvWidth, camvHeight);
     59        }
     60 
    5361  SetVerticalCamera(
    54       new SimuCamera("simu_cam_v", 320, 240, 3, simu_id, 10));
     62      new SimuCamera("simu_cam_v", camvWidth, camvHeight, 3, simu_id, 10));
    5563}
    5664
     
    5866
    5967void SimuX4::StartSensors(void) {
    60   ((SimuAhrs *)GetAhrs())->Start();
     68  ((SimuImu *)(GetAhrs()->GetImu()))->Start();
    6169  ((SimuUs *)GetUsRangeFinder())->Start();
    6270  ((SimuCamera *)GetVerticalCamera())->Start();
    6371}
    6472
     73
    6574} // end namespace meta
    6675} // end namespace flair
Note: See TracChangeset for help on using the changeset viewer.