GLIM
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
glim::TopicSubscription< Msg > Class Template Reference

Specialized topic subscription for type erasure. More...

#include <extension_module_ros.hpp>

Inheritance diagram for glim::TopicSubscription< Msg >:
Inheritance graph
[legend]
Collaboration diagram for glim::TopicSubscription< Msg >:
Collaboration graph
[legend]

Public Member Functions

template<typename Callback >
 TopicSubscription (const std::string &topic, const Callback &callback)
 topic Topic name
 
virtual void create_subscriber (ros::NodeHandle &nh) override
 Create a ROS subscriber.
 
virtual void insert_message_instance (const rosbag::MessageInstance &m) override
 Parse a rosbag message instance and feed the msg to the callback.
 
template<typename Callback >
 TopicSubscription (const std::string &topic, const Callback &callback)
 
template<typename Callback >
 TopicSubscription (const std::string &topic, const std::string &msg_type, const Callback &callback)
 
virtual void create_subscriber (rclcpp::Node &node) override
 
virtual void insert_message_instance (const rclcpp::SerializedMessage &serialized_msg, const std::string &msg_type="") override
 
- Public Member Functions inherited from glim::GenericTopicSubscription
 GenericTopicSubscription (const std::string &topic)
 Constructor.
 
 GenericTopicSubscription (const std::string &topic, const std::string &msg_type="")
 

Public Attributes

const std::function< void(const std::shared_ptr< const Msg > &)> callback
 
ros::Subscriber sub
 
rclcpp::Serialization< Msg > serialization
 
std::shared_ptr< rclcpp::Subscription< Msg > > sub
 
- Public Attributes inherited from glim::GenericTopicSubscription
const std::string topic
 Topic name.
 
const std::string msg_type
 

Additional Inherited Members

- Public Types inherited from glim::GenericTopicSubscription
using Ptr = std::shared_ptr< GenericTopicSubscription >
 
using Ptr = std::shared_ptr< GenericTopicSubscription >
 

Detailed Description

template<typename Msg>
class glim::TopicSubscription< Msg >

Specialized topic subscription for type erasure.

Constructor & Destructor Documentation

◆ TopicSubscription()

template<typename Msg >
template<typename Callback >
glim::TopicSubscription< Msg >::TopicSubscription ( const std::string &  topic,
const Callback &  callback 
)
inline

topic Topic name

callback Message callback

Member Function Documentation

◆ create_subscriber() [1/2]

template<typename Msg >
virtual void glim::TopicSubscription< Msg >::create_subscriber ( rclcpp::Node &  node)
inlineoverridevirtual

◆ create_subscriber() [2/2]

template<typename Msg >
virtual void glim::TopicSubscription< Msg >::create_subscriber ( ros::NodeHandle &  nh)
inlineoverridevirtual

Create a ROS subscriber.

Parameters
nhNode handle

Implements glim::GenericTopicSubscription.

◆ insert_message_instance() [1/2]

template<typename Msg >
virtual void glim::TopicSubscription< Msg >::insert_message_instance ( const rclcpp::SerializedMessage &  serialized_msg,
const std::string &  msg_type = "" 
)
inlineoverridevirtual

◆ insert_message_instance() [2/2]

template<typename Msg >
virtual void glim::TopicSubscription< Msg >::insert_message_instance ( const rosbag::MessageInstance &  m)
inlineoverridevirtual

Parse a rosbag message instance and feed the msg to the callback.

Parameters
mMessage instance

Implements glim::GenericTopicSubscription.


The documentation for this class was generated from the following files: