Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
dai::ros::BridgePublisher< RosMsg, SimMsg > Class Template Reference

#include <BridgePublisher.hpp>

Public Types

using ConvertFunc = std::function< void(std::shared_ptr< SimMsg >, std::deque< RosMsg > &)>
 
using CustomPublisher = typename std::conditional< std::is_same< RosMsg, ImageMsgs::Image >::value, std::shared_ptr< image_transport::Publisher >, std::shared_ptr< rosOrigin::Publisher > >::type
 

Public Member Functions

void addPublisherCallback ()
 
std::shared_ptr< image_transport::Publisheradvertise (int queueSize, std::true_type)
 
std::shared_ptr< rosOrigin::Publisheradvertise (int queueSize, std::false_type)
 
 BridgePublisher (std::shared_ptr< dai::DataOutputQueue > daiMessageQueue, rosOrigin::NodeHandle nh, std::string rosTopic, ConvertFunc converter, int queueSize, std::string cameraParamUri="", std::string cameraName="")
 
 BridgePublisher (std::shared_ptr< dai::DataOutputQueue > daiMessageQueue, rosOrigin::NodeHandle nh, std::string rosTopic, ConvertFunc converter, int queueSize, ImageMsgs::CameraInfo cameraInfoData, std::string cameraName)
 
 BridgePublisher (const BridgePublisher &other)
 
void publishHelper (std::shared_ptr< SimMsg > inData)
 
void startPublisherThread ()
 
 ~BridgePublisher ()
 

Private Member Functions

void daiCallback (std::string name, std::shared_ptr< ADatatype > data)
 

Private Attributes

ImageMsgs::CameraInfo _cameraInfoData
 
std::shared_ptr< rosOrigin::Publisher_cameraInfoPublisher
 
std::string _cameraName
 
std::string _cameraParamUri
 
std::string _camInfoFrameId
 
std::unique_ptr< camera_info_manager::CameraInfoManager_camInfoManager
 
ConvertFunc _converter
 
std::shared_ptr< dai::DataOutputQueue > _daiMessageQueue
 
bool _isCallbackAdded = false
 
bool _isImageMessage = false
 
image_transport::ImageTransport _it
 
rosOrigin::NodeHandle _nh
 
std::thread _readingThread
 
CustomPublisher _rosPublisher
 
std::string _rosTopic
 

Static Private Attributes

static const std::string LOG_TAG = "BridgePublisher"
 

Detailed Description

template<class RosMsg, class SimMsg>
class dai::ros::BridgePublisher< RosMsg, SimMsg >

Definition at line 50 of file BridgePublisher.hpp.

Member Typedef Documentation

◆ ConvertFunc

template<class RosMsg , class SimMsg >
using dai::ros::BridgePublisher< RosMsg, SimMsg >::ConvertFunc = std::function<void(std::shared_ptr<SimMsg>, std::deque<RosMsg>&)>

Definition at line 52 of file BridgePublisher.hpp.

◆ CustomPublisher

template<class RosMsg , class SimMsg >
using dai::ros::BridgePublisher< RosMsg, SimMsg >::CustomPublisher = typename std:: conditional<std::is_same<RosMsg, ImageMsgs::Image>::value, std::shared_ptr<image_transport::Publisher>, std::shared_ptr<rosOrigin::Publisher> >::type

Definition at line 92 of file BridgePublisher.hpp.

Constructor & Destructor Documentation

◆ BridgePublisher() [1/3]

template<class RosMsg , class SimMsg >
dai::ros::BridgePublisher< RosMsg, SimMsg >::BridgePublisher ( std::shared_ptr< dai::DataOutputQueue >  daiMessageQueue,
rosOrigin::NodeHandle  nh,
std::string  rosTopic,
ConvertFunc  converter,
int  queueSize,
std::string  cameraParamUri = "",
std::string  cameraName = "" 
)

Definition at line 233 of file BridgePublisher.hpp.

◆ BridgePublisher() [2/3]

template<class RosMsg , class SimMsg >
dai::ros::BridgePublisher< RosMsg, SimMsg >::BridgePublisher ( std::shared_ptr< dai::DataOutputQueue >  daiMessageQueue,
rosOrigin::NodeHandle  nh,
std::string  rosTopic,
ConvertFunc  converter,
int  queueSize,
ImageMsgs::CameraInfo  cameraInfoData,
std::string  cameraName 
)

Definition at line 252 of file BridgePublisher.hpp.

◆ BridgePublisher() [3/3]

template<class RosMsg , class SimMsg >
dai::ros::BridgePublisher< RosMsg, SimMsg >::BridgePublisher ( const BridgePublisher< RosMsg, SimMsg > &  other)

Definition at line 289 of file BridgePublisher.hpp.

◆ ~BridgePublisher()

template<class RosMsg , class SimMsg >
dai::ros::BridgePublisher< RosMsg, SimMsg >::~BridgePublisher ( )

Definition at line 394 of file BridgePublisher.hpp.

Member Function Documentation

◆ addPublisherCallback()

template<class RosMsg , class SimMsg >
void dai::ros::BridgePublisher< RosMsg, SimMsg >::addPublisherCallback ( )

Definition at line 345 of file BridgePublisher.hpp.

◆ advertise() [1/2]

template<class RosMsg , class SimMsg >
std::shared_ptr< image_transport::Publisher > dai::ros::BridgePublisher< RosMsg, SimMsg >::advertise ( int  queueSize,
std::true_type   
)

Tag Dispacher function to to overload the Publisher to ImageTransport Publisher

Definition at line 276 of file BridgePublisher.hpp.

◆ advertise() [2/2]

template<class RosMsg , class SimMsg >
std::shared_ptr< rosOrigin::Publisher > dai::ros::BridgePublisher< RosMsg, SimMsg >::advertise ( int  queueSize,
std::false_type   
)

Tag Dispacher function to to overload the Publisher to use Default ros::Publisher

Definition at line 271 of file BridgePublisher.hpp.

◆ daiCallback()

template<class RosMsg , class SimMsg >
void dai::ros::BridgePublisher< RosMsg, SimMsg >::daiCallback ( std::string  name,
std::shared_ptr< ADatatype >  data 
)
private

adding this callback will allow you to still be able to consume the data for other processing using get() function .

Definition at line 306 of file BridgePublisher.hpp.

◆ publishHelper()

template<class RosMsg , class SimMsg >
void dai::ros::BridgePublisher< RosMsg, SimMsg >::publishHelper ( std::shared_ptr< SimMsg >  inData)

Definition at line 351 of file BridgePublisher.hpp.

◆ startPublisherThread()

template<class RosMsg , class SimMsg >
void dai::ros::BridgePublisher< RosMsg, SimMsg >::startPublisherThread ( )

Definition at line 313 of file BridgePublisher.hpp.

Member Data Documentation

◆ _cameraInfoData

template<class RosMsg , class SimMsg >
ImageMsgs::CameraInfo dai::ros::BridgePublisher< RosMsg, SimMsg >::_cameraInfoData
private

Definition at line 152 of file BridgePublisher.hpp.

◆ _cameraInfoPublisher

template<class RosMsg , class SimMsg >
std::shared_ptr<rosOrigin::Publisher> dai::ros::BridgePublisher< RosMsg, SimMsg >::_cameraInfoPublisher
private

Definition at line 148 of file BridgePublisher.hpp.

◆ _cameraName

template<class RosMsg , class SimMsg >
std::string dai::ros::BridgePublisher< RosMsg, SimMsg >::_cameraName
private

Definition at line 156 of file BridgePublisher.hpp.

◆ _cameraParamUri

template<class RosMsg , class SimMsg >
std::string dai::ros::BridgePublisher< RosMsg, SimMsg >::_cameraParamUri
private

Definition at line 156 of file BridgePublisher.hpp.

◆ _camInfoFrameId

template<class RosMsg , class SimMsg >
std::string dai::ros::BridgePublisher< RosMsg, SimMsg >::_camInfoFrameId
private

Definition at line 156 of file BridgePublisher.hpp.

◆ _camInfoManager

template<class RosMsg , class SimMsg >
std::unique_ptr<camera_info_manager::CameraInfoManager> dai::ros::BridgePublisher< RosMsg, SimMsg >::_camInfoManager
private

Definition at line 157 of file BridgePublisher.hpp.

◆ _converter

template<class RosMsg , class SimMsg >
ConvertFunc dai::ros::BridgePublisher< RosMsg, SimMsg >::_converter
private

Definition at line 141 of file BridgePublisher.hpp.

◆ _daiMessageQueue

template<class RosMsg , class SimMsg >
std::shared_ptr<dai::DataOutputQueue> dai::ros::BridgePublisher< RosMsg, SimMsg >::_daiMessageQueue
private

Definition at line 140 of file BridgePublisher.hpp.

◆ _isCallbackAdded

template<class RosMsg , class SimMsg >
bool dai::ros::BridgePublisher< RosMsg, SimMsg >::_isCallbackAdded = false
private

Definition at line 158 of file BridgePublisher.hpp.

◆ _isImageMessage

template<class RosMsg , class SimMsg >
bool dai::ros::BridgePublisher< RosMsg, SimMsg >::_isImageMessage = false
private

Definition at line 159 of file BridgePublisher.hpp.

◆ _it

template<class RosMsg , class SimMsg >
image_transport::ImageTransport dai::ros::BridgePublisher< RosMsg, SimMsg >::_it
private

Definition at line 151 of file BridgePublisher.hpp.

◆ _nh

template<class RosMsg , class SimMsg >
rosOrigin::NodeHandle dai::ros::BridgePublisher< RosMsg, SimMsg >::_nh
private

Definition at line 147 of file BridgePublisher.hpp.

◆ _readingThread

template<class RosMsg , class SimMsg >
std::thread dai::ros::BridgePublisher< RosMsg, SimMsg >::_readingThread
private

Definition at line 155 of file BridgePublisher.hpp.

◆ _rosPublisher

template<class RosMsg , class SimMsg >
CustomPublisher dai::ros::BridgePublisher< RosMsg, SimMsg >::_rosPublisher
private

Definition at line 153 of file BridgePublisher.hpp.

◆ _rosTopic

template<class RosMsg , class SimMsg >
std::string dai::ros::BridgePublisher< RosMsg, SimMsg >::_rosTopic
private

Definition at line 156 of file BridgePublisher.hpp.

◆ LOG_TAG

template<class RosMsg , class SimMsg >
const std::string dai::ros::BridgePublisher< RosMsg, SimMsg >::LOG_TAG = "BridgePublisher"
staticprivate

Definition at line 139 of file BridgePublisher.hpp.


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


depthai_bridge
Author(s): Sachin Guruswamy
autogenerated on Tue May 10 2022 03:01:27