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;
transport::SubscriberPtr poseSub
Subscribe to pose updates.
Definition: Sensor.hh:242
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:144
Forward declarations for the common classes.
Definition: Animation.hh:24
boost::shared_ptr< Noise > NoisePtr
Definition: SensorTypes.hh:107
virtual bool UpdateImpl(bool)
This gets overwritten by derived sensor types.
Definition: Sensor.hh:119
std::vector< SensorPluginPtr > plugins
All the plugins for the sensor.
Definition: Sensor.hh:251
void DisconnectUpdated(event::ConnectionPtr &_c)
Disconnect from a the updated signal.
Definition: Sensor.hh:193
Encapsulates a position and rotation in three space.
Definition: Pose.hh:40
Number of Sensor Categories.
Definition: Sensor.hh:64
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:48
uint32_t parentId
The sensor's parent ID.
Definition: Sensor.hh:248
A type of sensor is not a RAY or IMAGE sensor.
Definition: Sensor.hh:61
common::Time updatePeriod
Desired time between updates, set indirectly by Sensor::SetUpdateRate.
Definition: Sensor.hh:261
gazebo::rendering::ScenePtr scene
Pointer to the Scene.
Definition: Sensor.hh:257
gazebo::physics::WorldPtr world
Pointer to the world.
Definition: Sensor.hh:254
Forward declarations for transport.
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:44
event::ConnectionPtr ConnectUpdated(T _subscriber)
Connect a signal that is triggered when the sensor is updated.
Definition: Sensor.hh:187
common::Time lastUpdateTime
Time of the last update.
Definition: Sensor.hh:264
std::vector< NoisePtr > noises
Noise added to sensor data.
Definition: Sensor.hh:271
default namespace for gazebo
common::Time lastMeasurementTime
Stores last time that a sensor measurement was generated; this value must be updated within each sens...
Definition: Sensor.hh:268
math::Pose pose
Pose of the sensor.
Definition: Sensor.hh:233
std::string parentName
Name of the parent.
Definition: Sensor.hh:245
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:77
SensorCategory
SensorClass is used to categorize sensors.
Definition: Sensor.hh:49
sdf::ElementPtr sdf
Pointer the the SDF element for the sensor.
Definition: Sensor.hh:230
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:52
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:67
bool active
True if sensor generation is active.
Definition: Sensor.hh:227
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Forward declarations and typedefs for sensors.
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:44
std::vector< event::ConnectionPtr > connections
All event connections.
Definition: Sensor.hh:236
Ray based sensor class.
Definition: Sensor.hh:58
Base class for sensors.
Definition: Sensor.hh:72
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
Image based sensor class.
Definition: Sensor.hh:55
transport::NodePtr node
Node for communication.
Definition: Sensor.hh:239
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:43