Index: trunk/lib/FlairMeta/src/HdsX8.cpp
===================================================================
--- trunk/lib/FlairMeta/src/HdsX8.cpp	(revision 121)
+++ trunk/lib/FlairMeta/src/HdsX8.cpp	(revision 122)
@@ -35,32 +35,20 @@
 namespace meta {
 
-HdsX8::HdsX8(FrameworkManager *parent, string uav_name,
+HdsX8::HdsX8(string name,
              filter::UavMultiplex *multiplex)
-    : Uav(parent, uav_name, multiplex) {
-  RTDM_I2cPort *i2cport = new RTDM_I2cPort(parent, "rtdm_i2c", "rti2c3");
-  RTDM_SerialPort *imu_port = new RTDM_SerialPort(parent, "imu_port", "rtser1");
+    : Uav(name, multiplex) {
+  RTDM_I2cPort *i2cport = new RTDM_I2cPort(getFrameworkManager(), "rtdm_i2c", "rti2c3");
+  RTDM_SerialPort *imu_port = new RTDM_SerialPort(getFrameworkManager(), "imu_port", "rtser1");
 
   if (multiplex == NULL)
-    SetMultiplex(new X4X8Multiplex(parent, "motors", X4X8Multiplex::X8));
+    SetMultiplex(new X4X8Multiplex(getFrameworkManager(), "motors", X4X8Multiplex::X8));
 
   SetBldc(new BlCtrlV2(GetUavMultiplex(), GetUavMultiplex()->GetLayout(),
                        "motors", GetUavMultiplex()->MotorsCount(), i2cport));
-  SetUsRangeFinder(new Srf08(parent, "SRF08", i2cport, 0x70, 60));
-  SetAhrs(new Gx3_25_ahrs(parent, "imu", imu_port,
+  SetUsRangeFinder(new Srf08(getFrameworkManager(), "SRF08", i2cport, 0x70, 60));
+  SetAhrs(new Gx3_25_ahrs(getFrameworkManager(), "imu", imu_port,
                           Gx3_25_imu::AccelerationAngularRateAndOrientationMatrix, 70));
   SetBatteryMonitor(((BlCtrlV2 *)GetBldc())->GetBatteryMonitor());
-
-  /*
-          if(VRPNType==Auto || VRPNType==AutoSerialPort)
-          {
-              RTDM_SerialPort* vrpn_port=new
-     RTDM_SerialPort(parent,"vrpn_port","rtser3");
-
-              vrpnclient=new VrpnClient(parent,"vrpn",vrpn_port,10000,80);
-              uav_vrpn=new
-     MetaVrpnObject(vrpnclient,uav_name,VRPNSerialObjectId);
-          }
-  */
-  SetVerticalCamera(new Ps3Eye(parent, "camv", 0, 50));
+  SetVerticalCamera(new Ps3Eye(getFrameworkManager(), "camv", 0, 50));
 }
 
@@ -71,5 +59,4 @@
   ((Srf08 *)GetUsRangeFinder())->Start();
   ((Ps3Eye *)GetVerticalCamera())->Start();
-  Uav::StartSensors();
 }
 
Index: trunk/lib/FlairMeta/src/HdsX8.h
===================================================================
--- trunk/lib/FlairMeta/src/HdsX8.h	(revision 121)
+++ trunk/lib/FlairMeta/src/HdsX8.h	(revision 122)
@@ -24,8 +24,9 @@
 class HdsX8 : public Uav {
 public:
-  HdsX8(core::FrameworkManager *parent, std::string uav_name,
+  HdsX8(std::string name,
         filter::UavMultiplex *multiplex = NULL);
   ~HdsX8();
   void StartSensors(void);
+	std::string GetDefaultVrpnAddress(void) const{return "192.168.147.197:3883";}
 
 private:
Index: trunk/lib/FlairMeta/src/MetaVrpnObject.cpp
===================================================================
--- trunk/lib/FlairMeta/src/MetaVrpnObject.cpp	(revision 121)
+++ trunk/lib/FlairMeta/src/MetaVrpnObject.cpp	(revision 122)
@@ -39,16 +39,16 @@
 namespace meta {
 
-MetaVrpnObject::MetaVrpnObject(const VrpnClient *parent, string name)
-    : VrpnObject(parent, name, parent->GetTabWidget()) {
-  ConstructorCommon(parent, name);
+MetaVrpnObject::MetaVrpnObject(string name)
+    : VrpnObject( name, GetVrpnClient()->GetTabWidget()) {
+  ConstructorCommon(name);
 }
 
-MetaVrpnObject::MetaVrpnObject(const VrpnClient *parent, std::string name,
+MetaVrpnObject::MetaVrpnObject(std::string name,
                                uint8_t id)
-    : VrpnObject(parent, name, id, parent->GetTabWidget()) {
-  ConstructorCommon(parent, name);
+    : VrpnObject(name, id, GetVrpnClient()->GetTabWidget()) {
+  ConstructorCommon( name);
 }
 
-void MetaVrpnObject::ConstructorCommon(const VrpnClient *parent, string name) {
+void MetaVrpnObject::ConstructorCommon(string name) {
   cvmatrix_descriptor *desc = new cvmatrix_descriptor(6, 1);
   for (int i = 0; i < 6; i++) {
@@ -60,5 +60,5 @@
   }
 
-  pbas = new LowPassFilter(this, parent->GetLayout()->NewRow(),
+  pbas = new LowPassFilter(this, GetVrpnClient()->GetLayout()->NewRow(),
                            name + " Passe bas", prev_value);
 
@@ -72,5 +72,5 @@
   }
 
-  euler = new EulerDerivative(pbas, parent->GetLayout()->NewRow(),
+  euler = new EulerDerivative(pbas, GetVrpnClient()->GetLayout()->NewRow(),
                               name + "_euler", prev_value);
 
@@ -82,5 +82,5 @@
   vz_opti_plot->AddCurve(euler->Matrix()->Element(5));
 
-  plot_tab = new Tab(parent->GetTabWidget(), "Mesures (xy) " + name);
+  plot_tab = new Tab(GetVrpnClient()->GetTabWidget(), "Mesures (xy) " + name);
   xy_plot = new DataPlot2D(plot_tab->NewRow(), "xy", "y", -5, 5, "x", -5, 5);
   xy_plot->AddCurve(Output()->Element(4, 0), Output()->Element(3, 0));
Index: trunk/lib/FlairMeta/src/MetaVrpnObject.h
===================================================================
--- trunk/lib/FlairMeta/src/MetaVrpnObject.h	(revision 121)
+++ trunk/lib/FlairMeta/src/MetaVrpnObject.h	(revision 122)
@@ -18,20 +18,17 @@
 
 namespace flair {
-namespace core {
-class Vector3D;
-class FloatType;
-}
-namespace gui {
-class DataPlot1D;
-class DataPlot2D;
-class Tab;
-}
-namespace filter {
-class EulerDerivative;
-class LowPassFilter;
-}
-namespace sensor {
-class VrpnClient;
-}
+	namespace core {
+		class Vector3D;
+		class FloatType;
+	}
+	namespace gui {
+		class DataPlot1D;
+		class DataPlot2D;
+		class Tab;
+	}
+	namespace filter {
+		class EulerDerivative;
+		class LowPassFilter;
+	}
 }
 
@@ -47,7 +44,6 @@
 class MetaVrpnObject : public sensor::VrpnObject {
 public:
-  MetaVrpnObject(const sensor::VrpnClient *parent, std::string name);
-  MetaVrpnObject(const sensor::VrpnClient *parent, std::string name,
-                 uint8_t id);
+  MetaVrpnObject(std::string name);
+  MetaVrpnObject(std::string name,uint8_t id);
   ~MetaVrpnObject();
   gui::DataPlot1D *VxPlot(void) const; // 1,0
@@ -58,5 +54,5 @@
 
 private:
-  void ConstructorCommon(const sensor::VrpnClient *parent, std::string name);
+  void ConstructorCommon(std::string name);
   filter::LowPassFilter *pbas;
   filter::EulerDerivative *euler;
Index: trunk/lib/FlairMeta/src/SimuX4.cpp
===================================================================
--- trunk/lib/FlairMeta/src/SimuX4.cpp	(revision 121)
+++ trunk/lib/FlairMeta/src/SimuX4.cpp	(revision 122)
@@ -37,20 +37,20 @@
 namespace meta {
 
-SimuX4::SimuX4(FrameworkManager *parent, string uav_name, int simu_id,
+SimuX4::SimuX4(string name, int simu_id,
                filter::UavMultiplex *multiplex)
-    : Uav(parent, uav_name, multiplex) {
+    : Uav(name, multiplex) {
 
   if (multiplex == NULL)
-    SetMultiplex(new X4X8Multiplex(parent, "motors", X4X8Multiplex::X4));
+    SetMultiplex(new X4X8Multiplex(getFrameworkManager(), "motors", X4X8Multiplex::X4));
 
   SetBldc(new SimuBldc(GetUavMultiplex(), GetUavMultiplex()->GetLayout(),
                        "motors", GetUavMultiplex()->MotorsCount(), simu_id));
-  SetUsRangeFinder(new SimuUs(parent, "us", simu_id, 60));
-  SetAhrs(new SimuAhrs(parent, "imu", simu_id, 70));
-  Tab *bat_tab = new Tab(parent->GetTabWidget(), "battery");
+  SetUsRangeFinder(new SimuUs(getFrameworkManager(), "us", simu_id, 60));
+  SetAhrs(new SimuAhrs(getFrameworkManager(), "imu", simu_id, 70));
+  Tab *bat_tab = new Tab(getFrameworkManager()->GetTabWidget(), "battery");
   SetBatteryMonitor(new BatteryMonitor(bat_tab->NewRow(), "battery"));
   GetBatteryMonitor()->SetBatteryValue(12);
   SetVerticalCamera(
-      new SimuCamera(parent, "simu_cam_v", 320, 240, 3, simu_id, 10));
+      new SimuCamera(getFrameworkManager(), "simu_cam_v", 320, 240, 3, simu_id, 10));
 }
 
@@ -61,8 +61,5 @@
   ((SimuUs *)GetUsRangeFinder())->Start();
   ((SimuCamera *)GetVerticalCamera())->Start();
-  Uav::StartSensors();
 }
-
-void SimuX4::SetupVRPNAutoIP(string name) { SetupVRPN("127.0.0.1:3883", name); }
 
 } // end namespace meta
Index: trunk/lib/FlairMeta/src/SimuX4.h
===================================================================
--- trunk/lib/FlairMeta/src/SimuX4.h	(revision 121)
+++ trunk/lib/FlairMeta/src/SimuX4.h	(revision 122)
@@ -26,9 +26,8 @@
   // simu_id: 0 if simulating only one UAV
   //>0 otherwise
-  SimuX4(core::FrameworkManager *parent, std::string uav_name, int simu_id = 0,
+  SimuX4(std::string name, int simu_id = 0,
          filter::UavMultiplex *multiplex = NULL);
   ~SimuX4();
   void StartSensors(void);
-  void SetupVRPNAutoIP(std::string name);
 };
 } // end namespace meta
Index: trunk/lib/FlairMeta/src/SimuX8.cpp
===================================================================
--- trunk/lib/FlairMeta/src/SimuX8.cpp	(revision 121)
+++ trunk/lib/FlairMeta/src/SimuX8.cpp	(revision 122)
@@ -37,20 +37,20 @@
 namespace meta {
 
-SimuX8::SimuX8(FrameworkManager *parent, string uav_name, int simu_id,
+SimuX8::SimuX8(string name, int simu_id,
                filter::UavMultiplex *multiplex)
-    : Uav(parent, uav_name, multiplex) {
+    : Uav(name, multiplex) {
 
   if (multiplex == NULL)
-    SetMultiplex(new X4X8Multiplex(parent, "motors", X4X8Multiplex::X8));
+    SetMultiplex(new X4X8Multiplex(getFrameworkManager(), "motors", X4X8Multiplex::X8));
 
   SetBldc(new SimuBldc(GetUavMultiplex(), GetUavMultiplex()->GetLayout(),
                        "motors", GetUavMultiplex()->MotorsCount(), simu_id));
-  SetUsRangeFinder(new SimuUs(parent, "us", simu_id, 60));
-  SetAhrs(new SimuAhrs(parent, "imu", simu_id, 70));
-  Tab *bat_tab = new Tab(parent->GetTabWidget(), "battery");
+  SetUsRangeFinder(new SimuUs(getFrameworkManager(), "us", simu_id, 60));
+  SetAhrs(new SimuAhrs(getFrameworkManager(), "imu", simu_id, 70));
+  Tab *bat_tab = new Tab(getFrameworkManager()->GetTabWidget(), "battery");
   SetBatteryMonitor(new BatteryMonitor(bat_tab->NewRow(), "battery"));
   GetBatteryMonitor()->SetBatteryValue(12);
   SetVerticalCamera(
-      new SimuCamera(parent, "simu_cam_v", 320, 240, 3, simu_id, 10));
+      new SimuCamera(getFrameworkManager(), "simu_cam_v", 320, 240, 3, simu_id, 10));
 }
 
@@ -61,8 +61,5 @@
   ((SimuUs *)GetUsRangeFinder())->Start();
   ((SimuCamera *)GetVerticalCamera())->Start();
-  Uav::StartSensors();
 }
-
-void SimuX8::SetupVRPNAutoIP(string name) { SetupVRPN("127.0.0.1:3883", name); }
 
 } // end namespace meta
Index: trunk/lib/FlairMeta/src/SimuX8.h
===================================================================
--- trunk/lib/FlairMeta/src/SimuX8.h	(revision 121)
+++ trunk/lib/FlairMeta/src/SimuX8.h	(revision 122)
@@ -26,9 +26,8 @@
   // simu_id: 0 if simulating only one UAV
   //>0 otherwise
-  SimuX8(core::FrameworkManager *parent, std::string uav_name, int simu_id = 0,
+  SimuX8(std::string name, int simu_id = 0,
          filter::UavMultiplex *multiplex = NULL);
   ~SimuX8();
   void StartSensors(void);
-  void SetupVRPNAutoIP(std::string name);
 };
 } // end namespace meta
Index: trunk/lib/FlairMeta/src/Uav.cpp
===================================================================
--- trunk/lib/FlairMeta/src/Uav.cpp	(revision 121)
+++ trunk/lib/FlairMeta/src/Uav.cpp	(revision 122)
@@ -38,11 +38,21 @@
 using namespace flair::actuator;
 
+namespace {
+  flair::meta::Uav *uavSingleton = NULL;
+}
+
 namespace flair {
 namespace meta {
 
-Uav::Uav(FrameworkManager *parent, string name, UavMultiplex *multiplex)
-    : Object(parent, name) {
-  vrpnclient = NULL;
-  uav_vrpn = NULL;
+Uav *GetUav(void) { return uavSingleton; }
+	
+Uav::Uav(string name, UavMultiplex *multiplex)
+    : Object(getFrameworkManager(), name) {
+	if (uavSingleton != NULL) {
+    Err("Uav must be instanced only one time\n");
+    return;
+  }
+
+  uavSingleton = this;
   verticalCamera = NULL;
   horizontalCamera = NULL;
@@ -82,35 +92,5 @@
   horizontalCamera = (Camera *)inHorizontalCamera;
 }
-/*
-void Uav::SetupVRPNSerial(SerialPort *vrpn_port,string name,int
-VRPNSerialObjectId) {
-    vrpnclient=new VrpnClient(getFrameworkManager(),"vrpn",vrpn_port,10000,80);
-    uav_vrpn=new MetaVrpnObject(vrpnclient,name,VRPNSerialObjectId);
 
-    getFrameworkManager()->AddDeviceToLog(uav_vrpn);
-}
-*/
-void Uav::SetupVRPNAutoIP(string name) {
-  SetupVRPN("192.168.147.197:3883", name);
-}
-
-void Uav::SetupVRPN(string optitrack_address, string name) {
-  vrpnclient = new VrpnClient(getFrameworkManager(), "vrpn", optitrack_address,
-                              10000, 80);
-  uav_vrpn = new MetaVrpnObject(vrpnclient, name);
-
-  getFrameworkManager()->AddDeviceToLog(uav_vrpn);
-
-  GetAhrs()->YawPlot()->AddCurve(uav_vrpn->State()->Element(2),
-                                 DataPlot::Green);
-  // GetAhrs()->RollPlot()->AddCurve(uav_vrpn->State()->Element(0),DataPlot::Green);
-  // GetAhrs()->PitchPlot()->AddCurve(uav_vrpn->State()->Element(1),DataPlot::Green);
-}
-
-void Uav::StartSensors(void) {
-  if (vrpnclient != NULL) {
-    vrpnclient->Start();
-  }
-}
 void Uav::UseDefaultPlot(void) {
   multiplex->UseDefaultPlot();
@@ -184,12 +164,4 @@
 BatteryMonitor *Uav::GetBatteryMonitor(void) const { return battery; }
 
-VrpnClient *Uav::GetVrpnClient(void) const {
-  if (vrpnclient == NULL)
-    Err("vrpn is not setup, call SetupVRPN before\n");
-  return vrpnclient;
-}
-
-MetaVrpnObject *Uav::GetVrpnObject(void) const { return uav_vrpn; }
-
 Camera *Uav::GetVerticalCamera(void) const { return verticalCamera; }
 
Index: trunk/lib/FlairMeta/src/Uav.h
===================================================================
--- trunk/lib/FlairMeta/src/Uav.h	(revision 121)
+++ trunk/lib/FlairMeta/src/Uav.h	(revision 122)
@@ -17,21 +17,17 @@
 
 namespace flair {
-namespace core {
-class FrameworkManager;
-}
-namespace filter {
-class Ahrs;
-class UavMultiplex;
-}
-namespace actuator {
-class Bldc;
-}
-namespace sensor {
-class UsRangeFinder;
-class BatteryMonitor;
-class VrpnClient;
-class Imu;
-class Camera;
-}
+	namespace filter {
+		class Ahrs;
+		class UavMultiplex;
+	}
+	namespace actuator {
+		class Bldc;
+	}
+	namespace sensor {
+		class UsRangeFinder;
+		class BatteryMonitor;
+		class Imu;
+		class Camera;
+	}
 }
 
@@ -39,32 +35,20 @@
 namespace meta {
 class MetaUsRangeFinder;
-class MetaVrpnObject;
 
 /*! \class Uav
 *
-* \brief Base class to construct sensors/actuators depending on uav type
+* \brief Base class to construct sensors/actuators depending on uav type.
+* The Object is created with 
+*  the FrameworkManager as parent. FrameworkManager must be created before.
+* Only one instance of this class is allowed by program.
 */
 class Uav : public core::Object {
 public:
-  /*
-      typedef enum {
-          None,
-          Auto,//rt serial if hds x4 ou x8, auto ip sinon
-          AutoIP,
-          UserDefinedIP,
-          AutoSerialPort,
-          } VRPNType_t;
-*/
-  // uav_name: for optitrack
-  Uav(core::FrameworkManager *parent, std::string name,
+
+  Uav(std::string name,
       filter::UavMultiplex *multiplex = NULL);
   ~Uav();
-  void SetupVRPN(std::string optitrack_address, std::string name);
-  // vrpn serial: broken, need to add serial port in uav specific code
-  // void SetupVRPNSerial(core::SerialPort *vrpn_port,std::string name,int
-  // VRPNSerialObjectId);
-  virtual void SetupVRPNAutoIP(std::string name);
 
-  virtual void StartSensors(void);
+  virtual void StartSensors(void)=0;
   void UseDefaultPlot(void);
   actuator::Bldc *GetBldc(void) const;
@@ -75,8 +59,7 @@
   sensor::UsRangeFinder *GetUsRangeFinder(void) const;
   sensor::BatteryMonitor *GetBatteryMonitor(void) const;
-  sensor::VrpnClient *GetVrpnClient(void) const;
-  meta::MetaVrpnObject *GetVrpnObject(void) const;
   sensor::Camera *GetVerticalCamera(void) const;
   sensor::Camera *GetHorizontalCamera(void) const;
+	virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";}
 
 protected:
@@ -96,9 +79,15 @@
   sensor::UsRangeFinder *us;
   MetaUsRangeFinder *meta_us;
-  sensor::VrpnClient *vrpnclient;
-  MetaVrpnObject *uav_vrpn;
   sensor::BatteryMonitor *battery;
   sensor::Camera *verticalCamera,*horizontalCamera;
 };
+
+/*!
+* \brief get Uav
+*
+* \return the Uav
+*/
+Uav *GetUav(void);
+
 } // end namespace meta
 } // end namespace flair
Index: trunk/lib/FlairMeta/src/UavFactory.cpp
===================================================================
--- trunk/lib/FlairMeta/src/UavFactory.cpp	(revision 121)
+++ trunk/lib/FlairMeta/src/UavFactory.cpp	(revision 122)
@@ -30,5 +30,5 @@
 
 namespace { // anonymous
-     vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)> *vectoroffunctions=NULL;
+     vector<flair::meta::Uav* (*)(string,string,UavMultiplex*)> *vectoroffunctions=NULL;
 }
 
@@ -41,5 +41,5 @@
 
 
-Uav *CreateUav(FrameworkManager *parent, string uav_name, string uav_type,
+Uav *CreateUav(string name, string uav_type,
                UavMultiplex *multiplex) {
 
@@ -48,5 +48,5 @@
   if(vectoroffunctions!=NULL) {
     for(int i=0;i<vectoroffunctions->size();i++) {
-      uav=vectoroffunctions->at(i)(parent, uav_name, uav_type,multiplex);
+      uav=vectoroffunctions->at(i)(name,uav_type,multiplex);
       if(uav!=NULL) {
         free(vectoroffunctions);
@@ -58,12 +58,12 @@
 
   if (uav_type == "hds_x4") {
-    parent->Err("UAV type %s not yet implemented\n", uav_type.c_str());
+    getFrameworkManager()->Err("UAV type %s not yet implemented\n", uav_type.c_str());
     return NULL;
   } else if (uav_type == "hds_x8") {
-    return new HdsX8(parent, uav_name, multiplex);
+    return new HdsX8(name, multiplex);
   } else if (uav_type == "xair") {
-    return new XAir(parent, uav_name, multiplex);
+    return new XAir(name, multiplex);
   } else if (uav_type == "hds_xufo") {
-    parent->Err("UAV type %s not yet implemented\n", uav_type.c_str());
+    getFrameworkManager()->Err("UAV type %s not yet implemented\n", uav_type.c_str());
     return NULL;
   } else if (uav_type.compare(0, 7, "x4_simu") == 0) {
@@ -72,5 +72,5 @@
       simu_id = atoi(uav_type.substr(7, uav_type.size() - 7).c_str());
     }
-    return new SimuX4(parent, uav_name, simu_id, multiplex);
+    return new SimuX4(name, simu_id, multiplex);
   } else if (uav_type.compare(0, 7, "x8_simu") == 0) {
     int simu_id = 0;
@@ -78,14 +78,14 @@
       simu_id = atoi(uav_type.substr(7, uav_type.size() - 7).c_str());
     }
-    return new SimuX8(parent, uav_name, simu_id, multiplex);
+    return new SimuX8(name, simu_id, multiplex);
   } else {
-    parent->Err("UAV type %s unknown\n", uav_type.c_str());
+    getFrameworkManager()->Err("UAV type %s unknown\n", uav_type.c_str());
     return NULL;
   }
 }
 
-void RegisterUavCreator(flair::meta::Uav*(*func)(FrameworkManager *parent, string uav_name, string uav_type,
+void RegisterUavCreator(flair::meta::Uav*(*func)(string name, string type,
                UavMultiplex *multiplex)) {
-  if(vectoroffunctions==NULL) vectoroffunctions=(vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)>*)malloc(sizeof(vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)>));
+  if(vectoroffunctions==NULL) vectoroffunctions=(vector<flair::meta::Uav* (*)(string,string,UavMultiplex*)>*)malloc(sizeof(vector<flair::meta::Uav* (*)(string,string,UavMultiplex*)>));
 
   vectoroffunctions->push_back(func);
Index: trunk/lib/FlairMeta/src/UavFactory.h
===================================================================
--- trunk/lib/FlairMeta/src/UavFactory.h	(revision 121)
+++ trunk/lib/FlairMeta/src/UavFactory.h	(revision 122)
@@ -21,10 +21,8 @@
 #include <Uav.h>
 
-flair::meta::Uav *CreateUav(flair::core::FrameworkManager *parent,
-                            std::string uav_name, std::string uav_type,
+flair::meta::Uav *CreateUav(std::string name, std::string type,
                             flair::filter::UavMultiplex *multiplex = NULL);
 
-void RegisterUavCreator(flair::meta::Uav*(*func)(flair::core::FrameworkManager *parent,
-                                   std::string uav_name, std::string uav_type,
+void RegisterUavCreator(flair::meta::Uav*(*func)(std::string name, std::string type,
                                    flair::filter::UavMultiplex *multiplex));
 #endif // UAVFACTORY
Index: trunk/lib/FlairMeta/src/UavStateMachine.cpp
===================================================================
--- trunk/lib/FlairMeta/src/UavStateMachine.cpp	(revision 121)
+++ trunk/lib/FlairMeta/src/UavStateMachine.cpp	(revision 122)
@@ -52,7 +52,7 @@
 using namespace flair::meta;
 
-UavStateMachine::UavStateMachine(Uav* inUav,TargetController *controller):
+UavStateMachine::UavStateMachine(TargetController *controller):
         Thread(getFrameworkManager(),"UavStateMachine",50),
-        uav(inUav),controller(controller),failSafeMode(true),flagConnectionLost(false),flagBatteryLow(false),flagCriticalSensorLost(false),flagZTrajectoryFinished(false),safeToFly(true){
+        uav(GetUav()),controller(controller),failSafeMode(true),flagConnectionLost(false),flagBatteryLow(false),flagCriticalSensorLost(false),flagZTrajectoryFinished(false),safeToFly(true){
     altitudeState=AltitudeState_t::Stopped;
     uav->UseDefaultPlot();
@@ -135,6 +135,4 @@
   return currentAngularSpeed;
 }
-
-const Uav *UavStateMachine::GetUav(void) const { return uav; }
 
 void UavStateMachine::AltitudeValues(float &altitude,
Index: trunk/lib/FlairMeta/src/UavStateMachine.h
===================================================================
--- trunk/lib/FlairMeta/src/UavStateMachine.h	(revision 121)
+++ trunk/lib/FlairMeta/src/UavStateMachine.h	(revision 122)
@@ -59,7 +59,8 @@
 *
 * \brief State machine for UAV
-*
-* thread synchronized with ahrs, unless a period is set with SetPeriodUS or
-*SetPeriodMS
+*  The Thread is created with 
+*  the FrameworkManager as parent. FrameworkManager must be created before.
+* The Thread is synchronized with Ahrs, unless a period is set with SetPeriodUS or
+* SetPeriodMS
 */
 
@@ -101,5 +102,5 @@
   };
 
-        UavStateMachine(meta::Uav* uav, sensor::TargetController* controller);
+        UavStateMachine(sensor::TargetController* controller);
         ~UavStateMachine();
 
@@ -107,6 +108,4 @@
 
   const core::Vector3D &GetCurrentAngularSpeed(void) const;
-
-  const meta::Uav *GetUav(void) const;
 
         void Land(void);
Index: trunk/lib/FlairMeta/src/XAir.cpp
===================================================================
--- trunk/lib/FlairMeta/src/XAir.cpp	(revision 121)
+++ trunk/lib/FlairMeta/src/XAir.cpp	(revision 122)
@@ -38,34 +38,22 @@
 namespace meta {
 
-XAir::XAir(FrameworkManager *parent, string uav_name,
+XAir::XAir(string name,
            filter::UavMultiplex *multiplex)
-    : Uav(parent, uav_name, multiplex) {
-  RTDM_I2cPort *i2cport = new RTDM_I2cPort(parent, "rtdm_i2c", "rti2c3");
-  RTDM_SerialPort *imu_port = new RTDM_SerialPort(parent, "imu_port", "rtser1");
+    : Uav(name, multiplex) {
+  RTDM_I2cPort *i2cport = new RTDM_I2cPort(getFrameworkManager(), "rtdm_i2c", "rti2c3");
+  RTDM_SerialPort *imu_port = new RTDM_SerialPort(getFrameworkManager(), "imu_port", "rtser1");
 
   if (multiplex == NULL)
-    SetMultiplex(new X4X8Multiplex(parent, "motors", X4X8Multiplex::X8));
+    SetMultiplex(new X4X8Multiplex(getFrameworkManager(), "motors", X4X8Multiplex::X8));
 
   SetBldc(new AfroBldc(GetUavMultiplex(), GetUavMultiplex()->GetLayout(),
                        "motors", GetUavMultiplex()->MotorsCount(), i2cport));
-  SetUsRangeFinder(new Srf08(parent, "SRF08", i2cport, 0x70, 60));
-  SetAhrs(new Gx3_25_ahrs(parent, "imu", imu_port,
+  SetUsRangeFinder(new Srf08(getFrameworkManager(), "SRF08", i2cport, 0x70, 60));
+  SetAhrs(new Gx3_25_ahrs(getFrameworkManager(), "imu", imu_port,
                           Gx3_25_imu::AccelerationAngularRateAndOrientationMatrix, 70));
-  Tab *bat_tab = new Tab(parent->GetTabWidget(), "battery");
+  Tab *bat_tab = new Tab(getFrameworkManager()->GetTabWidget(), "battery");
   SetBatteryMonitor(new BatteryMonitor(bat_tab->NewRow(), "battery"));
   GetBatteryMonitor()->SetBatteryValue(12);
-
-  /*
-          if(VRPNType==Auto || VRPNType==AutoSerialPort)
-          {
-              RTDM_SerialPort* vrpn_port=new
-     RTDM_SerialPort(parent,"vrpn_port","rtser3");
-
-              vrpnclient=new VrpnClient(parent,"vrpn",vrpn_port,10000,80);
-              uav_vrpn=new
-     MetaVrpnObject(vrpnclient,uav_name,VRPNSerialObjectId);
-          }
-  */
-  SetVerticalCamera(new Ps3Eye(parent, "camv", 0, 50));
+  SetVerticalCamera(new Ps3Eye(getFrameworkManager(), "camv", 0, 50));
 }
 
@@ -76,5 +64,4 @@
   ((Srf08 *)GetUsRangeFinder())->Start();
   ((Ps3Eye *)GetVerticalCamera())->Start();
-  Uav::StartSensors();
 }
 
Index: trunk/lib/FlairMeta/src/XAir.h
===================================================================
--- trunk/lib/FlairMeta/src/XAir.h	(revision 121)
+++ trunk/lib/FlairMeta/src/XAir.h	(revision 122)
@@ -24,8 +24,9 @@
 class XAir : public Uav {
 public:
-  XAir(core::FrameworkManager *parent, std::string uav_name,
+  XAir(std::string name,
        filter::UavMultiplex *multiplex = NULL);
   ~XAir();
   void StartSensors(void);
+	std::string GetDefaultVrpnAddress(void) const{return "192.168.147.197:3883";}
 
 private:
