17 #ifndef _GAZEBO_SENSOR_HH_
18 #define _GAZEBO_SENSOR_HH_
20 #include <boost/enable_shared_from_this.hpp>
21 #include <boost/thread/mutex.hpp>
27 #include <ignition/math/Pose3.hh>
81 public:
virtual void Load(
const std::string &_worldName,
82 sdf::ElementPtr _sdf);
86 public:
virtual void Load(
const std::string &_worldName);
89 public:
virtual void Init();
94 public:
void SetParent(
const std::string &_name, uint32_t _id);
99 public: std::string GetParentName()
const;
103 public:
void Update(
bool _force);
115 public:
double GetUpdateRate();
119 public:
void SetUpdateRate(
double _hz);
122 public:
virtual void Fini();
126 public: std::string GetName()
const;
130 public: std::string GetScopedName()
const;
140 public: virtual ignition::math::Pose3d Pose() const;
144 public: virtual
void SetActive(
bool _value);
148 public: virtual
bool IsActive();
152 public: std::
string GetType() const;
156 public: common::Time GetLastUpdateTime();
160 public: common::Time GetLastMeasurementTime();
165 public:
bool GetVisualize() const;
169 public: virtual std::
string GetTopic() const;
173 public:
void FillMsg(msgs::
Sensor &_msg);
177 public: std::
string GetWorldName() const;
184 public: template<typename T>
186 {
return this->updated.Connect(_subscriber);}
192 {this->updated.Disconnect(_c);}
200 public:
void ResetLastUpdateTime();
204 public: uint32_t GetId()
const;
208 public: uint32_t GetParentId()
const;
216 public:
NoisePtr GetNoise(
unsigned int _index = 0) const
227 protected:
bool NeedsUpdate();
231 private:
void LoadPlugin(sdf::ElementPtr _sdf);
234 protected:
bool active;
237 protected: sdf::ElementPtr sdf;
240 protected: ignition::math::Pose3d pose;
252 protected: std::
string parentName;
255 protected: uint32_t parentId;
268 protected: common::Time updatePeriod;
271 protected: common::Time lastUpdateTime;
275 protected: common::Time lastMeasurementTime;
286 private: boost::mutex mutexLastUpdateTime;
289 private: event::EventT<
void()> updated;
301 private: common::Time updateDelay;
304 private: uint32_t
id;
308 private: static sdf::ElementPtr sdfSensor;
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:147
boost::shared_ptr< Noise > NoisePtr
Definition: SensorTypes.hh:118
virtual bool UpdateImpl(bool)
This gets overwritten by derived sensor types.
Definition: Sensor.hh:111
void DisconnectUpdated(event::ConnectionPtr &_c)
Disconnect from a the updated signal.
Definition: Sensor.hh:191
Encapsulates a position and rotation in three space.
Definition: Pose.hh:37
Number of Sensor Categories.
Definition: Sensor.hh:61
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:53
A type of sensor is not a RAY or IMAGE sensor.
Definition: Sensor.hh:58
Forward declarations for transport.
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:47
default namespace for gazebo
boost::shared_ptr< SensorPlugin > SensorPluginPtr
Definition: CommonTypes.hh:76
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:80
SensorCategory
SensorClass is used to categorize sensors.
Definition: Sensor.hh:46
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:79
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Forward declarations and typedefs for sensors.
SensorNoiseType
Definition: SensorTypes.hh:202
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
Ray based sensor class.
Definition: Sensor.hh:55
Base class for sensors.
Definition: Sensor.hh:69
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:66
Image based sensor class.
Definition: Sensor.hh:52