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;
141 public: virtual
ignition::math::Pose3d Pose() const;
149 public:
void SetPose(const
ignition::math::Pose3d &_pose);
153 public: virtual
void SetActive(
bool _value);
157 public: virtual
bool IsActive();
161 public:
std::
string GetType() const;
165 public: common::Time GetLastUpdateTime();
169 public: common::Time GetLastMeasurementTime();
174 public:
bool GetVisualize() const;
178 public: virtual
std::
string GetTopic() const;
182 public:
void FillMsg(msgs::
Sensor &_msg);
186 public:
std::
string GetWorldName() const;
193 public: template<typename T>
195 {
return this->updated.Connect(_subscriber);}
201 {this->updated.Disconnect(_c);}
209 public:
void ResetLastUpdateTime();
213 public: uint32_t GetId()
const;
217 public: uint32_t GetParentId()
const;
225 public:
NoisePtr GetNoise(
unsigned int _index = 0) const
236 protected:
bool NeedsUpdate();
240 private:
void LoadPlugin(sdf::ElementPtr _sdf);
243 protected:
bool active;
246 protected: sdf::ElementPtr sdf;
261 protected:
std::
string parentName;
264 protected: uint32_t parentId;
277 protected: common::Time updatePeriod;
280 protected: common::Time lastUpdateTime;
284 protected: common::Time lastMeasurementTime;
295 private:
boost::mutex mutexLastUpdateTime;
298 private: event::EventT<
void()> updated;
310 private: common::Time updateDelay;
313 private: uint32_t
id;
317 private: static sdf::ElementPtr sdfSensor;
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:147
Definition: JointMaker.hh:41
Forward declarations for the common classes.
Definition: Animation.hh:33
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:200
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
SensorNoiseType
Definition: SensorTypes.hh:202
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.
Definition: Animation.hh:24
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