Index: trunk/lib/FlairMeta/CMakeLists.txt
===================================================================
--- trunk/lib/FlairMeta/CMakeLists.txt	(revision 42)
+++ trunk/lib/FlairMeta/CMakeLists.txt	(revision 45)
@@ -44,2 +44,9 @@
 
 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+
+add_custom_target(
+	compile_info
+	COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h
+)
+
+add_dependencies(${PROJECT_NAME} compile_info)
Index: trunk/lib/FlairMeta/src/UavFactory.cpp
===================================================================
--- trunk/lib/FlairMeta/src/UavFactory.cpp	(revision 42)
+++ trunk/lib/FlairMeta/src/UavFactory.cpp	(revision 45)
@@ -18,9 +18,9 @@
 #include "UavFactory.h"
 #include "FrameworkManager.h"
-//#include "ArDrone2.h"
 #include "SimuX4.h"
 #include "SimuX8.h"
 #include "HdsX8.h"
 #include "XAir.h"
+#include "compile_info.h"
 
 using namespace std;
@@ -30,6 +30,14 @@
 
 namespace { // anonymous
-     vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)> vectoroffunctions;
+     vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)> *vectoroffunctions=NULL;
 }
+
+
+static void constructor() __attribute__((constructor));
+
+void constructor() {
+  compile_info("FlairMeta");
+}
+
 
 Uav *CreateUav(FrameworkManager *parent, string uav_name, string uav_type,
@@ -37,7 +45,14 @@
 
   Uav *uav;
-  for(int i=0;i<vectoroffunctions.size();i++) {
-    uav=vectoroffunctions.at(i)(parent, uav_name, uav_type,multiplex);
-    if(uav!=NULL) return uav;
+
+  if(vectoroffunctions!=NULL) {
+    for(int i=0;i<vectoroffunctions->size();i++) {
+      uav=vectoroffunctions->at(i)(parent, uav_name, uav_type,multiplex);
+      if(uav!=NULL) {
+        free(vectoroffunctions);
+        vectoroffunctions=NULL;
+        return uav;
+      }
+    }
   }
 
@@ -72,5 +87,6 @@
 void RegisterUavCreator(flair::meta::Uav*(*func)(FrameworkManager *parent, string uav_name, string uav_type,
                UavMultiplex *multiplex)) {
-                 vectoroffunctions.push_back(func);
+  if(vectoroffunctions==NULL) vectoroffunctions=(vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)>*)malloc(sizeof(vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)>));
 
+  vectoroffunctions->push_back(func);
 }
Index: trunk/lib/FlairMeta/src/UavStateMachine.cpp
===================================================================
--- trunk/lib/FlairMeta/src/UavStateMachine.cpp	(revision 42)
+++ trunk/lib/FlairMeta/src/UavStateMachine.cpp	(revision 45)
@@ -181,9 +181,9 @@
     ComputeThrust(); // logs are added to uz, so it must be updated at last
 
-    //check nan problems
-    if(CheckIsNan(currentTorques.roll,"roll torque")
-       || CheckIsNan(currentTorques.pitch,"pitch torque")
-       || CheckIsNan(currentTorques.yaw,"yaw torque")
-       || CheckIsNan(currentThrust,"thrust")) {
+    //check nan/inf problems
+    if(IsValuePossible(currentTorques.roll,"roll torque")
+       || IsValuePossible(currentTorques.pitch,"pitch torque")
+       || IsValuePossible(currentTorques.yaw,"yaw torque")
+       || IsValuePossible(currentThrust,"thrust")) {
 
       if(failSafeMode) {
@@ -218,7 +218,10 @@
 }
 
-bool UavStateMachine::CheckIsNan(float value,std::string desc) {
+bool UavStateMachine::IsValuePossible(float value,std::string desc) {
   if(isnan(value)) {
     Warn("%s is not an number\n",desc.c_str());
+    return true;
+  } else if(isinf(value)) {
+    Warn("%s is infinite\n",desc.c_str());
     return true;
   } else {
Index: trunk/lib/FlairMeta/src/UavStateMachine.h
===================================================================
--- trunk/lib/FlairMeta/src/UavStateMachine.h	(revision 42)
+++ trunk/lib/FlairMeta/src/UavStateMachine.h	(revision 45)
@@ -261,5 +261,5 @@
   void Run(void);
   void StopMotors(void);
-  bool CheckIsNan(float value,std::string desc);
+  bool IsValuePossible(float value,std::string desc);
 
   meta::Uav *uav;
