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;
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);
246 protected: sdf::ElementPtr
sdf;
249 protected: ignition::math::Pose3d
pose;
267 protected: std::vector<SensorPluginPtr>
plugins;
292 protected: std::map<int, NoisePtr>
noises;
295 private: boost::mutex mutexLastUpdateTime;
313 private: uint32_t id;
317 private:
static sdf::ElementPtr sdfSensor;
transport::SubscriberPtr poseSub
Subscribe to pose updates.
Definition: Sensor.hh:258
std::map< int, NoisePtr > noises
Noise added to sensor data The key maps to a SensorNoiseType, and is kept as an int value for backwar...
Definition: Sensor.hh:292
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:147
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
std::vector< SensorPluginPtr > plugins
All the plugins for the sensor.
Definition: Sensor.hh:267
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
uint32_t parentId
The sensor's parent ID.
Definition: Sensor.hh:264
A type of sensor is not a RAY or IMAGE sensor.
Definition: Sensor.hh:58
common::Time updatePeriod
Desired time between updates, set indirectly by Sensor::SetUpdateRate.
Definition: Sensor.hh:277
gazebo::rendering::ScenePtr scene
Pointer to the Scene.
Definition: Sensor.hh:273
gazebo::physics::WorldPtr world
Pointer to the world.
Definition: Sensor.hh:270
Forward declarations for transport.
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:47
event::ConnectionPtr ConnectUpdated(T _subscriber)
Connect a signal that is triggered when the sensor is updated.
Definition: Sensor.hh:194
common::Time lastUpdateTime
Time of the last update.
Definition: Sensor.hh:280
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:284
std::string parentName
Name of the parent.
Definition: Sensor.hh:261
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:80
SensorCategory
SensorClass is used to categorize sensors.
Definition: Sensor.hh:46
ignition::math::Pose3d pose
Pose of the sensor.
Definition: Sensor.hh:249
sdf::ElementPtr sdf
Pointer the the SDF element for the sensor.
Definition: Sensor.hh:246
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:79
bool active
True if sensor generation is active.
Definition: Sensor.hh:243
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
std::vector< event::ConnectionPtr > connections
All event connections.
Definition: Sensor.hh:252
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
transport::NodePtr node
Node for communication.
Definition: Sensor.hh:255
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:39