source: flair-src/branches/mavlink/lib/FlairSensorActuator/src/SimuGps.cpp@ 98

Last change on this file since 98 was 15, checked in by Bayard Gildas, 8 years ago

sources reformatted with flair-format-dir script

File size: 1.2 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5// created: 2014/05/26
6// filename: SimuGps.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: Class for a simulation GPS
14//
15//
16/*********************************************************************/
17
18#include "SimuGps.h"
19#include <FrameworkManager.h>
20#include <string.h>
21#include <GeoCoordinate.h>
22
23using std::string;
24using namespace flair::core;
25
26namespace flair {
27namespace sensor {
28
29SimuGps::SimuGps(const FrameworkManager *parent, string name,
30 Gps::NMEAFlags_t NMEAFlags, uint8_t priority)
31 : Thread(parent, name, priority), Gps(parent, name, NMEAFlags) {}
32
33SimuGps::~SimuGps() {
34 SafeStop();
35 Join();
36}
37
38void SimuGps::Run(void) {
39 char response[200] = {0};
40 int size, result;
41 // double lat=0;
42 SetPeriodMS(500);
43 WarnUponSwitches(true);
44
45 while (!ToBeStopped()) {
46 WaitPeriod();
47 position->SetCoordinates(49.402313, 2.795463, 0);
48 // lat+=.5;
49 }
50
51 WarnUponSwitches(false);
52}
53
54} // end namespace sensor
55} // end namespace framewor
Note: See TracBrowser for help on using the repository browser.