All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GpsSensor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2014 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef _GPSSENSOR_HH_
19 #define _GPSSENSOR_HH_
20 
21 #include <string>
22 
23 #include <sdf/sdf.hh>
24 
25 #include "gazebo/sensors/Sensor.hh"
30 
31 namespace gazebo
32 {
33  namespace sensors
34  {
37 
40  class GpsSensor: public Sensor
41  {
43  public: GpsSensor();
44 
46  public: virtual ~GpsSensor();
47 
48  // Documentation inherited
49  public: virtual void Load(const std::string & _worldName,
50  sdf::ElementPtr &_sdf);
51 
52  // Documentation inherited
53  public: virtual void Load(const std::string & _worldName);
54 
55  // Documentation inherited
56  public: virtual void Init();
57 
58  // Documentation inherited
59  protected: virtual void UpdateImpl(bool _force);
60 
61  // Documentation inherited
62  public: virtual void Fini();
63 
66  public: math::Angle GetLongitude() const;
67 
70  public: math::Angle GetLatitude() const;
71 
74  public: double GetAltitude() const;
75 
77  private: NoisePtr horizontalPositionNoise;
78 
80  private: NoisePtr verticalPositionNoise;
81 
83  private: NoisePtr horizontalVelocityNoise;
84 
86  private: NoisePtr verticalVelocityNoise;
87 
89  private: transport::PublisherPtr gpsPub;
90 
92  private: std::string topicName;
93 
95  private: physics::LinkPtr parentLink;
96 
98  private: common::SphericalCoordinatesPtr sphericalCoordinates;
99 
101  private: msgs::GPS lastGpsMsg;
102  };
104  }
105 }
106 #endif