Changeset 186 in flair-src for trunk/lib/FlairMeta
- Timestamp:
- Jun 23, 2017, 5:33:03 PM (7 years ago)
- Location:
- trunk/lib/FlairMeta/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairMeta/src/HdsX8.cpp
r185 r186 49 49 "motors", GetUavMultiplex()->MotorsCount(), i2cport)); 50 50 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, 52 52 Gx3_25_imu::AccelerationAngularRateAndOrientationMatrix, 70)); 53 53 SetBatteryMonitor(((BlCtrlV2 *)GetBldc())->GetBatteryMonitor()); … … 57 57 if(useGps=="true") { 58 58 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)); 60 60 } 61 61 } … … 67 67 ((Srf08 *)GetUsRangeFinder())->Start(); 68 68 ((Ps3Eye *)GetVerticalCamera())->Start(); 69 ((Mb800 *)GetGps())->Start();69 if(GetGps()) ((Mb800 *)GetGps())->Start(); 70 70 } 71 71 -
trunk/lib/FlairMeta/src/SimuX4.cpp
r185 r186 49 49 "motors", GetUavMultiplex()->MotorsCount(), simu_id,0)); 50 50 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)); 52 52 Tab *bat_tab = new Tab(getFrameworkManager()->GetTabWidget(), "battery"); 53 53 SetBatteryMonitor(new BatteryMonitor(bat_tab->NewRow(), "battery")); … … 77 77 ((SimuCamera *)GetVerticalCamera())->Start(); 78 78 ((SimuCamera *)GetHorizontalCamera())->Start(); 79 ((SimuGps *)GetGps())->Start();79 if(GetGps()) ((SimuGps *)GetGps())->Start(); 80 80 } 81 81 -
trunk/lib/FlairMeta/src/SimuX8.cpp
r185 r186 49 49 "motors", GetUavMultiplex()->MotorsCount(), simu_id,0)); 50 50 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)); 52 52 Tab *bat_tab = new Tab(getFrameworkManager()->GetTabWidget(), "battery"); 53 53 SetBatteryMonitor(new BatteryMonitor(bat_tab->NewRow(), "battery")); … … 77 77 ((SimuCamera *)GetVerticalCamera())->Start(); 78 78 ((SimuCamera *)GetHorizontalCamera())->Start(); 79 ((SimuGps *)GetGps())->Start();79 if(GetGps()) ((SimuGps *)GetGps())->Start(); 80 80 } 81 81 -
trunk/lib/FlairMeta/src/Uav.cpp
r185 r186 73 73 ahrs = (Ahrs *)inAhrs; 74 74 imu = (Imu *)ahrs->GetImu(); 75 //only add imu; as ahrs is son of imu, it will be logged together 75 76 getFrameworkManager()->AddDeviceToLog(imu); 76 77 } -
trunk/lib/FlairMeta/src/UavStateMachine.cpp
r177 r186 460 460 flagZTrajectoryFinished = false; 461 461 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) { 463 463 //The uav always takes off in fail safe mode 464 464 flagBatteryLow=false; … … 573 573 if (getFrameworkManager()->ConnectionLost() && !flagConnectionLost) { 574 574 flagConnectionLost = true; 575 Thread::Err("Connection lost\n");575 576 576 EnterFailSafeMode(); 577 577 if (altitudeState == AltitudeState_t::Stopped) { 578 SafeStop(); 578 Thread::Warn("Connection lost\n"); 579 Thread::Warn("UAV won't take off\n"); 579 580 } else { 581 Thread::Err("Connection lost\n"); 580 582 Land(); 581 583 }
Note:
See TracChangeset
for help on using the changeset viewer.