Index: trunk/demos/SimpleFleet/uav/src/SimpleFleet.cpp
===================================================================
--- trunk/demos/SimpleFleet/uav/src/SimpleFleet.cpp	(revision 104)
+++ trunk/demos/SimpleFleet/uav/src/SimpleFleet.cpp	(revision 122)
@@ -50,16 +50,21 @@
 
 
-SimpleFleet::SimpleFleet(flair::meta::Uav* uav,string broadcast,TargetController *controller): UavStateMachine(uav,controller), behaviourMode(BehaviourMode_t::Default), vrpnLost(false) {
-    uav->SetupVRPNAutoIP(uav->ObjectName());
-
-    circle=new TrajectoryGenerator2DCircle(uav->GetVrpnClient()->GetLayout()->NewRow(),"circle");
-    uav->GetVrpnObject()->xPlot()->AddCurve(circle->Matrix()->Element(0,0),0,0,255);
-    uav->GetVrpnObject()->yPlot()->AddCurve(circle->Matrix()->Element(0,1),0,0,255);
-    uav->GetVrpnObject()->VxPlot()->AddCurve(circle->Matrix()->Element(1,0),0,0,255);
-    uav->GetVrpnObject()->VyPlot()->AddCurve(circle->Matrix()->Element(1,1),0,0,255);
-
-    xCircleCenter=new DoubleSpinBox(uav->GetVrpnClient()->GetLayout()->NewRow(),"x circle center"," m",-5,5,0.1,1,0);
-    yCircleCenter=new DoubleSpinBox(uav->GetVrpnClient()->GetLayout()->NewRow(),"y circle center"," m",-5,5,0.1,1,0);
-    yDisplacement=new DoubleSpinBox(uav->GetVrpnClient()->GetLayout()->NewRow(),"y displacement"," m",0,2,0.1,1,0);
+SimpleFleet::SimpleFleet(string broadcast,TargetController *controller): UavStateMachine(controller), behaviourMode(BehaviourMode_t::Default), vrpnLost(false) {
+    Uav* uav=GetUav();
+		
+		VrpnClient* vrpnclient=new VrpnClient("vrpn", uav->GetDefaultVrpnAddress(),10000, 80);
+		uavVrpn = new MetaVrpnObject(uav->ObjectName());
+		getFrameworkManager()->AddDeviceToLog(uavVrpn);
+		uav->GetAhrs()->YawPlot()->AddCurve(uavVrpn->State()->Element(2),DataPlot::Green);
+
+    circle=new TrajectoryGenerator2DCircle(vrpnclient->GetLayout()->NewRow(),"circle");
+    uavVrpn->xPlot()->AddCurve(circle->Matrix()->Element(0,0),0,0,255);
+    uavVrpn->yPlot()->AddCurve(circle->Matrix()->Element(0,1),0,0,255);
+    uavVrpn->VxPlot()->AddCurve(circle->Matrix()->Element(1,0),0,0,255);
+    uavVrpn->VyPlot()->AddCurve(circle->Matrix()->Element(1,1),0,0,255);
+
+    xCircleCenter=new DoubleSpinBox(vrpnclient->GetLayout()->NewRow(),"x circle center"," m",-5,5,0.1,1,0);
+    yCircleCenter=new DoubleSpinBox(vrpnclient->GetLayout()->NewRow(),"y circle center"," m",-5,5,0.1,1,0);
+    yDisplacement=new DoubleSpinBox(vrpnclient->GetLayout()->NewRow(),"y displacement"," m",0,2,0.1,1,0);
 
     //parent->AddDeviceToLog(Uz());
@@ -101,5 +106,5 @@
     //get yaw from vrpn
     Euler vrpnEuler;
-    GetUav()->GetVrpnObject()->GetEuler(vrpnEuler);
+    uavVrpn->GetEuler(vrpnEuler);
 
     //get roll, pitch and w from imu
@@ -120,6 +125,6 @@
     Vector3D uav_pos,uav_vel;
 
-    GetUav()->GetVrpnObject()->GetPosition(uav_pos);
-    GetUav()->GetVrpnObject()->GetSpeed(uav_vel);
+    uavVrpn->GetPosition(uav_pos);
+    uavVrpn->GetSpeed(uav_vel);
     //z and dz must be in uav's frame
     z=-uav_pos.z;
@@ -154,7 +159,7 @@
     Euler vrpn_euler; // in VRPN coordinate system
 
-    GetUav()->GetVrpnObject()->GetPosition(uav_pos);
-    GetUav()->GetVrpnObject()->GetSpeed(uav_vel);
-    GetUav()->GetVrpnObject()->GetEuler(vrpn_euler);
+    uavVrpn->GetPosition(uav_pos);
+    uavVrpn->GetSpeed(uav_vel);
+    uavVrpn->GetEuler(vrpn_euler);
 
     uav_pos.To2Dxy(uav_2Dpos);
@@ -294,5 +299,5 @@
 void SimpleFleet::ExtraSecurityCheck(void) {
     if (!vrpnLost && behaviourMode!=BehaviourMode_t::Default) {
-        if (!GetUav()->GetVrpnObject()->IsTracked(500)) {
+        if (!uavVrpn->IsTracked(500)) {
             Thread::Err("Optitrack, uav lost\n");
             vrpnLost=true;
@@ -322,5 +327,5 @@
     circle->SetCenter(target_2Dpos);
 
-    GetUav()->GetVrpnObject()->GetPosition(uav_pos);
+    uavVrpn->GetPosition(uav_pos);
     uav_pos.To2Dxy(uav_2Dpos);
     circle->StartTraj(uav_2Dpos,1);
@@ -347,8 +352,8 @@
     }
 
-    GetUav()->GetVrpnObject()->GetEuler(vrpn_euler);
+    uavVrpn->GetEuler(vrpn_euler);
     yaw_hold=vrpn_euler.yaw;
 
-    GetUav()->GetVrpnObject()->GetPosition(vrpn_pos);
+    uavVrpn->GetPosition(vrpn_pos);
     vrpn_pos.To2Dxy(pos_hold);
 
Index: trunk/demos/SimpleFleet/uav/src/SimpleFleet.h
===================================================================
--- trunk/demos/SimpleFleet/uav/src/SimpleFleet.h	(revision 104)
+++ trunk/demos/SimpleFleet/uav/src/SimpleFleet.h	(revision 122)
@@ -26,4 +26,7 @@
         class TrajectoryGenerator2DCircle;
     }
+		namespace meta {
+        class MetaVrpnObject;
+    }
     namespace gui {
         class DoubleSpinBox;
@@ -34,5 +37,5 @@
 class SimpleFleet : public flair::meta::UavStateMachine {
     public:
-        SimpleFleet(flair::meta::Uav* uav,std::string broadcast,flair::sensor::TargetController *controller);
+        SimpleFleet(std::string broadcast,flair::sensor::TargetController *controller);
         ~SimpleFleet();
 
@@ -75,4 +78,5 @@
         flair::gui::DoubleSpinBox *xCircleCenter,*yCircleCenter,*yDisplacement;
         flair::core::AhrsData *customReferenceOrientation,*customOrientation;
+				flair::meta::MetaVrpnObject *uavVrpn;
 };
 
Index: trunk/demos/SimpleFleet/uav/src/main.cpp
===================================================================
--- trunk/demos/SimpleFleet/uav/src/main.cpp	(revision 104)
+++ trunk/demos/SimpleFleet/uav/src/main.cpp	(revision 122)
@@ -46,7 +46,7 @@
     manager->SetupUserInterface(xml_file);
 
-    Uav* drone=CreateUav(manager,name,uav_type);
+    Uav* drone=CreateUav(name,uav_type);
     TargetEthController *controller=new TargetEthController(manager,"Dualshock3",ds3port);
-    SimpleFleet* demo=new SimpleFleet(drone,broadcast,controller);
+    SimpleFleet* demo=new SimpleFleet(broadcast,controller);
 
     demo->Start();
