2 #include <pr2_tilt_laser_interface/GetSnapshotActionResult.h> 3 #include <pr2_tilt_laser_interface/GetSnapshotActionFeedback.h> 4 #include <sensor_msgs/PointCloud2.h> 5 #include <pcl/io/pcd_io.h> 9 resultCallback(
const pr2_tilt_laser_interface::GetSnapshotActionResultConstPtr& action_result)
11 if (action_result->result.cloud.height*action_result->result.cloud.height == 0)
13 pub.
publish (action_result->result.cloud);
14 ROS_INFO (
"Published point cloud from action result!\n");
18 feedbackCallback(
const pr2_tilt_laser_interface::GetSnapshotActionFeedbackConstPtr& action_feedback)
20 if (action_feedback->feedback.cloud.height*action_feedback->feedback.cloud.height == 0)
22 pub.
publish (action_feedback->feedback.cloud);
23 ROS_INFO (
"Published point cloud from action feedback!\n");
27 main (
int argc,
char** argv)
31 pub = nh.
advertise<sensor_msgs::PointCloud2>(
"snapshot", 1,
true);
35 ROS_INFO (
"Waiting for cloud to come in over ROS");
void publish(const boost::shared_ptr< M > &message) const
void feedbackCallback(const pr2_tilt_laser_interface::GetSnapshotActionFeedbackConstPtr &action_feedback)
int main(int argc, char **argv)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ROSCPP_DECL void spin(Spinner &spinner)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void resultCallback(const pr2_tilt_laser_interface::GetSnapshotActionResultConstPtr &action_result)