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.)
std::timed_mutex cloud_publisher_mutex_
void run(double frequency=50.)
run the publisher; blocks until done
void slot(const CloudConstPtr &cloud)
SimplePublisher(ros::NodeHandle &nh, std::string topic, bool use_ros_time=false)
void publish(const boost::shared_ptr< M > &message) const
SimplePublisher publishes point clouds of type PointT.
std::string resolveName(const std::string &name, bool remap=true) const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
pcl::PointCloud< PointT > Cloud
typename Cloud::ConstPtr CloudConstPtr
ros::Publisher publisher_
void toROSMsg(const sensor_msgs::PointCloud2 &cloud, sensor_msgs::Image &image)
ROSCPP_DECL void shutdown()
ROSCPP_DECL void spinOnce()