Changeset 311 in flair-src for trunk/demos


Ignore:
Timestamp:
Mar 14, 2019, 2:28:37 PM (6 years ago)
Author:
Sanahuja Guillaume
Message:

maj

File:
1 edited

Legend:

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

    r263 r311  
    4343
    4444    VrpnClient* vrpnclient=new VrpnClient("vrpn", uav->GetDefaultVrpnAddress(),80);
    45     uavVrpn = new MetaVrpnObject(uav->ObjectName());
     45   
     46    if(vrpnclient->ConnectionType()==VrpnClient::Xbee) {
     47        uavVrpn = new MetaVrpnObject(uav->ObjectName(),(uint8_t)0);
     48        targetVrpn=new MetaVrpnObject("target",1);
     49    } else if (vrpnclient->ConnectionType()==VrpnClient::Vrpn) {
     50        uavVrpn = new MetaVrpnObject(uav->ObjectName());
     51        targetVrpn=new MetaVrpnObject("target");
     52    } else if (vrpnclient->ConnectionType()==VrpnClient::VrpnLite) {
     53        uavVrpn = new MetaVrpnObject(uav->ObjectName(),(uint8_t)0);
     54        targetVrpn=new MetaVrpnObject("target",1);
     55    }
     56   
    4657    getFrameworkManager()->AddDeviceToLog(uavVrpn);
    4758    uav->GetAhrs()->YawPlot()->AddCurve(uavVrpn->State()->Element(2),DataPlot::Green);
     
    5061    stopCircle=new PushButton(GetButtonsLayout()->LastRowLastCol(),"stop_circle");
    5162    positionHold=new PushButton(GetButtonsLayout()->LastRowLastCol(),"position hold");
    52 
    53     if(vrpnclient->UseXbee()==true) {
    54         targetVrpn=new MetaVrpnObject("target",1);
    55     } else {
    56         targetVrpn=new MetaVrpnObject("target");
    57     }
    58                 vrpnclient->Start();
     63   
     64    vrpnclient->Start();
    5965
    6066    getFrameworkManager()->AddDeviceToLog(targetVrpn);
Note: See TracChangeset for help on using the changeset viewer.