Changeset 185 in flair-src


Ignore:
Timestamp:
Jun 14, 2017, 11:46:03 AM (3 years ago)
Author:
Sanahuja Guillaume
Message:

modifs gps

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/demos/Gps/simulator/CMakeLists.txt

    r89 r185  
    55SET(FLAIR_USE_SIMULATOR TRUE)
    66SET(FLAIR_USE_SIMULATOR_GL TRUE)
    7 SET(FLAIR_USE_GPS TRUE)
    87
    98include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
     
    2322)
    2423
    25 TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT})
     24TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT} nmea)
    2625
    2726#non real time executable
     
    3029)
    3130
    32 TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT})
     31TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT} nmea)
  • trunk/demos/Gps/uav/CMakeLists.txt

    r123 r185  
    77SET(FLAIR_USE_VISION_FILTER TRUE)
    88SET(FLAIR_USE_META TRUE)
    9 SET(FLAIR_USE_GPS TRUE)
    10 
    119
    1210include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
  • trunk/demos/Gps/uav/src/DemoGps.cpp

    r167 r185  
    4646  stopCircle = new PushButton(GetButtonsLayout()->LastRowLastCol(), "stop_circle");
    4747
    48   // RTDM_SerialPort *serialport=new RTDM_SerialPort(getFrameworkManager(),"gps_serial","rtser2");
    49   // gps=new Mb800("gps",serialport,(NmeaGps::NMEAFlags_t)(NmeaGps::GGA|NmeaGps::VTG),40);
    50   gps = new SimuGps("gps", (NmeaGps::NMEAFlags_t)(NmeaGps::GGA | NmeaGps::VTG), 0,0, 40);
    51 
    52   gps->UseDefaultPlot();
    53   getFrameworkManager()->AddDeviceToLog(gps);
    54   gps->Start();
    55 
    56   circle = new TrajectoryGenerator2DCircle(gps->GetLayout()->NewRow(), "circle");
     48  circle = new TrajectoryGenerator2DCircle(uav->GetGps()->GetLayout()->NewRow(), "circle");
    5749  // todo: add graphs in gps plot
    5850  /*
  • trunk/demos/Gps/uav/src/DemoGps.h

    r167 r185  
    2626    namespace sensor {
    2727        class TargetController;
    28         class Mb800;
    29         class SimuGps;
    3028    }
    3129}
     
    6361        flair::filter::TrajectoryGenerator2DCircle *circle;
    6462        flair::core::AhrsData *customReferenceOrientation,*customOrientation;
    65         //flair::sensor::Mb800 *gps;
    66         flair::sensor::SimuGps *gps;
    6763};
    6864
  • trunk/demos/Gps/uav/src/main.cpp

    r137 r185  
    4545    manager->SetupLogger(log_path);
    4646
    47     Uav* drone=CreateUav(name,uav_type);
     47    Uav* drone=CreateUav(name,uav_type,"use_gps=true");
    4848    TargetEthController *controller=new TargetEthController("Dualshock3",ds3port);
    4949    DemoGps* demo=new DemoGps(controller);
  • trunk/lib/FlairMeta/src/HdsX8.cpp

    r157 r185  
    2525#include <X4X8Multiplex.h>
    2626#include <Ps3Eye.h>
     27#include <Mb800.h>
     28#include <FindArgument.h>
    2729
    2830using std::string;
     
    5153  SetBatteryMonitor(((BlCtrlV2 *)GetBldc())->GetBatteryMonitor());
    5254  SetVerticalCamera(new Ps3Eye("camv", 0, 50));
     55 
     56  string useGps=FindArgument(options,"use_gps=",false);
     57  if(useGps=="true") {
     58    RTDM_SerialPort *gps_port = new RTDM_SerialPort(getFrameworkManager(), "gps_port", "rtser2");
     59    SetGps(new Mb800("gps",gps_port,(NmeaGps::NMEAFlags_t)(NmeaGps::GGA|NmeaGps::VTG),40));
     60  }
    5361}
    5462
     
    5967  ((Srf08 *)GetUsRangeFinder())->Start();
    6068  ((Ps3Eye *)GetVerticalCamera())->Start();
     69  ((Mb800 *)GetGps())->Start();
    6170}
    6271
  • trunk/lib/FlairMeta/src/SimuX4.cpp

    r160 r185  
    2525#include <SimuCamera.h>
    2626#include <BatteryMonitor.h>
     27#include <SimuGps.h>
    2728#include <Tab.h>
    2829#include <FindArgument.h>
     
    6263  Info("using horizontal camera resolution: %ix%i\n",camhWidth, camhHeight);
    6364  SetHorizontalCamera(new SimuCamera("simu_cam_h", camhWidth, camhHeight, 3, simu_id,1, 10));
     65 
     66  string useGps=FindArgument(options,"use_gps=",false);
     67  if(useGps=="true") {
     68    SetGps(new SimuGps("gps", (NmeaGps::NMEAFlags_t)(NmeaGps::GGA | NmeaGps::VTG), 0,0, 40));
     69  }
    6470}
    6571
     
    7177  ((SimuCamera *)GetVerticalCamera())->Start();
    7278  ((SimuCamera *)GetHorizontalCamera())->Start();
     79  ((SimuGps *)GetGps())->Start();
    7380}
    7481
  • trunk/lib/FlairMeta/src/SimuX8.cpp

    r160 r185  
    2525#include <SimuCamera.h>
    2626#include <BatteryMonitor.h>
     27#include <SimuGps.h>
    2728#include <Tab.h>
    2829#include <FindArgument.h>
     
    6263  Info("using horizontal camera resolution: %ix%i\n",camhWidth, camhHeight);
    6364  SetHorizontalCamera(new SimuCamera("simu_cam_h", camhWidth, camhHeight, 3, simu_id,1, 10));
     65 
     66  string useGps=FindArgument(options,"use_gps=",false);
     67  if(useGps=="true") {
     68    SetGps(new SimuGps("gps", (NmeaGps::NMEAFlags_t)(NmeaGps::GGA | NmeaGps::VTG), 0,0, 40));
     69  }
    6470}
    6571
     
    7177  ((SimuCamera *)GetVerticalCamera())->Start();
    7278  ((SimuCamera *)GetHorizontalCamera())->Start();
     79  ((SimuGps *)GetGps())->Start();
    7380}
    7481
  • trunk/lib/FlairMeta/src/Uav.cpp

    r122 r185  
    2626#include <UavMultiplex.h>
    2727#include <UsRangeFinder.h>
     28#include <NmeaGps.h>
    2829#include <Bldc.h>
    2930#include <cvmatrix.h>
     
    5758  verticalCamera = NULL;
    5859  horizontalCamera = NULL;
     60  gps = NULL;
    5961  this->multiplex = multiplex;
    6062}
     
    9193void Uav::SetHorizontalCamera(const Camera *inHorizontalCamera) {
    9294  horizontalCamera = (Camera *)inHorizontalCamera;
     95}
     96
     97void Uav::SetGps(const NmeaGps *inGps) {
     98  gps=(NmeaGps*)inGps;
     99  getFrameworkManager()->AddDeviceToLog(gps);
    93100}
    94101
     
    148155  meta_us->UseDefaultPlot();
    149156  ahrs->UseDefaultPlot();
     157  if(gps!=NULL) gps->UseDefaultPlot();
    150158}
    151159
     
    168176Camera *Uav::GetHorizontalCamera(void) const { return horizontalCamera; }
    169177
     178NmeaGps *Uav::GetGps(void) const { return gps; }
     179
    170180} // end namespace meta
    171181} // end namespace flair
  • trunk/lib/FlairMeta/src/Uav.h

    r173 r185  
    3030                class Imu;
    3131                class Camera;
     32                class NmeaGps;
    3233        }
    3334}
     
    6263  sensor::Camera *GetVerticalCamera(void) const;
    6364  sensor::Camera *GetHorizontalCamera(void) const;
     65  sensor::NmeaGps *GetGps(void) const;
    6466        virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";}
    6567  virtual bool isReadyToFly(void) const { return true;}
     
    7476  void SetVerticalCamera(const sensor::Camera *verticalCamera);
    7577  void SetHorizontalCamera(const sensor::Camera *verticalCamera);
     78  void SetGps(const sensor::NmeaGps *gps);
    7679
    7780private:
    7881  sensor::Imu *imu;
     82  sensor::NmeaGps *gps;
    7983  filter::Ahrs *ahrs;
    8084  actuator::Bldc *bldc;
Note: See TracChangeset for help on using the changeset viewer.