Commit 778f8fa4 authored by Capp's avatar Capp

[node] Add node to publish poitn cloud from service

parent 5716a838
#include <ros/ros.h>
#include <sensor_msgs/PointCloud.h>
#include <laser_assembler/AssembleScans.h>
int main(int argc, char** argv)
{
ros::init(argc, argv, "assemble_scans_node");
ros::NodeHandle nh;
ros::Rate rate(5);
ros::ServiceClient client = nh.serviceClient<laser_assembler::AssembleScans>("assemble_scans");
ros::Publisher pub = nh.advertise<sensor_msgs::PointCloud>("assemble_PointCloud", 10);
laser_assembler::AssembleScans scans;
scans.request.begin = ros::Time::now();
sensor_msgs::PointCloud pc;
while(ros::ok()){
scans.request.end = ros::Time::now();
if(client.call(scans)){
pub.publish(scans.response.cloud);
}
else
ROS_WARN("FAILED TO REQUEST SERVICE");
rate.sleep();
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment