Changeset 185 in flair-src
- Timestamp:
- Jun 14, 2017, 11:46:03 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/demos/Gps/simulator/CMakeLists.txt
r89 r185 5 5 SET(FLAIR_USE_SIMULATOR TRUE) 6 6 SET(FLAIR_USE_SIMULATOR_GL TRUE) 7 SET(FLAIR_USE_GPS TRUE)8 7 9 8 include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake) … … 23 22 ) 24 23 25 TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT} )24 TARGET_LINK_LIBRARIES(${PROJECT_NAME}_rt ${FLAIR_LIBRARIES_RT} nmea) 26 25 27 26 #non real time executable … … 30 29 ) 31 30 32 TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT} )31 TARGET_LINK_LIBRARIES(${PROJECT_NAME}_nrt ${FLAIR_LIBRARIES_NRT} nmea) -
trunk/demos/Gps/uav/CMakeLists.txt
r123 r185 7 7 SET(FLAIR_USE_VISION_FILTER TRUE) 8 8 SET(FLAIR_USE_META TRUE) 9 SET(FLAIR_USE_GPS TRUE)10 11 9 12 10 include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake) -
trunk/demos/Gps/uav/src/DemoGps.cpp
r167 r185 46 46 stopCircle = new PushButton(GetButtonsLayout()->LastRowLastCol(), "stop_circle"); 47 47 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"); 57 49 // todo: add graphs in gps plot 58 50 /* -
trunk/demos/Gps/uav/src/DemoGps.h
r167 r185 26 26 namespace sensor { 27 27 class TargetController; 28 class Mb800;29 class SimuGps;30 28 } 31 29 } … … 63 61 flair::filter::TrajectoryGenerator2DCircle *circle; 64 62 flair::core::AhrsData *customReferenceOrientation,*customOrientation; 65 //flair::sensor::Mb800 *gps;66 flair::sensor::SimuGps *gps;67 63 }; 68 64 -
trunk/demos/Gps/uav/src/main.cpp
r137 r185 45 45 manager->SetupLogger(log_path); 46 46 47 Uav* drone=CreateUav(name,uav_type );47 Uav* drone=CreateUav(name,uav_type,"use_gps=true"); 48 48 TargetEthController *controller=new TargetEthController("Dualshock3",ds3port); 49 49 DemoGps* demo=new DemoGps(controller); -
trunk/lib/FlairMeta/src/HdsX8.cpp
r157 r185 25 25 #include <X4X8Multiplex.h> 26 26 #include <Ps3Eye.h> 27 #include <Mb800.h> 28 #include <FindArgument.h> 27 29 28 30 using std::string; … … 51 53 SetBatteryMonitor(((BlCtrlV2 *)GetBldc())->GetBatteryMonitor()); 52 54 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 } 53 61 } 54 62 … … 59 67 ((Srf08 *)GetUsRangeFinder())->Start(); 60 68 ((Ps3Eye *)GetVerticalCamera())->Start(); 69 ((Mb800 *)GetGps())->Start(); 61 70 } 62 71 -
trunk/lib/FlairMeta/src/SimuX4.cpp
r160 r185 25 25 #include <SimuCamera.h> 26 26 #include <BatteryMonitor.h> 27 #include <SimuGps.h> 27 28 #include <Tab.h> 28 29 #include <FindArgument.h> … … 62 63 Info("using horizontal camera resolution: %ix%i\n",camhWidth, camhHeight); 63 64 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 } 64 70 } 65 71 … … 71 77 ((SimuCamera *)GetVerticalCamera())->Start(); 72 78 ((SimuCamera *)GetHorizontalCamera())->Start(); 79 ((SimuGps *)GetGps())->Start(); 73 80 } 74 81 -
trunk/lib/FlairMeta/src/SimuX8.cpp
r160 r185 25 25 #include <SimuCamera.h> 26 26 #include <BatteryMonitor.h> 27 #include <SimuGps.h> 27 28 #include <Tab.h> 28 29 #include <FindArgument.h> … … 62 63 Info("using horizontal camera resolution: %ix%i\n",camhWidth, camhHeight); 63 64 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 } 64 70 } 65 71 … … 71 77 ((SimuCamera *)GetVerticalCamera())->Start(); 72 78 ((SimuCamera *)GetHorizontalCamera())->Start(); 79 ((SimuGps *)GetGps())->Start(); 73 80 } 74 81 -
trunk/lib/FlairMeta/src/Uav.cpp
r122 r185 26 26 #include <UavMultiplex.h> 27 27 #include <UsRangeFinder.h> 28 #include <NmeaGps.h> 28 29 #include <Bldc.h> 29 30 #include <cvmatrix.h> … … 57 58 verticalCamera = NULL; 58 59 horizontalCamera = NULL; 60 gps = NULL; 59 61 this->multiplex = multiplex; 60 62 } … … 91 93 void Uav::SetHorizontalCamera(const Camera *inHorizontalCamera) { 92 94 horizontalCamera = (Camera *)inHorizontalCamera; 95 } 96 97 void Uav::SetGps(const NmeaGps *inGps) { 98 gps=(NmeaGps*)inGps; 99 getFrameworkManager()->AddDeviceToLog(gps); 93 100 } 94 101 … … 148 155 meta_us->UseDefaultPlot(); 149 156 ahrs->UseDefaultPlot(); 157 if(gps!=NULL) gps->UseDefaultPlot(); 150 158 } 151 159 … … 168 176 Camera *Uav::GetHorizontalCamera(void) const { return horizontalCamera; } 169 177 178 NmeaGps *Uav::GetGps(void) const { return gps; } 179 170 180 } // end namespace meta 171 181 } // end namespace flair -
trunk/lib/FlairMeta/src/Uav.h
r173 r185 30 30 class Imu; 31 31 class Camera; 32 class NmeaGps; 32 33 } 33 34 } … … 62 63 sensor::Camera *GetVerticalCamera(void) const; 63 64 sensor::Camera *GetHorizontalCamera(void) const; 65 sensor::NmeaGps *GetGps(void) const; 64 66 virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";} 65 67 virtual bool isReadyToFly(void) const { return true;} … … 74 76 void SetVerticalCamera(const sensor::Camera *verticalCamera); 75 77 void SetHorizontalCamera(const sensor::Camera *verticalCamera); 78 void SetGps(const sensor::NmeaGps *gps); 76 79 77 80 private: 78 81 sensor::Imu *imu; 82 sensor::NmeaGps *gps; 79 83 filter::Ahrs *ahrs; 80 84 actuator::Bldc *bldc;
Note:
See TracChangeset
for help on using the changeset viewer.