GpsSensor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 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 #ifndef _GAZEBO_GPSSENSOR_HH_
18 #define _GAZEBO_GPSSENSOR_HH_
19 
20 #include <string>
21 
22 #include <sdf/sdf.hh>
23 
24 #include "gazebo/sensors/Sensor.hh"
29 #include "gazebo/util/system.hh"
30 
31 namespace gazebo
32 {
33  namespace sensors
34  {
37 
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 bool UpdateImpl(bool _force);
60 
61  // Documentation inherited
62  public: virtual void Fini();
63 
68  public: math::Angle GetLongitude() const GAZEBO_DEPRECATED(6.0);
69 
72  public: ignition::math::Angle Longitude() const;
73 
78  public: math::Angle GetLatitude() const GAZEBO_DEPRECATED(6.0);
79 
82  public: ignition::math::Angle Latitude() const;
83 
86  public: double GetAltitude() const;
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
Forward declarations for transport.
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:47
default namespace for gazebo
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Forward declarations and typedefs for sensors.
An angle and related functions.
Definition: Angle.hh:53
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
GpsSensor to provide position measurement.
Definition: GpsSensor.hh:40
boost::shared_ptr< SphericalCoordinates > SphericalCoordinatesPtr
Definition: CommonTypes.hh:138
Base class for sensors.
Definition: Sensor.hh:69
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:66
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:92