Changeset 186 in flair-src for trunk/lib/FlairMeta


Ignore:
Timestamp:
06/23/17 17:33:03 (5 years ago)
Author:
Sanahuja Guillaume
Message:

maj imu

Location:
trunk/lib/FlairMeta/src
Files:
5 edited

Legend:

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

    r185 r186  
    4949                       "motors", GetUavMultiplex()->MotorsCount(), i2cport));
    5050  SetUsRangeFinder(new Srf08("SRF08", i2cport, 0x70, 60));
    51   SetAhrs(new Gx3_25_ahrs("imu", imu_port,
     51  SetAhrs(new Gx3_25_ahrs("ahrs", imu_port,
    5252                          Gx3_25_imu::AccelerationAngularRateAndOrientationMatrix, 70));
    5353  SetBatteryMonitor(((BlCtrlV2 *)GetBldc())->GetBatteryMonitor());
     
    5757  if(useGps=="true") {
    5858    RTDM_SerialPort *gps_port = new RTDM_SerialPort(getFrameworkManager(), "gps_port", "rtser2");
    59     SetGps(new Mb800("gps",gps_port,(NmeaGps::NMEAFlags_t)(NmeaGps::GGA|NmeaGps::VTG),40));
     59    SetGps(new Mb800("gps",gps_port,(NmeaGps::NMEAFlags_t)(NmeaGps::GGA|NmeaGps::VTG|NmeaGps::GSA),40));
    6060  }
    6161}
     
    6767  ((Srf08 *)GetUsRangeFinder())->Start();
    6868  ((Ps3Eye *)GetVerticalCamera())->Start();
    69   ((Mb800 *)GetGps())->Start();
     69  if(GetGps()) ((Mb800 *)GetGps())->Start();
    7070}
    7171
  • trunk/lib/FlairMeta/src/SimuX4.cpp

    r185 r186  
    4949                       "motors", GetUavMultiplex()->MotorsCount(), simu_id,0));
    5050  SetUsRangeFinder(new SimuUs("us", simu_id,0, 60));
    51   SetAhrs(new SimuAhrs("imu", simu_id, 0,70));
     51  SetAhrs(new SimuAhrs("ahrs", simu_id, 0,70));
    5252  Tab *bat_tab = new Tab(getFrameworkManager()->GetTabWidget(), "battery");
    5353  SetBatteryMonitor(new BatteryMonitor(bat_tab->NewRow(), "battery"));
     
    7777  ((SimuCamera *)GetVerticalCamera())->Start();
    7878  ((SimuCamera *)GetHorizontalCamera())->Start();
    79   ((SimuGps *)GetGps())->Start();
     79  if(GetGps()) ((SimuGps *)GetGps())->Start();
    8080}
    8181
  • trunk/lib/FlairMeta/src/SimuX8.cpp

    r185 r186  
    4949                       "motors", GetUavMultiplex()->MotorsCount(), simu_id,0));
    5050  SetUsRangeFinder(new SimuUs("us", simu_id,0, 60));
    51   SetAhrs(new SimuAhrs("imu", simu_id, 0,70));
     51  SetAhrs(new SimuAhrs("ahrs", simu_id, 0,70));
    5252  Tab *bat_tab = new Tab(getFrameworkManager()->GetTabWidget(), "battery");
    5353  SetBatteryMonitor(new BatteryMonitor(bat_tab->NewRow(), "battery"));
     
    7777  ((SimuCamera *)GetVerticalCamera())->Start();
    7878  ((SimuCamera *)GetHorizontalCamera())->Start();
    79   ((SimuGps *)GetGps())->Start();
     79  if(GetGps()) ((SimuGps *)GetGps())->Start();
    8080}
    8181
  • trunk/lib/FlairMeta/src/Uav.cpp

    r185 r186  
    7373  ahrs = (Ahrs *)inAhrs;
    7474  imu = (Imu *)ahrs->GetImu();
     75  //only add imu; as ahrs is son of imu, it will be logged together
    7576  getFrameworkManager()->AddDeviceToLog(imu);
    7677}
  • trunk/lib/FlairMeta/src/UavStateMachine.cpp

    r177 r186  
    460460  flagZTrajectoryFinished = false;
    461461
    462   if((altitudeState==AltitudeState_t::Stopped) && safeToFly && uav->isReadyToFly()  && uav->GetBatteryMonitor()->IsBatteryLow()==false) {
     462  if((altitudeState==AltitudeState_t::Stopped) && safeToFly && uav->isReadyToFly()  && uav->GetBatteryMonitor()->IsBatteryLow()==false && !flagConnectionLost) {
    463463    //The uav always takes off in fail safe mode
    464464    flagBatteryLow=false;
     
    573573  if (getFrameworkManager()->ConnectionLost() && !flagConnectionLost) {
    574574    flagConnectionLost = true;
    575     Thread::Err("Connection lost\n");
     575   
    576576    EnterFailSafeMode();
    577577    if (altitudeState == AltitudeState_t::Stopped) {
    578       SafeStop();
     578      Thread::Warn("Connection lost\n");
     579      Thread::Warn("UAV won't take off\n");
    579580    } else {
     581      Thread::Err("Connection lost\n");
    580582      Land();
    581583    }
Note: See TracChangeset for help on using the changeset viewer.