Changeset 431 in flair-src


Ignore:
Timestamp:
Jul 12, 2021, 8:37:29 AM (3 years ago)
Author:
Sanahuja Guillaume
Message:

add vrpn connection type per uav

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/demos/CircleFollower/uav/src/CircleFollower.cpp

    r342 r431  
    4040    Uav* uav=GetUav();
    4141
    42     VrpnClient* vrpnclient=new VrpnClient("vrpn", uav->GetDefaultVrpnAddress(),80);
     42    VrpnClient* vrpnclient=new VrpnClient("vrpn", uav->GetDefaultVrpnAddress(),80,uav->GetDefaultVrpnConnectionType());
    4343   
    4444    if(vrpnclient->ConnectionType()==VrpnClient::Xbee) {
     
    4949        targetVrpn=new MetaVrpnObject("target");
    5050    } else if (vrpnclient->ConnectionType()==VrpnClient::VrpnLite) {
    51         uavVrpn = new MetaVrpnObject(uav->ObjectName(),(uint8_t)0);
    52         targetVrpn=new MetaVrpnObject("target",1);
     51        uavVrpn = new MetaVrpnObject(uav->ObjectName());
     52        targetVrpn=new MetaVrpnObject("target");
    5353    }
    5454   
  • trunk/demos/MixedReality/real/uav/src/CircleFollower.cpp

    r318 r431  
    4141    Uav* uav=GetUav();
    4242
    43     VrpnClient* realVrpnClient=new VrpnClient("real_vrpn", uav->GetDefaultVrpnAddress(),80);
    44     uavVrpn = new MetaVrpnObject(uav->ObjectName());
     43    VrpnClient* realVrpnClient=new VrpnClient("real_vrpn", uav->GetDefaultVrpnAddress(),80,uav->GetDefaultVrpnConnectionType());
     44    if(realVrpnClient->ConnectionType()==VrpnClient::Xbee) {
     45        uavVrpn = new MetaVrpnObject(uav->ObjectName(),(uint8_t)0);
     46    } else if (realVrpnClient->ConnectionType()==VrpnClient::Vrpn) {
     47        uavVrpn = new MetaVrpnObject(uav->ObjectName());
     48    } else if (realVrpnClient->ConnectionType()==VrpnClient::VrpnLite) {
     49        uavVrpn = new MetaVrpnObject(uav->ObjectName());
     50    }
    4551    getFrameworkManager()->AddDeviceToLog(uavVrpn);
    4652    uav->GetAhrs()->YawPlot()->AddCurve(uavVrpn->State()->Element(2),DataPlot::Green);
     
    5258    VrpnClient* simuVrpnClient=new VrpnClient("simu_vrpn", vrpn,80);//simu_simu vrpn server
    5359    targetVrpn=new MetaVrpnObject("Drone_1",simuVrpnClient);
    54                 simuVrpnClient->Start();
    55                 realVrpnClient->Start();
     60        simuVrpnClient->Start();
     61        realVrpnClient->Start();
    5662
    5763    getFrameworkManager()->AddDeviceToLog(targetVrpn);
  • trunk/demos/SimpleFleet/uav/src/SimpleFleet.cpp

    r318 r431  
    5353    Uav* uav=GetUav();
    5454               
    55         VrpnClient* vrpnclient=new VrpnClient("vrpn", uav->GetDefaultVrpnAddress(),80);
    56         uavVrpn = new MetaVrpnObject(uav->ObjectName());
     55        VrpnClient* vrpnclient=new VrpnClient("vrpn", uav->GetDefaultVrpnAddress(),80,uav->GetDefaultVrpnConnectionType());
     56    if(vrpnclient->ConnectionType()==VrpnClient::Xbee) {
     57        uavVrpn = new MetaVrpnObject(uav->ObjectName(),(uint8_t)0);
     58    } else if (vrpnclient->ConnectionType()==VrpnClient::Vrpn) {
     59        uavVrpn = new MetaVrpnObject(uav->ObjectName());
     60    } else if (vrpnclient->ConnectionType()==VrpnClient::VrpnLite) {
     61        uavVrpn = new MetaVrpnObject(uav->ObjectName());
     62    }
    5763        getFrameworkManager()->AddDeviceToLog(uavVrpn);
    5864        uav->GetAhrs()->YawPlot()->AddCurve(uavVrpn->State()->Element(2),DataPlot::Green);
  • trunk/lib/FlairMeta/src/Uav.h

    r377 r431  
    1515
    1616#include <Object.h>
     17#include <VrpnClient.h>
    1718
    1819namespace flair {
     
    6667  sensor::PressureSensor *GetPressureSensor(void) const;
    6768        virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";}
     69        virtual sensor::VrpnClient::ConnectionType_t GetDefaultVrpnConnectionType(void) const{return sensor::VrpnClient::ConnectionType_t::Vrpn;}
    6870  virtual bool isReadyToFly(void) const { return true;}
    6971  virtual std::string GetType(void) const=0;
Note: See TracChangeset for help on using the changeset viewer.