SonarSensor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 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_SENSORS_SONARSENSOR_HH_
18 #define _GAZEBO_SENSORS_SONARSENSOR_HH_
19 
20 #include <memory>
21 #include <string>
22 
23 #include "gazebo/sensors/Sensor.hh"
24 #include "gazebo/util/system.hh"
25 
26 namespace gazebo
27 {
30  namespace sensors
31  {
32  // Forward declare private data class.
33  class SonarSensorPrivate;
34 
37 
43  {
45  public: SonarSensor();
46 
48  public: virtual ~SonarSensor();
49 
50  // Documentation inherited
51  public: virtual void Load(const std::string &_worldName);
52 
53  // Documentation inherited
54  public: virtual void Init();
55 
56  // Documentation inherited
57  public: virtual std::string Topic() const;
58 
62  public: double GetRangeMin() const GAZEBO_DEPRECATED(7.0);
63 
66  public: double RangeMin() const;
67 
71  public: double GetRangeMax() const GAZEBO_DEPRECATED(7.0);
72 
75  public: double RangeMax() const;
76 
80  public: double GetRadius() const GAZEBO_DEPRECATED(7.0);
81 
84  public: double Radius() const;
85 
95  public: double GetRange() GAZEBO_DEPRECATED(7.0);
96 
105  public: double Range();
106 
107 
108  // Documentation inherited
109  public: virtual bool IsActive() const;
110 
114  public: event::ConnectionPtr ConnectUpdate(
115  std::function<void (msgs::SonarStamped)> _subscriber);
116 
119  public: void DisconnectUpdate(event::ConnectionPtr &_conn);
120 
121  // Documentation inherited
122  protected: virtual bool UpdateImpl(const bool _force);
123 
124  // Documentation inherited
125  protected: virtual void Fini();
126 
128  private: void OnContacts(ConstContactsPtr &_msg);
129 
132  private: std::unique_ptr<SonarSensorPrivate> dataPtr;
133  };
135  }
136 }
137 #endif
Forward declarations for the common classes.
Definition: Animation.hh:33
Sensor with sonar cone.
Definition: SonarSensor.hh:42
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:48
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:153
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Base class for sensors.
Definition: Sensor.hh:50
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:59