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


Ignore:
Timestamp:
Nov 8, 2018, 5:26:24 PM (6 years ago)
Author:
Sanahuja Guillaume
Message:

warn for all nan/inf torques/thrust

File:
1 edited

Legend:

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

    r216 r271  
    180180
    181181    //check nan/inf problems
    182     if(!IsValuePossible(currentTorques.roll,"roll torque")
    183        || !IsValuePossible(currentTorques.pitch,"pitch torque")
    184        || !IsValuePossible(currentTorques.yaw,"yaw torque")
    185        || !IsValuePossible(currentThrust,"thrust")) {
     182    bool isValuePossible=true;
     183    //test it separately to warn for all problems
     184    if(!IsValuePossible(currentTorques.roll,"roll torque")) isValuePossible=false;
     185    if(!IsValuePossible(currentTorques.pitch,"pitch torque")) isValuePossible=false;
     186    if(!IsValuePossible(currentTorques.yaw,"yaw torque")) isValuePossible=false;
     187    if(!IsValuePossible(currentThrust,"thrust")) isValuePossible=false;
     188    if(!isValuePossible) {
    186189
    187190        if(altitudeState==AltitudeState_t::Stopped) {
Note: See TracChangeset for help on using the changeset viewer.