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 #include "gazebo/util/system.hh"
31 
32 namespace gazebo
33 {
34  namespace sensors
35  {
38 
42  {
44  public: GpsSensor();
45 
47  public: virtual ~GpsSensor();
48 
49  // Documentation inherited
50  public: virtual void Load(const std::string & _worldName,
51  sdf::ElementPtr _sdf);
52 
53  // Documentation inherited
54  public: virtual void Load(const std::string & _worldName);
55 
56  // Documentation inherited
57  public: virtual void Init();
58 
59  // Documentation inherited
60  protected: virtual bool UpdateImpl(bool _force);
61 
62  // Documentation inherited
63  public: virtual void Fini();
64 
67  public: math::Angle GetLongitude() const;
68 
71  public: math::Angle GetLatitude() const;
72 
75  public: double GetAltitude() const;
76 
78  private: NoisePtr horizontalPositionNoise;
79 
81  private: NoisePtr verticalPositionNoise;
82 
84  private: NoisePtr horizontalVelocityNoise;
85 
87  private: NoisePtr verticalVelocityNoise;
88 
90  private: transport::PublisherPtr gpsPub;
91 
93  private: std::string topicName;
94 
96  private: physics::LinkPtr parentLink;
97 
99  private: common::SphericalCoordinatesPtr sphericalCoordinates;
100 
102  private: msgs::GPS lastGpsMsg;
103  };
105  }
106 }
107 #endif