Go to the documentation of this file.
8 #ifndef QUANERGY_CLIENT_ROS_SIMPLE_PUBLISHER_H
9 #define QUANERGY_CLIENT_ROS_SIMPLE_PUBLISHER_H
14 #include <pcl/point_cloud.h>
18 #include <sensor_msgs/PointCloud2.h>
21 template <
typename Po
intT>
25 using Cloud = pcl::PointCloud<PointT>;
39 if(!
ros::ok() || !cloud)
return;
41 sensor_msgs::PointCloud2 ros_cloud;
57 void run(
double frequency = 50.)
ROSCPP_DECL void spinOnce()
ROSCPP_DECL void shutdown()
void publish(const boost::shared_ptr< M > &message) const
Publisher advertise(AdvertiseOptions &ops)
std::string resolveName(const std::string &name, bool remap=true) const
void run(double frequency=50.)
run the publisher; blocks until done
pcl::PointCloud< PointT > Cloud
void slot(const CloudConstPtr &cloud)
SimplePublisher publishes point clouds of type PointT.
ros::Publisher publisher_
std::timed_mutex cloud_publisher_mutex_
SimplePublisher(ros::NodeHandle &nh, std::string topic, bool use_ros_time=false)
typename Cloud::ConstPtr CloudConstPtr
void toROSMsg(const pcl::PointCloud< T > &cloud, sensor_msgs::Image &msg)