AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
agxROS2::Subscriber< TMsg > Class Template Reference

Subscriber class that enables receiving ROS2 messages. More...

#include <Subscriber.h>

Public Member Functions

 Subscriber (const std::string &topic, const QOS &qos=QOS(), int8_t inDomainId=0)
 Constructor for the Subscriber.
 
 ~Subscriber ()
 
bool receiveMessage (TMsg &outMsg) const
 Try to receive a message.
 

Detailed Description

template<typename TMsg>
class agxROS2::Subscriber< TMsg >

Subscriber class that enables receiving ROS2 messages.

Definition at line 44 of file var/agx-dependencies/agx_dependencies_240424_ubuntu_24.04_64/include/agx-nt-ros2/Subscriber.h.

Constructor & Destructor Documentation

◆ Subscriber()

template<typename TMsg >
agxROS2::Subscriber< TMsg >::Subscriber ( const std::string &  topic,
const QOS &  qos = QOS(),
int8_t  inDomainId = 0 
)

Constructor for the Subscriber.

Parameters
topic- the topic on which the Subscriber will receive messages.
qos- Quality of Service (QOS) specifies behaviours such as message lifetime among other things.
inDomainId- determines which DDS domain the Subscriber uses. Default for ROS2 is 0.

◆ ~Subscriber()

template<typename TMsg >
agxROS2::Subscriber< TMsg >::~Subscriber ( )

Member Function Documentation

◆ receiveMessage()

template<typename TMsg >
bool agxROS2::Subscriber< TMsg >::receiveMessage ( TMsg &  outMsg) const

Try to receive a message.

This is a non-blocking function, i.e. it returns immediately if no new messages are avaiable.

Parameters
outMsg- out parameter containing the received message if a receive was successful.
Returns
- true if a message was received, false otherwise.

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