Template Class SensorData
Defined in File sensor.hpp
Inheritance Relationships
Derived Type
protected as2::sensors::Sensor< T >
(Template Class Sensor)
Class Documentation
-
template<typename T>
class SensorData SensorData object to publish data in a topic.
- Template Parameters:
T – Type of the message
Subclassed by as2::sensors::Sensor< T >
Public Functions
-
inline explicit SensorData(const std::string &topic_name, rclcpp::Node *node_ptr, bool add_sensor_measurements_base = true)
Construct a new GenericSensor object.
- Parameters:
node_ptr – Pointer to the node
-
inline virtual ~SensorData()
Destroy the GenericSensor object.
-
inline void publish()
Publish the data stored in the message.
-
inline void updateAndPublish(const T &msg)
Update the message value and publish it.
- Parameters:
msg – Message
-
inline const std::string &getTopicName() const
Get the Topic Name object.
- Returns:
std::string Topic name
Public Static Functions
-
static inline std::string processTopicName(const std::string &topic_name, bool add_sensor_measurements_base = true)
Process the topic name with the sensor measurements base.
- Parameters:
topic_name – Topic name
add_sensor_measurements_base – Add “sensor_measurements” to the topic name
- Returns:
std::string Processed topic name