25 #include <boost/enable_shared_from_this.hpp>
26 #include <boost/thread/mutex.hpp>
70 class Sensor :
public boost::enable_shared_from_this<Sensor>
82 public:
virtual void Load(
const std::string &_worldName,
83 sdf::ElementPtr _sdf);
87 public:
virtual void Load(
const std::string &_worldName);
90 public:
virtual void Init();
94 public:
virtual void SetParent(
const std::string &_name)
100 public:
void SetParent(
const std::string &_name, uint32_t _id);
109 public:
void Update(
bool _force);
127 public:
virtual void Fini();
131 public: std::string
GetName()
const;
143 public:
virtual void SetActive(
bool _value);
151 public: std::string
GetType()
const;
168 public:
virtual std::string
GetTopic()
const;
172 public:
void FillMsg(msgs::Sensor &_msg);
183 public:
template<
typename T>
185 {
return this->updated.
Connect(_subscriber);}
203 public: uint32_t
GetId()
const;
211 private:
void LoadPlugin(sdf::ElementPtr _sdf);
217 protected: sdf::ElementPtr
sdf;
238 protected: std::vector<SensorPluginPtr>
plugins;
276 private: uint32_t id;
280 private:
static sdf::ElementPtr sdfSensor;