25 #include <boost/enable_shared_from_this.hpp>
26 #include <boost/thread/mutex.hpp>
84 public:
virtual void Load(
const std::string &_worldName,
85 sdf::ElementPtr _sdf);
89 public:
virtual void Load(
const std::string &_worldName);
92 public:
virtual void Init();
96 public:
virtual void SetParent(
const std::string &_name)
102 public:
void SetParent(
const std::string &_name, uint32_t _id);
107 public: std::string GetParentName()
const;
111 public:
void Update(
bool _force);
123 public:
double GetUpdateRate();
127 public:
void SetUpdateRate(
double _hz);
130 public:
virtual void Fini();
134 public: std::string GetName()
const;
138 public: std::string GetScopedName()
const;
146 public:
virtual void SetActive(
bool _value);
150 public:
virtual bool IsActive();
154 public: std::string GetType()
const;
167 public:
bool GetVisualize()
const;
171 public:
virtual std::string GetTopic()
const;
175 public:
void FillMsg(msgs::Sensor &_msg);
179 public: std::string GetWorldName()
const;
186 public:
template<
typename T>
188 {
return this->updated.Connect(_subscriber);}
194 {this->updated.Disconnect(_c);}
202 public:
void ResetLastUpdateTime();
206 public: uint32_t GetId()
const;
210 public: uint32_t GetParentId()
const;
216 public:
NoisePtr GetNoise(
unsigned int _index = 0)
const;
220 protected:
bool NeedsUpdate();
224 private:
void LoadPlugin(sdf::ElementPtr _sdf);
230 protected: sdf::ElementPtr
sdf;
251 protected: std::vector<SensorPluginPtr>
plugins;
274 private: boost::mutex mutexLastUpdateTime;
292 private: uint32_t id;
296 private:
static sdf::ElementPtr sdfSensor;