17 #ifndef GAZEBO_SENSORS_SENSOR_HH_ 18 #define GAZEBO_SENSORS_SENSOR_HH_ 26 #include <ignition/math/Pose3.hh> 27 #include <ignition/transport/Node.hh> 52 :
public std::enable_shared_from_this<Sensor>
64 public:
virtual void Load(
const std::string &_worldName,
65 sdf::ElementPtr _sdf);
69 public:
virtual void Load(
const std::string &_worldName);
72 public:
virtual void Init();
77 public:
void SetParent(
const std::string &_name,
const uint32_t _id);
82 public: std::string ParentName()
const;
86 public:
virtual void Update(
const bool _force);
90 public:
double UpdateRate()
const;
94 public:
void SetUpdateRate(
const double _hz);
97 public:
virtual void Fini();
101 public: std::string Name()
const;
105 public: std::string ScopedName()
const;
110 public:
virtual ignition::math::Pose3d Pose()
const;
115 public:
virtual void SetPose(
const ignition::math::Pose3d &_pose);
119 public:
virtual void SetActive(
const bool _value);
123 public:
virtual bool IsActive()
const;
127 public: std::string Type()
const;
140 public:
bool Visualize()
const;
144 public:
virtual std::string Topic()
const;
148 public:
void FillMsg(msgs::Sensor &_msg);
152 public: std::string WorldName()
const;
160 std::function<
void()> _subscriber);
168 public:
virtual void ResetLastUpdateTime();
172 public: uint32_t Id()
const;
176 public: uint32_t ParentId()
const;
186 public:
virtual double NextRequiredTimestamp()
const;
194 protected:
virtual bool UpdateImpl(
const bool ) {
return false;}
198 protected:
virtual bool NeedsUpdate();
202 private:
void LoadPlugin(sdf::ElementPtr _sdf);
208 protected: sdf::ElementPtr
sdf;
211 protected: ignition::math::Pose3d
pose;
226 protected: std::vector<SensorPluginPtr>
plugins;
246 protected: std::map<SensorNoiseType, NoisePtr>
noises;
256 private: std::unique_ptr<SensorPrivate> dataPtr;
SensorCategory
SensorCategory is used to categorize sensors.
Definition: SensorTypes.hh:308
std::shared_ptr< Noise > NoisePtr
Definition: SensorTypes.hh:124
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:90
bool active
True if sensor generation is active.
Definition: Sensor.hh:205
Forward declarations for the common classes.
Definition: Animation.hh:26
sdf::ElementPtr sdf
Pointer the the SDF element for the sensor.
Definition: Sensor.hh:208
uint32_t parentId
The sensor's parent ID.
Definition: Sensor.hh:223
Forward declarations for transport.
std::string parentName
Name of the parent.
Definition: Sensor.hh:220
std::vector< event::ConnectionPtr > connections
All event connections.
Definition: Sensor.hh:214
common::Time lastMeasurementTime
Stores last time that a sensor measurement was generated; this value must be updated within each sens...
Definition: Sensor.hh:243
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
common::Time updatePeriod
Desired time between updates, set indirectly by Sensor::SetUpdateRate.
Definition: Sensor.hh:236
default namespace for gazebo
common::Time lastUpdateTime
Time of the last update.
Definition: Sensor.hh:239
sensors
Definition: SensorManager.hh:36
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:82
ignition::math::Pose3d pose
Pose of the sensor.
Definition: Sensor.hh:211
transport::NodePtr node
Node for communication.
Definition: Sensor.hh:217
gazebo::rendering::ScenePtr scene
Pointer to the Scene.
Definition: Sensor.hh:232
virtual bool UpdateImpl(const bool)
This gets overwritten by derived sensor types.
Definition: Sensor.hh:194
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
gazebo::physics::WorldPtr world
Pointer to the world.
Definition: Sensor.hh:229
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:208
std::map< SensorNoiseType, NoisePtr > noises
Noise added to sensor data.
Definition: Sensor.hh:246
Base class for sensors.
Definition: Sensor.hh:51
ignition::transport::Node nodeIgn
Ignition transport node.
Definition: Sensor.hh:252
event::EventT< void()> updated
Event triggered when a sensor is updated.
Definition: Sensor.hh:249
std::vector< SensorPluginPtr > plugins
All the plugins for the sensor.
Definition: Sensor.hh:226
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:47
Noise models for sensor output signals.
Definition: Noise.hh:55