gz/sensors/Sensor.hh
Go to the documentation of this file.
void PublishMetrics(const std::chrono::duration< double > &_now)
Publishes information about the performance of the sensor. This method is called by Update().
virtual bool Update(const std::chrono::steady_clock::duration &_now)=0
Force the sensor to generate data.
virtual void SetParent(const std::string &_parent)
Set the parent of the sensor.
void SetActive(bool _active)
Enable or disable the sensor. Disabled sensors will not generate or publish data unless Update is cal...
bool SetTopic(const std::string &_topic)
Set topic where sensor data is published.
void AddSequence(gz::msgs::Header *_msg, const std::string &_seqKey="default")
Add a sequence number to an gz::msgs::Header. This function can be called by a sensor that wants to a...
bool Update(const std::chrono::steady_clock::duration &_now, const bool _force)
Update the sensor.
void SetEnableMetrics(bool _enableMetrics)
Set flag to enable publishing performance metrics.
std::chrono::steady_clock::duration NextDataUpdateTime() const
Return the next time the sensor will generate data.
virtual bool Load(sdf::ElementPtr _sdf)
Load the sensor with SDF parameters.
virtual bool Load(const sdf::Sensor &_sdf)
Load the sensor based on data from an sdf::Sensor object.
void SetUpdateRate(const double _hz)
Set the update rate of the sensor. An update rate of zero means that the sensor is updated every cycl...
void SetFrameId(const std::string &_frameId)
Set Frame ID of the sensor.
void SetPose(const gz::math::Pose3d &_pose)
Update the pose of the sensor.
bool EnableMetrics() const
Get flag state for enabling performance metrics publication.
virtual bool Init()
Initialize values in the sensor This will set the next update time to zero. This is particularly usef...
Definition: gz/sensors/AirPressureSensor.hh:32