Changeset 45 in flair-src for trunk/lib/FlairMeta/src/UavStateMachine.cpp
- Timestamp:
- Jul 18, 2016, 4:13:56 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairMeta/src/UavStateMachine.cpp
r42 r45 181 181 ComputeThrust(); // logs are added to uz, so it must be updated at last 182 182 183 //check nan problems184 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")) { 188 188 189 189 if(failSafeMode) { … … 218 218 } 219 219 220 bool UavStateMachine:: CheckIsNan(float value,std::string desc) {220 bool UavStateMachine::IsValuePossible(float value,std::string desc) { 221 221 if(isnan(value)) { 222 222 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()); 223 226 return true; 224 227 } else {
Note:
See TracChangeset
for help on using the changeset viewer.