Changeset 45 in flair-src for trunk/lib/FlairMeta/src/UavStateMachine.cpp


Ignore:
Timestamp:
Jul 18, 2016, 4:13:56 PM (5 years ago)
Author:
Sanahuja Guillaume
Message:

added compile info

File:
1 edited

Legend:

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

    r42 r45  
    181181    ComputeThrust(); // logs are added to uz, so it must be updated at last
    182182
    183     //check nan problems
    184     if(CheckIsNan(currentTorques.roll,"roll torque")
    185        || CheckIsNan(currentTorques.pitch,"pitch torque")
    186        || CheckIsNan(currentTorques.yaw,"yaw torque")
    187        || CheckIsNan(currentThrust,"thrust")) {
     183    //check nan/inf problems
     184    if(IsValuePossible(currentTorques.roll,"roll torque")
     185       || IsValuePossible(currentTorques.pitch,"pitch torque")
     186       || IsValuePossible(currentTorques.yaw,"yaw torque")
     187       || IsValuePossible(currentThrust,"thrust")) {
    188188
    189189      if(failSafeMode) {
     
    218218}
    219219
    220 bool UavStateMachine::CheckIsNan(float value,std::string desc) {
     220bool UavStateMachine::IsValuePossible(float value,std::string desc) {
    221221  if(isnan(value)) {
    222222    Warn("%s is not an number\n",desc.c_str());
     223    return true;
     224  } else if(isinf(value)) {
     225    Warn("%s is infinite\n",desc.c_str());
    223226    return true;
    224227  } else {
Note: See TracChangeset for help on using the changeset viewer.