Index: /trunk/tools/CMakeLists.txt
===================================================================
--- /trunk/tools/CMakeLists.txt	(revision 307)
+++ /trunk/tools/CMakeLists.txt	(revision 308)
@@ -7,4 +7,5 @@
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Dbt2csv)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/VrpnBridge)
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/VrpnLite)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/FlairGCS)
 
Index: /trunk/tools/VrpnBridge/CMakeLists.txt
===================================================================
--- /trunk/tools/VrpnBridge/CMakeLists.txt	(revision 307)
+++ /trunk/tools/VrpnBridge/CMakeLists.txt	(revision 308)
@@ -5,21 +5,11 @@
 if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64")
 
+set(FLAIR_USE_VRPN true)
+
 include_directories(
-	${FLAIR_INCLUDE_DIR}
     ${CMAKE_SYSROOT}/usr/include/vrpn
 )
 
-ADD_EXECUTABLE(${PROJECT_NAME}
-    src/main.cpp
-)
-
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} vrpn)
-
-INSTALL(
-	TARGETS ${PROJECT_NAME}
-	RUNTIME DESTINATION $ENV{FLAIR_ROOT}/flair-install/bin/tools/${ARCH_DIR}
-)
-
-SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+FLAIR_NRT_TOOL(${PROJECT_NAME} src/main.cpp)
 
 else()
Index: /trunk/tools/VrpnLite/CMakeLists.txt
===================================================================
--- /trunk/tools/VrpnLite/CMakeLists.txt	(revision 308)
+++ /trunk/tools/VrpnLite/CMakeLists.txt	(revision 308)
@@ -0,0 +1,23 @@
+PROJECT(vrpnlite)
+cmake_minimum_required(VERSION 2.8)
+include($ENV{FLAIR_ROOT}/flair-src/cmake-modules/GlobalCmakeFlair.cmake)
+
+if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64")
+
+SET(FLAIR_USE_SENSOR_ACTUATOR TRUE)
+set(FLAIR_USE_VRPN true)
+
+SET(SRC_FILES
+	src/VrpnLite.cpp
+	src/main.cpp
+)
+
+FLAIR_NRT_TOOL(${PROJECT_NAME} "${SRC_FILES}" COPY_RESOURCES)
+
+else()
+    if(DEFINED CMAKE_SYSTEM_PROCESSOR_DEFAULTTUNE)
+        warn("${PROJECT_NAME} will not be built for ${CMAKE_SYSTEM_PROCESSOR_DEFAULTTUNE} architecture")
+    else()
+        warn("${PROJECT_NAME} will not be built for ${CMAKE_SYSTEM_PROCESSOR} architecture")
+    endif()
+endif()
Index: /trunk/tools/VrpnLite/resources/core2-64/vrpnlite.sh
===================================================================
--- /trunk/tools/VrpnLite/resources/core2-64/vrpnlite.sh	(revision 308)
+++ /trunk/tools/VrpnLite/resources/core2-64/vrpnlite.sh	(revision 308)
@@ -0,0 +1,18 @@
+#! /bin/bash
+#ARCH_DIR=$(uname -m)
+ARCH_DIR=core2-64
+
+#This script is the only one that calls itself with sudo.
+#As a consequence, only one exception is needed in sudoers (the following 2 lines)
+#  Defaults!/opt/flair/flair-bin/tools/scripts/dualshock3.sh setenv
+#  uav ALL=(root) /opt/flair/flair-bin/tools/scripts/dualshock3.sh
+
+#we must run as root
+if [ $EUID -ne 0 ]; then
+  exec sudo -E $0 $*
+fi
+
+. ${FLAIR_ROOT}/flair-src/scripts/ubuntu_cgroup_hack.sh
+
+export LD_LIBRARY_PATH="${OECORE_HOST_SYSROOT}/usr/lib:${OECORE_HOST_SYSROOT}/lib"
+${FLAIR_ROOT}/flair-install/bin/tools/$ARCH_DIR/vrpnlite -p 9000 -x vrpnlite.xml -s 127.0.0.1:3883 -c 127.0.0.1:3884
Index: /trunk/tools/VrpnLite/resources/core2-64/vrpnlite.xml
===================================================================
--- /trunk/tools/VrpnLite/resources/core2-64/vrpnlite.xml	(revision 308)
+++ /trunk/tools/VrpnLite/resources/core2-64/vrpnlite.xml	(revision 308)
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<root name="Manager">
+  <TabWidget name="Main_TabWidget">
+    <Tab name="dualshock3">
+      <TabWidget name="dualshock3">
+        <Tab name="Settings">
+          <GroupBox name="DualShock3">
+            <SpinBox name="dead zone:" value="8" />
+            <Label name="battery charge level" />
+            <CheckBox name="enabled" value="1" />
+          </GroupBox>
+        </Tab>
+        <Tab name="Measures">
+          <DataPlot1D name="left stick x-axis" period="100"
+          enabled="1" />
+          <DataPlot1D name="left stick y-axis" period="100"
+          enabled="1" />
+          <DataPlot1D name="right stick x-axis" period="100"
+          enabled="1" />
+          <DataPlot1D name="right stick y-axis" period="100"
+          enabled="1" />
+        </Tab>
+      </TabWidget>
+    </Tab>
+  </TabWidget>
+  <TabWidget name="App_TabWidget">
+    <Tab name="dualshock3">
+      <PushButton name="save config on target" value="1" />
+    </Tab>
+  </TabWidget>
+</root>
Index: /trunk/tools/VrpnLite/src/VrpnLite.cpp
===================================================================
--- /trunk/tools/VrpnLite/src/VrpnLite.cpp	(revision 308)
+++ /trunk/tools/VrpnLite/src/VrpnLite.cpp	(revision 308)
@@ -0,0 +1,87 @@
+//  created:    2019/03/12
+//  filename:   VrpnLite.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    vrpnlite, to forward it to bth for exemple
+//              usefull to reduce vrpn frame size
+//
+/*********************************************************************/
+
+#include "VrpnLite.h"
+#include <VrpnClient.h>
+#include <VrpnObject.h>
+#include <Thread.h>
+#include <UdpSocket.h>
+#include <FrameworkManager.h>
+#include <Quaternion.h>
+#include <string.h>
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::sensor;
+
+VrpnLite::VrpnLite(string clientAddress,string serveurAddress): Thread(getFrameworkManager(),"VrpnLite",90) {
+  vrpnclient=new VrpnClient("vrpn", serveurAddress,80); 
+  VrpnObject* vrpnobject = new VrpnObject("x4_0",vrpnclient->GetTabWidget(),vrpnclient);
+  //VrpnObject* vrpnobject2 = new VrpnObject("target",vrpnclient->GetTabWidget(),vrpnclient);
+  
+  vrpnobjects.push_back(vrpnobject);
+  //vrpnobjects.push_back(vrpnobject2);
+  
+  dataSocket = new UdpSocket(this,"client socket",clientAddress);
+  
+  vrpnclient->Start();
+}
+
+VrpnLite::~VrpnLite() {
+}
+
+void VrpnLite::Run(void) {
+  while (!ToBeStopped()) {
+    
+    WaitUpdate(vrpnobjects.at(0));//tood improve this wait, to be sure all vrpnobject are up to date; or one thread by object?
+    //could be also lighter to send only one frame with all objects
+    int i=0;
+    for (vector<VrpnObject*>::iterator it = vrpnobjects.begin();it < vrpnobjects.end(); it++) {
+      SendObject(*it,i);
+      i++;
+    }
+    
+  }
+}
+
+void VrpnLite::SendObject(const VrpnObject* vrpnobject,uint8_t id) const{
+    Vector3Df objectPosition;
+    Quaternion objectQuaternion;
+    
+    vrpnobject->GetPosition(objectPosition);
+    vrpnobject->GetQuaternion(objectQuaternion);
+    Time time=vrpnobject->GetLastPacketTime();
+    
+    float position[3];
+    position[0]=objectPosition.x;
+    position[1]=objectPosition.y;
+    position[2]=objectPosition.z;
+    float quaternion[4];
+    quaternion[0]=objectQuaternion.q0;
+    quaternion[1]=objectQuaternion.q1;
+    quaternion[2]=objectQuaternion.q2;
+    quaternion[3]=objectQuaternion.q3;
+    
+    for(int i=0;i<3;i++) dataSocket->HostToNetwork((char*)(&position[i]),sizeof(position[i]));
+    for(int i=0;i<4;i++) dataSocket->HostToNetwork((char*)(&quaternion[i]),sizeof(quaternion[i]));
+    dataSocket->HostToNetwork((char*)(&time),sizeof(Time));
+    
+    char datas[sizeof(id) + sizeof(position)+sizeof(quaternion)+ sizeof(time)];
+    
+    datas[0]=id;
+    memcpy(datas+sizeof(id),position, sizeof(position));
+    memcpy(datas +sizeof(id)+ sizeof(position),quaternion, sizeof(quaternion));
+    memcpy(datas+sizeof(id) + sizeof(position)+sizeof(quaternion),&time, sizeof(time));
+    
+    dataSocket->SendMessage(datas,sizeof(datas));
+}
Index: /trunk/tools/VrpnLite/src/VrpnLite.h
===================================================================
--- /trunk/tools/VrpnLite/src/VrpnLite.h	(revision 308)
+++ /trunk/tools/VrpnLite/src/VrpnLite.h	(revision 308)
@@ -0,0 +1,44 @@
+//  created:    2019/03/12
+//  filename:   VrpnLite.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    vrpnlite, to forward it to bth for exemple
+//              usefull to reduce vrpn frame size
+//
+/*********************************************************************/
+
+#ifndef VRPNLITE_H
+#define VRPNLITE_H
+
+#include <string>
+#include <Thread.h>
+
+namespace flair {
+  namespace core {
+    class UdpSocket;
+  }
+	namespace sensor {
+		class VrpnClient;
+		class VrpnObject;
+	}
+}
+
+class VrpnLite: public flair::core::Thread {
+  public:
+      VrpnLite(std::string clientAddress,std::string serveurAddress);
+      ~VrpnLite();
+
+private:
+      void Run(void);
+      flair::sensor::VrpnClient* vrpnclient;
+      std::vector<flair::sensor::VrpnObject*> vrpnobjects;
+      flair::core::UdpSocket* dataSocket;
+      void SendObject(const flair::sensor::VrpnObject* vrpnobject,uint8_t id) const;
+      
+};
+
+#endif // VRPNLITE_H
Index: /trunk/tools/VrpnLite/src/main.cpp
===================================================================
--- /trunk/tools/VrpnLite/src/main.cpp	(revision 308)
+++ /trunk/tools/VrpnLite/src/main.cpp	(revision 308)
@@ -0,0 +1,76 @@
+//  created:    2019/03/12
+//  filename:   main.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    vrpnlite, to forward it to bth for exemple
+//              usefull to reduce vrpn frame size
+//
+/*********************************************************************/
+
+#include "FrameworkManager.h"
+#include "VrpnLite.h"
+#include <stdio.h>
+#include <tclap/CmdLine.h>
+
+using namespace TCLAP;
+using namespace std;
+using namespace flair::core;
+
+string xml_file;
+string clientAddress,serverAddress;
+int port;
+
+void parseOptions(int argc, char **argv);
+
+int main (int argc, char ** argv) {
+  parseOptions(argc,argv);
+  
+  FrameworkManager *manager;
+  manager = new FrameworkManager("vrpnforwarder");
+  manager->SetupConnection("127.0.0.1", port);
+  manager->SetupUserInterface(xml_file);
+  
+  VrpnLite* vrpnlite=new VrpnLite(clientAddress,serverAddress);
+  
+  vrpnlite->Start();
+  vrpnlite->Join();
+
+  delete manager;
+}
+
+void parseOptions(int argc, char **argv) {
+  try {
+    CmdLine cmd("Command description message", ' ', "0.1");
+
+    ValueArg<string> clientaddressArg("c", "caddress","client address", true,
+                                "127.0.0.1:3884", "string");
+    cmd.add(clientaddressArg);
+    
+    ValueArg<string> serveraddressArg("s", "saddress","server address", true,
+                                "127.0.0.1:3883", "string");
+    cmd.add(serveraddressArg);
+
+    ValueArg<int> portArg("p", "port","local port used to connect to the ground station",
+                          false, 9000, "int");
+    cmd.add(portArg);
+
+
+    ValueArg<string> xmlArg("x", "xml", "xml file", true, "./settings.xml",
+                            "string");
+    cmd.add(xmlArg);
+
+    cmd.parse(argc, argv);
+
+    clientAddress = clientaddressArg.getValue();
+    serverAddress = serveraddressArg.getValue();
+    port = portArg.getValue();
+    xml_file = xmlArg.getValue();
+
+  } catch (ArgException &e) { // catch any exceptions
+    cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
+  }
+}
