Go to the documentation of this file.
24 if (pnh.hasParam(
"rate"))
32 if (pnh.hasParam(
"fix_frame_id"))
34 if (this->
frameId.has_value() && this->frameId.value().empty())
43 this->
subTransport = std::make_unique<image_transport::ImageTransport>(this->
subNh);
46 this->
pubTransport = std::make_unique<image_transport::ImageTransport>(this->
pubNh);
66 if (!this->
frameId.has_value() && !this->flipHorizontal && !this->flipVertical)
70 sensor_msgs::ImagePtr newImg(
new sensor_msgs::Image);
71 sensor_msgs::CameraInfoPtr newInfo(
new sensor_msgs::CameraInfo);
93 ROS_ERROR(
"cv_bridge exception: %s", e.what());
97 cv::flip(cvImage->image, this->data->opencvMat, flipValue);
104 newImg->header.frame_id = this->
frameId.value();
105 newInfo->header.frame_id = this->
frameId.value();
149 NODELET_DEBUG(
"Stopped lazy-subscription to %s", this->
sub.value().getTopic().c_str());
150 this->
sub.value().shutdown();
ros::NodeHandle & getNodeHandle() const
uint32_t getNumSubscribers() const
image_transport::CameraPublisher pub
sensor_msgs::ImagePtr toImageMsg() const
std::unique_ptr< image_transport::ImageTransport > subTransport
std::mutex publishersMutex
void info_connect_cb(const ros::SingleSubscriberPublisher &)
void publish(const sensor_msgs::Image &image, const sensor_msgs::CameraInfo &info) const
virtual void cb(const sensor_msgs::ImageConstPtr &img, const sensor_msgs::CameraInfoConstPtr &info)
ros::NodeHandle & getPrivateNodeHandle() const
std::unique_ptr< image_transport::ImageTransport > pubTransport
void img_connect_cb(const image_transport::SingleSubscriberPublisher &)
std::string resolveName(const std::string &name, bool remap=true) const
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
CvImagePtr toCvCopy(const sensor_msgs::CompressedImage &source, const std::string &encoding=std::string())
void img_disconnect_cb(const image_transport::SingleSubscriberPublisher &)
virtual void onFirstConnect()
std::optional< ros::Rate > rate
void info_disconnect_cb(const ros::SingleSubscriberPublisher &)
#define NODELET_INFO(...)
inline ::std::string getParam(const ::ros::NodeHandle &node, const ::std::string &name, const ::cras::optional< const char * > &defaultValue, const ::std::string &unit="", const ::cras::GetParamOptions<::std::string > &options={})
std::optional< std::string > frameId
virtual void onLastDisconnect()
std::optional< image_transport::CameraSubscriber > sub
#define NODELET_DEBUG(...)
camera_throttle
Author(s): Martin Pecka
autogenerated on Sat Dec 14 2024 03:51:15